Windows Instance number incrementation

Hello everyone,

I have a gun that can shoot bullets.
If my bullet touch a wall then this bullet is destroyed.
I want to know how many bullets have been shooted (bullet "alive" + destroyed).
Is that possible?
 

Alexx

Member
Several ways of doing this.
If you want as you have asked:
Count the number of bullets on screen.
Make a variable that counts destroyed bullets.
Add them together.

If you just need a count of bullets fired, just increment a variable each time a bullet is fired.
 

Alexx

Member
Set up a 2d array.
You can then store all your gun data in this, such as:
Weapon name, weapon sprite, clip size, current ammo, ammo shots, hit rate, etc...

I have a guide to arrays if you would like it.
 
Top