First of all- Yes, i’ve tried using/modifying the Kirupa tutorial (on a vertical shooter) to suit my needs, but when I implemented the knowedge onto my game, 2 pieces appeared in close sequence, and then only one of them moved right along the x axis as it was supposed to for about 2 seconds, only then to stop and the other enemy (flags of nations) to disappear. Here’s my code on Frame 1.
var i;
function fireBullets() {
i++;
var newname = “bullet”+i;
_root.attachMovie(“bullet”, newname, i);
_root[newname]._y = _root.hero._y-100;
_root[newname]._x = _root.hero._x;
_root[newname].onEnterFrame = function() {
var bullet_speed = 4;
var alpha_decrease = 3;
this._y -= bullet_speed;
this._alpha -= alpha_decrease;
this._yscale -= alpha_decrease;
this._xscale -= alpha_decrease;
if (this._x>555) {
this.removeMovieClip();
}
};
}
var enemiesCurrent = 0;
function makeFlags(){
var enemyCount;
var flagNo;
var newflag = “newflag” + enemiesCurrent;
_root.onEnterFrame = function (){
if (enemiesCurrent < 1){
_root.attachMovie(“flag”, newflag, enemyCount);
enemyCount +=1;
_root[newflag]._currentframe = flagNo + 1;
_root[newflag]._y = random(70);
flagNo += 1;
enemiesCurrent += 1;
}
if (newflag._x = 551){
newflag._visible = false;
enemiesCurrent -= 1;
}
root[newflag]. = 50;
_root[“newflag”+(enemiesCurrent - 1)]._x += 10
_root[newflag]._x += 10
}
};
_root.onEnterFrame = function() {
moveHero(5);
makeFlags();
updateFlags(newflag);
};
If you would like to tinker with my flash directly, send me an email and I’ll send it to you. esoltas@gmail.com