Hello, I am a Searcher in the Postgraduate level at faculty of Information Computing, and my graduation project involves a simulation for a movement of multiple trains, i am trying to stop a point on a specified (x,y), then i want to rotate its heading and change the (angle) of its heading.
i have watched all of this videos on your youtube channel about :
"Basic C# Game Programming Moving Object on the form " here :
https://www.youtube.com/watch?v=3eIzmcTe0mg[
^]
which illustrates how to control the movement of the point using the KeyDown Event in the .NET, but i want to enter different locations at different times ( it will be stored in a variable and entered by a textbox or whatever ) , so if you please, guide and tell me how to rotate the heading of the point when arrived to a specified (x,y) and also how to stop it on its station (another (x,y)) in the railway network .
and if that is related to "grid networking" ??
------------------
i have found that system.Drawing has a function, which can be overloaded such as :
e.Graphics.RotateTransform(30.0F); , but i found that it is not only rotate the transform, but also changes its location, you can check it by yourself.
------------------
also i tried this method :
----------------
int x_ex = 60, y_ex = 60;
private void increase_distance(PaintEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Blue, x_ex, y_ex, 20, 20);
x_ex = x_ex + (int)2.5;
y_ex = y_ex + (int)2.5;
if (x_ex == 90)
{
e.Graphics.RotateTransform(30.0F);
e.Graphics.FillRectangle(Brushes.Green, 90, 90, 20, 20);
}
}
help me if you please, your help & response already will be appreciated.
Thank you.