Jump to content
  • Advertisement
Sign in to follow this  
Darobat

Moving at an angle

This topic is 4993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings How would i do something like this: MoveSomeBitmap(&SomeBitmap, 32); to move it at a 32° angle? Assume I'm using Win32.G

Share this post


Link to post
Share on other sites
Advertisement
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.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!