Limiting Bullets
Skunkpuppy
Member Posts: 19
Hey. Looking for a way to limit the amount of bullets fired...
So i have it that when i push space it fires..but i want to only let it fire lets say every 5th touch.
Basically it fires to much.
So i have it that when i push space it fires..but i want to only let it fire lets say every 5th touch.
Basically it fires to much.
Comments
Either use a timer or limit the number of bullets.
Timestamp method (1 second delay):
When [all] conditions: key [space] is down AND self.Time>self.bulletTime+1
.....Spawn actor [bullet]
.....Change Attribute self.bulletTime (real) to self.Time
Counter method (max 5 bullets):
When [all] conditions: key [space] is down AND game.bulletCount (integer) <5
.....Spawn actor [bullet]
.....Change Attribute game.bulletCount to game.bulletCount+1
*then in the bullet actor, have a rule that changes game.bulletCount to game.bulletCount-1 before the bullet is destroyed or when it goes off screen.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User