Help with fire system!

DreamWorldDreamWorld Member Posts: 43
edited November -1 in Working with GS (Mac)
I want my tank to fire in 4 directions up,down,left,right. How can I do it?
Instead of changing the rotation of the image of the tank I change the image.

Comments

  • DreamWorldDreamWorld Member Posts: 43
    Thanks it works but there is a problem with that. When I change direction the bullet changes direction too. Is there anyway to fix it?
  • DreamWorldDreamWorld Member Posts: 43
    anyone?
  • reddotincreddotinc Member Posts: 653
    DreamWorld said:
    Thanks it works but there is a problem with that. When I change direction the bullet changes direction too. Is there anyway to fix it?

    Can you describe this a bit more? Your bullet doesn't fire the same way the tank is facing?
  • DreamWorldDreamWorld Member Posts: 43
    It is. But when I change direction of my tank so does the bullet. If I fire to the left and the go up the bullet will do the same.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    dreamworld, piece of cake to fix, when I first got started out with GS, that happened to me too.

    You need to create one more attribute on the bullet itself. Call that direction too. At the very top of your bullet rules, create a new new that says:

    change attribute self.Direction to game.Direction.

    and then change all your direction rules to use self.Direction instead of game.Direction.

    When the actor get's spawned, it will assign itself a direction (self.Direction). So when you hit a different button, keeps it's original direction.
  • DreamWorldDreamWorld Member Posts: 43
    Thank you mulcahy so much!!!
Sign In or Register to comment.