Ok, lets see if you can help me
Firstly, I am creating a game where you, well, shoot things!
It involves duplicating a movie clip to be used as a bullet.
My problem is that I can have to many bullets onscreen at once, which kind of ruins the game (makes it very easy).
I’ve tried this:
_root.NBullets = NBullets + 1;
if (NBullets < 5) {
duplicateMovieClip(_root.bullet, "bullet"+i, i);
}
on the space bar fire event.
Everytime one of the bullets passes off the screen it decrements the NBullets variable. This is where the problem is, as it keeps decrementing the NBullets variable below 0, I tried this:
if ((_root.NBullets > 0) && (NBullets < 5)) {
_root.NBullets = NBullets - 1;
}
But it didn’t work
Anybody any ideas?