Frame 1
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
_root.music = "on";
stop();
Instance of Symbol 5 MovieClip in Frame 1
onClipEvent (enterFrame) {
text = ((int(_parent.getBytesLoaded() / 1000) add " KBYTES OF ") add int(_parent.getBytesTotal() / 1000)) add " LOADED ...";
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_parent.gotoAndStop(2);
}
}
Instance of Symbol 2 MovieClip [empty] in Frame 1
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL)) {
foo = "";
}
if (_url != "http://www.tonypa.pri.ee/robootik_e.swf") {
_root.gotoAndStop(1);
}
}
Frame 2
function rotateTowards(clip, targetX, targetY) {
var clipPoint = {x:clip._x, y:clip._y};
clip._parent.localToGlobal(clipPoint);
var deltaX = (targetX - clipPoint.x);
var deltaY = (targetY - clipPoint.y);
var rotationRadian = Math.atan2(deltaY, deltaX);
var rotationAngle = radiansToDegrees(rotationRadian);
clip._rotation = rotationAngle;
}
function radiansToDegrees(radians) {
return((radians / Math.PI) * 180);
}
Instance of Symbol 29 MovieClip in Frame 2
onClipEvent (enterFrame) {
_root.rotateTowards(this, _root._xmouse, _root._ymouse);
}
Instance of Symbol 29 MovieClip in Frame 2
onClipEvent (enterFrame) {
_root.rotateTowards(this, _root._xmouse, _root._ymouse);
}
Frame 3
_root.score = 0;
_root.spares = 3;
stop();
Instance of Symbol 41 MovieClip "cont" in Frame 3
onClipEvent (load) {
function firstload() {
_root.h1.h._width = random(50) + 150;
_root.h2.h._width = random(50) + 150;
_root.h3.h._width = (450 - _root.h1.h._width) - _root.h2.h._width;
i = 1;
while (i < 5) {
_root["h" + i].rotcheck = _root["h" + i]._rotation;
_root["h" + i].rot = 0;
_root["h" + i].piecelength = _root["h" + i].h._width - 2;
i++;
}
}
function checkall() {
_root.h1.rotcheck = _root.h1.rot + _root.h1._rotation;
piAngle = (Math.PI/180) * _root.h1.rotcheck;
_root.h2.x = _root.h1._x + (_root.h1.piecelength * Math.cos(piAngle));
_root.h2.y = _root.h1._y + (_root.h1.piecelength * Math.sin(piAngle));
_root.h2.rotcheck = (_root.h2.rot + _root.h1.rot) + _root.h2.rotcheck;
piAngle = (Math.PI/180) * _root.h2.rotcheck;
_root.h3.x = _root.h2.x + (_root.h2.piecelength * Math.cos(piAngle));
_root.h3.y = _root.h2.y + (_root.h2.piecelength * Math.sin(piAngle));
_root.h3.rotcheck = ((_root.h2.rot + _root.h3.rot) + _root.h1.rot) + _root.h3.rotcheck;
piAngle = (Math.PI/180) * _root.h3.rotcheck;
_root.h4.x = _root.h3.x + (_root.h3.piecelength * Math.cos(piAngle));
_root.h4.y = _root.h3.y + (_root.h3.piecelength * Math.sin(piAngle));
_root.h4.rotcheck = (((_root.h3.rot + _root.h4.rot) + _root.h4.rotcheck) + _root.h1.rot) + _root.h2.rot;
piAngle = (Math.PI/180) * _root.h4.rotcheck;
_root.h4.end.x = _root.h4.x + (_root.h4.piecelength * Math.cos(piAngle));
_root.h4.end.y = _root.h4.y + (_root.h4.piecelength * Math.sin(piAngle));
if ((((leftx < _root.h2.x) and (_root.h2.x < rightx)) and (topy < _root.h2.y)) and (_root.h2.y < boty)) {
if ((((leftx < _root.h3.x) and (_root.h3.x < rightx)) and (topy < _root.h3.y)) and (_root.h3.y < boty)) {
if ((((leftx < _root.h4.x) and (_root.h4.x < rightx)) and (topy < _root.h4.y)) and (_root.h4.y < boty)) {
if ((((leftx < _root.h4.end.x) and (_root.h4.end.x < rightx)) and (topy < _root.h4.end.y)) and (_root.h4.end.y < boty)) {
placeall();
}
}
}
}
i = 1;
while (i < 5) {
_root["h" + i].rot = 0;
_root["h" + i].rotcheck = _root["h" + i]._rotation;
i++;
}
}
function placeall() {
if (_root.music == "on") {
_root["sound" + counter].gotoAndPlay(2);
}
i = 1;
while (i < 4) {
_root["h" + i]._rotation = _root["h" + i].rotcheck;
_root["h" + i]._x = _root["h" + i].x;
_root["h" + i]._y = _root["h" + i].y;
i++;
}
_root["h" + i]._x = _root["h" + i].x;
_root["h" + i]._y = _root["h" + i].y;
}
function placetarget() {
speed = 1;
timetogostart = int(getTimer() / 1000);
setProperty("_root.target", _x , random(340) + 40);
setProperty("_root.target", _y , random(250) + 130);
_root.change = 0;
}
function addbonus() {
bonus = 1;
bonustime = int(getTimer() / 1000) + 10;
setProperty("_root.bonus", _x , random(340) + 40);
setProperty("_root.bonus", _y , random(250) + 130);
}
function removebonus() {
setProperty("_root.bonus", _x , -200);
setProperty("_root.bonus", _y , random(250) + 130);
}
counter = 1;
bonus = 0;
m = _root["h" + counter];
m.b.gotoAndStop(2);
leftx = 30;
rightx = 390;
topy = 70;
boty = 390;
startx = 14;
pause = 500;
starty = 120;
_root.h1._x = startx;
_root.h1._y = starty;
firstload();
placetarget();
checkall();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
m.rot = -speed;
checkall();
}
if (Key.isDown(Key.DOWN)) {
m.rot = speed;
checkall();
}
if (Key.isDown(Key.RIGHT) and (mytime < getTimer())) {
if (_root.music == "on") {
_root.sound.gotoAndPlay(2);
}
m.b.gotoAndStop(1);
mytime = getTimer() + pause;
counter = counter + 1;
if (counter == 4) {
counter = 1;
}
m = _root["h" + counter];
m.b.gotoAndStop(2);
}
if (Key.isDown(Key.LEFT) and (mytime < getTimer())) {
if (_root.music == "on") {
_root.sound.gotoAndPlay(2);
}
m.b.gotoAndStop(1);
mytime = getTimer() + pause;
counter = counter - 1;
if (counter == 0) {
counter = 3;
}
m = _root["h" + counter];
m.b.gotoAndStop(2);
}
if (_root.target.hitTest(_root.h4.end.x, _root.h4.end.y, true) and (_root.change == 0)) {
_root.change = 1;
_root.score = Number(_root.score) + 10;
_root.target.gotoAndPlay(2);
if (_root.music == "on") {
_root.sound5.gotoAndPlay(2);
}
}
timetogo = ((180 - _root.score) - (int(getTimer() / 1000) - timetogostart)) / (280 - _root.score);
setProperty("_root.healthbar.h", _yscale , timetogo * 100);
if ((0 >= timetogo) and (_root.change == 0)) {
_root.spares = Number(_root.spares) - 1;
if (_root.spares == 0) {
_root.gotoAndStop(4);
}
if (_root.music == "on") {
_root.sound5.gotoAndPlay(2);
}
_root.change = 1;
_root.target.gotoAndPlay(2);
}
if (bonus == 0) {
if (997 < random(1000)) {
addbonus();
}
} else if (bonustime < int(getTimer() / 1000)) {
bonus = 0;
if (_root.music == "on") {
_root.sound4.gotoAndPlay(2);
}
_root.bonus.gotoAndPlay(2);
} else if (_root.bonus.hitTest(_root.h4.end.x, _root.h4.end.y, true) and (bonus == 1)) {
bonus = 0;
if (_root.music == "on") {
_root.sound4.gotoAndPlay(2);
}
_root.bonus.gotoAndPlay(2);
randombonus = random(3);
if (randombonus == 0) {
timetogostart = int(getTimer() / 1000);
_root.bonustext.t = "EXTRA TIME";
} else if (randombonus == 1) {
speed = 3;
_root.bonustext.t = "EXTRA SPEED";
} else {
_root.bonustext.t = "EXTRA POINTS";
_root.score = Number(_root.score) + 20;
}
}
}
Instance of Symbol 55 MovieClip "bonustext" in Frame 3
onClipEvent (load) {
speed = 15;
t = "";
}
onClipEvent (enterFrame) {
if (t != "") {
_xscale = (_xscale + speed);
_yscale = (_yscale + speed);
if (400 < _xscale) {
_xscale = 100;
_yscale = 100;
t = "";
}
}
}
Frame 4
stop();
Instance of Symbol 29 MovieClip in Frame 4
onClipEvent (enterFrame) {
_root.rotateTowards(this, _root._xmouse, _root._ymouse);
}
Instance of Symbol 29 MovieClip in Frame 4
onClipEvent (enterFrame) {
_root.rotateTowards(this, _root._xmouse, _root._ymouse);
}
Instance of Symbol 91 MovieClip in Frame 4
onClipEvent (load) {
if (_root.my_name != "unknown") {
gotoAndStop (2);
}
}
Frame 5
scoretable.filename = "scores/robootik.sco";
scoretable.scoresize = 10;
scoretable.action = "INSERT";
scoretable.viewtype = "FLASH";
scoretable.winname = _root.my_name;
scoretable.winscore = _root.score;
scoretable.loadVariables("scores.php", "GET");
Frame 7
stop();
Symbol 7 Button
on (keyPress "<Enter>") {
foo = "";
}
on (keyPress "<Left>") {
foo = "";
}
on (keyPress "<Right>") {
foo = "";
}
Symbol 18 Button
on (release) {
gotoAndStop (3);
}
Symbol 24 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 1
stop();
Instance of Symbol 36 MovieClip in Symbol 37 MovieClip Frame 1
onClipEvent (load) {
rot = ((random(2) * 2) - 1) * 3;
pause = getTimer() + 1000;
}
onClipEvent (enterFrame) {
if (pause < getTimer()) {
pause = getTimer() + 1000;
setProperty(_parent, _rotation , _parent._rotation + rot);
}
}
Symbol 43 MovieClip Frame 1
stop();
Symbol 43 MovieClip Frame 10
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 3
stop();
Symbol 46 MovieClip Frame 1
stop();
Symbol 46 MovieClip Frame 3
stop();
Symbol 47 MovieClip Frame 1
stop();
Symbol 47 MovieClip Frame 3
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 13
gotoAndStop (1);
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 12
_root.cont.removebonus();
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 13
gotoAndStop (1);
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 12
_root.cont.placetarget();
Symbol 75 Button
on (release) {
gotoAndStop (2);
_root.music = "off";
}
Symbol 77 Button
on (release) {
gotoAndStop (1);
_root.music = "on";
}
Symbol 78 MovieClip Frame 1
stop();
Symbol 88 Button
on (release) {
loadVariablesNum (score_keeper, 0, "POST");
nextFrame();
}
Symbol 91 MovieClip Frame 1
stop();