Moving actor and shooting
reddotinc
Member Posts: 653
I have an actor that moves vertically between the bottom and top of the screen, and when you touch the right side of the screen an actor is fired from the position of the player actor. I have calculated the angle between the player and the touch position so that the object fires directly through the point that the player touches.
This works perfectly when the player is at the bottom of the screen, however when my player actor moves vertically, the field of fire moves vertically also (i want the player to always have a field of fire that is equal to all angles of the scene). e.g. so if the player is at the top he can still fire to the bottom right of the screen.
Any ideas?
This works perfectly when the player is at the bottom of the screen, however when my player actor moves vertically, the field of fire moves vertically also (i want the player to always have a field of fire that is equal to all angles of the scene). e.g. so if the player is at the top he can still fire to the bottom right of the screen.
Any ideas?
Comments
If you are, you need to account for the camera offset and add it to your Y value.