Hello,
I have encountered my very first problem with the code itself. Basically, my code does not work as it should (if you insist "as i want").
Here is my code:
I have another condition which lower the ammo every time i shoot. Alarm 0 sets ammo to 3.
Now lets talk about the code above and why it does not work.
"ammo == 0" is real condition (it will eventually happen)
"alarm_set(0,120)" i believe it sets alarm with index 0 for 120 steps
"if (alarm_get(0) <=0)" it checks alarm index 0 value and once the alarm is 0 or lower the condition is true
i am not sure what is wrong with my code but that condition never gets to be true. Any ideas?
I have encountered my very first problem with the code itself. Basically, my code does not work as it should (if you insist "as i want").
Here is my code:
GML:
if (ammo == 0)
{
alarm_set(0,120);
if (alarm_get(0) <= 0)
{
instance_create_layer(x+50,y-50,"Bullets",oBDuck);
}
}
Now lets talk about the code above and why it does not work.
"ammo == 0" is real condition (it will eventually happen)
"alarm_set(0,120)" i believe it sets alarm with index 0 for 120 steps
"if (alarm_get(0) <=0)" it checks alarm index 0 value and once the alarm is 0 or lower the condition is true
i am not sure what is wrong with my code but that condition never gets to be true. Any ideas?