Frame 3
function displayplayer() {
var _local1 = this;
_local1.player._x = px;
_local1.player._y = py;
_local1.player._rotation = pr;
if (pr > 0) {
displayframe = 17 + Math.floor(Math.abs(pr) / 2);
if (displayframe > 30) {
displayframe = 30;
}
}
if (pr < 0) {
displayframe = 17 - Math.floor(Math.abs(pr) / 2);
}
if (displayframe < 1) {
displayframe = 1;
}
_local1.player.gotoAndStop(displayframe);
temp = Math.abs(pr);
if (temp > 80) {
_local1.player.gotoAndStop(31);
}
_local1.shadow._x = 275 + (pr * 1.3);
if ((pr > 24) && (pr < 40)) {
_local1.player.playerhead.gotoAndStop(4);
}
if (pr > 40) {
_local1.player.playerhead.gotoAndStop(4);
}
if ((pr > 10) && (pr < 25)) {
_local1.player.playerhead.gotoAndStop(3);
}
if (pr < 11) {
_local1.player.playerhead.gotoAndStop(1);
}
}
this.background.gotoAndStop(random(2) + 1);
function setup() {
var _local1 = _global;
_local1.px = 275;
_local1.py = 345;
_local1.pr = 0;
leftkey = 37;
rightkey = 39;
spacekey = 32;
trace(random(2) + 1);
time = 0;
if (highscore == undefined) {
highscore = 0;
}
this.pressspace.gotoAndStop(1);
if (firsttime == 0) {
firsttime = 1;
this.getready.gotoAndStop(1);
} else if (firsttime == 0) {
}
}
function frameaction() {
if (action == "wait") {
waitcount++;
if (waitcount > 2) {
waitcount = 0;
if (random(2) == 1) {
pr = Math.random(2);
}
if (random(2) == 1) {
pr = -Math.random(2);
}
if (pr > 0) {
displayframe = 17 + Math.floor(Math.abs(pr) / 2);
if (displayframe > 30) {
displayframe = 30;
}
}
if (pr < 0) {
displayframe = 17 - Math.floor(Math.abs(pr) / 2);
}
if (displayframe < 1) {
displayframe = 1;
}
this.player.gotoAndStop(displayframe);
this.player._rotation = pr;
}
}
if (action == "setup") {
setup();
start_time = getTimer();
action = "playing";
}
if (action == "playing") {
if ((pr > 0) || (pr < 0)) {
pr = pr * 1.1;
}
if (Math.abs(pr) < 4) {
if (random(2) == 1) {
pr = pr + Math.random(diff);
}
if (random(2) == 1) {
pr = pr - Math.random(diff);
}
}
if (Math.abs(pr) > 45) {
pr = pr * 1.2;
}
if (pr > 89) {
pr = 90;
action = "fell";
}
if (pr < -89) {
pr = -90;
action = "fell";
}
leftpress = Key.isDown(leftkey);
rightpress = Key.isDown(rightkey);
if (Math.abs(pr) < 70) {
if (leftpress == true) {
pr = pr - 5;
a = random(200) + 100;
attachMovie("indicator", "a" + a, a);
eval ("a" + a)._x = 150;
eval ("a" + a)._y = a;
}
if (rightpress == true) {
pr = pr + 5;
a = random(200) + 100;
attachMovie("indicator", "a" + a, a);
eval ("a" + a)._x = 400;
eval ("a" + a)._y = a;
eval ("a" + a)._xscale = -100;
}
}
displayplayer();
now_time = getTimer();
ntime = now_time - start_time;
utime = Math.floor(ntime / 1000);
displaytime = (utime + ".") + Math.floor((ntime - (utime * 1000)) / 100);
diff = (utime / 100) * 10;
if (diff < 3) {
diff = 3;
}
}
if (action == "fell") {
this.left.gotoAndStop(1);
this.right.gotoAndStop(1);
score = utime + (Math.floor((ntime - (utime * 1000)) / 100) / 10);
if (score > highscore) {
highscore = score;
this.newrecord.gotoAndPlay(2);
}
action = "menu wait";
acount = 40;
}
if (action == "menu wait") {
if (acount > 0) {
acount--;
}
if (acount == 1) {
this.pressspace.gotoAndPlay(2);
trace(1);
}
spacepress = Key.isDown(spacekey);
if (spacepress == true) {
_root.action = "setup";
this.getready.gotoAndPlay(2);
action = "wait";
this.pressspace.gotoAndStop(1);
}
}
}
function startagain() {
_root.action = "setup";
this.getready.gotoAndPlay(2);
action = "wait";
this.pressspace.gotoAndStop(1);
}
waitcount = 0;
diff = 3;
Instance of Symbol 41 MovieClip in Frame 3
onClipEvent (enterFrame) {
_root.frameaction();
}
Frame 7
setup();
action = "menu wait";
acount = 40;
firsttime = 0;
stop();
Symbol 5 MovieClip Frame 1
_root.stop();
PercentLoaded = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
_root.play();
}
Symbol 5 MovieClip Frame 2
gotoAndPlay (1);
Symbol 7 MovieClip [indicator] Frame 12
removeMovieClip(this);
Symbol 13 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 50
_root.action = "setup";
Symbol 51 MovieClip Frame 75
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 41
stop();
Symbol 66 Button
on (release) {
_root.startagain();
}
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 18
stop();