Frame 1
stop();
Frame 2
stop();
Frame 3
function movement() {
pathlength = random(100) + 10;
pathnum = random(8);
}
function changepath() {
xfactor = 2;
yfactor = 2;
movearray = new Array();
if ((_root.box._x - Number(_root.box._width / 2)) < 10) {
xfactor = -1;
} else if ((_root.box._x + Number(_root.box._width / 2)) > 540) {
xfactor = 1;
}
if ((_root.box._y - Number(_root.box._height / 2)) < 10) {
yfactor = -1;
} else if ((_root.box._y + Number(_root.box._height / 2)) > 410) {
yfactor = 1;
}
i = 0;
while (i < 8) {
if ((_root["path" add i][0] != xfactor) && (_root["path" add i][1] != yfactor)) {
movearray.push(i);
}
i++;
}
_root.pathnum = movearray[random(movearray.length)];
_root.pathlength = random(100) + 20;
}
scoretxt.setStyle = "scorefont";
scoretxt.embedFonts = true;
square._x = xmouse;
square._y = ymouse;
Mouse.hide();
square.startDrag();
bg._alpha = 0;
path0 = new Array(0, -1);
path1 = new Array(1, -1);
path2 = new Array(1, 0);
path3 = new Array(1, 1);
path4 = new Array(0, 1);
path5 = new Array(-1, 1);
path6 = new Array(-1, 0);
path7 = new Array(-1, -1);
pathlength = 0;
score = 0;
timect = 0;
movespeed = 0.6;
dupebox = 0;
movement();
stop();
Instance of Symbol 69 MovieClip "box" in Frame 3
onClipEvent (enterFrame) {
if (_root.pathlength > 0) {
this._x = this._x + Number(_root["path" add _root.pathnum][0] * _root.movespeed);
this._y = this._y + Number(_root["path" add _root.pathnum][1] * _root.movespeed);
_root.pathlength--;
if (((((this._x - Number(this._width / 2)) < 10) or ((this._x + Number(this._width / 2)) > 540)) or ((this._y - Number(this._height / 2)) < 10)) or ((this._y + Number(this._height / 2)) > 410)) {
_root.changepath();
}
} else {
_root.movement();
}
}
Instance of Symbol 71 MovieClip "square" in Frame 3
onClipEvent (enterFrame) {
if (((((this._x + Number(this._width / 2)) < (_root.box._x + Number(_root.box._width / 2))) && ((this._x - Number(this._width / 2)) > (_root.box._x - Number(_root.box._width / 2)))) && ((this._y - Number(this._height / 2)) > (_root.box._y - Number(_root.box._height / 2)))) && ((this._y + Number(this._height / 2)) < (_root.box._y + Number(_root.box._height / 2)))) {
} else {
Mouse.show();
_root.gotoAndPlay("endgame");
}
}
Instance of Symbol 76 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (_root.timect < 60) {
_root.timect++;
if ((_root.score > 10) && (_root.score < 21)) {
if (_root.box._width > 100) {
_root.box._height = (_root.box._width = _root.box._width - 1);
}
}
if ((_root.score > 20) && (_root.score < 25)) {
if (_root.box._alpha > 20) {
_root.box._alpha--;
}
}
if ((_root.score > 28) && (_root.score < 40)) {
if ((((((((((_root.timect == 6) or (_root.timect == 12)) or (_root.timect == 18)) or (_root.timect == 24)) or (_root.timect == 30)) or (_root.timect == 36)) or (_root.timect == 42)) or (_root.timect == 48)) or (_root.timect == 54)) or (_root.timect == 60)) {
_root.dupebox++;
duplicateMovieClip (_root.ibox, "fakebox" add _root.dupebox, _root.getNextHighestDepth());
_root["fakebox" add _root.dupebox]._width = _root.box._width;
_root["fakebox" add _root.dupebox]._height = _root.box._height;
_root["fakebox" add _root.dupebox]._alpha = _root.box._alpha;
_root["fakebox" add _root.dupebox]._x = random(500) + 50;
_root["fakebox" add _root.dupebox]._y = -200;
_root["fakebox" add _root.dupebox].id = 1;
}
}
if ((_root.score > 30) && (_root.score < 37)) {
_root.box._rotation = _root.box._rotation - 10;
}
if ((_root.score > 45) && (_root.score < 50)) {
if (_root.box._width > 80) {
_root.box._height = (_root.box._width = _root.box._width - 1);
}
}
if ((_root.score > 49) && (_root.score < 80)) {
if ((((((((((_root.timect == 6) or (_root.timect == 12)) or (_root.timect == 18)) or (_root.timect == 24)) or (_root.timect == 30)) or (_root.timect == 36)) or (_root.timect == 42)) or (_root.timect == 48)) or (_root.timect == 54)) or (_root.timect == 60)) {
_root.dupebox++;
duplicateMovieClip (_root.isquare, "fakesquare" add _root.dupebox, _root.getNextHighestDepth());
_root["fakesquare" add _root.dupebox]._x = random(500) + 50;
_root["fakesquare" add _root.dupebox]._y = random(370) + 50;
_root["fakesquare" add _root.dupebox].id = 1;
_root["fakesquare" add _root.dupebox].itime = 0;
}
}
if ((_root.score > 15) && (_root.score < 25)) {
if ((((((((((_root.timect == 6) or (_root.timect == 12)) or (_root.timect == 18)) or (_root.timect == 24)) or (_root.timect == 30)) or (_root.timect == 36)) or (_root.timect == 42)) or (_root.timect == 48)) or (_root.timect == 54)) or (_root.timect == 60)) {
_root.dupebox++;
duplicateMovieClip (_root.isquare, "fakesquare" add _root.dupebox, _root.getNextHighestDepth());
_root["fakesquare" add _root.dupebox]._x = random(500) + 50;
_root["fakesquare" add _root.dupebox]._y = random(370) + 50;
_root["fakesquare" add _root.dupebox].id = 1;
_root["fakesquare" add _root.dupebox].itime = 0;
}
}
if (_root.score > 59) {
if ((_root.score == 2) && (_root.timect == 2)) {
changebg = 1;
}
if (changebg == 1) {
if (_root.bg._alpha < 50) {
_root.bg._alpha++;
} else {
changebg = 0;
}
} else if (_root.bg._alpha > 0) {
_root.bg._alpha--;
} else {
changebg = 1;
}
}
if ((_root.score > 30) && (_root.score < 50)) {
if ((_root.score == 2) && (_root.timect == 2)) {
changebg = 1;
}
if (changebg == 1) {
if (_root.bg._alpha < 50) {
_root.bg._alpha++;
} else {
changebg = 0;
}
} else if (_root.bg._alpha > 0) {
_root.bg._alpha--;
} else {
changebg = 1;
}
}
if (_root.score > 80) {
if (_root.box._width > 70) {
_root.box._height = (_root.box._width = _root.box._width - 1);
}
}
if (_root.score > 90) {
if (((((_root.timect == 10) or (_root.timect == 20)) or (_root.timect == 30)) or (_root.timect == 40)) or (_root.timect == 50)) {
_root.dupebox++;
duplicateMovieClip (_root.ibox, "fakebox" add _root.dupebox, _root.getNextHighestDepth());
_root["fakebox" add _root.dupebox]._width = _root.box._width;
_root["fakebox" add _root.dupebox]._height = _root.box._height;
_root["fakebox" add _root.dupebox]._alpha = _root.box._alpha;
_root["fakebox" add _root.dupebox]._x = random(500) + 50;
_root["fakebox" add _root.dupebox]._y = -200;
_root["fakebox" add _root.dupebox].id = 1;
}
}
if (_root.score > 100) {
if ((((((((((_root.timect == 6) or (_root.timect == 12)) or (_root.timect == 18)) or (_root.timect == 24)) or (_root.timect == 30)) or (_root.timect == 36)) or (_root.timect == 42)) or (_root.timect == 48)) or (_root.timect == 54)) or (_root.timect == 60)) {
_root.dupebox++;
duplicateMovieClip (_root.isquare, "fakesquare" add _root.dupebox, _root.getNextHighestDepth());
_root["fakesquare" add _root.dupebox]._x = random(500) + 50;
_root["fakesquare" add _root.dupebox]._y = random(370) + 50;
_root["fakesquare" add _root.dupebox].id = 1;
_root["fakesquare" add _root.dupebox].itime = 0;
}
}
} else {
_root.score++;
if (_root.score < 11) {
_root.movespeed = _root.movespeed + 0.05;
}
if (_root.score > 10) {
_root.movespeed = _root.movespeed + 0.01;
}
_root.timect = 0;
}
}
Instance of Symbol 69 MovieClip "ibox" in Frame 3
onClipEvent (enterFrame) {
if (id > 0) {
if (this._y < 500) {
this._y = this._y + 10;
} else {
removeMovieClip(this);
}
}
}
Instance of Symbol 71 MovieClip "isquare" in Frame 3
onClipEvent (enterFrame) {
if (id > 0) {
if (itime < 240) {
itime++;
} else {
removeMovieClip(this);
}
}
}
Frame 4
i = 0;
while (i < 50) {
removeMovieClip(_root["fakebox" add Number(_root.dupebox - i)]);
removeMovieClip(_root["fakesquare" add Number(_root.dupebox - i)]);
i++;
}
scoretxt.setStyle = "scorefont";
scoretxt.embedFonts = true;
stop();
Symbol 60 Button
on (press) {
getURL ("http://www.vivalagames.com", _blank);
}
Symbol 64 Button
on (press) {
gotoAndPlay ("game");
}
Symbol 72 Button
on (press) {
gotoAndPlay (2);
}
Symbol 82 Button
on (press) {
gotoAndPlay ("game");
}