Frame 1
stop();
Frame 2
i = 0;
stop();
chance = 0;
internaltimer = 0;
reachrate = 6;
scoretimer = 0;
onEnterFrame = function () {
if (char._x < 0) {
gotoAndStop (3);
}
internaltimer++;
if (_currentframe == 2) {
scoretimer++;
}
if ((internaltimer == ((7 - reachrate) * 100)) && (reachrate != 1)) {
internaltimer = 0;
reachrate--;
chance = 0;
}
if (Key.isDown(40) && (char._y < 345)) {
char._y = char._y + 5;
} else if (Key.isDown(38) && (char._y > 25)) {
char._y = char._y - 5;
} else if (Key.isDown(39) && (char._x < 525)) {
char._x = char._x + 5;
char.speed = 0;
} else if (Key.isDown(37) && (char._x > 25)) {
char._x = char._x - 5;
char.speed = -5;
} else {
char.speed = 0;
}
updateAfterEvent();
chance = chance + 1;
if (chance == reachrate) {
chance = 0;
if (i < 999) {
i++;
} else {
i = 0;
}
duplicateMovieClip (evil, "evil" + i, i);
_root["evil" + i]._x = 570;
_root["evil" + i]._y = Math.floor(Math.random() * 320) + 22;
_root["evil" + i].speed = Math.floor(Math.random() * 5) + 2;
}
};
Instance of Symbol 14 MovieClip "evil" in Frame 2
onClipEvent (enterFrame) {
this._x = this._x - this.speed;
if (this._x < -15) {
removeMovieClip(this);
}
if (this.hitTest(_root.char)) {
difference = this.speed - _root.char.speed;
this._x = this._x + difference;
_root.char._x = _root.char._x - difference;
}
}
Symbol 9 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 19 Button
on (release) {
_root.gotoAndStop(1);
}