Login | Register

Ammo and Reloading

February 11, 2009, 20:59 by Nano
[loading]
-->



In the Weapons Global Left Button event put,

if can_shoot=true
if (ammo>0)
{
//Bullet create code goes here
if ammo = 0;
{ alarm[0]=70 //change this for a different reload time
can_shoot=false
}
ammo-=1;
can_shoot=false
}

Now in Alarm 0

ammo = 30; //Change the number for different ammunition amount
can_shoot=true


Lastly the Create Event
can_shoot=true;
ammo=30; //Change the number for different ammunition amount

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games