Frame 1
loadingbar.onEnterFrame = function () {
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
_root.gotoAndPlay("init");
} else {
this._xscale = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
}
};
stop();
Instance of Symbol 3 MovieClip [pnFlashGames] "pnConnector" in Frame 1
//component parameters
onClipEvent (construct) {
debugMode = false;
}
Frame 5
function WorldToScreen(world_x, world_y, world_z) {
x = Math.round((world_x * 7) + ((world_z * 5) * 1.4));
y = Math.round(((-(world_z * 5)) + ((world_x * 7) * 0.71426)) - (world_y * 5));
return([x, y]);
}
var Snd_hit = new Sound();
Snd_hit.attachSound("hit_1");
var Snd_hit2 = new Sound();
Snd_hit2.attachSound("hit_2");
var B = new Object();
B.clip = "tile_blktop";
B.oktodrive = true;
B.effects = new Object();
B.effects.bumpy = 0;
B.effects.drag = 0;
var P = new Object();
P.clip = "tile_pothole";
P.oktodrive = true;
P.effects = new Object();
P.effects.bumpy = 5;
P.effects.drag = 0.08;
var L = new Object();
L.clip = "obj_lightpole";
L.doWhenHit = function (speed, angle, tile) {
if (Math.abs(_root.game.player.speed) >= 0.5) {
_root.Snd_hit.start();
}
_root.game.player.car_x = _root.game.player.car_x + ((-speed) * Math.sin((angle * Math.PI) / 180));
_root.game.player.car_z = _root.game.player.car_z + ((-speed) * Math.cos((angle * Math.PI) / 180));
_root.game.player.speed = -(_root.game.player.speed * 0.8);
};
var H = new Object();
H.clip = "obj_hydrant";
H.doWhenHit = function (speed, angle, tile) {
_root.lives--;
this.nextFrame();
if (Math.abs(_root.game.player.speed) >= 0.5) {
_root.Snd_hit.start();
}
_root.game.player.car_x = _root.game.player.car_x + ((-speed) * Math.sin((angle * Math.PI) / 180));
_root.game.player.car_z = _root.game.player.car_z + ((-speed) * Math.cos((angle * Math.PI) / 180));
_root.game.player.speed = -(_root.game.player.speed * 0.8);
tile.object = null;
if (_root.lives <= 0) {
_root.lives = 0;
timer.display = 0;
this._xscale = 0;
_root.timer.onEnterFrame = null;
_root.game.player.onEnterFrame = null;
_root.gotoAndPlay("game_over");
}
};
var S = new Object();
S.clip = "obj_sp_cone";
S.doWhenHit = function (speed, angle, tile) {
_root.Snd_hit2.start();
_root.score = _root.score + 50;
_root.cones_hit++;
this.speed = speed * 1.8;
this.angle = angle + (random(30) - 15);
if (this.angle < 0) {
this.angle = 360 + this.angle;
}
this.angle = this.angle % 360;
var _local3 = "hit_" + (45 * Math.floor(this.angle / 45));
this.gotoAndStop(_local3);
_root.game.player.speed = _root.game.player.speed * 0.8;
this.onEnterFrame = this.doAfterHit;
tile.object = null;
};
S.doAfterHit = function () {
if ((Math.abs(this.trans_x) + Math.abs(this.trans_z)) >= 0.01) {
this.trans_x = this.speed * Math.sin((this.angle * Math.PI) / 180);
this.trans_z = this.speed * Math.cos((this.angle * Math.PI) / 180);
this.pos_x = this.pos_x + this.trans_x;
this.pos_z = this.pos_z + this.trans_z;
var _local3 = _root.WorldToScreen(this.pos_x, 0, this.pos_z);
var _local4 = Math.floor(((world.totaldepth - (this.pos_z + 8)) * 1000) + this.pos_x);
this.swapDepths(_local4);
this._x = _local3[0];
this._y = _local3[1];
this.speed = this.speed * 0.8;
this.t_row = Math.floor(this.pos_z / _root.world.tile_height);
this.t_col = Math.floor(this.pos_x / _root.world.tile_width);
this.t_tile = _root.game[(("tile_" + this.t_row) + "_") + this.t_col];
this.t_object = this.t_tile.object;
if (this.t_object) {
_local3 = WorldToScreen(this.t_object.pos_x, 0, this.t_object.pos_z);
if (this.hitTest(_local3[0] + _root.game._x, _local3[1] + _root.game._y, true)) {
this.t_object = null;
this.t_object.doWhenHit(this.speed, this.angle, this.t_tile);
}
}
} else {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
var C = new Object();
C.clip = "obj_cone";
C.doWhenHit = function (speed, angle, tile) {
_root.Snd_hit2.start();
_root.score = _root.score + 10;
_root.cones_hit++;
this.speed = speed * 1.8;
this.angle = angle + (random(30) - 15);
if (this.angle < 0) {
this.angle = 360 + this.angle;
}
this.angle = this.angle % 360;
var _local3 = "hit_" + (45 * Math.floor(this.angle / 45));
this.gotoAndStop(_local3);
_root.game.player.speed = _root.game.player.speed * 0.8;
this.onEnterFrame = this.doAfterHit;
tile.object = null;
};
C.doAfterHit = function () {
if ((Math.abs(this.trans_x) + Math.abs(this.trans_z)) >= 0.01) {
this.trans_x = this.speed * Math.sin((this.angle * Math.PI) / 180);
this.trans_z = this.speed * Math.cos((this.angle * Math.PI) / 180);
this.pos_x = this.pos_x + this.trans_x;
this.pos_z = this.pos_z + this.trans_z;
var _local3 = _root.WorldToScreen(this.pos_x, 0, this.pos_z);
var _local4 = Math.floor(((world.totaldepth - (this.pos_z + 8)) * 1000) + this.pos_x);
this.swapDepths(_local4);
this._x = _local3[0];
this._y = _local3[1];
this.speed = this.speed * 0.8;
this.t_row = Math.floor(this.pos_z / _root.world.tile_height);
this.t_col = Math.floor(this.pos_x / _root.world.tile_width);
this.t_tile = _root.game[(("tile_" + this.t_row) + "_") + this.t_col];
this.t_object = this.t_tile.object;
if (this.t_object) {
_local3 = WorldToScreen(this.t_object.pos_x, 0, this.t_object.pos_z);
if (this.hitTest(_local3[0] + _root.game._x, _local3[1] + _root.game._y, true)) {
this.t_object = null;
this.t_object.doWhenHit(this.speed, this.angle, this.t_tile);
}
}
} else {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
var map = new Array();
map[0] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[1] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[2] = [B, B, B, P, B, B, B, B, P, B, B, B, B, B, B, P, B, B, B, B, P, B, B, B];
map[3] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[4] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[5] = [B, B, B, B, B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B, B];
map[6] = [B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B, B, B, B, B, B];
map[7] = [B, B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B, B, B, B, B];
map[8] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[9] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[10] = [B, B, B, B, B, B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B];
map[11] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[12] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[13] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[14] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[15] = [B, B, B, P, B, B, B, B, P, B, B, B, B, B, B, P, B, B, B, B, P, B, B, B];
map[16] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[17] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[18] = [B, B, B, B, B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B, B];
map[19] = [B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B, B, B, B, B, B];
map[20] = [B, B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B, B, B, B, B];
map[21] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[22] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[23] = [B, B, B, B, B, B, B, P, B, B, B, B, B, B, B, B, B, B, B, P, B, B, B, B];
map[24] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
map[25] = [B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B];
var objects = new Array();
objects[0] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
objects[1] = [0, S, 0, C, 0, 0, C, 0, 0, S, 0, 0, 0, S, 0, C, 0, 0, C, 0, 0, S, 0, 0];
objects[2] = [0, C, 0, 0, 0, H, 0, 0, C, O, 0, H, 0, C, 0, 0, 0, H, 0, 0, C, O, 0, 0];
objects[3] = [0, 0, C, C, L, 0, H, 0, 0, 0, C, 0, 0, 0, C, C, L, 0, H, 0, 0, 0, C, 0];
objects[4] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, C, 0];
objects[5] = [0, H, C, O, 0, 0, 0, O, 0, C, 0, 0, H, 0, C, O, 0, 0, 0, O, 0, C, 0, 0];
objects[6] = [0, 0, 0, L, 0, 0, C, 0, 0, C, 0, 0, 0, 0, 0, L, 0, 0, C, 0, 0, C, 0, 0];
objects[7] = [0, 0, L, H, 0, C, 0, C, 0, 0, H, 0, 0, 0, L, 0, H, C, 0, C, 0, 0, H, 0];
objects[8] = [0, 0, C, O, 0, 0, O, 0, C, 0, C, 0, 0, 0, C, O, 0, 0, O, 0, C, 0, C, 0];
objects[9] = [0, C, S, 0, 0, 0, C, C, C, 0, H, 0, 0, C, S, 0, 0, 0, C, C, C, 0, H, 0];
objects[10] = [0, 0, 0, C, H, 0, C, S, C, 0, 0, 0, 0, 0, 0, C, 0, H, C, S, C, 0, 0, 0];
objects[11] = [0, 0, C, C, 0, S, C, C, C, 0, O, 0, 0, H, C, C, 0, S, C, C, C, 0, O, 0];
objects[12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, H, 0, 0, 0];
objects[13] = [0, 0, C, C, 0, S, C, C, C, 0, H, 0, 0, 0, C, C, 0, S, C, C, C, 0, O, 0];
objects[14] = [0, S, H, C, 0, C, C, 0, 0, S, 0, 0, 0, S, 0, C, 0, C, C, 0, 0, S, 0, 0];
objects[15] = [0, C, 0, 0, 0, 0, 0, 0, C, L, 0, 0, 0, C, 0, 0, 0, H, 0, 0, C, L, 0, 0];
objects[16] = [0, C, C, C, 0, 0, H, 0, 0, C, C, 0, 0, C, C, C, 0, 0, C, 0, 0, 0, C, 0];
objects[17] = [0, C, 0, 0, C, S, 0, 0, 0, C, H, 0, 0, C, 0, 0, C, S, 0, 0, 0, C, C, 0];
objects[18] = [0, L, C, H, 0, 0, 0, L, C, C, 0, 0, 0, L, C, 0, H, 0, C, L, 0, C, 0, 0];
objects[19] = [0, 0, 0, S, C, C, H, C, 0, 0, 0, 0, 0, 0, 0, S, C, C, C, C, 0, C, 0, 0];
objects[20] = [0, L, 0, 0, 0, C, 0, C, 0, 0, H, 0, 0, 0, 0, S, C, C, C, C, 0, H, 0, 0];
objects[21] = [0, C, C, C, L, 0, C, 0, C, 0, C, 0, 0, 0, C, C, C, H, C, 0, C, S, C, 0];
objects[22] = [0, C, S, C, 0, 0, 0, C, H, 0, 0, O, 0, C, S, C, 0, 0, C, C, H, 0, 0, 0];
objects[23] = [0, H, C, C, 0, 0, C, S, C, 0, 0, 0, C, C, C, C, 0, 0, 0, C, C, 0, 0, 0];
objects[24] = [0, C, C, C, H, S, C, C, C, 0, L, 0, 0, C, C, C, H, S, C, C, C, 0, L, 0];
objects[25] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var world = new Object();
world.tile_width = 10;
world.tile_height = 10;
world.totaldepth = world.tile_height * map.length;
world.totalwidth = world.tile_width * map[0].length;
var screen = new Object();
screen.scroll_x = 0;
screen.scroll_y = 0;
screen.keepplayerat_x = 200;
screen.keepplayerat_y = 200;
var player = new Object();
player.car_x = 55;
player.car_y = 0;
player.car_z = 55;
player.speed = 0;
player.maxspeed = 2;
player.accelrate = 0.2;
player.decelrate = 0.9;
player.angle = 0;
player.anglechange = 0;
player.maxanglechange = 10;
player.anglechangerate = 7;
player.allowturns = true;
stop();
Frame 11
var lives = 3;
var score = 0;
var row = 0;
while (row < _root.map.length) {
var col = 0;
while (col < _root.map[row].length) {
if ((!_root.map[row][col]) || (_root.map[row][col] == 0)) {
} else {
var the_tile = ((("tile_" + row) + "_") + col);
var world_x = (world.tile_width * col);
var world_y = 0;
var world_z = (world.tile_height * row);
var newdepth = Math.floor(((world.totaldepth - world_z) * 1000) + world_x);
_root.game.attachMovie(_root.map[row][col].clip, the_tile, newdepth, _root.map[row][col]);
var temp = _root.WorldToScreen(world_x, world_y, world_z);
_root.game[the_tile]._x = temp[0];
_root.game[the_tile]._y = temp[1];
_root.game[the_tile].swapDepths(temp[1] + temp[0]);
if ((!_root.objects[row][col]) || (_root.objects[row][col] == 0)) {
} else {
var the_object = ((("object_" + row) + "_") + col);
var world_x = ((world.tile_width * col) + (world.tile_width / 2));
var world_y = 0;
var world_z = ((world.tile_height * row) + (world.tile_height / 2));
var newdepth = Math.floor(((world.totaldepth - world_z) * 1000) + world_x);
_root.game.attachMovie(_root.objects[row][col].clip, the_object, newdepth, _root.objects[row][col]);
var temp = _root.WorldToScreen(world_x, world_y, world_z);
_root.game[the_object]._x = temp[0];
_root.game[the_object]._y = temp[1];
_root.game[the_object].pos_x = world_x;
_root.game[the_object].pos_z = world_z;
_root.game[the_tile].object = _root.game[the_object];
}
}
col++;
}
row++;
}
var newdepth = Math.floor(((world.totaldepth - player.car_z) * 1000) + player.car_x);
game.attachMovie("player", "player", newdepth, player);
var temp = WorldToScreen(player.car_x, player.car_y, player.car_z);
game.player._x = temp[0];
game.player._y = temp[1];
game.player.stop();
game.player.car_collider.stop();
game.player.car_collider._visible = false;
_root.focus_x = temp[0];
_root.focus_y = temp[1];
game.onEnterFrame = function () {
var _local4 = _root.screen.keepplayerat_x - _root.focus_x;
var _local3 = _root.screen.keepplayerat_y - _root.focus_y;
var _local6 = Math.floor(this._x + ((_local4 - this._x) * 0.2));
var _local5 = Math.floor(this._y + ((_local3 - this._y) * 0.2));
this._x = _local6;
this._y = _local5;
};
stop();
Frame 20
timer.gameStartTime = getTimer();
timer.gameDuration = 60000;
timer.gameTimerStarted = false;
timer.display = 60;
timer.onEnterFrame = function () {
gameTimeLeft = this.gameDuration - (getTimer() - this.gameStartTime);
if (gameTimeLeft <= 0) {
timer.display = 0;
this._xscale = 0;
_root.timer.onEnterFrame = null;
_root.game.player.onEnterFrame = null;
_root.gotoAndPlay("game_over");
} else {
secondsleft = Math.ceil(gameTimeLeft / 1000);
timer.display = secondsleft;
this._xscale = ((secondsleft * 1000) / this.gameDuration) * 100;
}
};
game.player.onEnterFrame = function () {
if (Key.isDown(38)) {
this.speed = Math.min(this.maxspeed, this.speed + this.accelrate);
} else if (Key.isDown(40)) {
this.speed = Math.max(-this.maxspeed, this.speed - this.accelrate);
} else if (Math.abs(this.speed) <= 0.1) {
this.speed = 0;
} else {
this.speed = this.speed * this.decelrate;
}
if (this.car_tile.effects.drag) {
this.speed = this.speed - (this.speed * this.car_tile.effects.drag);
}
if (Key.isDown(39) && (this.allowturns == true)) {
this.speedpercent = this.speed / this.maxspeed;
this.anglechange = Math.min(this.maxanglechange, this.maxanglechange * this.speedpercent);
this.angle = this.angle + this.anglechange;
} else if (Key.isDown(37) && (this.allowturns == true)) {
this.speedpercent = this.speed / this.maxspeed;
this.anglechange = Math.max(-this.maxanglechange, (-this.maxanglechange) * this.speedpercent);
this.angle = this.angle + this.anglechange;
}
if (this.angle < 0) {
this.angle = 360 + this.angle;
}
this.angle = this.angle % 360;
this.stepfactor_x = Math.sin((this.angle * Math.PI) / 180);
this.stepfactor_z = Math.cos((this.angle * Math.PI) / 180);
this.t_car_x = this.car_x + (this.speed * this.stepfactor_x);
this.t_car_z = this.car_z + (this.speed * this.stepfactor_z);
if (this.speed >= 0) {
this.t_bumper_x = this.t_car_x + (6 * this.stepfactor_x);
this.t_bumper_z = this.t_car_z + (6 * this.stepfactor_z);
} else {
this.t_bumper_x = this.t_car_x + (-6 * this.stepfactor_x);
this.t_bumper_z = this.t_car_z + (-6 * this.stepfactor_z);
}
this.t_car_row = Math.floor(this.t_car_z / _root.world.tile_height);
this.t_car_col = Math.floor(this.t_car_x / _root.world.tile_width);
this.t_car_tile = _root.game[(("tile_" + this.t_car_row) + "_") + this.t_car_col];
this.t_bumper_row = Math.floor(this.t_bumper_z / _root.world.tile_height);
this.t_bumper_col = Math.floor(this.t_bumper_x / _root.world.tile_width);
this.t_bumper_tile = _root.game[(("tile_" + this.t_bumper_row) + "_") + this.t_bumper_col];
this.t_bumper_object = this.t_bumper_tile.object;
if (!this.t_bumper_tile.oktodrive) {
this.speed = -(this.speed * 0.8);
this.allowturns = false;
clearInterval(intervalID);
var intervalID = setInterval(function () {
_root.game.player.allowturns = true;
clearInterval(intervalID);
}, 250);
return(undefined);
}
this.car_x = this.t_car_x;
this.car_z = this.t_car_z;
this.bumper_x = this.t_bumper_x;
this.bumper_z = this.t_bumper_z;
this.car_row = this.t_car_row;
this.car_col = this.t_car_col;
this.car_tile = this.t_car_tile;
this.bumper_row = this.t_bumper_row;
this.bumper_col = this.t_bumper_col;
this.bumper_tile = this.t_bumper_tile;
this.bumper_object = this.t_bumper_object;
this.bumper_local_x = this.bumper_x % _root.world.tile_width;
this.bumper_local_z = this.bumper_z % _root.world.tile_height;
if (this.bumper_object) {
var _local3 = WorldToScreen(this.bumper_object.pos_x, 0, this.bumper_object.pos_z);
if (this.car_collider.hitTest(_local3[0] + _root.game._x, _local3[1] + _root.game._y, true)) {
this.bumper_object.doWhenHit(this.speed, this.angle, this.bumper_tile);
}
}
this.pan_pos_x = this.car_x + ((7 * this.speed) * this.stepfactor_x);
this.pan_pos_z = this.car_z + ((7 * this.speed) * this.stepfactor_z);
var _local3 = WorldToScreen(this.pan_pos_x, 0, this.pan_pos_z);
_root.focus_x = _local3[0];
_root.focus_y = _local3[1];
_local3 = WorldToScreen(this.car_x, this.car_y, this.car_z);
var _local5 = Math.floor(((world.totaldepth - this.car_z) * 1000) + this.car_x);
this.swapDepths(_local5);
var _local4 = Math.round(this.angle * 0.1) + 1;
this.gotoAndStop(_local4);
this.car_collider.gotoAndStop(_local4);
this._x = _local3[0];
this._y = _local3[1] + random(this.car_tile.effects.bumpy * Math.abs(this.speed));
};
stop();
Frame 29
pnConnector.storeScore(_root.score);
trace(_root.score);
Frame 38
stop();
Symbol 3 MovieClip [pnFlashGames] Frame 1
#initclip 1
pnFlashGames = function () {
this.gid = _root.pn_gid;
this.uname = _root.pn_uname;
this._modvalue = "pnFlashGames";
this._modvar = "module";
this._script = "index.php";
if (_root.pn_modvalue != null) {
this._modvalue = _root.pn_modvalue;
}
if (_root.pn_modvar != null) {
this._modvar = _root.pn_modvar;
}
if (_root.pn_script != null) {
this._script = _root.pn_script;
}
this._autoupdate = false;
if (_root.pn_autoupdate == "true") {
this._autoupdate = true;
}
if (_root.pn_extravars != null) {
this._extravars = new Array();
temppairs = _root.pn_extravars.split("|");
x = 0;
while (x < temppairs.length) {
tempset = temppairs[x].split("~");
this._extravars.push(tempset);
x++;
}
} else {
this._extravars = null;
}
this.busy = false;
this.gameSaved = null;
this.gameLoaded = null;
this.gameScoresLoaded = null;
this.gameScores = null;
this.scoreStored = null;
this.gameData = "";
};
pnFlashGames.prototype.saveGame = function (gameData) {
this.busy = true;
varsObj = new LoadVars();
varsObj.func = "saveGame";
varsObj.gid = this.gid;
varsObj.gameData = gameData;
varsObj.type = "user";
varsObj[this._modvar] = this._modvalue;
varsObj.parent = this;
varsObj.onLoad = this.saveGame_Result;
if (this._extravars != null) {
x = 0;
while (x < this._extravars.length) {
varsObj[this._extravars[x][0]] = this._extravars[x][1];
x++;
}
}
if (this.debugMode) {
this.debugOutput(varsObj);
} else {
varsObj.sendAndLoad(this._script, varsObj, "POST");
}
};
pnFlashGames.prototype.saveGame_Result = function (success) {
this.parent._parent.incoming = this.opSuccess;
if (this.opSuccess == "true") {
this.parent.gameSaved = true;
} else {
this.parent.gameSaved = false;
}
this.parent.busy = false;
};
pnFlashGames.prototype.loadGame = function () {
this.busy = true;
varsObj = new LoadVars();
varsObj.func = "loadGame";
varsObj.gid = this.gid;
varsObj.type = "user";
varsObj[this._modvar] = this._modvalue;
varsObj.parent = this;
varsObj.onLoad = this.loadGame_Result;
if (this._extravars != null) {
x = 0;
while (x < this._extravars.length) {
varsObj[this._extravars[x][0]] = this._extravars[x][1];
x++;
}
}
if (this.debugMode) {
this.debugOutput(varsObj);
} else {
varsObj.sendAndLoad(this._script, varsObj, "POST");
}
};
pnFlashGames.prototype.loadGame_Result = function (success) {
if (this.opSuccess == "true") {
this.parent.gameLoaded = true;
this.parent.gameData = gameData;
} else {
this.parent.gameLoaded = false;
}
if (this.parent.onLoadGame != null) {
this.parent.onLoadGame(this.gameData);
}
this.parent.busy = false;
};
pnFlashGames.prototype.storeScore = function (score) {
this.busy = true;
varsObj = new LoadVars();
varsObj.score = score;
varsObj.func = "storeScore";
varsObj.gid = this.gid;
varsObj.type = "user";
varsObj[this._modvar] = this._modvalue;
varsObj.parent = this;
varsObj.onLoad = this.storeScore_Result;
if (this._extravars != null) {
x = 0;
while (x < this._extravars.length) {
varsObj[this._extravars[x][0]] = this._extravars[x][1];
x++;
}
}
if (this.debugMode) {
this.debugOutput(varsObj);
} else {
varsObj.sendAndLoad(this._script, varsObj, "POST");
}
};
pnFlashGames.prototype.storeScore_Result = function (success) {
if (this.opSuccess == "true") {
this.parent.scoreStored = true;
if (this.parent._autoupdate) {
_root.getURL("javascript:refreshScores();");
}
} else {
this.parent.scoreStored = false;
}
this.parent.busy = false;
};
pnFlashGames.prototype.loadGameScores = function () {
this.busy = true;
varsObj = new LoadVars();
varsObj.func = "loadGameScores";
varsObj.gid = this.gid;
varsObj.type = "user";
varsObj[this._modvar] = this._modvalue;
varsObj.parent = this;
varsObj.onLoad = this.loadGameScores_Result;
if (this._extravars != null) {
x = 0;
while (x < this._extravars.length) {
varsObj[this._extravars[x][0]] = this._extravars[x][1];
x++;
}
}
if (this.debugMode) {
this.debugOutput(varsObj);
} else {
varsObj.sendAndLoad(this._script, varsObj, "POST");
}
};
pnFlashGames.prototype.loadGameScores_Result = function (success) {
if (this.opSuccess == "true") {
this.parent.gameScoresLoaded = true;
this.parent.gameScores = new XML(this.gameScores);
} else {
this.parent.gameScoresLoaded = false;
}
if (this.parent.onLoadGameScores != null) {
this.parent.onLoadGameScores(this.gameScores);
}
this.parent.busy = false;
};
pnFlashGames.prototype.debugOutput = function (vars) {
debug = "";
debug = debug + (("Function: " + vars.func) + newline);
switch (vars.func) {
case "storeScore" :
debug = debug + ("Score: " + vars.score);
break;
case "saveGame" :
debug = debug + ("Saving: " + vars.gameData);
break;
case "loadGame" :
debug = debug + "Loading data....";
break;
case "getGameScores" :
debug = debug + "Getting scores for this game....";
}
trace(debug);
};
Object.registerClass("pnFlashGames", pnFlashGames);
#endinitclip
Symbol 29 Button
on (release) {
gotoAndPlay ("countdown");
}
Symbol 162 MovieClip [obj_cone] Frame 1
stop();
Symbol 162 MovieClip [obj_cone] Frame 21
gotoAndPlay ("hit_0");
Symbol 181 MovieClip [obj_sp_cone] Frame 1
stop();
Symbol 181 MovieClip [obj_sp_cone] Frame 21
gotoAndPlay ("hit_0");
Symbol 193 MovieClip [obj_hydrant] Frame 1
stop();
Symbol 193 MovieClip [obj_hydrant] Frame 2
play();
Symbol 193 MovieClip [obj_hydrant] Frame 21
stop();
Symbol 210 MovieClip Frame 63
_root.gotoAndPlay("play");
Symbol 210 MovieClip Frame 91
stop();