Shooting in Gamesalad?
NicoSola
Member Posts: 5
Hello, I am Nico and I know the basics of shooting, I know how to make the actor shoot a bullet in direction of an "angle attribute" , but I made that attribute to switch from 0º to 180º when I press the key "D" (for 0º) and "A" (for 180º) and when those are pressed, the actor's image change to that orientation. But the problem is that I think that isn't the best way because sometimes I shoot the opposite way I am facing...
So what I need is if someone could please tell me how to make the bullet move into my player orientation with another technique more accurate. Thanks a lot!:)
So what I need is if someone could please tell me how to make the bullet move into my player orientation with another technique more accurate. Thanks a lot!:)
Best Answer
-
tatiang Posts: 11,949One way to do this is to change a game attribute (e.g. game.playerDirection) each time you change directions. So if you are facing right, you might set game.playerDirection to 1. When you flip to the left, you could change game.playerDirection to -1. Then have the bullet spawn and move based on the value of game.playerDirection.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User