Question
My bullets dont work in my game >.<
I have a ship mc on the stage called "hero" and a bullet mc
off the stage called "bullet". When you press space, the function
below called fireBullets() is triggered, but its not working how I
want it to, of course. When you shoot a new bullet, there should be
another one following behind the first, but instead the bullet
already shot disappears and a new one appears in front of the ship.
Maybe Im just not using the right strategy, but this is really
aggravating me. Any help appreciated!
var i;
function fireBullets() {
if (i >= 2) {
//this should happen AFTER the else statement
_root[newname].duplicateMovieClip(newname);
i++;
} else {
var newname = "bullet"+i;
bullet.duplicateMovieClip(newname);
i++;
}
_root[newname]._x = hero._x;
_root[newname]._y = hero._y-38;
var newname = "bullet"+i;
}
var i;
function fireBullets() {
if (i >= 2) {
//this should happen AFTER the else statement
_root[newname].duplicateMovieClip(newname);
i++;
} else {
var newname = "bullet"+i;
bullet.duplicateMovieClip(newname);
i++;
}
_root[newname]._x = hero._x;
_root[newname]._y = hero._y-38;
var newname = "bullet"+i;
}
