Shooting Actor - shoot in tow different directions

Hello.
I would like to know how to spawn a bullet in two different directions, left and right:

- when the actor is turned to the left (shoot in that direction) and when the actor is turned to the right (shoot in that direction).

Best regards

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You'll need to provide more information. Is this a side-scroller where the player flips horizontally? Is it an asteroids-type game where the player rotates from side to side?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • umeiumei Member, PRO Posts: 21
    You can make 2 boolean attributes and call them left and right. Have a rule that say when left button is pressed change left attribute to true and spawn bullet. In your bullet actor have a rule that checks if left attribute is true, if so, fire to the left. Do the same for the right side.

    Hope that helps. I am new to Gamesalad so I could be wrong, but I think it will work.
  • quantumsheepquantumsheep Member Posts: 8,188
    In my latest game, I have two different bullets - one for shooting left, one for shooting right.

    Was the easiest way I could think of when I started the game 2 years ago - there may be better ways of doing it now!

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • RuddvandolphRuddvandolph Member Posts: 19
    @tatiang‌ , it´s "a side-scroller where the player flips horizontally".
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Follow @umei's advice. You'll need something like that to flip your actor's image any way, so why not use it for shooting bullets, too?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RuddvandolphRuddvandolph Member Posts: 19

    I am sorry... I will update my problem:

    • If the actor is looking to left (after touch left key, flip horizontal), than i touch space and the bullet goes to that direction (left). And of course, the same thing when the actor is turned to the right.

    Best regards.

Sign In or Register to comment.