PDA

View Full Version : Count the number of bullets shot...


ckrupala
02-25-2009, 06:05 AM
I need to figure out how to count the number of bullets shot and when the amount of bullets shot reaches 5 I need to identify with a speech bubble that you need to reload. And then after you reload I need to know how to reset the number of bullets shot to = 0 so that the process can start over.

Any help is appreciated.. :)

JustasM
02-25-2009, 10:53 AM
Try creating a number variable of 0.
Every time a bullet is shot, increment the variable by 1, but allow the bullets to shoot only if the variable is < 5.

Have another if statement say that if variable is 5, show a dialog box.

Finally, make it such that whenever the reload button is pressed (R, or any other one), set that variable to 0.