Moving at an angle

Started by
4 comments, last by mdias 19 years, 6 months ago
Greetings How would i do something like this: MoveSomeBitmap(&SomeBitmap, 32); to move it at a 32° angle? Assume I'm using Win32.G
--------------------C++ Home - Check it out!Lol... - Amazing video
Advertisement
Do you actually mean move or do you mean rotate?

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
move. Like say move a bitmap of an object accross the screen at a 32° angle.
--------------------C++ Home - Check it out!Lol... - Amazing video
deltax = delta * cos(angle);
deltay = delta * sin(angle);

where delta is the displacement length and angle is the direction of movement (0° means in x direction, 90° in y direction etc.)
hardcore! thanks!
--------------------C++ Home - Check it out!Lol... - Amazing video
Also remember that sin and cos use radian angles.

This topic is closed to new replies.

Advertisement