Spawning bullets on screen
Dayton App Company
Member, PRO Posts: 12
I am needing a little assistance with some coding my first platformer. I am getting stuck when it comes to having a cannon only shoot cannon balls once the play comes on screen. Right now it just shoots constantly from all over the map since I have nothing coded says "when on screen" or something along those lines. Can anyone throw me a bone on this one please?
Comments
Create an invisible actor, a boolean attribute and a rule that says when player touches invisible actor than attribute is true cannon can shoot balls.
What @baronedevelop says will most likely work and might be the easiest method. An alternative though is to constrain the player's X and Y position to two real game attributes, and within the cannon have a rule that says when magnitude(playerx-cannonx,playery-cannoy) = 100 (or something) then shoot.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support