Gun follow crosshairs

GLJ27GLJ27 Member Posts: 27
edited November -1 in Working with GS (Mac)
Im making a duck shoot carnival game. In the game i have some cross hairs that move around on the screen. I want to have a gun at the bottom of the screen that follows my crosshairs, does anybody know how to do this?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    In the crosshairs you need to constrain the x and y to game level attributes (game.crosshairX and game.crosshairY)

    then in the gun at the bottom of the screen you will want an actor with an image of the gun. be sure that this image take into account the fact that GS rotates from the middle of the image. In this actor you will need to constrain the rotation to vectortoangle(game.crosshairX-self.positionX,game.crosshairY-self.positionY)
Sign In or Register to comment.