Frame 1
life = 3;
hit = 0;
speed = 1;
lives.number = life;
stop();
Frame 2
lives.number = life;
stop();
Mouse.hide();
Instance of Symbol 11 MovieClip "character" in Frame 2
onClipEvent (load) {
speed = 1;
speedx = speed;
speedy = 0;
}
onClipEvent (enterFrame) {
_x = (_x + speedx);
_y = (_y + speedy);
if ((Key.isDown(37) && (!Key.isDown(39))) && (speedx == 0)) {
speedx = speed * -1;
speedy = 0;
_rotation = 270;
}
if ((Key.isDown(39) && (!Key.isDown(37))) && (speedx == 0)) {
speedx = speed;
speedy = 0;
_rotation = 90;
}
if ((Key.isDown(38) && (!Key.isDown(40))) && (speedy == 0)) {
speedy = speed * -1;
speedx = 0;
_rotation = 0;
}
if ((Key.isDown(40) && (!Key.isDown(38))) && (speedy == 0)) {
speedy = speed;
speedx = 0;
_rotation = 180;
}
if (_root.hit == 1) {
speedx = 0;
speedy = 0;
if (_root.life == 0) {
_root.gotoAndPlay(7);
}
}
}
Instance of Symbol 17 MovieClip "Food" in Frame 2
onClipEvent (load) {
_root.Food.number = 1;
fspeed = 3;
speedx = fspeed;
speedy = fspeed;
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && ((_root.character.speedy != 0) || (_root.character.speedx != 0))) {
_root.Food.number++;
_root.character.speed++;
if (_root.Food.number == 11) {
_root.character.speedx = 0;
_root.character.speedy = 0;
_root.character.speed = 1;
setProperty("_root.character", _x , 116);
setProperty("_root.character", _y , 170);
_root.gotoAndPlay(3);
}
_x = Math.floor((451 * Math.random()) + 50);
_y = Math.floor((301 * Math.random()) + 50);
}
setProperty("/Food", _x , _x + speedx);
setProperty("/Food", _y , _y + speedy);
if (_y > (400 - _height)) {
speedy = Math.abs(speedy) * -1;
}
if (_y < 0) {
speedy = Math.abs(speedy);
}
if (_x > (550 - _width)) {
speedx = Math.abs(speedx) * -1;
}
if (_x < 0) {
speedx = Math.abs(speedx);
}
}
Frame 3
stop();
_root.Food.number = 1;
Instance of Symbol 17 MovieClip "Food" in Frame 3
onClipEvent (load) {
_root.Food.number = 1;
fspeed = 3;
speedx = fspeed;
speedy = fspeed;
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && ((_root.character.speedy != 0) || (_root.character.speedx != 0))) {
_root.Food.number++;
_root.character.speed++;
if (_root.Food.number == 11) {
_root.character.speedx = 0;
_root.character.speedy = 0;
_root.character.speed = 1;
setProperty("_root.character", _x , 116);
setProperty("_root.character", _y , 170);
_root.gotoAndPlay(4);
}
_x = Math.floor((451 * Math.random()) + 50);
_y = Math.floor((301 * Math.random()) + 50);
}
setProperty("/Food", _x , _x + speedx);
setProperty("/Food", _y , _y + speedy);
if (_y > (400 - _height)) {
speedy = Math.abs(speedy) * -1;
}
if (_y < 0) {
speedy = Math.abs(speedy);
}
if (_x > (550 - _width)) {
speedx = Math.abs(speedx) * -1;
}
if (_x < 0) {
speedx = Math.abs(speedx);
}
}
Frame 4
stop();
_root.Food.number = 1;
Instance of Symbol 17 MovieClip "Food" in Frame 4
onClipEvent (load) {
_root.Food.number = 1;
fspeed = 3;
speedx = fspeed;
speedy = fspeed;
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && ((_root.character.speedy != 0) || (_root.character.speedx != 0))) {
_root.Food.number++;
_root.character.speed++;
if (_root.Food.number == 11) {
_root.character.speedx = 0;
_root.character.speedy = 0;
_root.character.speed = 1;
setProperty("_root.character", _x , 116);
setProperty("_root.character", _y , 170);
_root.gotoAndPlay(5);
}
_x = Math.floor((451 * Math.random()) + 50);
_y = Math.floor((301 * Math.random()) + 50);
}
setProperty("/Food", _x , _x + speedx);
setProperty("/Food", _y , _y + speedy);
if (_y > (400 - _height)) {
speedy = Math.abs(speedy) * -1;
}
if (_y < 0) {
speedy = Math.abs(speedy);
}
if (_x > (550 - _width)) {
speedx = Math.abs(speedx) * -1;
}
if (_x < 0) {
speedx = Math.abs(speedx);
}
}
Frame 5
stop();
_root.Food.number = 1;
Instance of Symbol 17 MovieClip "Food" in Frame 5
onClipEvent (load) {
_root.Food.number = 1;
fspeed = 3;
speedx = fspeed;
speedy = fspeed;
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && ((_root.character.speedy != 0) || (_root.character.speedx != 0))) {
_root.Food.number++;
_root.character.speed++;
if (_root.Food.number == 11) {
_root.character.speedx = 0;
_root.character.speedy = 0;
_root.character.speed = 1;
setProperty("_root.character", _x , 116);
setProperty("_root.character", _y , 170);
_root.gotoAndPlay(6);
}
_x = Math.floor((451 * Math.random()) + 50);
_y = Math.floor((301 * Math.random()) + 50);
}
setProperty("/Food", _x , _x + speedx);
setProperty("/Food", _y , _y + speedy);
if (_y > (400 - _height)) {
speedy = Math.abs(speedy) * -1;
}
if (_y < 0) {
speedy = Math.abs(speedy);
}
if (_x > (550 - _width)) {
speedx = Math.abs(speedx) * -1;
}
if (_x < 0) {
speedx = Math.abs(speedx);
}
}
Frame 6
stop();
_root.Food.number = 1;
Instance of Symbol 17 MovieClip "Food" in Frame 6
onClipEvent (load) {
_root.Food.number = 1;
fspeed = 3;
speedx = fspeed;
speedy = fspeed;
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && ((_root.character.speedy != 0) || (_root.character.speedx != 0))) {
_root.Food.number++;
_root.character.speed++;
if (_root.Food.number == 11) {
_root.character.speedx = 0;
_root.character.speedy = 0;
_root.character.speed = 1;
setProperty("_root.character", _x , 116);
setProperty("_root.character", _y , 170);
gotoAndPlay (8);
}
_x = Math.floor((451 * Math.random()) + 50);
_y = Math.floor((301 * Math.random()) + 50);
}
setProperty("/Food", _x , _x + speedx);
setProperty("/Food", _y , _y + speedy);
if (_y > (400 - _height)) {
speedy = Math.abs(speedy) * -1;
}
if (_y < 0) {
speedy = Math.abs(speedy);
}
if (_x > (550 - _width)) {
speedx = Math.abs(speedx) * -1;
}
if (_x < 0) {
speedx = Math.abs(speedx);
}
}
Frame 7
life = 3;
hit = 0;
_root.character.speedx = 0;
_root.character.speedx = 0;
_root.character.speed = 1;
Mouse.show();
stop();
Frame 8
stop();
Symbol 4 Button
on (release) {
play();
}
Symbol 11 MovieClip Frame 10
if (_root.hit != 1) {
gotoAndPlay (1);
}
Symbol 11 MovieClip Frame 11
_root.life--;
if (_root.life == 0) {
_root.lives.number = _root.life;
stopAllSounds();
} else {
_root.lives.number = _root.life;
}
Symbol 11 MovieClip Frame 50
setProperty("_root.character", _x , 116);
setProperty("_root.character", _y , 170);
_root.hit = 0;
Instance of Symbol 13 MovieClip in Symbol 14 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.character.hitTest(this)) {
_root.hit = 1;
}
}
Symbol 27 Button
on (release) {
gotoAndPlay (2);
}