Frame 1
function initialMusic() {
music = {};
music.lastMusic = "none";
music.currentMusic = "none";
music.menuLoop = new Sound();
music.menuLoop.attachSound("musicLoopMenu");
music.gameLoop = new Sound();
music.gameLoop.attachSound("musicLoopGame");
}
function initialSFX() {
sfx = {};
sfx.buttonHit = new Sound();
sfx.buttonHit.attachSound("sfxButtonHit");
sfx.buttonOver = new Sound();
sfx.buttonOver.attachSound("sfxButtonOver");
sfx.crashSmall = new Sound();
sfx.crashSmall.attachSound("sfxCrashSmall");
sfx.crashBig = new Sound();
sfx.crashBig.attachSound("sfxCrashBig");
sfx.crashOldLady = new Sound();
sfx.crashOldLady.attachSound("sfxCrashOldLady");
sfx.brake = new Sound();
sfx.brake.attachSound("sfxbrake");
sfx.jump = new Sound();
sfx.jump.attachSound("sfxJump");
sfx.land = new Sound();
sfx.land.attachSound("sfxLand");
sfx.superJump = new Sound();
sfx.superJump.attachSound("sfxSuperJump");
sfx.powerUp = new Sound();
sfx.powerUp.attachSound("sfxPowerUp");
sfx.shiftEndBad = new Sound();
sfx.shiftEndBad.attachSound("sfxShiftEndBad");
sfx.shiftEndGood = new Sound();
sfx.shiftEndGood.attachSound("sfxShiftEndGood");
sfx.shiftEndWarning = new Sound();
sfx.shiftEndWarning.attachSound("sfxShiftEndWarning");
sfx.money = new Sound();
sfx.money.attachSound("sfxMoney");
sfx.trick0 = new Sound();
sfx.trick0.attachSound("sfxTrick0");
sfx.trick1 = new Sound();
sfx.trick1.attachSound("sfxTrick1");
sfx.trick2 = new Sound();
sfx.trick2.attachSound("sfxTrick2");
sfx.trick3 = new Sound();
sfx.trick3.attachSound("sfxTrick3");
sfx.trick4 = new Sound();
sfx.trick4.attachSound("sfxTrick4");
sfx.trick5 = new Sound();
sfx.trick5.attachSound("sfxTrick5");
sfx.trick6 = new Sound();
sfx.trick6.attachSound("sfxTrick6");
sfx.trick7 = new Sound();
sfx.trick7.attachSound("sfxTrick7");
sfx.trick8 = new Sound();
sfx.trick8.attachSound("sfxTrick8");
sfx.nextCrashFrame = 0;
sfx.framesCrash = 24;
sfx.nextBrakeFrame = 0;
sfx.framesBrake = 32;
}
function playMusic(name) {
if (world.soundOn) {
if (music.currentMusic != "none") {
stopMusic(music.currentMusic);
}
music.currentMusic = name;
var _local1 = music[name];
_local1.start();
_local1.onSoundComplete = function () {
playMusic(music.currentMusic);
};
}
}
function stopMusic(name) {
music.currentMusic = "none";
var _local1 = music[name];
_local1.stop();
}
function playSFX(name) {
if (world.soundOn) {
if ((name == "crashSmall") || (name == "crashBig")) {
if (game.frames > sfx.nextCrashFrame) {
var _local2 = sfx[name];
_local2.start();
sfx.nextCrashFrame = game.frames + sfx.framesCrash;
}
} else if (name == "brake") {
if (game.frames > sfx.nextBrakeFrame) {
var _local2 = sfx[name];
_local2.start();
sfx.nextBrakeFrame = game.frames + sfx.framesBrake;
}
} else {
var _local2 = sfx[name];
_local2.start();
}
}
}
function stopSFX(name) {
var _local1 = sfx[name];
_local1.stop();
}
function initialLevels() {
alert("initialLevels");
var _local1 = "level" + world.currentLevel;
main[_local1] = {};
main[_local1].deliveryTotal = 0;
main[_local1].trickTotal = 0;
main[_local1].deliveryAdded = false;
main[_local1].previousEarned = world.currentLevelEarned;
}
function loadLevel(level) {
lstring = "level" + level;
if (level == 1) {
var _local2 = 1500;
main[lstring].totalMinutes = 1;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, false, false];
main[lstring].groundTrickUnlocked_array = [false, false, false];
main[lstring].horseTrickUnlocked_array = [false, false, false];
main[lstring].airTrickUnlocked_array = [false, false, false, false, false, false];
} else if (level == 2) {
var _local2 = 2000;
main[lstring].totalMinutes = 1;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, false, false];
main[lstring].groundTrickUnlocked_array = [false, false, true];
main[lstring].horseTrickUnlocked_array = [false, false, false];
main[lstring].airTrickUnlocked_array = [false, true, false, false, false, false];
} else if (level == 3) {
var _local2 = 2600;
main[lstring].totalMinutes = 1;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, false, false];
main[lstring].groundTrickUnlocked_array = [false, false, true];
main[lstring].horseTrickUnlocked_array = [false, true, false];
main[lstring].airTrickUnlocked_array = [false, true, false, false, false, false];
} else if (level == 4) {
var _local2 = 3300;
main[lstring].totalMinutes = 1.5;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, false];
main[lstring].groundTrickUnlocked_array = [false, false, true];
main[lstring].horseTrickUnlocked_array = [false, true, false];
main[lstring].airTrickUnlocked_array = [false, true, false, false, false, false];
} else if (level == 5) {
var _local2 = 4100;
main[lstring].totalMinutes = 1.5;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, false];
main[lstring].groundTrickUnlocked_array = [false, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, false];
main[lstring].airTrickUnlocked_array = [false, true, false, false, false, false];
} else if (level == 6) {
var _local2 = 4800;
main[lstring].totalMinutes = 1.5;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, false];
main[lstring].groundTrickUnlocked_array = [false, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, false];
main[lstring].airTrickUnlocked_array = [false, true, true, false, false, false];
} else if (level == 7) {
var _local2 = 5500;
main[lstring].totalMinutes = 2;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, true];
main[lstring].groundTrickUnlocked_array = [false, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, false];
main[lstring].airTrickUnlocked_array = [false, true, true, false, false, false];
} else if (level == 8) {
var _local2 = 6200;
main[lstring].totalMinutes = 2;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, true];
main[lstring].groundTrickUnlocked_array = [false, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, false];
main[lstring].airTrickUnlocked_array = [false, true, true, false, true, false];
} else if (level == 9) {
var _local2 = 6900;
main[lstring].totalMinutes = 2;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, true];
main[lstring].groundTrickUnlocked_array = [true, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, true];
main[lstring].airTrickUnlocked_array = [false, true, true, false, true, false];
} else if (level == 10) {
var _local2 = 7600;
main[lstring].totalMinutes = 3;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, true];
main[lstring].groundTrickUnlocked_array = [true, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, true];
main[lstring].airTrickUnlocked_array = [false, true, true, false, true, true];
} else if (level > 10) {
var _local2 = 7600 + ((level - 10) * 500);
main[lstring].totalMinutes = 3;
main[lstring].quotaCents = main[lstring].totalMinutes * _local2;
main[lstring].townsUnlocked_array = [true, true, true];
main[lstring].groundTrickUnlocked_array = [true, true, true];
main[lstring].horseTrickUnlocked_array = [true, true, true];
main[lstring].airTrickUnlocked_array = [false, true, true, false, true, true];
}
}
function funcLevelUp() {
alert("funcLevelUp");
var _local1;
if (world.doOver) {
_local1 = "level" + world.currentLevel;
world.doOver = null;
world.cheatCode = "";
} else {
world.currentLevel++;
_local1 = "level" + world.currentLevel;
var _local2 = "level" + (world.currentLevel - 1);
alert("lstring " + _local1);
main[_local1] = {};
main[_local1].deliveryTotal = 0;
main[_local1].trickTotal = 0;
main[_local1].deliveryAdded = false;
}
main[_local1].previousEarned = world.currentLevelEarned;
world.framesLeft = main.framesLeft;
world.levelCompleted = true;
loadLevel(world.currentLevel);
gotoAndPlay ("deliveryOptions");
}
function initialTown() {
town0 = {};
var _local1 = town0;
_local1.map_array = [{width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}];
_local1.item_array = [];
_local1.item_array.push({type:"cone", row:0, x:400, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:400, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:800, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:800, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:1200, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:1200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:1600, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:1600, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:2200, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:2800, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:2700, direction:"left"});
_local1.item_array.push({type:"horseHor", row:2, x:2700, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:3000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:3200, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:3200, direction:"left"});
_local1.item_array.push({type:"horseHor", row:2, x:3200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:3500, direction:"left"});
_local1.item_array.push({type:"hydrant", row:2, x:3700, direction:"left"});
_local1.item_array.push({type:"bench", row:0, x:3600, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:3900, direction:"left"});
_local1.item_array.push({type:"bench", row:0, x:4200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:4000, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:4800, direction:"left"});
_local1.item_array.push({type:"horseVer", row:1, x:5200, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:5600, direction:"left"});
_local1.item_array.push({type:"horseVer", row:1, x:6000, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:5600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:6000, direction:"left"});
_local1.item_array.push({type:"bench", row:0, x:6600, direction:"left"});
_local1.item_array.push({type:"ramp", row:1, x:6500, direction:"left"});
_local1.item_array.push({type:"ramp", row:2, x:6600, direction:"right"});
_local1.item_array.push({type:"garbageCan", row:3, x:6500, direction:"left"});
_local1.item_array.push({type:"bench", row:1, x:7200, direction:"left"});
_local1.item_array.push({type:"hydrant", row:2, x:7500, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:8000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:3, x:8000, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:8400, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:8600, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:8800, direction:"left"});
_local1.item_array.push({type:"streetSignUptown", row:2, x:8650, direction:"left"});
_local1.item_array.push({type:"streetSignUptown", row:2, x:9050, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:9200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:9200, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:9200, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:9200, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:2, x:9500, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:9800, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:9800, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:9800, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:9800, direction:"left"});
_local1.item_array.push({type:"streetSignUptown", row:2, x:10650, direction:"left"});
_local1.item_array.push({type:"streetSignUptown", row:2, x:11050, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:11400, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:11800, direction:"left"});
_local1.item_array.push({type:"hydrant", row:2, x:11500, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:11200, direction:"left"});
_local1.powerUp_array = [];
_local1.powerUp_array.push({type:"jump", row:0, x:5800, y:-10, height:20});
_local1.powerUp_array.push({type:"money", row:1, x:8000, y:-10, height:20});
town1 = {};
_local1 = town1;
_local1.map_array = [{width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}];
_local1.item_array = [];
_local1.item_array.push({type:"bin", row:0, x:400, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:400, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:800, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:800, direction:"left"});
_local1.item_array.push({type:"bin", row:0, x:1200, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:1200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:1600, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:1600, direction:"left"});
_local1.item_array.push({type:"oldLady", row:2, x:1900, direction:"down"});
_local1.item_array.push({type:"oldLady", row:3, x:2100, direction:"up"});
_local1.item_array.push({type:"horseVer", row:0, x:2400, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:2400, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:2400, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:2800, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:2700, direction:"left"});
_local1.item_array.push({type:"horseHor", row:2, x:2700, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:3000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:3200, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:3200, direction:"left"});
_local1.item_array.push({type:"horseHor", row:2, x:3200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:3500, direction:"left"});
_local1.item_array.push({type:"hydrant", row:2, x:3700, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:3, x:3700, direction:"left"});
_local1.item_array.push({type:"bench", row:0, x:3600, direction:"left"});
_local1.item_array.push({type:"bench", row:0, x:4200, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:4000, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:4400, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:4600, direction:"left"});
_local1.item_array.push({type:"horseVer", row:1, x:5000, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:5400, direction:"left"});
_local1.item_array.push({type:"horseVer", row:1, x:5800, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:6200, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:6000, direction:"left"});
_local1.item_array.push({type:"ramp", row:3, x:7200, direction:"left"});
_local1.item_array.push({type:"ramp", row:3, x:7500, direction:"right"});
_local1.item_array.push({type:"bench", row:0, x:6600, direction:"left"});
_local1.item_array.push({type:"ramp", row:1, x:6200, direction:"left"});
_local1.item_array.push({type:"ramp", row:1, x:6800, direction:"left"});
_local1.item_array.push({type:"ramp", row:2, x:6600, direction:"right"});
_local1.item_array.push({type:"ramp", row:2, x:7200, direction:"right"});
_local1.item_array.push({type:"bench", row:1, x:7200, direction:"left"});
_local1.item_array.push({type:"hydrant", row:2, x:7800, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:8000, direction:"left"});
_local1.item_array.push({type:"oldLady", row:0, x:8400, direction:"down"});
_local1.item_array.push({type:"oldLady", row:3, x:8600, direction:"up"});
_local1.item_array.push({type:"streetSignMidtown", row:2, x:8650, direction:"left"});
_local1.item_array.push({type:"streetSignMidtown", row:2, x:9050, direction:"left"});
_local1.item_array.push({type:"oldLady", row:2, x:9200, direction:"down"});
_local1.item_array.push({type:"oldLady", row:3, x:9400, direction:"up"});
_local1.item_array.push({type:"oldLady", row:0, x:9600, direction:"down"});
_local1.item_array.push({type:"oldLady", row:2, x:9800, direction:"up"});
_local1.item_array.push({type:"bin", row:0, x:10000, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:10000, direction:"left"});
_local1.item_array.push({type:"cone", row:2, x:10000, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:10000, direction:"left"});
_local1.item_array.push({type:"horseVer", row:1, x:10400, direction:"left"});
_local1.item_array.push({type:"horseVer", row:0, x:10750, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:10500, direction:"left"});
_local1.item_array.push({type:"streetSignMidtown", row:2, x:10650, direction:"left"});
_local1.item_array.push({type:"streetSignMidtown", row:2, x:11050, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:11400, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:3, x:11600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:11800, direction:"left"});
_local1.item_array.push({type:"hydrant", row:2, x:11500, direction:"left"});
_local1.powerUp_array = [];
_local1.powerUp_array.push({type:"jump", row:0, x:1400, y:-10, height:20});
_local1.powerUp_array.push({type:"speed", row:0, x:5700, y:-10, height:20});
_local1.powerUp_array.push({type:"time", row:2, x:6700, y:-10, height:20});
_local1.powerUp_array.push({type:"money", row:1, x:8000, y:-10, height:20});
town2 = {};
_local1 = town2;
_local1.map_array = [{width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}, {width:bg.streetWidth, clip:""}];
_local1.item_array = [];
_local1.item_array.push({type:"planter", row:2, x:400, direction:"left"});
_local1.item_array.push({type:"longPlanter", row:2, x:750, direction:"left"});
_local1.item_array.push({type:"planter", row:2, x:1100, direction:"left"});
_local1.item_array.push({type:"longPlanter", row:2, x:1450, direction:"left"});
_local1.item_array.push({type:"planter", row:2, x:1800, direction:"left"});
_local1.item_array.push({type:"longPlanter", row:2, x:2150, direction:"left"});
_local1.item_array.push({type:"planter", row:2, x:2500, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:600, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:600, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:600, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:1000, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:1000, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:1000, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:1400, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:1400, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:1400, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:1800, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:1800, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:1800, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:2200, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:2200, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:2200, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:2600, direction:"left"});
_local1.item_array.push({type:"cone", row:1, x:2600, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:2600, direction:"left"});
_local1.item_array.push({type:"ramp", row:0, x:3000, direction:"left"});
_local1.item_array.push({type:"ramp", row:1, x:3400, direction:"right"});
_local1.item_array.push({type:"ramp", row:2, x:3400, direction:"right"});
_local1.item_array.push({type:"ramp", row:3, x:3000, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:3200, direction:"left"});
_local1.item_array.push({type:"cone", row:0, x:3400, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:3200, direction:"left"});
_local1.item_array.push({type:"cone", row:3, x:3500, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:4000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:1, x:4300, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:4600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:1, x:4900, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:5200, direction:"left"});
_local1.item_array.push({type:"horseHor", row:3, x:4000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:3, x:4300, direction:"left"});
_local1.item_array.push({type:"horseHor", row:3, x:4600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:3, x:4900, direction:"left"});
_local1.item_array.push({type:"horseHor", row:3, x:5200, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:4000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:4600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:5200, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:2, x:4000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:2, x:4600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:2, x:5200, direction:"left"});
_local1.item_array.push({type:"oldLady", row:1, x:5600, direction:"up"});
_local1.item_array.push({type:"oldLady", row:2, x:5900, direction:"down"});
_local1.item_array.push({type:"planter", row:2, x:6300, direction:"left"});
_local1.item_array.push({type:"longPlanter", row:2, x:6800, direction:"left"});
_local1.item_array.push({type:"planter", row:2, x:7400, direction:"left"});
_local1.item_array.push({type:"longPlanter", row:2, x:7900, direction:"left"});
_local1.item_array.push({type:"planter", row:2, x:8500, direction:"left"});
_local1.item_array.push({type:"bench", row:1, x:6500, direction:"left"});
_local1.item_array.push({type:"bench", row:1, x:7000, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:6800, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:7600, direction:"left"});
_local1.item_array.push({type:"garbageCan", row:0, x:8400, direction:"left"});
_local1.item_array.push({type:"bin", row:1, x:7200, direction:"left"});
_local1.item_array.push({type:"bin", row:1, x:8000, direction:"left"});
_local1.item_array.push({type:"bin", row:1, x:8800, direction:"left"});
_local1.item_array.push({type:"ramp", row:0, x:9600, direction:"right"});
_local1.item_array.push({type:"ramp", row:1, x:9800, direction:"left"});
_local1.item_array.push({type:"ramp", row:2, x:9800, direction:"left"});
_local1.item_array.push({type:"ramp", row:3, x:9600, direction:"right"});
_local1.item_array.push({type:"streetSignDowntown", row:2, x:8650, direction:"left"});
_local1.item_array.push({type:"streetSignDowntown", row:2, x:9050, direction:"left"});
_local1.item_array.push({type:"bench", row:1, x:10300, direction:"left"});
_local1.item_array.push({type:"horseHor", row:1, x:10700, direction:"left"});
_local1.item_array.push({type:"bench", row:0, x:10200, direction:"left"});
_local1.item_array.push({type:"bench", row:2, x:10200, direction:"left"});
_local1.item_array.push({type:"horseHor", row:3, x:10600, direction:"left"});
_local1.item_array.push({type:"streetSignDowntown", row:2, x:10650, direction:"left"});
_local1.item_array.push({type:"streetSignDowntown", row:2, x:11050, direction:"left"});
_local1.item_array.push({type:"oldLady", row:2, x:10900, direction:"down"});
_local1.item_array.push({type:"oldLady", row:4, x:11300, direction:"up"});
_local1.item_array.push({type:"oldLady", row:2, x:11600, direction:"up"});
_local1.item_array.push({type:"oldLady", row:3, x:11900, direction:"down"});
_local1.powerUp_array = [];
_local1.powerUp_array.push({type:"time", row:2, x:1200, y:-10, height:20});
_local1.powerUp_array.push({type:"jump", row:0, x:1600, y:-10, height:20});
_local1.powerUp_array.push({type:"speed", row:0, x:2800, y:-10, height:20});
_local1.powerUp_array.push({type:"money", row:1, x:3600, y:-10, height:20});
_local1.powerUp_array.push({type:"speed", row:1, x:5000, y:-10, height:20});
_local1.powerUp_array.push({type:"time", row:2, x:6500, y:-10, height:20});
_local1.powerUp_array.push({type:"money", row:1, x:8000, y:-10, height:20});
}
function initialWorldVaribles() {
alert("initialWorldVaribles");
world = {};
world.fps = 24;
world.soundOn = true;
world.currentLevel = 1;
world.initialTownId = 0;
world.initialStreetNum = 25;
world.playerCurrentTownId = world.initialTownId;
world.playerCurrentStreetNum = world.initialStreetNum;
world.currentLevelEarned = 0;
world.currentDeliveryEarned = 0;
world.totalEarned = 0;
world.currentLevel_obj = {};
world.currentDelivery_obj = {};
world.intersection1Num = 44;
world.intersection2Num = 54;
world.maxStreetNum = 60;
world.town_array = new Array();
world.town_array[0] = {name:"uptown", unlocked:false, streetNumStreetFrom:100};
world.town_array[1] = {name:"midtown", unlocked:false, streetNumStreetFrom:200};
world.town_array[2] = {name:"downtown", unlocked:false, streetNumStreetFrom:300};
world.levelCompleted = true;
world.cheatCodeBonusTime = 240;
world.framesBonusDistRatio = 0.25;
world.levelQuotaCents = 0;
world.money = 0;
world.cheatCodeBonusSuperJumps = 3;
world.superJumpsLeft = 0;
world.cheatCodeBonusInvinc = 3;
world.superInvincLeft = 0;
world.cheatCode = "";
world.framesLeft = 0;
}
function resetWorldVaribles() {
world.currentLevel = 1;
world.playerCurrentTownId = world.initialTownId;
world.currentLevelEarned = 0;
world.currentDeliveryEarned = 0;
world.totalEarned = 0;
world.currentLevel_obj = {};
world.currentDelivery_obj = {};
world.intersection1Num = 44;
world.intersection2Num = 54;
world.maxStreetNum = 60;
world.town_array = new Array();
world.town_array[0] = {name:"uptown", locked:false, streetNumStreetFrom:100};
world.town_array[1] = {name:"midtown", locked:true, streetNumStreetFrom:200};
world.town_array[2] = {name:"downtown", locked:true, streetNumStreetFrom:300};
world.levelCompleted = true;
world.framesLeft = 0;
world.framesBonusDistRatio = 0.5;
world.money = 0;
world.superJumpsLeft = 0;
world.superInvincLeft = 0;
}
function initialSoundButton() {
sound_btn.onRelease = function () {
if (world.soundOn) {
world.soundOn = false;
music.menuLoop.setVolume(0);
music.gameLoop.setVolume(0);
music.lastMusic = music.currentMusic;
this.gotoAndStop("off");
} else {
world.soundOn = true;
music.menuLoop.setVolume(100);
music.gameLoop.setVolume(100);
this.gotoAndStop("on");
}
};
}
function startLevel(level) {
alert("startLevel " + level);
world.currentLevel_obj = main["level" + level];
world.framesLeft = (world.currentLevel_obj.totalMinutes * world.fps) * 60;
}
function (arEvent, arAction) {
((("javascript: _hbLink ('/flash/" + arEvent.toLowerCase()) + "/") + arAction.toLowerCase()) + "','left','0,0,0,0')";
};
main = this;
initialWorldVaribles();
initialSoundButton();
initialLevels();
initialMusic();
initialSFX();
Frame 2
function initialTitleButtons() {
play_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("loader");
};
play_btn.onRollOver = function () {
playSFX("buttonOver");
};
code_btn.onRelease = function () {
_root.funcHITBOX("misc", "code");
playSFX("buttonHit");
gotoAndPlay ("code");
};
code_btn.onRollOver = function () {
playSFX("buttonOver");
};
instructions_btn.onRelease = function () {
_root.funcHITBOX("instructions", "view_instructions");
playSFX("buttonHit");
gotoAndPlay ("instructions");
};
instructions_btn.onRollOver = function () {
playSFX("buttonOver");
};
highscore_btn.onRelease = function () {
_root.funcHITBOX("misc", "high_score");
playSFX("buttonHit");
gotoAndPlay ("highscores");
};
highscore_btn.onRollOver = function () {
playSFX("buttonOver");
};
}
function funcConvertToCurrency(arNum) {
var _local2;
if ((arNum % 100) == 0) {
_local2 = ("$" + (arNum / 100)) + ".00";
} else if ((arNum % 10) == 0) {
_local2 = ("$" + (arNum / 100)) + "0";
} else {
_local2 = "$" + (arNum / 100);
}
return(_local2);
}
function updateTitleMusic() {
if (music.currentMusic != "menuLoop") {
playMusic("menuLoop");
}
}
stop();
updateTitleMusic();
initialTitleButtons();
main.framesLeft = 3600;
main.gameID = 218;
main.path = this._url.substr(0, this._url.indexOf(".com") + 5);
alert("main.path " + main.path);
Frame 11
function initialCodeButtons() {
submit_btn.onRelease = function () {
if (codeStatus == "none") {
playSFX("buttonHit");
checkCode();
}
};
submit_btn.onRollOver = function () {
if (codeStatus == "none") {
playSFX("buttonOver");
}
};
back_btn.onRelease = function () {
if (codeStatus == "none") {
playSFX("buttonHit");
gotoAndPlay ("title");
}
};
back_btn.onRollOver = function () {
if (codeStatus == "none") {
playSFX("buttonOver");
}
};
}
function checkCode() {
var _local2 = code_txt.text.toLowerCase();
alert("code " + _local2);
if (_local2 == "ketchup") {
_root.funcHITBOX("misc", "Code_ketchup");
world.cheatCode = "jump";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if ((((((((_local2 == "069192000014") || (_local2 == "6919200001")) || (_local2 == "069192000175")) || (_local2 == "6919200017")) || (_local2 == "069192000151")) || (_local2 == "6919200015")) || (_local2 == "069192000151")) || (_local2 == "6919200015")) {
_root.funcHITBOX("misc", "Code_UPC_ketchup_" + _local2);
world.cheatCode = "jump";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if (_local2 == "wheels") {
_root.funcHITBOX("misc", "Code_wheels");
world.cheatCode = "speed";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if (_local2 == "highroller") {
_root.funcHITBOX("misc", "Code_highroller");
world.cheatCode = "money";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if (_local2 == "bigtime") {
_root.funcHITBOX("misc", "Code_bigtime");
world.cheatCode = "time";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if (_local2 == "mustard") {
_root.funcHITBOX("misc", "Code_mustard");
world.cheatCode = "invincible";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if ((((((((_local2 == "069192001004") || (_local2 == "6919200100")) || (_local2 == "069192000984")) || (_local2 == "6919200098")) || (_local2 == "069192000991")) || (_local2 == "6919200099")) || (_local2 == "069192003026")) || (_local2 == "6919200302")) {
_root.funcHITBOX("misc", "Code_UPC_mustard_" + _local2);
world.cheatCode = "invincible";
codeStatus = "accepted";
showCodeAcceptedBox();
} else if (_local2 == "fourpack") {
_root.funcHITBOX("misc", "Code_fourpack");
world.cheatCode = "life";
codeStatus = "accepted";
showCodeAcceptedBox();
} else {
code_txt.text = "";
codeStatus = "invalid";
showInvalidCodeMsg();
}
}
function showCodeAcceptedBox() {
submit_btn.enabled = false;
codeAccepted_mc._visible = true;
if (world.cheatCode == "jump") {
codeAccepted_mc.msg_txt.text = "3 Super Jumps!";
} else if (world.cheatCode == "speed") {
codeAccepted_mc.msg_txt.text = "Super Speed!";
} else if (world.cheatCode == "money") {
codeAccepted_mc.msg_txt.text = "2 x Cash!";
} else if (world.cheatCode == "time") {
codeAccepted_mc.msg_txt.text = "Bonus Time!";
} else if (world.cheatCode == "invincible") {
codeAccepted_mc.msg_txt.text = "Invincibility!";
} else if (world.cheatCode == "life") {
codeAccepted_mc.msg_txt.text = "Bonus Life!";
}
codeAccepted_mc.start_btn.onRelease = function () {
gotoLoadingScreen();
};
}
function showInvalidCodeMsg() {
codeStatus = "invalid";
invalid_mc.play();
invalid_mc.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
Selection.setFocus(code_txt);
codeStatus = "none";
this.onEnterFrame = undefined;
}
};
}
function gotoLoadingScreen() {
gotoAndPlay ("loader");
}
stop();
initialCodeButtons();
Selection.setFocus(code_txt);
var codeStatus = "none";
codeAccepted_mc._visible = false;
Frame 21
function initialInstructionButtons() {
play_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("loader");
};
play_btn.onRollOver = function () {
playSFX("buttonOver");
};
back_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("title");
};
back_btn.onRollOver = function () {
playSFX("buttonOver");
};
instructionNext_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("instructions2");
};
instructionNext_btn.onRollOver = function () {
playSFX("buttonOver");
};
}
stop();
initialInstructionButtons();
Frame 31
function initialInstruction2Buttons() {
play_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("loader");
};
play_btn.onRollOver = function () {
playSFX("buttonOver");
};
back_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("title");
};
back_btn.onRollOver = function () {
playSFX("buttonOver");
};
instructionBack_btn.onRelease = function () {
playSFX("buttonHit");
gotoAndPlay ("instructions");
};
instructionBack_btn.onRollOver = function () {
playSFX("buttonOver");
};
}
stop();
initialInstruction2Buttons();
Frame 41
function createLoaderActionControl() {
createEmptyMovieClip("loaderAction_mc", -1);
loaderAction_mc.onEnterFrame = function () {
percent_txt.text = (loaderBar_mc._currentframe + 1) + "%";
if (loaderBar_mc._currentframe == loaderBar_mc._totalframes) {
this.onEnterFrame = undefined;
this.removeMovieClip();
gotoAndPlay ("deliveryOptions");
}
};
}
stop();
_root.funcHITBOX("play_activity", "play_game");
loadLevel(world.currentLevel);
createLoaderActionControl();
Frame 51
function getDistance(fromWhere_obj, toWhere_obj) {
var _local1 = 0;
if (fromWhere_obj.townId == toWhere_obj.townId) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, toWhere_obj.streetNum);
} else if ((fromWhere_obj.townId == 0) && (toWhere_obj.townId == 1)) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, world.intersection1Num);
_local1 = _local1 + getDistanceFromSameTown(world.intersection2Num, toWhere_obj.streetNum);
} else if ((fromWhere_obj.townId == 1) && (toWhere_obj.townId == 2)) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, world.intersection1Num);
_local1 = _local1 + getDistanceFromSameTown(world.intersection2Num, toWhere_obj.streetNum);
} else if ((fromWhere_obj.townId == 2) && (toWhere_obj.townId == 0)) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, world.intersection1Num);
_local1 = _local1 + getDistanceFromSameTown(world.intersection2Num, toWhere_obj.streetNum);
} else if ((fromWhere_obj.townId == 0) && (toWhere_obj.townId == 2)) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, world.intersection2Num);
_local1 = _local1 + getDistanceFromSameTown(world.intersection1Num, toWhere_obj.streetNum);
} else if ((fromWhere_obj.townId == 2) && (toWhere_obj.townId == 1)) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, world.intersection2Num);
_local1 = _local1 + getDistanceFromSameTown(world.intersection1Num, toWhere_obj.streetNum);
} else if ((fromWhere_obj.townId == 1) && (toWhere_obj.townId == 0)) {
_local1 = getDistanceFromSameTown(fromWhere_obj.streetNum, world.intersection2Num);
_local1 = _local1 + getDistanceFromSameTown(world.intersection1Num, toWhere_obj.streetNum);
}
return(_local1);
}
function getDistanceFromSameTown(streetNum1, streetNum2) {
var _local2 = Math.abs(streetNum2 - streetNum1);
if (streetNum1 > streetNum2) {
streetNum2 = streetNum2 + world.maxStreetNum;
} else {
streetNum1 = streetNum1 + world.maxStreetNum;
}
var _local1 = Math.abs(streetNum2 - streetNum1);
if (_local2 < _local1) {
return(_local2);
}
return(_local1);
}
function setDeliveries() {
deliveryList.item_array = [];
var _local3 = 0;
while (_local3 < deliveryList.items) {
do {
deliveryList.item_array[_local3] = {};
var done = true;
var _local4 = getARandomUnlockedTown();
var _local5 = world.town_array[_local4];
var _local2 = deliveryList.item_array[_local3];
_local2.townId = _local4;
_local2.streetNum = random(world.maxStreetNum);
_local2.dist = getDistance(deliveryList.currentLocation_obj, _local2);
if ((_local2.streetNum == world.intersection1Num) || (_local2.streetNum == world.intersection2Num)) {
done = false;
} else if (_local2.dist < delivery.minDist) {
done = false;
}
} while (!done);
_local2.id = _local3;
_local2.order = deliveryList.order_array[random(deliveryList.order_array.length)];
_local2.town = _local5.name;
_local2.realStreetNum = _local5.streetNumStreetFrom + (_local2.streetNum * 2);
_local2.moneyCents = (_local2.dist * 50) + (random(Math.round(_local2.dist)) * 8);
if (_local2.dist > 45) {
_local2.moneyCents = _local2.moneyCents + 800;
} else if (_local2.dist > 35) {
_local2.moneyCents = _local2.moneyCents + 400;
} else if (_local2.dist > 25) {
_local2.moneyCents = _local2.moneyCents + 200;
} else if (_local2.dist > 15) {
_local2.moneyCents = _local2.moneyCents + 100;
}
_local2.secBonus = Math.round(_local2.dist * world.framesBonusDistRatio);
if (world.playerCurrentTownId != _local4) {
_local2.secBonus = _local2.secBonus + delivery.secsCrossTownExtra;
}
_local2.secIncr = 100 / _local2.secBonus;
alert("delivery_obj.secIncr " + _local2.secIncr);
_local2.timeMod = 3;
_local2.subtractPoint = world.framesLeft - (world.fps * _local2.timeMod);
_local2.clip = deliveryField.clip[("deliveryBar" + _local3) + "_mc"];
_local2.clip.order_txt.text = ("Pogo " + _local2.order) + " pack";
_local2.clip.address_txt.text = (_local2.realStreetNum + " ") + _local2.town;
if ((_local2.dist % 10) == 0) {
_local2.clip.distance_txt.text = (_local2.dist / 10) + ".0 km";
} else {
_local2.clip.distance_txt.text = (_local2.dist / 10) + "km";
}
_local2.clip.money_txt.text = funcConvertToCurrency(_local2.moneyCents);
_local2.clip.id_txt.text = _local2.id + 1;
_local2.clip.gotoAndPlay(_local2.level);
_local2.clip.id = _local3;
_local2.clip.onRelease = function () {
selectItem(this.id);
};
_local3++;
}
}
function showCurrentLocationClip() {
var _local1 = world.playerCurrentTownId;
var _local8 = world.town_array[_local1];
var _local3 = world.playerCurrentStreetNum;
var _local4 = deliveryMap[("town" + _local1) + "Clip"];
deliveryMap.currentPositionClip = _local4.attachMovie("symbol current location", "currentLocation_mc", deliveryDepth.mapCurrentLocationDepth);
var _local5 = (_local3 / world.maxStreetNum) * 360;
var _local2 = (_local5 * Math.PI) / 180;
var _local7 = deliveryMap.radius * Math.cos(_local2);
var _local6 = deliveryMap.radius * Math.sin(_local2);
deliveryMap.currentPositionClip._x = _local7;
deliveryMap.currentPositionClip._y = _local6;
if (_local1 == 0) {
deliveryMap.currentPositionClip._rotation = -90;
} else if (_local1 == 1) {
deliveryMap.currentPositionClip._rotation = 150;
} else if (_local1 == 2) {
deliveryMap.currentPositionClip._rotation = 30;
}
}
function showDeliveryLocationsClip() {
var _local2 = 0;
while (_local2 < deliveryList.items) {
var _local1 = deliveryList.item_array[_local2];
var _local3 = _local1.townId;
var _local10 = world.town_array[_local3];
var _local8 = _local1.streetNum;
var _local4 = deliveryMap[("town" + _local3) + "Clip"];
_local1.mapClip = _local4.attachMovie("symbol delivery location", ("deliveryLocation" + _local2) + "_mc", deliveryDepth.mapDeliveryLocationDepth + _local2);
var _local9 = (_local8 / world.maxStreetNum) * 360;
var _local5 = (_local9 * Math.PI) / 180;
var _local7 = deliveryMap.radius * Math.cos(_local5);
var _local6 = deliveryMap.radius * Math.sin(_local5);
if (_local2 == deliveryList.currentItem) {
_local1.clip.gotoAndStop("selected");
deliveryMap.currentDeliveryPositionClip = _local4.attachMovie("symbol current delivery location", "currentDeliveryLocation_mc", deliveryDepth.mapCurrentDeliveryLocationDepth);
deliveryMap.currentDeliveryPositionClip._x = _local7;
deliveryMap.currentDeliveryPositionClip._y = _local6;
}
_local1.mapClip._x = _local7;
_local1.mapClip._y = _local6;
_local2++;
}
}
function getARandomUnlockedTown() {
var _local3 = [];
var _local1 = 0;
while (_local1 < world.town_array.length) {
var _local2 = world.currentLevel_obj.townsUnlocked_array[_local1];
if (_local2) {
_local3.push(_local1);
}
_local1++;
}
return(_local3[random(_local3.length)]);
}
function initialDeliveryVariables() {
deliveryDepth = {};
deliveryDepth.mapDeliveryLocationDepth = 200;
deliveryDepth.mapCurrentLocationDepth = 1000;
deliveryDepth.mapCurrentDeliveryLocationDepth = 2000;
delivery = {};
delivery.status = "showRequirement";
delivery.minDist = 10;
delivery.secsCrossTownExtra = 3;
delivery.keyListener = {};
deliveryField = {};
deliveryField.clip = deliveryField_mc;
deliveryMap = {};
deliveryMap.town0Clip = deliveryField.clip.town0_mc;
deliveryMap.town1Clip = deliveryField.clip.town1_mc;
deliveryMap.town2Clip = deliveryField.clip.town2_mc;
deliveryMap.currentPositionClip = "";
deliveryMap.currentDeliveryPositionClip = "";
deliveryMap.radius = 50;
deliveryMap.locationsInTown = 60;
deliveryList = {};
deliveryList.clip = deliveryField.clip.deliveryList_mc;
deliveryList.items = 5;
deliveryList.order_array = [4, 8, 12];
deliveryList.currentLocation_obj = {townId:world.playerCurrentTownId, streetNum:world.playerCurrentStreetNum};
deliveryList.item_array = [];
deliveryList.currentItem = 0;
requirementPopUp = {};
requirementPopUp.clip = popUpRequirement_mc;
deliveryStats = {};
deliveryStats.clip = earning_mc;
deliveryStats.currentLevelEarnedClip = deliveryStats.clip.currentLevelEarned_mc;
deliveryStats.quota_txt = deliveryStats.clip.quota_txt;
deliveryStats.currentLevelEarned_txt = deliveryStats.clip.currentLevelEarned_mc.money_mc.money_txt;
}
function initialRequirementBox() {
alert("world.levelCompleted " + world.levelCompleted);
if (world.levelCompleted) {
startLevel(world.currentLevel);
delivery.status = "showRequirement";
play_btn._visible = false;
requirementPopUp.clip._visible = true;
requirementPopUp.clip.money_txt.text = ("$" + (world.currentLevel_obj.quotaCents / 100)) + ".00";
requirementPopUp.clip.money_txt.text = funcConvertToCurrency(world.currentLevel_obj.quotaCents);
var _local1 = Math.floor(world.currentLevel_obj.totalMinutes);
var _local2 = 0;
if (_local1 != world.currentLevel_obj.totalMinutes) {
_local2 = (world.currentLevel_obj.totalMinutes - _local1) * 60;
}
var _local3;
if (_local1 < 1) {
_local3 = ("0 MINUTES AND \r" + _local2) + " SECONDS";
} else if (_local1 == 1) {
_local3 = ("1 MINUTE AND \r" + _local2) + " SECONDS";
} else {
_local3 = ((_local1 + " MINUTES AND \r") + _local2) + " SECONDS";
}
requirementPopUp.clip.minutes_txt.text = _local3;
requirementPopUp.clip.shiftTitle_txt.text = ("SHIFT " + world.currentLevel) + " QUOTA";
requirementPopUp.clip.continue_btn.onRelease = function () {
delivery.status = "selectDelivery";
world.levelCompleted = false;
main.requirementPopUp.clip._visible = false;
play_btn._visible = true;
};
} else {
delivery.status = "selectDelivery";
requirementPopUp.clip._visible = false;
}
}
function initialDeliveryKeyControl() {
delivery.keyListener.onKeyDown = function () {
if (delivery.status == "showRequirement") {
if (Key.getCode() == 13) {
delivery.status = "selectDelivery";
world.levelCompleted = false;
main.requirementPopUp.clip._visible = false;
play_btn._visible = true;
}
} else if (delivery.status == "selectDelivery") {
if (Key.getCode() == 38) {
selectPreviousItem();
} else if (Key.getCode() == 40) {
selectNextItem();
} else if (Key.getCode() == 13) {
setDeliveryGoal();
Key.removeListener(this);
gotoAndPlay ("game");
}
}
};
Key.addListener(delivery.keyListener);
}
function initialDeliveryButtons() {
play_btn.onRelease = function () {
if (delivery.status == "selectDelivery") {
playSFX("buttonHit");
setDeliveryGoal();
Key.removeListener(delivery.keyListener);
gotoAndPlay ("game");
}
};
play_btn.onRollOver = function () {
playSFX("buttonOver");
};
}
function setDeliveryGoal() {
var _local1 = deliveryList.item_array[deliveryList.currentItem];
world.currentDelivery_obj = _local1;
}
function selectPreviousItem() {
deliveryList.currentItem--;
if (deliveryList.currentItem < 0) {
deliveryList.currentItem = deliveryList.items - 1;
}
deliveryMap.currentDeliveryPositionClip.removeMovieClip();
var _local2 = 0;
while (_local2 < deliveryList.items) {
var _local1 = deliveryList.item_array[_local2];
if (_local2 == deliveryList.currentItem) {
_local1.clip.gotoAndStop("selected");
var _local3 = _local1.townId;
var _local4 = deliveryMap[("town" + _local3) + "Clip"];
deliveryMap.currentDeliveryPositionClip = _local4.attachMovie("symbol current delivery location", "currentDeliveryLocation_mc", deliveryDepth.mapCurrentDeliveryLocationDepth);
deliveryMap.currentDeliveryPositionClip._x = _local1.mapClip._x;
deliveryMap.currentDeliveryPositionClip._y = _local1.mapClip._y;
} else {
_local1.clip.gotoAndStop("normal");
}
_local2++;
}
}
function selectNextItem() {
alert("CURRENT ITEM " + deliveryList.currentItem);
deliveryList.currentItem++;
if (deliveryList.currentItem > (deliveryList.items - 1)) {
deliveryList.currentItem = 0;
}
deliveryMap.currentDeliveryPositionClip.removeMovieClip();
var _local2 = 0;
while (_local2 < deliveryList.items) {
var _local1 = deliveryList.item_array[_local2];
if (_local2 == deliveryList.currentItem) {
_local1.clip.gotoAndStop("selected");
var _local3 = _local1.townId;
var _local4 = deliveryMap[("town" + _local3) + "Clip"];
deliveryMap.currentDeliveryPositionClip = _local4.attachMovie("symbol current delivery location", "currentDeliveryLocation_mc", deliveryDepth.mapCurrentDeliveryLocationDepth);
deliveryMap.currentDeliveryPositionClip._x = _local1.mapClip._x;
deliveryMap.currentDeliveryPositionClip._y = _local1.mapClip._y;
} else {
_local1.clip.gotoAndStop("normal");
}
_local2++;
}
}
function selectItem(id) {
deliveryList.currentItem = id;
deliveryMap.currentDeliveryPositionClip.removeMovieClip();
var _local2 = 0;
while (_local2 < deliveryList.items) {
var _local1 = deliveryList.item_array[_local2];
if (_local2 == deliveryList.currentItem) {
_local1.clip.gotoAndStop("selected");
var _local3 = _local1.townId;
var _local4 = deliveryMap[("town" + _local3) + "Clip"];
deliveryMap.currentDeliveryPositionClip = _local4.attachMovie("symbol current delivery location", "currentDeliveryLocation_mc", deliveryDepth.mapCurrentDeliveryLocationDepth);
deliveryMap.currentDeliveryPositionClip._x = _local1.mapClip._x;
deliveryMap.currentDeliveryPositionClip._y = _local1.mapClip._y;
} else {
_local1.clip.gotoAndStop("normal");
}
_local2++;
}
}
function showDeliveryStats() {
if ((world.currentLevel_obj.quotaCents % 100) == 0) {
deliveryStats.quota_txt.text = ("/$" + (world.currentLevel_obj.quotaCents / 100)) + ".00";
} else if ((world.currentLevel_obj.quotaCents % 10) == 0) {
deliveryStats.quota_txt.text = ("/$" + (world.currentLevel_obj.quotaCents / 100)) + "0";
} else {
deliveryStats.quota_txt.text = "/$" + (world.currentLevel_obj.quotaCents / 100);
}
var _local1 = world.currentLevel_obj.deliveryTotal + world.currentLevel_obj.trickTotal;
deliveryStats.currentLevelEarned_txt.text = funcConvertToCurrency(_local1);
}
function showDeliveryTimeLeft() {
var _local2 = Math.floor(world.framesLeft / world.fps);
var _local1 = _local2 % 60;
var _local3 = Math.floor(_local2 / 60);
if (_local1 < 10) {
timeLeft_mc.timeLeft_txt.text = (_local3 + ":0") + _local1;
} else {
timeLeft_mc.timeLeft_txt.text = (_local3 + ":") + _local1;
}
}
function updateDeliveryMusic() {
if (music.currentMusic != "gameLoop") {
playMusic("gameLoop");
}
}
stop();
updateDeliveryMusic();
initialDeliveryVariables();
initialRequirementBox();
initialDeliveryKeyControl();
initialDeliveryButtons();
showDeliveryStats();
setDeliveries();
showCurrentLocationClip();
showDeliveryLocationsClip();
showDeliveryTimeLeft();
Frame 61
function initialIsoWorld() {
iso = {};
iso.alpha = 0;
iso.theta = 45;
iso.alphaRad = (iso.alpha * Math.PI) / 180;
iso.thetaRad = (iso.theta * Math.PI) / 180;
iso.sinAlpha = Math.sin(iso.alphaRad);
iso.cosAlpha = Math.cos(iso.alphaRad);
iso.sinTheta = Math.sin(iso.thetaRad);
iso.cosTheta = Math.cos(iso.thetaRad);
}
function mapToScreen(xpp, ypp, zpp) {
var _local4 = iso.sinTheta;
var _local6 = iso.cosTheta;
var _local1 = iso.sinAlpha;
var _local2 = iso.cosAlpha;
var _local5 = ypp;
var _local7 = (xpp * _local2) + (zpp * _local1);
var _local3 = (zpp * _local2) - (xpp * _local1);
var _local9 = _local7;
var _local8 = (_local5 * _local6) - (_local3 * _local4);
return([_local9, _local8]);
}
function mapToIsoWorld(screenX, screenY) {
var _local4 = iso.sinTheta;
var _local7 = iso.cosTheta;
var _local1 = iso.sinAlpha;
var _local2 = iso.cosAlpha;
var _local3 = ((screenX / _local2) - (screenY / (_local1 * _local4))) * (1 / ((_local2 / _local1) + (_local1 / _local2)));
var _local5 = (1 / _local2) * (screenX - (_local3 * _local1));
return([_local5, _local3]);
}
function checkCollisions() {
checkPlayerItemsCollision();
checkPlayerPowerUpCollision();
}
function funcJumpCrashCheck(arObj, arType, arNum, arNum2) {
switch (arType) {
case ">" :
if (world.superInvincLeft > -1) {
if (arObj != player.collisionObj) {
player.collisionObj = arObj;
world.superInvincLeft--;
}
} else {
if (player.xmov >= player.minCrashSpeed) {
if (arObj.type == "oldLady") {
playSFX("crashOldLady");
} else {
playSFX("crashBig");
}
if (player.onObject == "ground") {
player.moveStatus = "crash";
} else if (player.onObject == "air") {
player.moveStatus = "jumpCrash";
}
} else {
playSFX("crashSmall");
}
player.tempx = arNum;
player.xmov = 0;
}
break;
case "<" :
if (world.superInvincLeft > -1) {
if (arObj != player.collisionObj) {
player.collisionObj = arObj;
world.superInvincLeft--;
}
} else {
if (player.xmov <= (-player.minCrashSpeed)) {
if (arObj.type == "oldLady") {
playSFX("crashOldLady");
} else {
playSFX("crashBig");
}
if (player.onObject == "ground") {
player.moveStatus = "crash";
} else if (player.onObject == "air") {
player.moveStatus = "jumpCrash";
}
} else {
playSFX("crashSmall");
}
player.tempx = arNum;
player.xmov = 0;
}
break;
case "<>" :
if (world.superInvincLeft > -1) {
if (arObj != player.collisionObj) {
player.collisionObj = arObj;
world.superInvincLeft--;
}
} else {
playSFX("crashSmall");
if (player.onObject == "ground") {
player.moveStatus = "crash";
} else if (player.onObject == "air") {
player.moveStatus = "jumpCrash";
}
if (arNum != undefined) {
player.tempx = arNum;
player.xmov = 0;
}
}
break;
case "abs>" :
if (world.superInvincLeft > -1) {
if (arObj != player.collisionObj) {
player.collisionObj = arObj;
world.superInvincLeft--;
}
} else {
if (Math.abs(player.xmov) >= player.minCrashSpeed) {
if (arObj.type == "oldLady") {
playSFX("crashOldLady");
} else {
playSFX("crashBig");
}
if (player.onObject == "ground") {
player.moveStatus = "crash";
} else if (player.onObject == "air") {
player.moveStatus = "jumpCrash";
}
} else {
playSFX("crashSmall");
}
player.tempx = arNum;
player.xmov = 0;
}
break;
case "ground" :
if (world.superInvincLeft > -1) {
if (arObj != player.collisionObj) {
player.collisionObj = arObj;
world.superInvincLeft--;
}
} else if (player.xmov > 0) {
if (Math.abs(player.xmov) >= player.minCrashSpeed) {
if (arObj.type == "oldLady") {
playSFX("crashOldLady");
} else {
playSFX("crashBig");
}
player.moveStatus = "crash";
} else {
playSFX("crashSmall");
}
player.tempx = arNum;
player.xmov = 0;
} else {
if (Math.abs(player.xmov) >= player.minCrashSpeed) {
if (arObj.type == "oldLady") {
playSFX("crashOldLady");
} else {
playSFX("crashBig");
}
player.moveStatus = "crash";
} else {
playSFX("crashSmall");
}
player.tempx = arNum2;
player.xmov = 0;
}
}
}
function checkPlayerPowerUpCollision() {
var _local11 = main["town" + world.playerCurrentTownId];
var _local2 = 0;
while (_local2 < _local11.powerUp_array.length) {
var _local1 = main["powerUp" + _local2];
if (_local1.status == "normal") {
var _local6 = _local1.x - (powerUp.width / 2);
var _local4 = _local1.x + (powerUp.width / 2);
var _local5 = _local1.y - (powerUp.height / 2);
var _local3 = _local1.y + (powerUp.height / 2);
if ((player.tempx > _local6) && (player.tempx < _local4)) {
if ((player.tempy > _local5) && (player.tempy < _local3)) {
if (player.currentRow == _local1.row) {
playSFX("powerUp");
_local1.status = "taken";
playerPowerUp(_local1.type);
_local1.clip.removeMovieClip();
}
}
}
if (_local1.x2 != -1) {
var _local8 = _local1.x2 - (_local1.width / 2);
var _local10 = _local1.x2 + (_local1.width / 2);
var _local7 = _local1.y2 - (powerUp.height / 2);
var _local9 = _local1.y2 + (powerUp.height / 2);
if ((player.tempx > _local8) && (player.tempx < _local10)) {
if ((player.tempy > _local7) && (player.tempy < _local9)) {
if (player.currentRow == _local1.row) {
playSFX("powerUp");
_local1.status = "taken";
playerPowerUp(_local1.type);
_local1.clip.removeMovieClip();
}
}
}
}
}
_local2++;
}
}
function checkPlayerTypeAItemCollision(item_obj) {
var _local4 = item_obj.x - (item_obj.width / 2);
var _local3 = item_obj.x + (item_obj.width / 2);
var _local2 = item_obj.x;
if ((player.tempx > _local4) && (player.tempx < _local3)) {
if (player.currentRow == item_obj.row) {
player.tempz = bg.rowz_array[player.currentRow];
if (player.tempy <= (-item_obj.height)) {
if ((player.tempx <= _local2) && (player.x > _local2)) {
addTrickMoney(item_obj.jumpMoney);
} else if ((player.tempx >= _local2) && (player.x < _local2)) {
addTrickMoney(item_obj.jumpMoney);
}
} else if (player.tempy > (-item_obj.height)) {
player.onSuperJump = false;
if (player.xmov >= 0) {
if (player.tempx < _local2) {
funcJumpCrashCheck(item_obj, ">", _local4);
} else {
funcJumpCrashCheck(item_obj, "<>", _local3);
}
if (player.xmov >= player.minCrashSpeed) {
funcJumpCrashCheck(item_obj, "<>", undefined);
}
} else if (player.xmov < 0) {
if (player.tempx > _local2) {
funcJumpCrashCheck(item_obj, "<", _local3);
} else {
funcJumpCrashCheck(item_obj, "<>", _local4);
}
if (player.xmov <= (-player.minCrashSpeed)) {
funcJumpCrashCheck(item_obj, "<>", undefined);
}
}
}
}
}
if (item_obj.x2 != -1) {
_local4 = item_obj.x2 - (item_obj.width / 2);
_local3 = item_obj.x2 + (item_obj.width / 2);
_local2 = item_obj.x2;
if (player.tempy <= (-item_obj.height)) {
if ((player.tempx <= _local2) && (player.x > _local2)) {
addTrickMoney(item_obj.jumpMoney);
} else if ((player.tempx >= _local2) && (player.x < _local2)) {
addTrickMoney(item_obj.jumpMoney);
}
} else if ((player.tempx > _local4) && (player.tempx < _local3)) {
if (player.currentRow == item_obj.row) {
if (player.tempy > (-item_obj.height)) {
player.onSuperJump = false;
if (player.xmov > 0) {
if (player.tempx < _local2) {
funcJumpCrashCheck(item_obj, ">", _local4);
} else {
funcJumpCrashCheck(item_obj, "<>", _local3);
}
} else if (player.xmov < 0) {
if (player.tempx > _local2) {
funcJumpCrashCheck(item_obj, "<", _local3);
} else {
funcJumpCrashCheck(item_obj, "<>", _local4);
}
if (player.xmov <= (-player.minCrashSpeed)) {
funcJumpCrashCheck(item_obj, "<>", undefined);
}
}
}
}
}
}
}
function checkPlayerTypeBItemCollision(item_obj) {
var _local4 = item_obj.x - (item_obj.width / 2);
var _local3 = item_obj.x + (item_obj.width / 2);
var _local2 = item_obj.x;
if ((player.tempx > _local4) && (player.tempx < _local3)) {
if ((player.currentRow == item_obj.row) || (player.currentRow == (item_obj.row + 1))) {
player.tempz = bg.rowz_array[player.currentRow];
if (player.tempy <= (-item_obj.height)) {
if ((player.tempx <= _local2) && (player.x > _local2)) {
addTrickMoney(item_obj.jumpMoney);
} else if ((player.tempx >= _local2) && (player.x < _local2)) {
addTrickMoney(item_obj.jumpMoney);
}
} else if (player.tempy > (-item_obj.height)) {
player.onSuperJump = false;
if (player.xmov > 0) {
if (player.tempx < _local2) {
funcJumpCrashCheck(item_obj, ">", _local4);
} else {
funcJumpCrashCheck(item_obj, "<>", _local3);
}
} else if (player.xmov < 0) {
if (player.tempx > _local2) {
funcJumpCrashCheck(item_obj, "<", _local3);
} else {
funcJumpCrashCheck(item_obj, "<>", _local4);
}
if (player.xmov <= (-player.minCrashSpeed)) {
funcJumpCrashCheck(item_obj, "<>", undefined);
}
}
}
}
}
if (item_obj.x2 != -1) {
_local4 = item_obj.x2 - (item_obj.width / 2);
_local3 = item_obj.x2 + (item_obj.width / 2);
_local2 = item_obj.x2;
if ((player.tempx > _local4) && (player.tempx < _local3)) {
if ((player.currentRow == item_obj.row) || (player.currentRow == (item_obj.row + 1))) {
if (player.tempy <= (-item_obj.height)) {
if ((player.tempx <= _local2) && (player.x > _local2)) {
addTrickMoney(item_obj.jumpMoney);
} else if ((player.tempx >= _local2) && (player.x < _local2)) {
addTrickMoney(item_obj.jumpMoney);
}
} else if (player.tempy > (-item_obj.height)) {
player.onSuperJump = false;
if (player.xmov > 0) {
if (player.tempx < _local2) {
funcJumpCrashCheck(item_obj, ">", _local4);
} else {
funcJumpCrashCheck(item_obj, "<>", _local3);
}
} else if (player.xmov < 0) {
if (player.tempx > _local2) {
funcJumpCrashCheck(item_obj, "<", _local3);
} else {
funcJumpCrashCheck(item_obj, "<>", _local4);
}
if (player.xmov <= (-player.minCrashSpeed)) {
funcJumpCrashCheck(item_obj, "<>", undefined);
}
}
}
}
}
}
}
function checkPlayerTypeCItemCollision(item_obj) {
var _local3 = item_obj.x - (item_obj.width / 2);
var _local2 = item_obj.x + (item_obj.width / 2);
if ((player.tempx > _local3) && (player.tempx < _local2)) {
if (player.currentRow == item_obj.row) {
player.tempz = bg.rowz_array[player.currentRow];
if ((player.tempy > (-item_obj.height)) && (player.y < (-item_obj.height))) {
playSFX("land");
player.onSuperJump = false;
player.tempy = -item_obj.height;
player.moveStatus = "landHorse";
} else if (player.tempy >= (-item_obj.height)) {
if (player.onObject == "ground") {
player.onSuperJump = false;
funcJumpCrashCheck(item_obj, "ground", _local3, _local2);
} else if (player.onObject == "air") {
playSFX("land");
player.onSuperJump = false;
player.tempy = -item_obj.height;
player.moveStatus = "landHorse";
resetTrickArray();
}
}
}
} else if ((player.tempx > _local2) && (player.x < _local2)) {
if ((player.moveStatus == "landHorse") || (player.moveStatus == "jumpReadyOnHorse")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick0") || (player.moveStatus == "horseTrickEnd0")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick1") || (player.moveStatus == "horseTrickEnd1")) {
player.moveStatus = "jumpDown";
} else if (player.moveStatus == "horseTrick2") {
player.moveStatus = "jumpDown";
}
} else if ((player.tempx < _local3) && (player.x > _local3)) {
if ((player.moveStatus == "landHorse") || (player.moveStatus == "jumpReadyOnHorse")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick0") || (player.moveStatus == "horseTrickEnd0")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick1") || (player.moveStatus == "horseTrickEnd1")) {
player.moveStatus = "jumpDown";
} else if (player.moveStatus == "horseTrick2") {
player.moveStatus = "jumpDown";
}
}
if (item_obj.x2 != -1) {
var _local4 = item_obj.x2 - (item_obj.width / 2);
var _local5 = item_obj.x2 + (item_obj.width / 2);
if ((player.tempx > _local4) && (player.tempx < _local5)) {
if (player.currentRow == item_obj.row) {
if ((player.tempy > (-item_obj.height)) && (player.y < (-item_obj.height))) {
playSFX("land");
player.onSuperJump = false;
player.tempy = -item_obj.height;
player.moveStatus = "landHorse";
} else if (player.tempy >= (-item_obj.height)) {
if (player.onObject == "ground") {
player.onSuperJump = false;
funcJumpCrashCheck(item_obj, "ground", _local4, _local5);
} else if (player.onObject == "air") {
playSFX("land");
player.onSuperJump = false;
player.tempy = -item_obj.height;
player.moveStatus = "landHorse";
}
}
}
} else if ((player.tempx > _local5) && (player.x < _local5)) {
if ((player.moveStatus == "landHorse") || (player.moveStatus == "jumpReadyOnHorse")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick0") || (player.moveStatus == "horseTrickEnd0")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick1") || (player.moveStatus == "horseTrickEnd1")) {
player.moveStatus = "jumpDown";
} else if (player.moveStatus == "horseTrick2") {
player.moveStatus = "jumpDown";
}
} else if ((player.tempx < _local4) && (player.x > _local4)) {
if ((player.moveStatus == "landHorse") || (player.moveStatus == "jumpReadyOnHorse")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick0") || (player.moveStatus == "horseTrickEnd0")) {
player.moveStatus = "jumpDown";
} else if ((player.moveStatus == "horseTrick1") || (player.moveStatus == "horseTrickEnd1")) {
player.moveStatus = "jumpDown";
} else if (player.moveStatus == "horseTrick2") {
player.moveStatus = "jumpDown";
}
}
}
}
function checkPlayerTypeDItemCollision(item_obj) {
var _local3 = item_obj.x - (item_obj.width / 2);
var _local2 = item_obj.x + (item_obj.width / 2);
if (player.currentRow == item_obj.row) {
if (item_obj.direction == "left") {
if (player.xmov > 0) {
if ((player.tempx > _local3) && (player.x < _local2)) {
player.tempz = bg.rowz_array[player.currentRow];
var _local5 = player.tempx - _local3;
var _local4 = (_local5 * item_obj.height) / item_obj.width;
if (player.tempy >= (-_local4)) {
if (player.tempx < _local2) {
player.onSuperJump = false;
player.onObject = "ramp";
player.moveStatus = "accelerate";
player.tempy = -_local4;
player.clip._rotation = ((-Math.atan(item_obj.height / item_obj.width)) / Math.PI) * 180;
} else if ((player.x < _local2) && (player.tempx > _local2)) {
player.onSuperJump = false;
player.ymov = player.xmov * (-Math.atan(item_obj.height / item_obj.width));
player.onObject = "air";
player.moveStatus = "jumpUp";
player.tempy = -_local4;
player.clip._rotation = 0;
}
}
}
} else if ((player.tempx > _local3) && (player.tempx < _local2)) {
player.tempz = bg.rowz_array[player.currentRow];
var _local4 = ((-(player.tempx - _local3)) / item_obj.width) * item_obj.height;
if (player.tempy > _local4) {
player.onSuperJump = false;
if (Math.abs(player.tempx - _local3) < Math.abs(player.tempx - _local2)) {
funcJumpCrashCheck(item_obj, "abs>", _local3);
} else {
funcJumpCrashCheck(item_obj, "abs>", _local2 + 10);
}
}
}
} else if (player.xmov < 0) {
if ((player.tempx < _local2) && (player.x > _local3)) {
var _local5 = _local2 - player.tempx;
var _local4 = (_local5 * item_obj.height) / item_obj.width;
if (player.tempy >= (-_local4)) {
if (player.tempx > _local3) {
player.onSuperJump = false;
player.onObject = "ramp";
player.moveStatus = "accelerate";
player.tempy = -_local4;
player.clip._rotation = (Math.atan(item_obj.height / item_obj.width) / Math.PI) * 180;
} else if ((player.x > _local3) && (player.tempx < _local3)) {
player.onSuperJump = false;
player.ymov = (-player.xmov) * (-Math.atan(item_obj.height / item_obj.width));
player.onObject = "air";
player.moveStatus = "jumpUp";
player.tempy = -_local4;
player.clip._rotation = 0;
addTrickMoney(item_obj.jumpMoney);
}
}
}
} else if ((player.tempx > _local3) && (player.tempx < _local2)) {
var _local4 = ((-(_local2 - player.tempx)) / item_obj.width) * item_obj.height;
if (player.tempy > _local4) {
player.onSuperJump = false;
if (Math.abs(player.tempx - _local3) < Math.abs(player.tempx - _local2)) {
funcJumpCrashCheck(item_obj, "abs>", _local3 - 10);
} else {
funcJumpCrashCheck(item_obj, "abs>", _local2);
}
}
}
}
if (item_obj.x2 != -1) {
_local3 = item_obj.x2 - (item_obj.width / 2);
_local2 = item_obj.x2 + (item_obj.width / 2);
if (player.currentRow == item_obj.row) {
if (item_obj.direction == "left") {
if (player.xmov > 0) {
if ((player.tempx > _local3) && (player.x < _local2)) {
var _local5 = player.tempx - _local3;
var _local4 = (_local5 * item_obj.height) / item_obj.width;
if (player.tempy >= (-_local4)) {
if (player.tempx < _local2) {
player.onSuperJump = false;
player.onObject = "ramp";
player.moveStatus = "accelerate";
player.tempy = -_local4;
player.clip._rotation = ((-Math.atan(item_obj.height / item_obj.width)) / Math.PI) * 180;
} else if ((player.x < _local2) && (player.tempx > _local2)) {
player.onSuperJump = false;
player.ymov = player.xmov * (-Math.atan(item_obj.height / item_obj.width));
player.onObject = "air";
player.moveStatus = "jumpUp";
player.tempy = -_local4;
player.clip._rotation = 0;
}
}
}
} else if ((player.tempx > _local3) && (player.tempx < _local2)) {
var _local4 = ((-(player.tempx - _local3)) / item_obj.width) * item_obj.height;
if (player.tempy > _local4) {
player.onSuperJump = false;
if (Math.abs(player.tempx - _local3) < Math.abs(player.tempx - _local2)) {
funcJumpCrashCheck(item_obj, "abs>", _local3);
} else {
funcJumpCrashCheck(item_obj, "abs>", _local2 + 10);
}
}
}
} else if (player.xmov < 0) {
if ((player.tempx < _local2) && (player.x > _local3)) {
var _local5 = _local2 - player.tempx;
var _local4 = (_local5 * item_obj.height) / item_obj.width;
if (player.tempy >= (-_local4)) {
if (player.tempx > _local3) {
player.onSuperJump = false;
player.onObject = "ramp";
player.moveStatus = "accelerate";
player.tempy = -_local4;
player.clip._rotation = (Math.atan(item_obj.height / item_obj.width) / Math.PI) * 180;
} else if ((player.x > _local3) && (player.tempx < _local3)) {
player.onSuperJump = false;
player.ymov = (-player.xmov) * (-Math.atan(item_obj.height / item_obj.width));
player.onObject = "air";
player.moveStatus = "jumpUp";
player.tempy = -_local4;
player.clip._rotation = 0;
addTrickMoney(item_obj.jumpMoney);
}
}
}
} else if ((player.tempx > _local3) && (player.tempx < _local2)) {
var _local4 = ((-(_local2 - player.tempx)) / item_obj.width) * item_obj.height;
if (player.tempy > _local4) {
player.onSuperJump = false;
if (Math.abs(player.tempx - _local3) < Math.abs(player.tempx - _local2)) {
funcJumpCrashCheck(item_obj, "abs>", _local3 - 10);
} else {
funcJumpCrashCheck(item_obj, "abs>", _local2);
}
}
}
}
}
}
function checkPlayerItemsCollision() {
var _local3 = main["town" + world.playerCurrentTownId];
var _local2 = 0;
while (_local2 < _local3.item_array.length) {
var _local1 = main["item" + _local2];
if (_local1.type == "cone") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "bin") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "hydrant") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "streetSignUptown") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "streetSignMidtown") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "streetSignDowntown") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "oldLady") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "garbageCan") {
checkPlayerTypeAItemCollision(_local1);
} else if (_local1.type == "horseVer") {
checkPlayerTypeBItemCollision(_local1);
} else if (_local1.type == "planter") {
checkPlayerTypeCItemCollision(_local1);
} else if (_local1.type == "longPlanter") {
checkPlayerTypeCItemCollision(_local1);
} else if (_local1.type == "bench") {
checkPlayerTypeCItemCollision(_local1);
} else if (_local1.type == "longBench") {
checkPlayerTypeCItemCollision(_local1);
} else if (_local1.type == "horseHor") {
checkPlayerTypeCItemCollision(_local1);
} else if (_local1.type == "ramp") {
checkPlayerTypeDItemCollision(_local1);
}
_local2++;
}
}
function initialPlayer() {
player = {};
player.clip = "";
player.animationClip = "";
player.pogoClip = "";
player.radius = 20;
player.mass = 10;
player.initx = gameField.width / 2;
player.inity = 0;
player.initz = -350;
player.minz = -500;
player.maxz = -250;
player.maxXSpeed = 12;
player.maxXSpeedOnRamp = 15;
player.maxXCheatCodeSpeed = 14;
player.maxXCheatCodeSpeedOnRamp = 17;
player.maxXPowerUpSpeed = 16;
player.maxXPowerUpSpeedOnRamp = 19;
player.minXSpeedOnHorse = 4;
player.minCrashSpeed = 8;
player.jumpRowSpeed = 10;
player.jumpYSpeed = -12.5;
player.jumpPowerUpYSpeed = -20;
player.minx = 0;
player.maxx = bg.locations * bg.locationWidth;
player.yacc = 1;
player.xacceleration = 0.3;
player.xRampAcceleration = 0.4;
player.xdecay = 0.03;
player.xBrakeDecay = 0.6;
player.tempx = 0;
player.tempy = 0;
player.tempz = 0;
player.x = 0;
player.y = 0;
player.z = 0;
player.flashx = 0;
player.flashy = 0;
player.xmov = 0;
player.ymov = 0;
player.zmov = 0;
player.xacc = 0;
player.zacc = 0;
player.framesKeyDownPowerUp = 12;
player.framesKeyDown = 0;
player.framesPowerUp = 240;
player.powerUpEndFrame = 0;
player.status = "normal";
player.lastMoveStatus = "rest";
player.moveStatus = "rest";
player.onSuperJump = false;
player.powerUpStatus = "none";
player.onObject = "ground";
player.nextClipLabel = "none";
player.lastMoveFrame = 19;
player.lastAccelerateFrame = 38;
player.lastSlowFrame = 44;
player.lastBrakeFrame = 50;
player.lastJumpReadyFrame = 58;
player.lastJumpUpFrame = 70;
player.lastJumpDownFrame = 79;
player.lastJumpLandFrame = 84;
player.lastJumpRowStartFrame = 89;
player.lastJumpRowFrame = 99;
player.lastCrashFrame = 112;
player.lastJumpCrashFrame = 138;
player.lastSkateUpFrame = 171;
player.lastGroundTrick0Frame = 186;
player.lastGroundTrick1Frame = 221;
player.lastGroundTrick2Frame = 229;
player.lastHorseTrick0Frame = 240;
player.lastHorseTrick0EndFrame = 244;
player.lastHorseTrick1Frame = 247;
player.lastHorseTrick1EndFrame = 250;
player.lastHorseTrick2Frame = 262;
player.lastAirTrick0Frame = 277;
player.lastAirTrick1Frame = 284;
player.lastAirTrick2Frame = 297;
player.lastAirTrick3EndFrame = 311;
player.lastAirTrick4Frame = 314;
player.lastAirTrick4EndFrame = 319;
player.lastAirTrick5EndFrame = 344;
player.currentRow = 0;
}
function loadPlayer(streetNum) {
var _local3 = "player";
var _local4 = "player_mc";
var _local2 = gameDepth[("row" + player.currentRow) + "Max"];
player.clip = bg.clip.attachMovie(_local3, _local4, _local2);
player.animationClip = player.clip.animation_mc;
player.pogoClip = pPogoShow_mc;
player.initx = (streetNum * bg.houseWidth) + (bg.houseWidth / 2);
player.x = player.initx;
player.y = player.inity;
player.z = bg.rowz_array[player.currentRow];
player.tempx = player.x;
player.tempy = player.y;
player.tempz = player.z;
var _local1 = mapToScreen(player.x, player.y, player.z);
player.flashx = _local1[0];
player.flashy = _local1[1];
player.clip._x = player.flashx;
player.clip._y = player.flashy;
player.nextClipLabel = "stop";
}
function resetTrickArray() {
game.currentTrick_array = [];
}
function addCurrentTrick(trick) {
game.currentTrick_array.push(trick);
}
function getCurrentTrickInArray(trick) {
var _local2 = 0;
var _local1 = 0;
while (_local1 < game.currentTrick_array.length) {
if (game.currentTrick_array[_local1] == trick) {
_local2++;
}
_local1++;
}
return(_local2);
}
function captureKeys() {
var _local1 = main["level" + world.currentLevel];
var _local8 = Key.isDown(37);
var _local7 = Key.isDown(39);
var _local10 = Key.isDown(38);
var _local14 = Key.isDown(40);
var _local2 = Key.isDown(32);
var _local3 = Key.isDown(90);
var _local4 = Key.isDown(88);
var _local5 = Key.isDown(67);
var _local11 = Key.isDown(86);
player.lastMoveStatus = player.moveStatus;
if (player.onObject == "ground") {
if ((((player.lastMoveStatus == "rest") || (player.lastMoveStatus == "slow")) || (player.lastMoveStatus == "accelerate")) || (player.lastMoveStatus == "brake")) {
if ((!_local8) && (!_local7)) {
if (player.xmov == 0) {
player.moveStatus = "rest";
player.xacc = 0;
} else if (player.xmov > 0) {
if (player.xmov < player.xdecay) {
player.moveStatus = "rest";
player.xacc = -player.xmov;
} else {
player.moveStatus = "slow";
player.xacc = -player.xdecay;
}
} else if (player.xmov < 0) {
if (player.xmov > (-player.xdecay)) {
player.moveStatus = "rest";
player.xacc = -player.xmov;
} else {
player.moveStatus = "slow";
player.xacc = player.xdecay;
}
}
} else if (_local8) {
if (player.xmov > 0) {
playSFX("brake");
player.xacc = -player.xBrakeDecay;
player.moveStatus = "brake";
} else {
player.xacc = -player.xacceleration;
player.moveStatus = "accelerate";
}
} else if (_local7) {
if (player.xmov < 0) {
playSFX("brake");
player.moveStatus = "brake";
player.xacc = player.xBrakeDecay;
} else {
player.xacc = player.xacceleration;
player.moveStatus = "accelerate";
}
}
if (_local10) {
if (player.currentRow > 0) {
if (!isItemRowUp()) {
jumpUpRow();
}
} else if (player.currentRow == 0) {
var _local9 = getPlayerCurrentIntersectionId();
if (_local9 == 1) {
if (world.playerCurrentTownId == 0) {
var _local12 = world.town_array[1];
} else if (world.playerCurrentTownId == 1) {
var _local12 = world.town_array[2];
} else if (world.playerCurrentTownId == 2) {
var _local12 = world.town_array[0];
}
if (_local12.unlocked) {
playerSkateUp(1);
}
} else if (_local9 == 2) {
if (world.playerCurrentTownId == 0) {
var _local12 = world.town_array[2];
} else if (world.playerCurrentTownId == 1) {
var _local12 = world.town_array[0];
} else if (world.playerCurrentTownId == 2) {
var _local12 = world.town_array[1];
}
if (_local12.unlocked) {
playerSkateUp(2);
}
}
}
} else if (_local14) {
if (player.currentRow < (bg.rows - 1)) {
if (!isItemRowDown()) {
jumpDownRow();
}
}
}
if (_local2) {
player.moveStatus = "jumpReady";
}
if (((player.lastMoveStatus == "slow") || (player.lastMoveStatus == "accelerate")) || (player.lastMoveStatus == "brake")) {
if (_local3) {
if (_local1.groundTrickUnlocked_array[2]) {
playSFX("trick1");
player.moveStatus = "groundTrick2";
}
} else if (_local4) {
if (_local1.groundTrickUnlocked_array[1]) {
playSFX("trick0");
player.moveStatus = "groundTrick1";
}
} else if (_local5) {
if (_local1.groundTrickUnlocked_array[0]) {
playSFX("trick2");
player.moveStatus = "groundTrick0";
}
}
}
} else if (player.lastMoveStatus == "jumpReady") {
if (!_local2) {
if (player.framesKeyDown >= player.framesKeyDownPowerUp) {
if (world.superJumpsLeft > 0) {
playSFX("superJump");
player.onSuperJump = true;
world.superJumpsLeft--;
player.moveStatus = "jumpUp";
player.ymov = player.jumpPowerUpYSpeed;
player.framesKeyDown = 0;
stats.superJumpMeterClipFlashOn = false;
stats.superJumpMeterClip.animation_mc.gotoAndStop("normal");
} else {
playSFX("jump");
player.onSuperJump = false;
player.moveStatus = "jumpUp";
player.ymov = player.jumpYSpeed;
player.framesKeyDown = 0;
}
} else {
playSFX("jump");
player.onSuperJump = false;
player.moveStatus = "jumpUp";
player.ymov = player.jumpYSpeed;
player.framesKeyDown = 0;
}
resetTrickArray();
} else {
player.framesKeyDown++;
}
}
} else if (player.onObject == "air") {
if ((player.lastMoveStatus == "jumpUp") || (player.lastMoveStatus == "jumpDown")) {
if (_local3) {
if (_local1.airTrickUnlocked_array[1]) {
playSFX("trick1");
player.moveStatus = "airTrick1";
}
} else if (_local4) {
if (_local1.airTrickUnlocked_array[2]) {
playSFX("trick2");
player.moveStatus = "airTrick2";
}
} else if (_local5) {
if (_local1.airTrickUnlocked_array[4]) {
playSFX("trick8");
player.moveStatus = "airTrick4";
}
} else if (_local11) {
if (_local1.airTrickUnlocked_array[5]) {
playSFX("trick7");
player.moveStatus = "airTrick5";
}
}
} else if (player.lastMoveStatus == "airTrick4") {
if (!_local5) {
player.moveStatus = "airTrickEnd4";
} else if ((game.frames % 5) == 0) {
var _local13 = getCurrentTrickInArray("airTrick4");
var _local6 = Math.round(score.airTrick4 / Math.pow(2, _local13));
if (_local6 < 1) {
_local6 = 1;
}
addTrickMoney(_local6);
addCurrentTrick("airTrick4");
if (player.onSuperJump) {
addTrickMoney(_local6 * score.superJumpRatio);
} else {
addTrickMoney(_local6);
}
}
}
} else if (player.onObject == "ramp") {
if (player.xmov > 0) {
player.xacc = player.xRampAcceleration;
} else {
player.xacc = -player.xRampAcceleration;
}
if ((((player.lastMoveStatus == "rest") || (player.lastMoveStatus == "slow")) || (player.lastMoveStatus == "accelerate")) || (player.lastMoveStatus == "brake")) {
if (_local2) {
player.moveStatus = "jumpReady";
}
} else if (player.lastMoveStatus == "jumpReady") {
if (!_local2) {
playSFX("jump");
player.onSuperJump = false;
player.moveStatus = "jumpUp";
player.ymov = player.jumpYSpeed - (Math.abs(player.xmov) * 0.707106781186547);
}
}
} else if (player.onObject == "horse") {
player.xacc = 0;
if (player.lastMoveStatus == "landHorse") {
if (_local2) {
player.moveStatus = "jumpReadyOnHorse";
} else if (_local3) {
if (_local1.horseTrickUnlocked_array[1]) {
player.moveStatus = "horseTrick1";
}
} else if (_local4) {
if (_local1.horseTrickUnlocked_array[0]) {
player.moveStatus = "horseTrick0";
}
} else if (_local5) {
if (_local1.horseTrickUnlocked_array[2]) {
player.moveStatus = "horseTrick2";
}
}
} else if (player.lastMoveStatus == "jumpReadyOnHorse") {
if (!_local2) {
playSFX("jump");
player.onSuperJump = false;
player.moveStatus = "jumpUp";
player.ymov = player.jumpYSpeed;
resetTrickArray();
}
} else if (player.moveStatus == "horseTrick1") {
if (!_local3) {
player.moveStatus = "horseTrickEnd1";
} else if ((game.frames % 8) == 0) {
var _local13 = getCurrentTrickInArray("horseTrick1");
var _local6 = Math.round(score.horseTrick1 / Math.pow(2, _local13));
if (_local6 < 1) {
_local6 = 1;
}
addTrickMoney(_local6);
addCurrentTrick("horseTrick1");
}
} else if (player.moveStatus == "horseTrick0") {
if (!_local4) {
player.moveStatus = "horseTrickEnd0";
} else if ((game.frames % 15) == 0) {
var _local13 = getCurrentTrickInArray("horseTrick0");
var _local6 = Math.round(score.horseTrick0 / Math.pow(2, _local13));
if (_local6 < 1) {
_local6 = 1;
}
addTrickMoney(_local6);
addCurrentTrick("horseTrick0");
}
}
}
}
function getPlayerCurrentIntersectionId() {
if ((player.tempx > game.intersection1Minx) && (player.tempx < game.intersection1Maxx)) {
return(1);
}
if ((player.tempx > game.intersection2Minx) && (player.tempx < game.intersection2Maxx)) {
return(2);
}
return(-1);
}
function jumpDownRow() {
player.moveStatus = "jumpRowDownStart";
player.nextClipLabel = "jumpRowStart";
player.currentRow++;
var _local1 = gameDepth[("row" + player.currentRow) + "Max"];
player.clip.swapDepths(_local1);
}
function jumpUpRow() {
player.moveStatus = "jumpRowUpStart";
player.nextClipLabel = "jumpRowStart";
player.currentRow--;
var _local1 = gameDepth[("row" + player.currentRow) + "Max"];
player.clip.swapDepths(_local1);
}
function playerSkateUp(intersectionId) {
player.moveStatus = "skateUp" + intersectionId;
player.nextClipLabel = "skateUp";
player.status = "changingTown";
player.currentRow = 0;
}
function playerPowerUp(type) {
if (type == "speed") {
player.powerUpStatus = "speed";
player.powerUpEndFrame = game.frames + player.framesPowerUp;
} else if (type == "jump") {
if (world.superJumpsLeft < game.superJumpsMax) {
world.superJumpsLeft++;
}
} else if (type == "time") {
addTime(powerUp.secBonus);
} else if (type == "money") {
addTrickMoney(powerUp.centsBonus);
}
}
function playerMoveToNewTown() {
removeAllItems();
removeAllPowerUps();
if (player.moveStatus == "skateUp1") {
world.playerCurrentStreetNum = world.intersection2Num;
if (world.playerCurrentTownId == 0) {
world.playerCurrentTownId = 1;
} else if (world.playerCurrentTownId == 1) {
world.playerCurrentTownId = 2;
} else if (world.playerCurrentTownId == 2) {
world.playerCurrentTownId = 0;
}
} else if (player.moveStatus == "skateUp2") {
world.playerCurrentStreetNum = world.intersection1Num;
if (world.playerCurrentTownId == 0) {
world.playerCurrentTownId = 2;
} else if (world.playerCurrentTownId == 1) {
world.playerCurrentTownId = 0;
} else if (world.playerCurrentTownId == 2) {
world.playerCurrentTownId = 1;
}
}
player.status = "normal";
bg.goalClip.removeMovieClip();
miniMap.currentPositionClip.removeMovieClip();
loadPlayer(world.playerCurrentStreetNum);
loadMap(world.playerCurrentTownId);
loadCurrentLocationClip();
}
function setPlayerTempPosition() {
player.xmov = player.xmov + player.xacc;
if (player.powerUpStatus != "none") {
if (game.frames > player.powerUpEndFrame) {
player.powerUpStatus = "none";
}
}
if (player.onObject == "ground") {
if (player.powerUpStatus == "speed") {
if (player.xmov > player.maxXPowerUpSpeed) {
player.xmov = player.maxXPowerUpSpeed;
} else if (player.xmov < (-player.maxXPowerUpSpeed)) {
player.xmov = -player.maxXPowerUpSpeed;
}
} else if (player.xmov > player.maxXSpeed) {
player.xmov = player.maxXSpeed;
} else if (player.xmov < (-player.maxXSpeed)) {
player.xmov = -player.maxXSpeed;
}
} else if (player.onObject == "air") {
if (player.powerUpStatus == "speed") {
if (player.xmov > player.maxXPowerUpSpeed) {
player.xmov = player.maxXPowerUpSpeed;
} else if (player.xmov < (-player.maxXPowerUpSpeed)) {
player.xmov = -player.maxXPowerUpSpeed;
}
} else if (player.xmov > player.maxXSpeed) {
player.xmov = player.maxXSpeed;
} else if (player.xmov < (-player.maxXSpeed)) {
player.xmov = -player.maxXSpeed;
}
} else if (player.onObject == "ramp") {
if (player.powerUpStatus == "speed") {
if (player.xmov > player.maxXPowerUpSpeedOnRamp) {
player.xmov = player.maxXPowerUpSpeedOnRamp;
} else if (player.xmov < (-player.maxXPowerUpSpeedOnRamp)) {
player.xmov = -player.maxXPowerUpSpeedOnRamp;
}
} else if (player.xmov > player.maxXSpeedOnRamp) {
player.xmov = player.maxXSpeedOnRamp;
} else if (player.xmov < (-player.maxXSpeedOnRamp)) {
player.xmov = -player.maxXSpeedOnRamp;
}
} else if (player.onObject == "horse") {
if (player.powerUpStatus == "speed") {
if (player.xmov > 0) {
if (player.xmov > player.maxXPowerUpSpeed) {
player.xmov = player.maxXPowerUpSpeed;
} else if (player.xmov < player.minXSpeedOnHorse) {
player.xmov = player.minXSpeedOnHorse;
}
} else if (player.xmov < (-player.maxXPowerUpSpeed)) {
player.xmov = -player.maxXPowerUpSpeed;
} else if (player.xmov > (-player.minXSpeedOnHorse)) {
player.xmov = -player.minXSpeedOnHorse;
}
} else if (player.xmov > 0) {
if (player.xmov > player.maxXSpeed) {
player.xmov = player.maxXSpeed;
} else if (player.xmov < player.minXSpeedOnHorse) {
player.xmov = player.minXSpeedOnHorse;
}
} else if (player.xmov < (-player.maxXSpeed)) {
player.xmov = -player.maxXSpeed;
} else if (player.xmov > (-player.minXSpeedOnHorse)) {
player.xmov = -player.minXSpeedOnHorse;
}
}
if (player.moveStatus == "jumpUp") {
player.ymov = player.ymov + player.yacc;
player.tempy = player.tempy + player.ymov;
if (player.ymov > 0) {
player.moveStatus = "jumpDown";
}
} else if (player.moveStatus == "jumpDown") {
player.ymov = player.ymov + player.yacc;
player.tempy = player.tempy + player.ymov;
if (player.tempy > 0) {
playSFX("land");
player.onSuperJump = false;
player.moveStatus = "jumpLand";
player.ymov = 0;
player.tempy = 0;
}
} else if (((((((player.moveStatus == "airTrick0") || (player.moveStatus == "airTrick1")) || (player.moveStatus == "airTrick2")) || (player.moveStatus == "airTrick3")) || (player.moveStatus == "airTrick4")) || (player.moveStatus == "airTrickEnd4")) || (player.moveStatus == "airTrick5")) {
player.ymov = player.ymov + player.yacc;
player.tempy = player.tempy + player.ymov;
if (player.tempy > 0) {
playSFX("crashBig");
player.moveStatus = "crash";
player.onObject = "ground";
player.nextClipLabel = "crash";
player.xmov = 0;
player.ymov = 0;
player.tempy = 0;
}
} else if (player.moveStatus == "jumpCrash") {
player.ymov = player.ymov + player.yacc;
player.tempy = player.tempy + player.ymov;
if (player.tempy > 0) {
player.onSuperJump = false;
player.ymov = 0;
player.tempy = 0;
}
} else if (player.moveStatus == "jumpRowUp") {
player.zmov = player.jumpRowSpeed;
var _local1 = bg.rowz_array[player.currentRow];
player.tempz = player.tempz + player.zmov;
if (player.tempz > _local1) {
player.tempz = _local1;
}
} else if (player.moveStatus == "jumpRowDown") {
player.zmov = -player.jumpRowSpeed;
var _local2 = bg.rowz_array[player.currentRow];
player.tempz = player.tempz + player.zmov;
if (player.tempz < _local2) {
player.tempz = _local2;
}
} else if (player.moveStatus == "skateUp1") {
player.xmov = 0;
player.ymov = 0;
} else if (player.moveStatus == "skateUp2") {
player.xmov = 0;
player.ymov = 0;
}
player.tempx = player.tempx + player.xmov;
var _local4 = (-bg.maxx) + (gameField.width / 2);
var _local3 = (-bg.minx) + (gameField.width / 2);
if (player.tempx < _local4) {
player.tempx = player.tempx + bg.width;
} else if (player.tempx > _local3) {
player.tempx = player.tempx - bg.width;
}
}
function updatePlayer() {
updatePlayerAnimations();
if (player.xmov > 0) {
player.clip._xscale = 100;
} else if (player.xmov < 0) {
player.clip._xscale = -100;
}
if (world.playerCurrentTownId == world.currentDelivery_obj.townId) {
if ((player.tempx > game.targetMinx) && (player.tempx < game.targetMaxx)) {
if (Math.abs(player.xmov) < game.deliverySpeed) {
deliveryCompleted();
}
} else if ((player.tempx > game.target2Minx) && (player.tempx < game.target2Maxx)) {
if (Math.abs(player.xmov) < game.deliverySpeed) {
deliveryCompleted();
}
}
}
player.x = player.tempx;
player.y = player.tempy;
player.z = player.tempz;
var _local1 = mapToScreen(player.x, player.y, player.z);
player.flashx = _local1[0];
player.flashy = _local1[1];
player.clip._x = player.flashx;
player.clip._y = player.flashy;
}
function updatePlayerAnimations() {
if (player.onObject == "ground") {
updatePlayerAnimationsOnGround();
} else if (player.onObject == "air") {
updatePlayerAnimationsOnAir();
} else if (player.onObject == "ramp") {
updatePlayerAnimationsOnRamp();
} else if (player.onObject == "horse") {
updatePlayerAnimationsOnHorse();
}
}
function updatePlayerAnimationsOnGround() {
if (player.lastMoveStatus == "rest") {
if (player.moveStatus == "accelerate") {
player.nextClipLabel = "accelerate";
} else if (player.moveStatus == "brake") {
player.nextClipLabel = "brake";
} else if (player.moveStatus == "jumpReady") {
player.nextClipLabel = "jumpReady";
} else if (player.moveStatus == "jumpRowUpStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "jumpRowDownStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
}
} else if (player.lastMoveStatus == "slow") {
if (player.moveStatus == "accelerate") {
player.nextClipLabel = "accelerate";
} else if (player.moveStatus == "brake") {
player.nextClipLabel = "brake";
} else if (player.moveStatus == "rest") {
player.nextClipLabel = "stop";
} else if (player.moveStatus == "jumpReady") {
player.nextClipLabel = "jumpReady";
} else if (player.moveStatus == "jumpRowUpStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "jumpRowDownStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
} else if (player.moveStatus == "groundTrick0") {
player.nextClipLabel = "groundTrick0";
} else if (player.moveStatus == "groundTrick1") {
player.nextClipLabel = "groundTrick1";
} else if (player.moveStatus == "groundTrick2") {
player.nextClipLabel = "groundTrick2";
}
} else if (player.lastMoveStatus == "accelerate") {
if (player.moveStatus == "brake") {
player.nextClipLabel = "brake";
} else if (player.moveStatus == "slow") {
player.nextClipLabel = "slow";
} else if (player.moveStatus == "jumpReady") {
player.nextClipLabel = "jumpReady";
} else if (player.moveStatus == "jumpRowUpStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "jumpRowDownStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
} else if (player.moveStatus == "groundTrick0") {
player.nextClipLabel = "groundTrick0";
} else if (player.moveStatus == "groundTrick1") {
player.nextClipLabel = "groundTrick1";
} else if (player.moveStatus == "groundTrick2") {
player.nextClipLabel = "groundTrick2";
}
} else if (player.lastMoveStatus == "brake") {
if (player.moveStatus == "accelerate") {
player.nextClipLabel = "accelerate";
} else if (player.moveStatus == "slow") {
player.nextClipLabel = "slow";
} else if (player.moveStatus == "rest") {
player.nextClipLabel = "stop";
} else if (player.moveStatus == "jumpReady") {
player.nextClipLabel = "jumpReady";
} else if (player.moveStatus == "jumpRowUpStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "jumpRowDownStart") {
player.nextClipLabel = "jumpRowStart";
} else if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
} else if (player.moveStatus == "groundTrick0") {
player.nextClipLabel = "groundTrick0";
} else if (player.moveStatus == "groundTrick1") {
player.nextClipLabel = "groundTrick1";
} else if (player.moveStatus == "groundTrick2") {
player.nextClipLabel = "groundTrick2";
}
} else if (player.lastMoveStatus == "jumpReady") {
if (player.moveStatus == "jumpUp") {
player.onObject = "air";
player.nextClipLabel = "jumpUp";
} else if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
}
} else if (player.lastMoveStatus == "jumpLand") {
if (player.moveStatus == "rest") {
player.nextClipLabel = "rest";
}
} else if (((player.lastMoveStatus == "groundTrick0") || (player.lastMoveStatus == "groundTrick1")) || (player.lastMoveStatus == "groundTrick2")) {
if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
}
} else if (((player.lastMoveStatus == "groundTrickEnd0") || (player.lastMoveStatus == "groundTrickEnd1")) || (player.lastMoveStatus == "groundTrickEnd2")) {
if (player.moveStatus == "crash") {
player.nextClipLabel = "crash";
}
}
if (((player.nextClipLabel == "stop") || (player.nextClipLabel == "rest")) || (player.nextClipLabel == "jumpReady")) {
player.animationClip.gotoAndStop(player.nextClipLabel);
} else if ((((((player.nextClipLabel == "accelerate") || (player.nextClipLabel == "brake")) || (player.nextClipLabel == "slow")) || (player.nextClipLabel == "jumpUp")) || (player.nextClipLabel == "jumpRowStart")) || (player.nextClipLabel == "crash")) {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "skateUp") {
player.clip.gotoAndPlay("up");
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "groundTrick0") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "groundTrick1") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "groundTrick2") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.animationClip._currentframe == player.lastMoveFrame) {
player.animationClip.gotoAndPlay("move");
} else if (player.animationClip._currentframe == player.lastAccelerateFrame) {
player.animationClip.gotoAndPlay("accelerate");
} else if (player.animationClip._currentframe == player.lastSlowFrame) {
player.animationClip.gotoAndPlay("move");
} else if (player.animationClip._currentframe == player.lastBrakeFrame) {
player.animationClip.stop();
} else if (player.animationClip._currentframe == player.lastCrashFrame) {
player.moveStatus = "rest";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastJumpLandFrame) {
player.moveStatus = "rest";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastJumpRowStartFrame) {
if (player.lastMoveStatus == "jumpRowUpStart") {
player.moveStatus = "jumpRowUp";
} else if (player.lastMoveStatus == "jumpRowDownStart") {
player.moveStatus = "jumpRowDown";
}
player.animationClip.gotoAndPlay("jumpRow");
} else if (player.animationClip._currentframe == player.lastJumpRowFrame) {
player.tempz = bg.rowz_array[player.currentRow];
player.moveStatus = "rest";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastSkateUpFrame) {
playerMoveToNewTown();
player.moveStatus = "rest";
player.clip.gotoAndStop("normal");
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastGroundTrick0Frame) {
addTrickMoney(score.groundTrick0);
player.moveStatus = "rest";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastGroundTrick1Frame) {
addTrickMoney(score.groundTrick1);
player.moveStatus = "rest";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastGroundTrick2Frame) {
addTrickMoney(score.groundTrick2);
player.moveStatus = "rest";
player.animationClip.gotoAndStop("rest");
}
player.nextClipLabel = "none";
}
function updatePlayerAnimationsOnAir() {
if (player.lastMoveStatus == "accelerate") {
if (player.moveStatus == "jumpUp") {
player.nextClipLabel = "jumpUp";
}
} else if (player.lastMoveStatus == "jumpUp") {
if (player.moveStatus == "jumpDown") {
player.nextClipLabel = "jumpDown";
} else if (player.moveStatus == "jumpCrash") {
player.nextClipLabel = "jumpCrash";
} else if (player.moveStatus == "landHorse") {
player.onObject = "horse";
player.nextClipLabel = "rest";
} else if (player.moveStatus == "airTrick0") {
player.nextClipLabel = "airTrick0";
} else if (player.moveStatus == "airTrick1") {
player.nextClipLabel = "airTrick1";
} else if (player.moveStatus == "airTrick2") {
player.nextClipLabel = "airTrick2";
} else if (player.moveStatus == "airTrick3") {
player.nextClipLabel = "airTrick3";
} else if (player.moveStatus == "airTrick4") {
player.nextClipLabel = "airTrick4";
} else if (player.moveStatus == "airTrick5") {
player.nextClipLabel = "airTrick5";
}
} else if (player.lastMoveStatus == "jumpDown") {
if (player.moveStatus == "jumpLand") {
player.onObject = "ground";
player.nextClipLabel = "jumpLand";
} else if (player.moveStatus == "jumpCrash") {
player.nextClipLabel = "jumpCrash";
} else if (player.moveStatus == "landHorse") {
player.onObject = "horse";
player.nextClipLabel = "rest";
} else if (player.moveStatus == "airTrick0") {
player.nextClipLabel = "airTrick0";
} else if (player.moveStatus == "airTrick1") {
player.nextClipLabel = "airTrick1";
} else if (player.moveStatus == "airTrick2") {
player.nextClipLabel = "airTrick2";
} else if (player.moveStatus == "airTrick3") {
player.nextClipLabel = "airTrick3";
} else if (player.moveStatus == "airTrick4") {
player.nextClipLabel = "airTrick4";
} else if (player.moveStatus == "airTrick5") {
player.nextClipLabel = "airTrick5";
}
} else if ((((((player.lastMoveStatus == "airTrick0") || (player.lastMoveStatus == "airTrick1")) || (player.lastMoveStatus == "airTrick2")) || (player.lastMoveStatus == "airTrick3")) || (player.lastMoveStatus == "airTrick4")) || (player.lastMoveStatus == "airTrick5")) {
if (player.moveStatus == "airTrickEnd4") {
player.nextClipLabel = "airTrickEnd4";
} else if (player.moveStatus == "landHorse") {
player.onObject = "horse";
player.nextClipLabel = "rest";
} else if (player.moveStatus == "jumpCrash") {
player.nextClipLabel = "jumpCrash";
}
} else if ((((((player.lastMoveStatus == "airTrickEnd0") || (player.lastMoveStatus == "airTrickEnd1")) || (player.lastMoveStatus == "airTrickEnd2")) || (player.lastMoveStatus == "airTrickEnd3")) || (player.lastMoveStatus == "airTrickEnd4")) || (player.lastMoveStatus == "airTrickEnd5")) {
if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
} else if (player.moveStatus == "landHorse") {
player.onObject = "horse";
player.nextClipLabel = "rest";
} else if (player.moveStatus == "jumpCrash") {
player.nextClipLabel = "jumpCrash";
}
}
if (player.nextClipLabel == "jumpLand") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "jumpUp") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "jumpDown") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "rest") {
player.animationClip.gotoAndStop(player.nextClipLabel);
} else if (player.nextClipLabel == "jumpCrash") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrick0") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrick1") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrick2") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrick3") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrick4") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrickEnd4") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "airTrick5") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.animationClip._currentframe == player.lastJumpUpFrame) {
player.moveStatus = "jumpDown";
player.animationClip.gotoAndPlay("jumpDown");
} else if (player.animationClip._currentframe == player.lastJumpDownFrame) {
player.animationClip.stop();
} else if (player.animationClip._currentframe == player.lastJumpCrashFrame) {
player.moveStatus = "rest";
player.onObject = "ground";
player.animationClip.gotoAndStop("stop");
} else if (player.animationClip._currentframe == player.lastAirTrick0Frame) {
var _local2 = getCurrentTrickInArray("airTrick0");
var _local1 = Math.round(score.airTrick0 / Math.pow(2, _local2));
if (_local1 < 1) {
_local1 = 1;
}
addTrickMoney(_local1);
addCurrentTrick("airTrick0");
if (player.onSuperJump) {
addTrickMoney(_local1 * score.superJumpRatio);
} else {
addTrickMoney(_local1);
}
player.moveStatus = "jumpDown";
player.animationClip.gotoAndStop("jumpDown");
} else if (player.animationClip._currentframe == player.lastAirTrick1Frame) {
var _local2 = getCurrentTrickInArray("airTrick1");
var _local1 = Math.round(score.airTrick1 / Math.pow(2, _local2));
if (_local1 < 1) {
_local1 = 1;
}
addTrickMoney(_local1);
addCurrentTrick("airTrick1");
if (player.onSuperJump) {
addTrickMoney(_local1 * score.superJumpRatio);
} else {
addTrickMoney(_local1);
}
player.moveStatus = "jumpDown";
player.animationClip.gotoAndStop("jumpDown");
} else if (player.animationClip._currentframe == player.lastAirTrick2Frame) {
var _local2 = getCurrentTrickInArray("airTrick2");
var _local1 = Math.round(score.airTrick2 / Math.pow(2, _local2));
if (_local1 < 1) {
_local1 = 1;
}
addTrickMoney(_local1);
addCurrentTrick("airTrick2");
if (player.onSuperJump) {
addTrickMoney(_local1 * score.superJumpRatio);
} else {
addTrickMoney(_local1);
}
player.moveStatus = "jumpDown";
player.animationClip.gotoAndStop("jumpDown");
} else if (player.animationClip._currentframe == player.lastAirTrick3EndFrame) {
var _local2 = getCurrentTrickInArray("airTrick3");
var _local1 = Math.round(score.airTrick3 / Math.pow(2, _local2));
if (_local1 < 1) {
_local1 = 1;
}
addTrickMoney(_local1);
addCurrentTrick("airTrick3");
if (player.onSuperJump) {
addTrickMoney(_local1 * score.superJumpRatio);
} else {
addTrickMoney(_local1);
}
player.moveStatus = "jumpDown";
player.animationClip.gotoAndStop("jumpDown");
} else if (player.animationClip._currentframe == player.lastAirTrick4Frame) {
player.animationClip.stop();
} else if (player.animationClip._currentframe == player.lastAirTrick4EndFrame) {
player.moveStatus = "jumpDown";
player.animationClip.gotoAndStop("jumpDown");
} else if (player.animationClip._currentframe == player.lastAirTrick5EndFrame) {
var _local2 = getCurrentTrickInArray("airTrick5");
var _local1 = Math.round(score.airTrick5 / Math.pow(2, _local2));
if (_local1 < 1) {
_local1 = 1;
}
addTrickMoney(_local1);
addCurrentTrick("airTrick5");
if (player.onSuperJump) {
addTrickMoney(_local1 * score.superJumpRatio);
} else {
addTrickMoney(_local1);
}
player.moveStatus = "jumpDown";
player.animationClip.gotoAndStop("jumpDown");
}
player.nextClipLabel = "none";
}
function updatePlayerAnimationsOnRamp() {
if ((((player.lastMoveStatus == "rest") || (player.lastMoveStatus == "slow")) || (player.lastMoveStatus == "accelerate")) || (player.lastMoveStatus == "brake")) {
if (player.moveStatus == "jumpReady") {
player.nextClipLabel = "jumpReady";
}
} else if (player.lastMoveStatus == "jumpReady") {
if (player.moveStatus == "jumpUp") {
player.onObject = "air";
player.nextClipLabel = "jumpUp";
}
}
if (player.nextClipLabel == "jumpReady") {
player.animationClip.gotoAndStop(player.nextClipLabel);
} else if (player.nextClipLabel == "jumpUp") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
}
player.nextClipLabel = "none";
}
function updatePlayerAnimationsOnHorse() {
if (player.lastMoveStatus == "landHorse") {
if (player.moveStatus == "jumpReadyOnHorse") {
player.nextClipLabel = "jumpReady";
} else if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
} else if (player.moveStatus == "horseTrick0") {
player.nextClipLabel = "horseTrick0";
} else if (player.moveStatus == "horseTrick1") {
player.nextClipLabel = "horseTrick1";
} else if (player.moveStatus == "horseTrick2") {
var _local2 = getCurrentTrickInArray("horseTrick2");
var _local1 = Math.round(score.horseTrick2 / Math.pow(2, _local2));
if (_local1 < 1) {
_local1 = 1;
}
addTrickMoney(_local1);
addCurrentTrick("horseTrick2");
player.nextClipLabel = "horseTrick2";
}
} else if (player.lastMoveStatus == "jumpReadyOnHorse") {
if (player.moveStatus == "jumpUp") {
player.onObject = "air";
player.nextClipLabel = "jumpUp";
} else if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
}
} else if (player.lastMoveStatus == "horseTrick0") {
if (player.moveStatus == "horseTrickEnd0") {
player.nextClipLabel = "horseTrickEnd0";
} else if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
}
} else if (player.lastMoveStatus == "horseTrickEnd0") {
if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
}
} else if (player.lastMoveStatus == "horseTrick1") {
if (player.moveStatus == "horseTrickEnd1") {
player.nextClipLabel = "horseTrickEnd1";
} else if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
}
} else if (player.lastMoveStatus == "horseTrickEnd1") {
if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
}
} else if (player.lastMoveStatus == "horseTrick2") {
if (player.moveStatus == "jumpDown") {
player.onObject = "air";
player.nextClipLabel = "jumpDown";
}
}
if ((player.nextClipLabel == "jumpUp") || (player.nextClipLabel == "jumpDown")) {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "jumpReady") {
player.animationClip.gotoAndStop(player.nextClipLabel);
} else if (player.nextClipLabel == "horseTrick0") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "horseTrickEnd0") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "horseTrick1") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "horseTrickEnd1") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.nextClipLabel == "horseTrick2") {
player.animationClip.gotoAndPlay(player.nextClipLabel);
} else if (player.animationClip._currentframe == player.lastHorseTrick0Frame) {
player.animationClip.stop();
} else if (player.animationClip._currentframe == player.lastHorseTrick0EndFrame) {
player.moveStatus = "landHorse";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastHorseTrick1Frame) {
player.animationClip.stop();
} else if (player.animationClip._currentframe == player.lastHorseTrick1EndFrame) {
player.moveStatus = "landHorse";
player.animationClip.gotoAndStop("rest");
} else if (player.animationClip._currentframe == player.lastHorseTrick2Frame) {
player.moveStatus = "landHorse";
player.animationClip.gotoAndStop("rest");
}
player.nextClipLabel = "none";
}
function loadItems(id) {
var _local3 = main["town" + id];
var _local2 = 0;
while (_local2 < _local3.item_array.length) {
main["item" + _local2] = {};
var _local1 = main["item" + _local2];
_local1.type = _local3.item_array[_local2].type;
_local1.row = _local3.item_array[_local2].row;
_local1.direction = _local3.item_array[_local2].direction;
_local1.x = _local3.item_array[_local2].x;
_local1.z = bg.rowz_array[_local1.row];
_local1.y = 0;
if (_local1.type == "ramp") {
if (_local1.direction == "left") {
var _local6 = "rampLeft";
} else {
var _local6 = "rampRight";
}
} else {
var _local6 = _local1.type;
}
var _local7 = ("item" + _local2) + "_mc";
var _local5 = (gameDepth[("row" + _local1.row) + "Max"] - _local2) - 1;
_local1.clip = bg.clip.attachMovie(_local6, _local7, _local5);
var _local4 = mapToScreen(_local1.x, _local1.y, _local1.z);
_local1.flashx = _local4[0];
_local1.flashy = _local4[1];
_local1.clip._x = _local1.flashx;
_local1.clip._y = _local1.flashy;
if (_local1.direction == "right") {
_local1.clip._xscale = -100;
}
if (_local1.direction == "right") {
if (_local1.type == "ramp") {
_local1.clip._xscale = 100;
} else {
_local1.clip._xscale = -100;
}
}
if ((_local1.x >= 0) && (_local1.x < bg.streetWidth)) {
if (_local1.type == "ramp") {
if (_local1.direction == "left") {
var _local6 = "rampLeft";
} else {
var _local6 = "rampRight";
}
} else {
var _local6 = _local1.type;
}
_local7 = ("item_2" + _local2) + "_mc";
_local5 = (gameDepth[("row" + _local1.row) + "Max"] - _local2) - 500;
_local1.clip2 = bg.clip.attachMovie(_local6, _local7, _local5);
_local1.x2 = _local1.x + bg.width;
_local1.z2 = bg.rowz_array[_local1.row];
_local1.y2 = 0;
_local4 = mapToScreen(_local1.x2, _local1.y, _local1.z);
_local1.flashx2 = _local4[0];
_local1.flashy2 = _local4[1];
_local1.clip2._x = _local1.flashx2;
_local1.clip2._y = _local1.flashy2;
if (_local1.direction == "right") {
if (_local1.type == "ramp") {
_local1.clip2._xscale = 100;
} else {
_local1.clip2._xscale = -100;
}
}
} else {
_local1.x2 = -1;
_local1.z2 = -1;
_local1.y2 = -1;
}
if (_local1.type == "cone") {
_local1.width = cone.width;
_local1.height = cone.height;
_local1.jumpMoney = cone.jumpMoney;
} else if (_local1.type == "bin") {
_local1.width = bin.width;
_local1.height = bin.height;
_local1.jumpMoney = bin.jumpMoney;
} else if (_local1.type == "hydrant") {
_local1.width = hydrant.width;
_local1.height = hydrant.height;
_local1.jumpMoney = hydrant.jumpMoney;
} else if (_local1.type == "garbageCan") {
_local1.width = garbageCan.width;
_local1.height = garbageCan.height;
_local1.jumpMoney = garbageCan.jumpMoney;
} else if (_local1.type == "planter") {
_local1.width = planter.width;
_local1.height = planter.height;
_local1.jumpMoney = planter.jumpMoney;
} else if (_local1.type == "longPlanter") {
_local1.width = longPlanter.width;
_local1.height = longPlanter.height;
_local1.jumpMoney = longPlanter.jumpMoney;
} else if (_local1.type == "streetSignUptown") {
_local1.width = streetSignUptown.width;
_local1.height = streetSignUptown.height;
_local1.jumpMoney = streetSignUptown.jumpMoney;
} else if (_local1.type == "streetSignMidtown") {
_local1.width = streetSignMidtown.width;
_local1.height = streetSignMidtown.height;
_local1.jumpMoney = streetSignMidtown.jumpMoney;
} else if (_local1.type == "streetSignDowntown") {
_local1.width = streetSignDowntown.width;
_local1.height = streetSignDowntown.height;
_local1.jumpMoney = streetSignDowntown.jumpMoney;
} else if (_local1.type == "oldLady") {
_local1.width = oldLady.width;
_local1.height = oldLady.height;
_local1.jumpMoney = oldLady.jumpMoney;
if (_local1.direction == "down") {
_local1.clip.animation_mc.gotoAndPlay("down");
} else {
_local1.clip.animation_mc.gotoAndPlay("up");
}
} else if (_local1.type == "bench") {
_local1.width = bench.width;
_local1.height = bench.height;
_local1.jumpMoney = bench.jumpMoney;
} else if (_local1.type == "longBench") {
_local1.width = longBench.width;
_local1.height = longBench.height;
_local1.jumpMoney = longBench.jumpMoney;
} else if (_local1.type == "horseVer") {
_local1.width = horseVer.width;
_local1.height = horseVer.height;
_local1.jumpMoney = horseVer.jumpMoney;
} else if (_local1.type == "horseHor") {
_local1.width = horseHor.width;
_local1.height = horseHor.height;
_local1.jumpMoney = horseHor.jumpMoney;
} else if (_local1.type == "ramp") {
_local1.width = ramp.width;
_local1.height = ramp.height;
_local1.jumpMoney = ramp.jumpMoney;
}
_local2++;
}
}
function removeAllItems() {
var _local3 = main["town" + world.playerCurrentTownId];
var _local1 = 0;
while (_local1 < _local3.item_array.length) {
var _local2 = main["item" + _local1];
_local2.clip.removeMovieClip();
_local2.clip2.removeMovieClip();
_local2 = {};
_local1++;
}
}
function isItemRowUp() {
var _local5 = player.currentRow - 1;
var _local6 = main["town" + world.playerCurrentTownId];
var _local2 = 0;
while (_local2 < _local6.item_array.length) {
var _local1 = main["item" + _local2];
if (_local1.row == _local5) {
var _local4 = _local1.x - (_local1.width / 2);
var _local3 = _local1.x + (_local1.width / 2);
if ((player.tempx > _local4) && (player.tempx < _local3)) {
return(true);
}
}
_local2++;
}
return(false);
}
function isItemRowDown() {
var _local5 = player.currentRow + 1;
var _local6 = main["town" + world.playerCurrentTownId];
var _local2 = 0;
while (_local2 < _local6.item_array.length) {
var _local1 = main["item" + _local2];
if (_local1.row == _local5) {
var _local4 = _local1.x - (_local1.width / 2);
var _local3 = _local1.x + (_local1.width / 2);
if ((player.tempx > _local4) && (player.tempx < _local3)) {
return(true);
}
}
_local2++;
}
return(false);
}
function updateItems() {
var _local12 = world.playerCurrentTownId;
var _local11 = main["town" + _local12];
var _local5 = 0;
while (_local5 < _local11.item_array.length) {
var _local1 = main["item" + _local5];
if (_local1.type == "oldLady") {
var _local8 = bg.rowz_array[bg.rowz_array.length - 1];
var _local6 = bg.rowz_array[0];
var _local7 = oldLady.speed;
if (_local1.direction == "up") {
_local1.z = _local1.z + _local7;
if (_local1.z > _local6) {
_local1.z = _local6;
_local1.direction = "down";
_local1.clip.animation_mc.gotoAndPlay("down");
}
} else if (_local1.direction == "down") {
_local1.z = _local1.z - _local7;
if (_local1.z < _local8) {
_local1.z = _local8;
_local1.direction = "up";
_local1.clip.animation_mc.gotoAndPlay("up");
}
}
var _local4 = 9999;
var _local2 = 0;
while (_local2 < bg.rowz_array.length) {
var _local3 = Math.abs(_local1.z - bg.rowz_array[_local2]);
if (_local3 < _local4) {
_local4 = _local3;
_local1.row = _local2;
}
_local2++;
}
var _local10 = (gameDepth[("row" + _local1.row) + "Max"] - _local5) - 1;
_local1.clip.swapDepths(_local10);
var _local9 = mapToScreen(_local1.x, _local1.y, _local1.z);
_local1.flashx = _local9[0];
_local1.flashy = _local9[1];
_local1.clip._x = _local1.flashx;
_local1.clip._y = _local1.flashy;
}
_local5++;
}
}
function loadPowerUps(id) {
var _local3 = main["town" + id];
var _local2 = 0;
while (_local2 < _local3.powerUp_array.length) {
main["powerUp" + _local2] = {};
var _local1 = main["powerUp" + _local2];
_local1.type = _local3.powerUp_array[_local2].type;
_local1.row = _local3.powerUp_array[_local2].row;
_local1.x = _local3.powerUp_array[_local2].x;
_local1.z = bg.rowz_array[_local1.row];
_local1.y = _local3.powerUp_array[_local2].y;
_local1.status = "normal";
var _local6 = "powerUp";
var _local7 = ("powerUp" + _local2) + "_mc";
var _local5 = (gameDepth[("row" + _local1.row) + "Max"] - _local2) - 250;
_local1.clip = bg.clip.attachMovie(_local6, _local7, _local5);
_local1.itemClip = _local1.clip.animation_mc.item_mc;
var _local4 = mapToScreen(_local1.x, _local1.y, _local1.z);
_local1.flashx = _local4[0];
_local1.flashy = _local4[1];
_local1.clip._x = _local1.flashx;
_local1.clip._y = _local1.flashy;
_local1.itemClip.gotoAndStop(_local1.type);
if ((_local1.x >= 0) && (_local1.x < bg.streetWidth)) {
_local6 = "powerUp";
_local7 = ("powerUp_2" + _local2) + "_mc";
_local5 = (gameDepth[("row" + _local1.row) + "Max"] - _local2) - 350;
_local1.clip2 = bg.clip.attachMovie(_local6, _local7, _local5);
_local1.x2 = _local1.x + bg.width;
_local1.z2 = bg.rowz_array[_local1.row];
_local1.y2 = _local1.height;
_local4 = mapToScreen(_local1.x2, _local1.y, _local1.z);
_local1.flashx2 = _local4[0];
_local1.flashy2 = _local4[1];
_local1.clip2._x = _local1.flashx2;
_local1.clip2._y = _local1.flashy2;
} else {
_local1.x2 = -1;
_local1.z2 = -1;
_local1.y2 = -1;
}
_local2++;
}
}
function removeAllPowerUps() {
var _local3 = main["town" + world.playerCurrentTownId];
var _local2 = 0;
while (_local2 < _local3.powerUp_array.length) {
var _local1 = main["powerUp" + _local2];
_local1.clip.removeMovieClip();
_local1.clip2.removeMovieClip();
_local1 = {};
_local2++;
}
}
function loadMap(id) {
var _local2 = main["town" + id];
var _local1 = 0;
while (_local1 < (_local2.map_array.length - 1)) {
var _local4 = _local2.map_array[_local1];
loadMapSection(id, _local1);
_local1++;
}
loadMapEnd(id);
bg.streets = _local2.map_array.length;
bg.width = bg.streetWidth * (bg.streets - 1);
bg.minx = (-bg.width) - gameField.width;
bg.maxx = 0;
if (id == world.currentDelivery_obj.townId) {
loadDeliveryGoal(id);
}
loadItems(id);
loadPowerUps(id);
setMapIntersections();
updateBG();
}
function setMapIntersections() {
world.intersection1Num = 44;
world.intersection2Num = 54;
game.intersection1Minx = (world.intersection1Num * bg.houseWidth) + (bg.houseWidth / 4);
game.intersection1Maxx = game.intersection1Minx + (bg.houseWidth / 2);
game.intersection2Minx = (world.intersection2Num * bg.houseWidth) + (bg.houseWidth / 4);
game.intersection2Maxx = game.intersection2Minx + (bg.houseWidth / 2);
}
function loadMapSection(id, section) {
var _local5 = main["level" + world.currentLevel];
var _local9 = main["town" + id];
var _local2 = _local9.map_array[section];
var _local7 = (("map" + id) + "_") + section;
var _local11 = ((("map" + id) + "_") + section) + "_mc";
var _local6 = gameDepth.map + section;
_local2.clip = bg.clip.attachMovie(_local7, _local11, _local6);
_local2.clip._x = getSectionX(id, section);
_local2.clip._y = 0;
world.town_array[0].unlocked = _local5.townsUnlocked_array[0];
world.town_array[1].unlocked = _local5.townsUnlocked_array[1];
world.town_array[2].unlocked = _local5.townsUnlocked_array[2];
if (id == 0) {
var _local10 = world.town_array[1];
var _local8 = world.town_array[2];
if (section == 4) {
_local2.clip.sign_mc.gotoAndStop(2);
if (_local10.unlocked) {
_local2.clip.block_mc._alpha = 0;
} else {
_local2.clip.block_mc._alpha = 100;
}
} else if (section == 5) {
_local2.clip.sign_mc.gotoAndStop(3);
if (_local8.unlocked) {
_local2.clip.block_mc._alpha = 0;
} else {
_local2.clip.block_mc._alpha = 100;
}
}
} else if (id == 1) {
var _local10 = world.town_array[2];
var _local8 = world.town_array[0];
if (section == 4) {
_local2.clip.sign_mc.gotoAndStop(3);
if (_local10.unlocked) {
_local2.clip.block_mc._alpha = 0;
} else {
_local2.clip.block_mc._alpha = 100;
}
} else if (section == 5) {
_local2.clip.sign_mc.gotoAndStop(1);
if (_local8.unlocked) {
_local2.clip.block_mc._alpha = 0;
} else {
_local2.clip.block_mc._alpha = 100;
}
}
} else if (id == 2) {
var _local10 = world.town_array[0];
var _local8 = world.town_array[1];
if (section == 4) {
_local2.clip.sign_mc.gotoAndStop(1);
if (_local10.unlocked) {
_local2.clip.block_mc._alpha = 0;
} else {
_local2.clip.block_mc._alpha = 100;
}
} else if (section == 5) {
_local2.clip.sign_mc.gotoAndStop(2);
if (_local8.unlocked) {
_local2.clip.block_mc._alpha = 0;
} else {
_local2.clip.block_mc._alpha = 100;
}
}
}
var _local1 = 0;
while (_local1 < bg.housesPerStreet) {
_local2.clip[("buildingNum" + _local1) + "_mc"].number_txt.text = ((_local1 + (section * bg.housesPerStreet)) * 2) + world.town_array[id].streetNumStreetFrom;
_local1++;
}
}
function loadMapEnd(id) {
var _local6 = main["town" + id];
var _local5 = _local6.map_array.length - 1;
var _local3 = _local6.map_array[_local5];
var _local8 = ("map" + id) + "_0";
var _local9 = ((("map" + id) + "_") + _local5) + "_mc";
var _local7 = gameDepth.map + _local5;
_local3.clip = bg.clip.attachMovie(_local8, _local9, _local7);
_local3.clip._x = getSectionX(id, _local5);
_local3.clip._y = 0;
var _local1 = 0;
while (_local1 < bg.housesPerStreet) {
var _local2 = 0;
_local3.clip[("buildingNum" + _local1) + "_mc"].number_txt.text = ((_local1 + (_local2 * bg.housesPerStreet)) * 2) + world.town_array[id].streetNumStreetFrom;
_local1++;
}
}
function loadDeliveryGoal(id) {
var _local5 = main["town" + id];
var _local1 = world.currentDelivery_obj.streetNum;
var _local3 = "deliveryGoal";
var _local4 = "deliveryGoal_mc";
var _local2 = gameDepth.deliveryGoal;
bg.goalClip = bg.clip.attachMovie(_local3, _local4, _local2);
bg.goalClip._x = (_local1 * bg.houseWidth) + (bg.houseWidth / 3);
bg.goalClip._y = 159;
game.targetMinx = bg.goalClip._x;
game.targetMaxx = bg.goalClip._x + (bg.houseWidth / 3);
if ((bg.goalClip._x >= 0) && (bg.goalClip._x < bg.streetWidth)) {
_local3 = "deliveryGoal";
_local4 = "deliveryGoal2_mc";
_local2 = gameDepth.deliveryGoal + 1;
bg.goalClip2 = bg.clip.attachMovie(_local3, _local4, _local2);
bg.goalClip2._x = ((_local1 * bg.houseWidth) + bg.width) + (bg.houseWidth / 3);
bg.goalClip2._y = 159;
game.target2Minx = bg.goalClip2._x;
game.target2Maxx = bg.goalClip2._x + (bg.houseWidth / 3);
}
}
function getSectionX(id, section) {
var _local4 = main["town" + id];
var _local2 = 0;
var _local1 = 0;
while (_local1 < section) {
_local2 = _local2 + bg.streetWidth;
_local1++;
}
return(_local2);
}
function unloadMapSection(id, section) {
var _local2 = main["town" + id];
var _local1 = _local2.map_array[section];
_local1.clip = bg.clip.unloadMovie();
}
function updateBG() {
bg.x = (gameField.width / 2) - player.flashx;
var _local1 = mapToScreen(bg.x, bg.y, bg.z);
bg.flashx = _local1[0];
if (bg.x < bg.minx) {
bg.x = bg.x + bg.width;
} else if (bg.x > bg.maxx) {
bg.x = bg.x - bg.width;
}
bg.clip._x = bg.x;
}
function loadMiniMap() {
loadCurrentLocationClip();
loadDeliveryLocationsClip();
}
function updateMiniMap() {
updateCurrentLocationClip();
}
function loadCurrentLocationClip() {
var _local1 = world.playerCurrentTownId;
var _local8 = world.town_array[_local1];
var _local3 = world.playerCurrentStreetNum;
var _local4 = miniMap[("town" + _local1) + "Clip"];
var _local5 = (_local3 / world.maxStreetNum) * 360;
var _local2 = (_local5 * Math.PI) / 180;
var _local7 = miniMap.radius * Math.cos(_local2);
var _local6 = miniMap.radius * Math.sin(_local2);
miniMap.currentPositionClip = _local4.attachMovie("symbol current location", "currentLocation_mc", 1);
miniMap.currentPositionClip._x = _local7;
miniMap.currentPositionClip._y = _local6;
if (_local1 == 0) {
miniMap.currentPositionClip._rotation = -90;
} else if (_local1 == 1) {
miniMap.currentPositionClip._rotation = 150;
} else if (_local1 == 2) {
miniMap.currentPositionClip._rotation = 30;
}
}
function loadDeliveryLocationsClip() {
var _local1 = world.currentDelivery_obj.townId;
var _local8 = world.town_array[_local1];
var _local3 = world.currentDelivery_obj.streetNum;
var _local4 = miniMap[("town" + _local1) + "Clip"];
var _local5 = (_local3 / world.maxStreetNum) * 360;
var _local2 = (_local5 * Math.PI) / 180;
var _local7 = miniMap.radius * Math.cos(_local2);
var _local6 = miniMap.radius * Math.sin(_local2);
miniMap.deliveryPositionClip = _local4.attachMovie("symbol current delivery location", "deliveryLocation_mc", 0);
miniMap.deliveryPositionClip._x = _local7;
miniMap.deliveryPositionClip._y = _local6;
miniMap.deliveryPositionClip._rotation = -90;
}
function updateCurrentLocationClip() {
var _local1 = world.playerCurrentTownId;
var _local8 = world.town_array[_local1];
var _local3 = (player.x - (bg.houseWidth / 2)) / bg.houseWidth;
var _local7 = miniMap[("town" + _local1) + "Clip"];
var _local4 = (_local3 / world.maxStreetNum) * 360;
var _local2 = (_local4 * Math.PI) / 180;
var _local6 = miniMap.radius * Math.cos(_local2);
var _local5 = miniMap.radius * Math.sin(_local2);
miniMap.currentPositionClip._x = _local6;
miniMap.currentPositionClip._y = _local5;
}
function initialGameVariables() {
gameDepth = {};
gameDepth.action = 0;
gameDepth.map = 1;
gameDepth.deliveryGoal = 100;
gameDepth.itemInit = 1000;
gameDepth.row0Max = 3000;
gameDepth.row1Max = 4000;
gameDepth.row2Max = 5000;
gameDepth.row3Max = 6000;
gameDepth.popUpPoint = 8000;
game = {};
game.gravity = 0.5;
game.targetMinx = 0;
game.targetMaxx = 0;
game.target2Minx = 0;
game.target2Maxx = 0;
game.intersection1Minx = 0;
game.intersection1Maxx = 0;
game.intersection2Minx = 0;
game.intersection2Maxx = 0;
game.deliverySpeed = 1;
game.superJumpsMax = 5;
game.framesPogoPopUpDelay = 24;
game.deliveryPopUpFrame = 0;
game.status = "ready";
game.currentTrick_array = [];
game.frames = 0;
game.keyListener = {};
gameField = {};
gameField.clip = gameField_mc;
gameField.width = 550;
bg = {};
bg.clip = gameField.clip.bgLoader_mc;
bg.goalClip = "";
bg.streetWidth = 2000;
bg.houseWidth = 200;
bg.housesPerStreet = bg.streetWidth / bg.houseWidth;
bg.streets = 0;
bg.width = 0;
bg.height = 250;
bg.locations = 12;
bg.minx = 0;
bg.maxx = 0;
bg.rowz_array = [-265, -332, -399, -480];
bg.rows = 4;
bg.x = 0;
bg.y = 0;
bg.z = 0;
bg.flashx = 0;
bg.flashy = 0;
bg.xmov = 0;
bumper = {};
bumper.currentId = 0;
item = {};
item.currentId = 0;
cone = {};
cone.width = 100;
cone.height = 25;
cone.jumpMoney = 20;
hydrant = {};
hydrant.width = 100;
hydrant.height = 35;
hydrant.jumpMoney = 40;
garbageCan = {};
garbageCan.width = 100;
garbageCan.height = 40;
garbageCan.jumpMoney = 50;
bin = {};
bin.width = 100;
bin.height = 25;
bin.jumpMoney = 30;
streetSignUptown = {};
streetSignUptown.width = 80;
streetSignUptown.height = 300;
streetSignUptown.jumpMoney = 30;
streetSignMidtown = {};
streetSignMidtown.width = 80;
streetSignMidtown.height = 300;
streetSignMidtown.jumpMoney = 30;
streetSignDowntown = {};
streetSignDowntown.width = 80;
streetSignDowntown.height = 300;
streetSignDowntown.jumpMoney = 30;
oldLady = {};
oldLady.width = 100;
oldLady.height = 45;
oldLady.jumpMoney = 40;
oldLady.speed = 3;
planter = {};
planter.width = 165;
planter.height = 15;
planter.jumpMoney = 30;
longPlanter = {};
longPlanter.width = 230;
longPlanter.height = 15;
longPlanter.jumpMoney = 50;
bench = {};
bench.width = 146;
bench.height = 80;
bench.jumpMoney = 50;
longBench = {};
longBench.width = 220;
longBench.height = 80;
longBench.jumpMoney = 80;
horseVer = {};
horseVer.width = 100;
horseVer.height = 40;
horseVer.jumpMoney = 40;
horseHor = {};
horseHor.width = 240;
horseHor.height = 40;
horseHor.jumpMoney = 100;
ramp = {};
ramp.width = 110;
ramp.height = 90;
ramp.jumpMoney = 80;
powerUp = {};
powerUp.width = 40;
powerUp.height = 40;
powerUp.secBonus = 5;
powerUp.centsBonus = 200;
circlesColl = new CirclesCollision2();
collision = {};
collision.bumperDecay = 0.3;
miniMap = {};
miniMap.clip = map_mc;
miniMap.town0Clip = miniMap.clip.town0_mc;
miniMap.town1Clip = miniMap.clip.town1_mc;
miniMap.town2Clip = miniMap.clip.town2_mc;
miniMap.currentPositionClip = "";
miniMap.deliveryPositionClip = "";
miniMap.radius = 50;
score = {};
score.popUpClip = "";
score.superJumpRatio = 3;
score.ramp = 10;
score.groundTrick0 = 20;
score.groundTrick1 = 50;
score.groundTrick2 = 5;
score.airTrick0 = 0;
score.airTrick1 = 12;
score.airTrick2 = 40;
score.airTrick3 = 0;
score.airTrick4 = 18;
score.airTrick5 = 150;
score.horseTrick0 = 75;
score.horseTrick1 = 25;
score.horseTrick2 = 80;
popUpPoint = {};
popUpPoint.y = -120;
popUpPoint.currentId = 0;
popUpPoint.currentMaxId = 20;
deliveryPopUp = {};
deliveryPopUp.clip = popUpDeliveryComplete_mc;
stats = {};
stats.deliveryClip = stats_mc;
stats.superJumpMeterClip = superJumpIcon_mc;
stats.superJumpsLeftTxt = superJumpsLeft_txt;
stats.superSpeedMeterClip = superSpeedIcon_mc;
stats.invincibleMeterClip = invincible_mc;
stats.invincibleLeftTxt = invincibleLeft_txt;
stats.superJumpMeterClipFlashOn = false;
}
function loadCode() {
if (world.cheatCode == "jump") {
world.superJumpsLeft = world.cheatCodeBonusSuperJumps;
} else if (world.cheatCode == "speed") {
player.maxXSpeed = player.maxXCheatCodeSpeed;
player.maxXSpeedOnRamp = player.maxXCheatCodeSpeedOnRamp;
} else if (world.cheatCode == "money") {
} else if (world.cheatCode == "time") {
world.framesLeft = world.framesLeft + world.cheatCodeBonusTime;
} else if (world.cheatCode == "invincible") {
world.superInvincLeft = world.cheatCodeBonusInvinc;
} else if (world.cheatCode == "life") {
}
}
function startGame() {
deliveryPopUp.clip._visible = false;
world.currentDeliveryEarned = 0;
game.targetMinx = 0;
game.targetMaxx = 0;
loadPlayer(world.playerCurrentStreetNum);
loadMap(world.playerCurrentTownId);
loadMiniMap();
loadStats();
createActionControl();
game.status = "play";
}
function loadStats() {
var _local2 = world.currentDelivery_obj.realStreetNum;
var _local3 = world.town_array[world.currentDelivery_obj.townId].name;
var _local1 = (_local2 + " ") + _local3;
var _local4 = world.currentDelivery_obj.moneyCents / 100;
stats.deliveryClip.address_txt.text = _local1;
stats.deliveryClip.money_txt.text = funcConvertToCurrency(world.currentDelivery_obj.moneyCents);
}
function addTime(sec) {
alert("addTime");
var _local1 = sec * world.fps;
world.framesLeft = world.framesLeft + _local1;
}
function addMoney(cent) {
if (world.cheatCode == "money") {
cent = cent * 2;
cent = Math.floor(cent);
}
world.currentDeliveryEarned = world.currentDeliveryEarned + cent;
world.currentLevelEarned = world.currentLevelEarned + cent;
world.currentLevel_obj.deliveryTotal = world.currentLevel_obj.deliveryTotal + cent;
var _local2 = world.currentLevel_obj.deliveryTotal + world.currentLevel_obj.trickTotal;
deliveryStats.currentLevelEarned_txt.text = funcConvertToCurrency(_local2);
deliveryStats.currentLevelEarnedClip.gotoAndPlay("pop");
showPopUpMoney(cent);
}
function addTrickMoney(cent) {
playSFX("money");
if (world.cheatCode == "money") {
cent = cent * 2;
cent = Math.floor(cent);
}
world.currentLevel_obj.trickTotal = world.currentLevel_obj.trickTotal + cent;
world.currentLevelEarned = world.currentLevelEarned + cent;
var _local2 = world.currentLevel_obj.deliveryTotal + world.currentLevel_obj.trickTotal;
deliveryStats.currentLevelEarned_txt.text = funcConvertToCurrency(_local2);
deliveryStats.currentLevelEarnedClip.gotoAndPlay("pop");
showPopUpMoney(cent);
}
function showPopUpMoney(cent) {
var _local3 = "popUpPoint";
var _local4 = "popUpPoint_mc";
var _local2 = gameDepth.popUpPoint;
score.popUpClip = bg.clip.attachMovie(_local3, _local4, _local2);
score.popUpClip.points_mc.points_txt.text = cent + "\u00A2";
var _local1 = mapToScreen(player.x, player.y - 150, player.z);
score.popUpClip._x = _local1[0];
score.popUpClip._y = _local1[1];
}
function showDeliveryPopUp() {
player.pogoClip.gotoAndPlay("hide");
if (world.currentDelivery_obj.faceThing > 90) {
deliveryPopUp.clip.pHead.pHead.gotoAndStop("vhappy");
} else if ((world.currentDelivery_obj.faceThing < 91) && (world.currentDelivery_obj.faceThing > 70)) {
deliveryPopUp.clip.pHead.pHead.gotoAndStop("happy");
} else if ((world.currentDelivery_obj.faceThing < 30) && (world.currentDelivery_obj.faceThing > 10)) {
deliveryPopUp.clip.pHead.pHead.gotoAndStop("angry");
} else if (world.currentDelivery_obj.faceThing < 11) {
deliveryPopUp.clip.pHead.pHead.gotoAndStop("vangry");
} else {
deliveryPopUp.clip.pHead.pHead.gotoAndStop("default");
}
deliveryPopUp.clip._visible = true;
stats.deliveryClip.customer_mc.pHead.gotoAndStop("default");
deliveryPopUp.clip.deliveryEarned_txt.text = funcConvertToCurrency(world.currentDeliveryEarned);
deliveryPopUp.clip.secondsBonus_txt.text = String(world.currentDelivery_obj.secBonus);
if (world.currentDelivery_obj.secBonus == 1) {
deliveryPopUp.clip.shift_txt.text = "second to your shift.";
} else {
deliveryPopUp.clip.shift_txt.text = "seconds to your shift.";
}
if (!world.currentLevel_obj.deliveryAdded) {
world.currentLevel_obj.deliveryAdded = true;
world.currentLevel_obj.deliveryTotal = world.currentLevel_obj.deliveryTotal + world.currentDeliveryEarned;
}
deliveryPopUp.clip.continue_btn.onRelease = function () {
backToDeliveryOptionsPage();
};
}
function deliveryCompleted() {
world.playerCurrentTownId = world.currentDelivery_obj.townId;
world.playerCurrentStreetNum = world.currentDelivery_obj.streetNum;
if (world.cheatCode == "money") {
world.currentDelivery_obj.moneyCents = world.currentDelivery_obj.moneyCents * 2;
}
world.currentDeliveryEarned = world.currentDeliveryEarned + world.currentDelivery_obj.moneyCents;
world.currentLevelEarned = world.currentLevelEarned + world.currentDelivery_obj.moneyCents;
addTime(world.currentDelivery_obj.secBonus);
miniMap.deliveryPositionClip.removeMovieClip();
game.status = "deliveryComplete";
game.deliveryPopUpFrame = game.frames + game.framesPogoPopUpDelay;
player.pogoClip._y = player.clip._y;
player.pogoClip._x = player.clip._x + bg.clip._x;
player.animationClip.gotoAndStop("stop");
player.pogoClip.gotoAndPlay("show");
}
function backToDeliveryOptionsPage() {
action_mc.onEnterFrame = undefined;
action_mc.removeMovieClip();
gotoAndPlay ("deliveryOptions");
world.currentLevel_obj.deliveryAdded = false;
}
function levelCompleted() {
action_mc.onEnterFrame = undefined;
action_mc.removeMovieClip();
gotoAndPlay ("levelCompleted");
}
function gameOver() {
action_mc.onEnterFrame = undefined;
action_mc.removeMovieClip();
gotoAndPlay ("gameOver");
}
function updateTime() {
if (player.status != "changingTown") {
world.framesLeft--;
if (world.framesLeft < 0) {
world.framesLeft = 0;
var _local4 = world.currentLevel_obj.deliveryTotal + world.currentLevel_obj.trickTotal;
if (_local4 < world.currentLevel_obj.quotaCents) {
alert("game over");
if (world.cheatCode != "life") {
gameOver();
} else {
world.doOver = true;
alert("doOver");
levelCompleted();
}
} else {
alert("level complete");
levelCompleted();
}
} else {
if (world.framesLeft < world.currentDelivery_obj.subtractPoint) {
world.currentDelivery_obj.subtractPoint = world.framesLeft - (world.fps * world.currentDelivery_obj.timeMod);
if (world.currentDelivery_obj.secBonus < 0) {
world.currentDelivery_obj.secBonus = 0;
}
world.currentDelivery_obj.faceThing = Math.floor(world.currentDelivery_obj.secBonus * world.currentDelivery_obj.secIncr);
alert("delivery_obj.secBonus " + world.currentDelivery_obj.faceThing);
if ((world.currentDelivery_obj.faceThing < 30) && (world.currentDelivery_obj.faceThing > 9)) {
stats.deliveryClip.customer_mc.pHead.gotoAndStop("angry");
} else if (world.currentDelivery_obj.faceThing < 10) {
stats.deliveryClip.customer_mc.pHead.gotoAndStop("vangry");
}
}
var _local2 = Math.floor(world.framesLeft / world.fps);
var _local1 = _local2 % 60;
var _local3 = Math.floor(_local2 / 60);
if (_local1 < 10) {
timeLeft_mc.timeLeft_txt.text = (_local3 + ":0") + _local1;
} else {
timeLeft_mc.timeLeft_txt.text = (_local3 + ":") + _local1;
}
}
}
}
function updateStats() {
if (world.superJumpsLeft > 0) {
if (player.framesKeyDown >= player.framesKeyDownPowerUp) {
if (!stats.superJumpMeterClipFlashOn) {
stats.superJumpMeterClipFlashOn = true;
stats.superJumpMeterClip.animation_mc.gotoAndPlay("ready");
}
}
}
if (world.superJumpsLeft > 0) {
stats.superJumpMeterClip._visible = true;
stats.superJumpsLeftTxt.text = "x " + world.superJumpsLeft;
} else {
stats.superJumpMeterClip._visible = false;
stats.superJumpsLeftTxt.text = "";
}
if (player.powerUpStatus == "speed") {
stats.superSpeedMeterClip._visible = true;
} else {
stats.superSpeedMeterClip._visible = false;
}
if (world.superInvincLeft > 0) {
stats.invincibleMeterClip._visible = true;
stats.invincibleLeftTxt.text = "X" + world.superInvincLeft;
} else {
stats.invincibleMeterClip._visible = false;
stats.invincibleLeftTxt.text = "";
}
}
function initialDeliveryCompletedKeyControl() {
game.keyListener.onKeyDown = function () {
if (Key.getCode() == 13) {
Key.removeListener(this);
backToDeliveryOptionsPage();
}
};
Key.addListener(game.keyListener);
}
function createActionControl() {
createEmptyMovieClip("action_mc", gameDepth.action);
action_mc.onEnterFrame = function () {
if (game.status == "play") {
captureKeys();
setPlayerTempPosition();
updateItems();
checkCollisions();
updatePlayer();
updateBG();
updateMiniMap();
updateTime();
updateStats();
} else if (game.status == "deliveryComplete") {
if (game.frames > game.deliveryPopUpFrame) {
showDeliveryPopUp();
initialDeliveryCompletedKeyControl();
}
}
trace("speed " + player.xmov);
game.frames++;
};
}
stop();
initialGameVariables();
initialIsoWorld();
initialTown();
initialPlayer();
loadCode();
startGame();
Frame 71
function funcLevelEndMessage() {
var _local7 = world.currentLevel_obj.deliveryTotal;
var _local5 = world.currentLevel_obj.trickTotal;
var _local9 = world.currentLevelEarned;
var _local10 = world.currentLevel_obj.quotaCents;
var _local4 = world.currentLevel_obj.deliveryTotal + world.currentLevel_obj.trickTotal;
var _local6 = world.currentLevel_obj.previousEarned;
var _local2 = _local4 - world.currentLevel_obj.quotaCents;
pDeliveryTotal_txt.text = funcConvertToCurrency(_local7);
pTrickTotal_txt.text = funcConvertToCurrency(_local5);
pCurrentTotal_txt.text = funcConvertToCurrency(_local9);
pShiftTotal_txt.text = funcConvertToCurrency(_local4);
pPreviousScore_txt.text = funcConvertToCurrency(_local6);
alert("lProfit " + _local2);
if (world.doOver) {
pShift_txt.text = ("SHIFT " + world.currentLevel) + " do over!";
pMessage.pTitle.text = "You get a do over";
pMessage.pCopy.text = "The Boss gives you another chance.";
} else {
pShift_txt.text = ("SHIFT " + world.currentLevel) + " PASSED!";
var _local3 = world.currentLevel + 1;
if (_local3 == 4) {
pBoss.pHead.gotoAndStop("happy");
} else if (_local3 == 7) {
pBoss.pHead.gotoAndStop("happy");
} else {
var _local1 = _local2 / 100;
if (_local1 > 20) {
pBoss.pHead.gotoAndStop("vhappy");
} else if ((_local1 < 21) && (_local1 > 16)) {
pBoss.pHead.gotoAndStop("happy");
} else if ((_local1 < 6) && (_local1 > 0)) {
pBoss.pHead.gotoAndStop("angry");
} else if (_local1 < 1) {
pBoss.pHead.gotoAndStop("vangry");
}
}
}
if (world.currentLevel < 10) {
var _local8 = world.currentLevel + "";
message_mc.gotoAndStop(_local8);
} else {
message_mc.gotoAndStop(10);
}
}
stop();
funcLevelEndMessage();
btContinue.onRelease = function () {
playSFX("buttonHit");
main.funcLevelUp();
};
btContinue.onRollOver = function () {
playSFX("buttonOver");
};
Frame 81
var gname = "pogo_panicMT";
var gscore = world.currentLevelEarned;
getURL ("index.php?act=Arcade&do=newscore", "_self", "POST");
Frame 90
stop();
funcGetScores = function () {
var _local4 = new LoadVars();
_local4.onLoad = function (success) {
if (success) {
i = 0;
while (i < 10) {
var _local2 = main["sc" + i];
_local2.pRank_text = String((i + 1) + ".");
var _local3 = this["name" + i];
if ((_local3 == null) || (_local3 == undefined)) {
_local2.pName_txt.text = "AA";
_local2.pScore_txt.text = funcConvertToCurrency(0);
} else {
_local2.pName_txt.text = this["name" + i];
_local2.pScore_txt.text = funcConvertToCurrency(this["score" + i]);
}
_local2._visible = true;
i++;
}
} else {
alert("NOMO");
}
};
_local4.load((main.path + "/gamepad/play/games/getGameHighScores.asp?gameID=") + main.gameID);
};
btPlayAgain.onRelease = function () {
playSFX("buttonHit");
main.resetWorldVaribles();
main.initialLevels();
gotoAndPlay ("loader");
};
btPlayAgain.onRollOver = function () {
playSFX("buttonOver");
};
main_btn.onRelease = function () {
_root.funcHITBOX("play_activity", "play_again");
playSFX("buttonHit");
main.resetWorldVaribles();
main.initialLevels();
gotoAndPlay ("title");
};
main_btn.onRollOver = function () {
playSFX("buttonOver");
};
funcGetScores();
Symbol 276 MovieClip Frame 181
gotoAndPlay (1);
Symbol 319 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 1
Symbol 42 MovieClip Frame 21
gotoAndPlay (1);
Symbol 47 MovieClip [pogoPack] Frame 16
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 122 MovieClip [popUpPoint] Frame 12
Symbol 122 MovieClip [popUpPoint] Frame 21
stop();
Symbol 126 MovieClip [deliveryGoal] Frame 27
gotoAndPlay (1);
Symbol 210 MovieClip Frame 12
gotoAndPlay (1);
Symbol 231 MovieClip Frame 139
_root.dustCloud.gotoAndStop(2);
Symbol 231 MovieClip Frame 285
Symbol 231 MovieClip Frame 297
Symbol 231 MovieClip Frame 298
Symbol 231 MovieClip Frame 311
Symbol 231 MovieClip Frame 319
Symbol 235 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 26
stop();
Symbol 236 MovieClip [player] Frame 1
stop();
Symbol 236 MovieClip [player] Frame 42
stop();
Symbol 271 MovieClip Frame 11
gotoAndPlay ("down");
Symbol 271 MovieClip Frame 22
gotoAndPlay ("up");
Symbol 351 MovieClip Frame 1
stop();
Symbol 351 MovieClip Frame 2
_root.func_playSound("error1");
Symbol 370 MovieClip Frame 21
gotoAndPlay (1);
Symbol 384 MovieClip Frame 100
stop();
Symbol 408 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 11
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 428 MovieClip Frame 18
gotoAndStop ("normal");
Symbol 445 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 1
stop();
Symbol 465 MovieClip Frame 1
stop();
Symbol 465 MovieClip Frame 31
gotoAndPlay ("ready");
Symbol 466 MovieClip Frame 1
stop();
Symbol 469 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 23
gotoAndPlay ("ready");
Symbol 478 Button
on (release) {
this._visible = false;
}
Symbol 518 MovieClip Frame 1
stop();