Changing direction the bullets go?

keflynkeflyn Member Posts: 29
edited November -1 in Working with GS (Mac)
I'm trying to make the bullets go down, left, up and right depending on the direction my character is moving/face(Not sure I have program the facing different directions correctly as I just made the image change depending on which key is pressed) so when my character is facing down or moving down the bullets shot down. I've tried a few things but I can't seem to get it to work.

Thanks.

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    I had a similar problem too. I made a game.attribute that is an ANGLE. Then when I do my 'shooting' rule, I have it change attribute game.PlayerRotation to self.rotation and then spawn actor from -game.PlayerRotation (Note the negative sign - in front of game.playerrotation, not sure why this is, but my game works with it).

    My game has the shooting behavior outside of the player actor, so if you have a player-actor that has the spawn rule on him, just have the bullet spawn from -self.rotation.

    Good luck!
Sign In or Register to comment.