Advanced math (Magnitude to Angle)

skottskott Member Posts: 172
Hi,

I am working on a control like in the game "Fragger". The problem I have is the "arrow" direction should keep the same angle as last shot and being able to control the "arrow" to a new position no matter where you touch the screen next.

I started with VectorToAngle (self.pos x - mouse pos x, self.pos y - mouse pos y) which works but I am not able to "save" last position and continue changing the "arrows" angle.

Do I have to use COS, SIN, Magnitude or.....???

- Skott

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Store it in an attribute right before you launch. Then use that value on the next launch.
Sign In or Register to comment.