Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Is there any method to move a sprite/shape according to his rotation ?  (Read 2464 times)

0 Members and 1 Guest are viewing this topic.

Dacapo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Does any method that move the sprite/shape according to his rotation. For example if it is rotated by 90 degrees, it will move forward by x:1 and y:0, if it is rotated by -90 it will move forward by x:-1 y:0 if it is rotated by 0 degrees it will move forward by y:1 x:0  etc...
Or do I have to do all the calculus by myself ? If I have to, what are the most efficient function to code ?

G.

  • Hero Member
  • *****
  • Posts: 1548
    • View Profile
Re: Is there any method to move a sprite/shape according to his rotation ?
« Reply #1 on: October 23, 2021, 05:00:20 pm »
You'd have to compute it yourself. Using cosine and sine. (Or maybe a lookup table if you only have a few fixed angles)

 

anything