Moving actor and shooting

reddotincreddotinc Member Posts: 653
edited November -1 in Working with GS (Mac)
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?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Is the Scene larger than the screen? i.e. , are you scrolling the Scene?

    If you are, you need to account for the camera offset and add it to your Y value.
  • reddotincreddotinc Member Posts: 653
    Nope, the scene is always the same constraints, just everything moves in an out. So the maximum height the player can move to is the top of the screen.
Sign In or Register to comment.