Frame 1
turnrate = 20;
nextflag = 0;
countflag = -1;
score = 0;
name = "Enter Name";
countdown = 45;
gametime = 0;
startpoint = 0;
gamestart = 0;
delay = 1000;
endgame = 0;
obstacle = 0;
countobstacle = -1;
boarderfall = false;
boarder.gotoandstop(2);
turn = new Sound();
turn.attachSound("turn.wav");
pass = new Sound();
pass.attachSound("pass.wav");
miss = new Sound();
miss.attachSound("miss.wav");
hit = new Sound();
hit.attachSound("hit2.wav");
stop();
Frame 2
if (_root.name != "Enter Name") {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Frame 4
gametime = getTimer();
if (gametime < 2500) {
gotoAndPlay (3);
}
Frame 5
if (gamestart == 0) {
startpoint = getTimer();
gamestart = 1;
}
gametime = getTimer() - startpoint;
if ((gametime >= (obstacle + delay)) and (countdown > 1)) {
boarder._y++;
obstacle = gametime;
delay = delay - 10;
countobstacle++;
if (countobstacle > 20) {
countobstacle = 0;
}
duplicateMovieClip (object, "object" add countobstacle, countobstacle);
}
if ((Key.isDown(90) and (boarderfall == false)) and (countdown > 0)) {
guide._x = 50;
}
if ((Key.isDown(88) and (boarderfall == false)) and (countdown > 0)) {
guide._x = 130;
}
if ((Key.isDown(67) and (boarderfall == false)) and (countdown > 0)) {
guide._x = 210;
}
if (guide._x > boarder._x) {
boarder._x = boarder._x + turnrate;
if ((boarderfall == false) and (countdown > 0)) {
boarder.gotoandstop(3);
}
if ((boarderfall == true) and (countdown > 0)) {
boarder.gotoandstop(4);
}
}
if (guide._x < boarder._x) {
boarder._x = boarder._x - turnrate;
if ((boarderfall == false) and (countdown > 0)) {
boarder.gotoandstop(1);
}
if ((boarderfall == true) and (countdown > 0)) {
boarder.gotoandstop(4);
}
}
if (guide._x == boarder._x) {
if ((boarderfall == false) and (countdown > 0)) {
boarder.gotoandstop(2);
}
if ((boarderfall == true) and (countdown > 0)) {
boarder.gotoandstop(4);
}
}
if (countdown <= 0) {
boarder.gotoandstop(5);
course.gotoandstop(2);
if (endgame == 0) {
endgame = getTimer() - startpoint;
}
if (gametime >= (endgame + 3000)) {
gotoAndStop (7);
}
}
if (countdown > 0) {
countdown = 45 - math.floor(gametime / 1000);
}
Frame 6
gotoAndPlay (5);
Frame 7
scoretable0.filename = "scores/slalom.sco";
scoretable0.scoresize = 10;
scoretable0.action = "INSERT";
scoretable0.viewtype = "FLASH";
scoretable0.winname = name;
scoretable0.winscore = score;
scoretable0.loadVariables("http://www.robotubegames.com/slalom.php", "GET");
stop();
Symbol 11 Button
on (keyPress "<Enter>") {
gotoAndPlay (2);
}
Symbol 18 MovieClip Frame 20
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 45 MovieClip Frame 1
_root.hit.start();
Symbol 45 MovieClip Frame 45
_root.turn.start();
Symbol 45 MovieClip Frame 60
_root.boarderfall = false;
_root.boarder.gotoandstop(2);
Symbol 46 MovieClip Frame 20
stop();
Instance of Symbol 33 MovieClip "head" in Symbol 46 MovieClip Frame 20
onClipEvent (enterFrame) {
this.gotoandstop(1);
}
Symbol 47 MovieClip Frame 1
_root.turn.start();
Symbol 47 MovieClip Frame 20
stop();
Symbol 48 MovieClip Frame 1
_root.turn.start();
Symbol 48 MovieClip Frame 3
_root.turn.start();
Symbol 48 MovieClip Frame 5
_root.turn.start();
Instance of Symbol 21 MovieClip in Symbol 57 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 57 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 59 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 59 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 61 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 61 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 63 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 63 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 65 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 65 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 67 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 67 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 69 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 69 MovieClip Frame 30
stop();
Instance of Symbol 21 MovieClip in Symbol 71 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
}
}
Symbol 71 MovieClip Frame 30
stop();
Symbol 74 MovieClip Frame 1
stop();
Instance of Symbol 21 MovieClip in Symbol 74 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
_root.boarderfall = true;
_parent.gotoAndStop(2);
}
}
Symbol 74 MovieClip Frame 2
stop();
Symbol 75 MovieClip Frame 30
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
_root.pass.start();
stop();
Symbol 79 MovieClip Frame 1
flagpass = false;
Instance of Symbol 21 MovieClip in Symbol 79 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
if (_parent.flagpass == false) {
_root.score++;
}
_parent.flagpass = true;
_parent.flags.gotoAndStop(2);
}
}
Symbol 79 MovieClip Frame 30
if (flagpass == false) {
_root.miss.start();
_root.score--;
}
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 2
_root.pass.start();
stop();
Symbol 83 MovieClip Frame 1
flagpass = false;
Instance of Symbol 21 MovieClip in Symbol 83 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
if (_parent.flagpass == false) {
_root.score++;
}
_parent.flagpass = true;
_parent.flags.gotoAndStop(2);
}
}
Symbol 83 MovieClip Frame 30
if (flagpass == false) {
_root.miss.start();
_root.score--;
}
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 2
_root.pass.start();
stop();
Symbol 87 MovieClip Frame 1
flagpass = false;
Instance of Symbol 21 MovieClip in Symbol 87 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.boarder.boarderhit)) {
if (_parent.flagpass == false) {
_root.score++;
}
_parent.flagpass = true;
_parent.flags.gotoAndStop(2);
}
}
Symbol 87 MovieClip Frame 30
if (flagpass == false) {
_root.miss.start();
_root.score--;
}
stop();
Symbol 88 MovieClip Frame 1
if ((_root.countobstacle == -1) or (_root.countdown <= 0)) {
stop();
} else {
flagobject = random(3);
if (flagobject == 0) {
whatobject = random(9);
whatpos = random(3);
}
if (flagobject > 0) {
nextflag = random(3);
whatpos = 0;
}
if (whatpos == 0) {
this._x = 72;
}
if (whatpos == 1) {
this._x = 150;
}
if (whatpos == 2) {
this._x = 228;
}
if (flagobject == 0) {
gotoAndStop(whatobject + 2);
}
if (flagobject > 0) {
gotoAndStop(nextflag + 11);
}
}
Symbol 88 MovieClip Frame 2
stop();
Symbol 88 MovieClip Frame 3
stop();
Symbol 88 MovieClip Frame 4
stop();
Symbol 88 MovieClip Frame 5
stop();
Symbol 88 MovieClip Frame 6
stop();
Symbol 88 MovieClip Frame 7
stop();
Symbol 88 MovieClip Frame 8
stop();
Symbol 88 MovieClip Frame 9
stop();
Symbol 88 MovieClip Frame 10
stop();
Symbol 88 MovieClip Frame 11
stop();
Symbol 88 MovieClip Frame 12
stop();
Symbol 88 MovieClip Frame 13
stop();
Symbol 91 Button
on (release) {
gotoAndPlay (1);
}