Game Development Reference
In-Depth Information
To count ammo that is being depleted, go into our
Inter-Dimensional Gravity
Distributor
actor. That didn't sound epic enough. Hold on!
That's better! Let's go edit our weapon, and inside both the
Shoot Left
and
Shoot
Right
rules, we need to add in one more condition each. In the rule, click on the
+
button, change the new condition to
Attribute
|
game.Ammo
|
>
|
0
. This way, he will
only be able to shoot when he has more than one bullet. Now in both shooting rules,
drag in a Change Attribute behavior, and change it to
Change Attribute
|
game.Ammo
|
to
|
game.Ammo -1
. This will now deplete the ammo each time you shoot.