Advanced math (Magnitude to Angle)
skott
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
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