Frame 1
function setBoard(input) {
level = input;
rect1_clip.gotoAndStop(input);
grav.gotoAndStop(input);
play();
}
function setBoardRoll(input) {
rect1_clip.gotoAndStop(input);
grav.gotoAndStop(input);
_root.boardtitle = levelnames[input - 1];
trace(levelnames[input - 1]);
}
stop();
levelnames = new Array("WHEELS OF DOOM", "BALLS OF DEATH", "AN EASY BOARD", "MAZE OF DESTRUCTION", "CAT WITH LIMP", "THREE TIMES...DEATH", "ANTI GRAVITY PIT", "GRAVITY PIT", "SNAKE FROM HELL", "ACHIM'S RAZOR", "NIPPLE PIMPLES", "THE SMELL OF FEAR", "DIAMOND OF TERROR", "NOT KITTENS", "HUDSON'S HELL");
Frame 3
function update() {
loadVariables ((("getdata.php?tablename=highscores_" + level) + "&cache=") + random(999), "_root.highscore");
}
stop();
update();
Frame 5
function init() {
gameover = false;
username = "zefrank" + random(10);
game = {};
game.accel = 0.2;
game.grav = 0.001;
game.xfriction = 0.98;
game.yfriction = 0.98;
game.startTime = 0;
game.ship = {};
game.ship.path = _root.ship_clip;
game.ship.xpos = rect1_clip.landing1._x + 40;
game.ship.ypos = rect1_clip.landing1._y - 20;
game.ship.width = game.ship.path._width;
game.ship.height = game.ship.path._height;
game.ship.xmov = 0;
game.ship.ymov = 0;
game.landing = false;
game.ship.hit = false;
}
function explode() {
game.ship.hit = true;
gameover = true;
_root.attachMovie("explosion", "explosion", 1);
_root.explosion._x = game.ship.xpos;
_root.explosion._y = game.ship.ypos;
_root.explosion._rotation = game.ship.rotation;
gotoAndPlay (23);
}
function win() {
time = game.starttime - random(15);
game.starttime = time;
score_time = ("time : " + (game.starttime / 1000)) + " secs";
gameover = true;
gotoAndPlay (12);
}
function moveShip() {
var obj = game.ship;
if (Key.isDown(37)) {
obj.rotation = obj.rotation - 5;
} else if (Key.isDown(39)) {
obj.rotation = obj.rotation + 5;
}
if (Key.isDown(38)) {
obj.ymov = obj.ymov - (game.accel * Math.cos((game.ship.rotation * Math.PI) / 180));
obj.xmov = obj.xmov + (game.accel * Math.sin((game.ship.rotation * Math.PI) / 180));
}
if (Key.isDown(40)) {
obj.ymov = obj.ymov + (game.accel * Math.cos((game.ship.rotation * Math.PI) / 180));
obj.xmov = obj.xmov - (game.accel * Math.sin((game.ship.rotation * Math.PI) / 180));
}
obj.xmov = obj.xmov * game.xfriction;
obj.ymov = obj.ymov + game.grav;
obj.ymov = obj.ymov * game.yfriction;
if (grav.pits) {
checkGravityPit();
}
obj.tempx = game.ship.xpos + game.ship.xmov;
obj.tempy = game.ship.ypos + game.ship.ymov;
}
function hitTestCheck() {
game.ship.hit = false;
i = 1;
while (i <= game.ship.points) {
var pt = game.ship.path["point" + i];
pt.conv = {};
pt.conv.x = pt._x;
pt.conv.y = pt._y;
game.ship.path.localToGlobal(pt.conv);
var ptx = (pt.h + game.ship.tempx);
var pty = (pt.h + game.ship.tempy);
game.landing = false;
n = 1;
while (n <= 2) {
var obj = ("landing" + n);
if (game[obj].path.hitTest(pt.conv.x, pt.conv.y, true)) {
trace("hit");
game.landing = true;
game.ship.tempy = (game[obj].ypos - 0.8) - (0.5 * game.ship.height);
game.ship.ymov = 0;
game.ship.xmov = game.ship.xmov * 0.9;
game.ship.rotation = 0;
if (n == 2) {
win();
break;
}
}
n++;
}
if (rect1_clip.hitTest(pt.conv.x, pt.conv.y, true) && (game.landing == false)) {
explode();
trace("exploded");
return;
}
i++;
}
}
function renderShip() {
var obj = game.ship;
obj.xpos = game.ship.tempx;
obj.ypos = game.ship.tempy;
obj.path._x = game.ship.xpos;
obj.path._y = game.ship.ypos;
obj.path._rotation = game.ship.rotation;
}
function checkGravityPit() {
m = 1;
while (m <= grav.numpits) {
var obj = ("gravitypit" + m);
xdisgrav = game.ship.xpos - _root.grav[obj]._x;
ydisgrav = game.ship.ypos - _root.grav[obj]._y;
hypgrav = Math.sqrt(Math.pow(xdisgrav, 2) + Math.pow(ydisgrav, 2));
forcegrav = 1000 / Math.pow(hypgrav, 2);
gravangle = Math.atan(ydisgrav / xdisgrav);
xgrav = Math.abs(Math.cos(gravangle) * forcegrav);
ygrav = Math.abs(Math.sin(gravangle) * forcegrav);
maxforce = 10;
if (xgrav > maxforce) {
xgrav = maxforce;
}
if (ygrav > maxforce) {
ygrav = maxforce;
}
if (xdisgrav < 0) {
xgrav = xgrav * -1;
}
if (ydisgrav < 0) {
ygrav = ygrav * -1;
}
if (_root.grav.anti) {
game.ship.xmov = game.ship.xmov + xgrav;
game.ship.ymov = game.ship.ymov + ygrav;
} else {
game.ship.xmov = game.ship.xmov - xgrav;
game.ship.ymov = game.ship.ymov - ygrav;
}
m++;
}
}
init();
i = 1;
while (i <= 2) {
var pad = ("landing" + i);
game[pad] = {};
game[pad].path = _root.rect1_clip[pad];
game[pad].xpos = game[pad].path._x;
game[pad].ypos = game[pad].path._y;
game[pad].width = game[pad].path._width;
game[pad].height = game[pad].path._height;
i++;
}
_root.onEnterFrame = function () {
if ((!gameover) && (_currentframe == 5)) {
game.starttime = game.starttime + 42;
score_time = ("time : " + (game.starttime / 1000)) + " secs";
moveShip();
hitTestCheck();
renderShip();
if (Key.isDown(38)) {
game.ship.path.gotoAndStop(2);
} else if (Key.isDown(40)) {
game.ship.path.gotoAndStop(3);
} else {
game.ship.path.gotoAndStop(1);
}
}
};
stop();
Frame 17
my_score = ("your time: " + (_root.time / 1000)) + " seconds";
if ((_root.time / 1000) <= lowestscore) {
submit.userscore = _root.time / 1000;
win_message = "cogratulations! you have a high score. enter your name below and press submit.";
} else {
submit._visible = false;
win_message = "bummer thats not a high score";
}
stop();
Instance of Symbol 114 MovieClip "submit" in Frame 17
onClipEvent (data) {
_root.update();
}
Frame 27
stop();
Symbol 10 MovieClip Frame 10
stop();
Symbol 17 MovieClip Frame 1
this.onEnterFrame = function () {
if (!_root.gameover) {
this._rotation++;
}
};
Symbol 42 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
};
Instance of Symbol 17 MovieClip in Symbol 42 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 28 MovieClip in Symbol 42 MovieClip Frame 6
onClipEvent (load) {
gotoAndPlay (20);
}
Instance of Symbol 28 MovieClip in Symbol 42 MovieClip Frame 6
onClipEvent (load) {
gotoAndPlay (40);
}
Instance of Symbol 36 MovieClip in Symbol 42 MovieClip Frame 11
onClipEvent (enterFrame) {
this._rotation = this._rotation + 0.7;
}
Instance of Symbol 39 MovieClip in Symbol 42 MovieClip Frame 13
onClipEvent (enterFrame) {
this._rotation = this._rotation + 0.3;
}
Symbol 50 MovieClip Frame 1
_parent.numpits++;
this._name = "gravitypit" + _parent.numpits;
Symbol 50 MovieClip Frame 36
gotoAndPlay (2);
Symbol 51 MovieClip Frame 1
stop();
pits = false;
Symbol 51 MovieClip Frame 2
pits = false;
Symbol 51 MovieClip Frame 3
pits = false;
Symbol 51 MovieClip Frame 4
pits = false;
Symbol 51 MovieClip Frame 5
pits = false;
Symbol 51 MovieClip Frame 6
pits = false;
Symbol 51 MovieClip Frame 7
anti = true;
pits = true;
Symbol 51 MovieClip Frame 8
anti = false;
pits = true;
Symbol 51 MovieClip Frame 9
pits = false;
Symbol 51 MovieClip Frame 10
pits = false;
Symbol 51 MovieClip Frame 11
pits = false;
Symbol 51 MovieClip Frame 12
pits = false;
Symbol 51 MovieClip Frame 13
pits = false;
Symbol 51 MovieClip Frame 14
pits = false;
Symbol 51 MovieClip Frame 15
anti = true;
pits = true;
Symbol 56 Button
on (rollOver) {
_root.setBoardRoll(this._name);
}
on (press) {
_root.setBoard(this._name);
}
Symbol 59 MovieClip Frame 1
num = this._name;
Symbol 61 Button
on (keyPress "<Enter>") {
play();
}
Symbol 82 MovieClip Frame 1
this.onData = function () {
if (score7 > 0.01) {
_root.lowestscore = score7;
} else {
_root.lowestscore = 10000;
}
status = "";
};
Symbol 92 Button
on (press, keyPress "<Enter>") {
play();
}
Symbol 96 Button
on (press) {
getURL ("http://www.zefrank.com", _blank);
}
Symbol 97 Button
on (press) {
getURL ("http://www.zefrank.com", _blank);
}
Symbol 103 MovieClip Frame 1
_root.game.ship.points++;
this._name = "point" + _root.game.ship.points;
this.h = Math.sqrt((this._x * this._x) + (this._y * this._y));
this.theta = (Math.atan(this._y / this._x) * 180) / Math.PI;
Symbol 113 Button
on (release) {
if ((userscore < _root.lowestscore) && (sent < 1)) {
sent = 1;
output = "please wait : sending score";
lowscore = _root.lowestscore;
loadVariables ((("insertdelete.php?tablename=highscores_" + _root.level) + "&cache=") + random(9999), this, "POST");
trace(lowscore);
}
}
Symbol 114 MovieClip Frame 1
this.onData = function () {
};
Symbol 117 Button
on (press, keyPress "<Enter>") {
init();
gotoAndStop (1);
}