How to make limited amount of bullets an actor can shoot
Monsterzproductions
Member Posts: 66
Hey guys ,
Thanks to those that helped me last time . Anyway , Im trying to make a game where actor 1 has to shoot actor 2 with a limited amount of bullets . I need help in making like after 5 shots , actor 1 cannot shoot anymore . Im not really sure how to make this . Pls help if u know
Tks
Comments
Make an attribute on Actor 1. Call it Bullet number and make it whatever number of bullets you want. Once you have it, on your Shooting command, add a wrapper rule If BulletNumber>0, and add the command Bulletnumber = bulletnumber- 1 as one of the behaviors within that rule.
could u send a template ? I don't really understand .
Tks
I'm afraid I dont have time to do a template, so I'll try typing it out quickly here. The shooting rule should look like this.
If Integer.Bulletnumber >0
( If trigger is pulled(however you have the player fire, button or screen touch)
Spawn Bullet
Integer.Bulletnumber = Integer.Bulletnumber - 1)
That way each time you fire, the number drops by one, and when it hits zero, you can no longer fire.
Demo attached.
Need Help? Email Me | Templates | Full Game Source Code
Tks