Frame 1
function showInstructions() {
theGame.gotoAndPlay("instruction");
startInstructionsAnimation();
}
function startGame() {
_global.tracercall("DAS IST LOCALMOVIE " + localMovie);
theGame.initGameListeners();
theGame.initGame();
theGame._parent._parent.setTimer("start");
}
function finishGame() {
_global.tracercall("Finish Game");
}
stop();
Symbol 39 MovieClip [tut_mouse] Frame 32
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 16
stop();
Symbol 98 MovieClip [Tutorial_Lession] Frame 1
stop();
Symbol 98 MovieClip [Tutorial_Lession] Frame 30
stop();
Symbol 98 MovieClip [Tutorial_Lession] Frame 60
stop();
Symbol 98 MovieClip [Tutorial_Lession] Frame 90
stop();
next_btn.field_txt.text = "NEXT";
next_btn.onRelease = function () {
this._parent.gotoAndPlay("tutorial5");
this._parent.stage = "tutorial5";
};
Symbol 98 MovieClip [Tutorial_Lession] Frame 120
stop();
this.lessionFive();
next_btn.field_txt.text = "I'M DONE";
next_btn.onRelease = function () {
this._parent._parent.endTutorial();
this._parent._parent.stage = "tutorial6";
};
Symbol 98 MovieClip [Tutorial_Lession] Frame 149
stop();
Symbol 133 MovieClip [stageStart] Frame 65
Symbol 133 MovieClip [stageStart] Frame 91
stop();
this.levelObj.stageStartCallBack(this);
Symbol 136 MovieClip Frame 40
stop();
Symbol 139 MovieClip [stageEnd] Frame 1
Symbol 139 MovieClip [stageEnd] Frame 64
this.lvlBonus_txt.text = this.bonus;
Symbol 139 MovieClip [stageEnd] Frame 91
stop();
this.levelObj.stageStart();
Symbol 140 MovieClip [endSound2] Frame 32
stop();
Symbol 141 MovieClip [endSound1] Frame 31
stop();
Symbol 142 MovieClip [beginSound2] Frame 31
stop();
Symbol 143 MovieClip [beginSound1] Frame 31
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 16
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 2
stop();
Symbol 160 MovieClip Frame 3
stop();
Symbol 160 MovieClip Frame 4
stop();
Symbol 160 MovieClip Frame 5
stop();
Symbol 173 Button
on (press) {
clip = _parent._parent._parent;
clip.sounds[0].stop();
clip.sounds[13].stop();
clip.sounds[14].stop();
clip.sounds[15].stop();
clip.music_mute = true;
clip.stopAllSounds();
gotoAndStop ("off");
}
Symbol 177 Button
on (press) {
clip = _parent._parent._parent;
clip.sounds[0].start();
clip.music_mute = false;
gotoAndStop ("on");
}
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
stop();
Instance of Symbol 185 MovieClip in Symbol 186 MovieClip [hitAreaOuter] Frame 1
onClipEvent (load) {
}
Symbol 197 MovieClip [Pylon] Frame 1
stop();
Symbol 197 MovieClip [Pylon] Frame 25
removeMovieClip(this);
Symbol 210 MovieClip [HorseR] Frame 1
stop();
Symbol 210 MovieClip [HorseR] Frame 2
stop();
Symbol 215 MovieClip [HorseL] Frame 1
stop();
Symbol 215 MovieClip [HorseL] Frame 2
stop();
Symbol 220 MovieClip [Horse] Frame 1
stop();
Symbol 220 MovieClip [Horse] Frame 2
stop();
Symbol 223 MovieClip [DitchR] Frame 1
stop();
Symbol 226 MovieClip [DitchL] Frame 1
stop();
Symbol 229 MovieClip [Ditch] Frame 1
stop();
Symbol 239 MovieClip Frame 30
stop();
this.word.removeMovieClip();
Symbol 251 MovieClip [Ani_Webkinz] Frame 1
stop();
Symbol 251 MovieClip [Ani_Webkinz] Frame 2
stop();
Symbol 251 MovieClip [Ani_Webkinz] Frame 3
stop();
Symbol 251 MovieClip [Ani_Webkinz] Frame 4
stop();
Symbol 251 MovieClip [Ani_Webkinz] Frame 5
stop();
Symbol 262 MovieClip Frame 12
stop();
Symbol 279 MovieClip Frame 30
this._parent.character.jumpdoubleActionOn = false;
this._parent.character.moveJump(true);
this._parent.character.rootMC.stats.debugtext.text = this._parent.character.rootMC.stats.debugtext.text + "DOUBLE JUMP";
Symbol 294 MovieClip Frame 11
this._parent.character.self.levelEnv.endLevel();
stop();
Symbol 311 MovieClip Frame 21
this._parent.character.self.invincibileSetTimer();
this._parent.character.gotoState("normal");
Symbol 347 MovieClip Frame 60
this._parent.character.self.gameOver(false);
stop();
Symbol 364 MovieClip Frame 21
stop();
Symbol 365 MovieClip [hero] Frame 1
stop();
Symbol 365 MovieClip [hero] Frame 2
stop();
Symbol 365 MovieClip [hero] Frame 3
stop();
Symbol 365 MovieClip [hero] Frame 4
stop();
Symbol 365 MovieClip [hero] Frame 5
stop();
Symbol 365 MovieClip [hero] Frame 6
stop();
Symbol 365 MovieClip [hero] Frame 7
stop();
Symbol 365 MovieClip [hero] Frame 8
stop();
Symbol 379 MovieClip [preloader] Frame 1
stop();
Symbol 389 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 1
function frameRateWatcher(holder, framerate, showParameters) {
_global.traceit("FUNCTION: frameRateWatcher", 0, showParameters);
_global.traceit("Holder: " + holder, 1, showParameters);
_global.traceit("Framerate: " + framerate, 1, showParameters);
holder.framerate = framerate;
holder.initFRW = function () {
_global.traceit("FUNCTION: initFRW", 0);
this.currentFramerate = 1;
this.watchFlag = false;
};
holder.startWatcher = function () {
_global.traceit("FUNCTION: startWatcher", 0);
this.accumFramerate = 0;
this.framerateSamples = 0;
this.framesPassed = 0;
this.watchFlag = true;
};
holder.stopWatcher = function () {
_global.traceit("FUNCTION: stopWatcher", 0);
this.currentFramerate = this.accumFramerate / this.framerateSamples;
this.currentFramerate = this.framerate / this.currentFramerate;
if (this.currentFramerate >= this.framerate) {
this.currentFramerate = 10;
}
if (this.currentFramerate < 1) {
this.currentFramerate = 1;
}
this.accumFramerate = 0;
this.framerateSamples = 0;
this.watchFlag = false;
_global.traceit("Returning: " + this.currentFramerate, 1);
return(this.currentFramerate);
};
holder.getFramerateSample = function () {
_global.traceit("FUNCTION: getFramerateSample", 0);
var _local6 = _level1410064297.timer.fps;
var _local4 = _local6.substring(0, 2);
var _local3 = Number(_local4);
var _local5 = isNaN(_local3);
if (_local5 == true) {
_local4 = _local6.substring(0, 1);
_local3 = Number(_local4);
_local5 = isNaN(_local3);
}
if (_local5 == true) {
_local3 = 0;
} else {
this.accumFramerate = this.accumFramerate + _local3;
this.framerateSamples++;
}
};
holder.onEnterFrame = function () {
if (this.watchFlag) {
this.framesPassed++;
if (this.framesPassed >= this.framerate) {
this.getFramerateSample();
this.framesPassed = 0;
}
}
};
holder.initFRW();
}
function GameEnvironment(self) {
this.init.apply(this, arguments);
}
function GameStatistics(self, gameMenuMC, curLevel) {
this.init.apply(this, arguments);
}
function SkateBoard(self, height) {
this.init.apply(this, arguments);
}
function CharacterHero(self, clip, dep, rotation_speed, statsObj) {
this.init.apply(this, arguments);
}
function SoundMusic(self, clip, volume) {
SoundMusic.cnt;
SoundMusic.addToStaticList;
SoundMusic.stopAllSounds = function () {
var _local2;
i = 0;
while (i < SoundMusic.addToStaticList.length) {
SoundMusic.addToStaticList[i].stopSound();
_global.tracercall((("stoping " + typeof(i)) + "total Sound") + SoundMusic.cnt);
i++;
}
};
SoundMusic.removeAllSoundToGroupList = function () {
i = 0;
while (i <= SoundMusic.addToStaticList.length) {
SoundMusic.addToStaticList.shift();
i++;
}
SoundMusic.addToStaticList = new Array();
};
this.init.apply(this, arguments);
}
function Obstacle(self, id, linkageID, type, xi, yi, size, speedMovement, isBonus, vhdir) {
this.init.apply(this, arguments);
Obstacle.playAllObstacles = function () {
Obstacle.action = "move";
};
Obstacle.stopAllObstacles = function () {
Obstacle.action = "stop";
};
Obstacle.setNewSpeed = function (val) {
if (Obstacle.speed != val) {
Obstacle.speed = val;
}
};
}
function Level(self, levelNum, statsObj) {
this.init.apply(this, arguments);
this.setLevelInfo(this.lvlNum);
this.setAvailableAttachPoints();
}
function ScorebarObject(mainObject, scorebarClip, scoreKinzcashRatio, setScoreToUpdateKinzcash) {
this.mainObject = mainObject;
this.scorebarClip = scorebarClip;
this.scoreObject;
this.levelObject;
this.kinzcashObject;
if (scoreKinzcashRatio == undefined) {
scoreKinzcashRatio = 1;
}
if (setScoreToUpdateKinzcash == undefined) {
setScoreToUpdateKinzcash = false;
}
this.scoreKinzcashRatio = scoreKinzcashRatio;
this.setScoreToUpdateKinzcash = setScoreToUpdateKinzcash;
this.initialize();
}
function VariableHandler(scorebarObject, variableName, turnOnFakeArray, numberOfFakeAddresses) {
this.scorebarObject = scorebarObject;
this.variableName = variableName;
this.variableArray;
this.cheatEngineArray;
if (turnOnFakeArray == undefined) {
turnOnFakeArray = false;
}
this.turnOnFakeArray = turnOnFakeArray;
if (numberOfFakeAddresses == undefined) {
numberOfFakeAddresses = 20;
}
this.numberOfFakeAddresses = numberOfFakeAddresses;
this.initialize();
}
function traceit(myText, tracerType, indentValue, programName) {
if (tracerType != undefined) {
setTracerType(tracerType, indentValue, programName);
}
if (gTracer == cNoTracer) {
return(undefined);
}
var _local3 = "";
if (gTracer == cLocal) {
} else if (gTracer == cTracercall) {
if (gIndent != 0) {
var _local2 = 0;
while (_local2 < gIndent) {
_local3 = _local3 + gIndentCharacter;
indent++;
}
}
_global.tracercall(_local3 + myText);
} else if (gTracer == cStracercall) {
_global.stracercall(myText, gProgramName, gIndent);
}
}
function setTracerIndent(indentValue) {
gIndent = indentValue;
}
function setIndentCharacter(indentCharacter) {
gIndentCharacter = indentCharacter;
}
function setTracerType(tracerType, indentValue, programName) {
if (tracerType == undefined) {
tracerType = "tracercall";
}
if (indentValue != undefined) {
gIndent = indentValue;
}
if (programName != undefined) {
gProgramName = programName;
}
if (tracerType == "local") {
gTracer = cLocal;
} else if (tracerType == "tracercall") {
gTracer = cTracercall;
} else if (tracerType == "stracercall") {
gTracer = cStracercall;
} else if (tracerType == "noTracer") {
gTracer = cNoTracer;
}
}
function initFramerate() {
frameRateWatcher(localMovie.frameWatcher, 30, true);
localMovie.frameWatcher.startWatcher();
_global.tracercall("Skaterkcat initFramerate framerate " + localMovie.currentFramerate);
}
function redefineFramerate() {
localMovie.currentFramerate = localMovie.frameWatcher.stopWatcher();
frameRateWatcher(localMovie.frameWatcher, 30, true);
localMovie.frameWatcher.startWatcher();
_global.tracercall("Skaterkat redefineFramerate framerate " + localMovie.currentFramerate);
}
function initGroup() {
_parent._parent.getGameGroupItems(localMovie.onGetGameItems);
}
function onGetGameItems(resultObj) {
var _local2;
var _local3 = resultObj.itemdef;
_global.tracercall("SkaterKat: onGetGameItems() itemObj.length=" + _local3.length);
var _local6 = _local3.length;
var _local4 = [];
for (_local2 in _local3) {
_local4.push(_local3[_local2]);
_global.tracercall((("SkaterKat: \ti" + _local2) + ", itemObj") + _local3[_local2]);
}
var _local5 = Math.floor(Math.random() * _local4.length);
_global.tracercall("SkaterKat: trophy id " + trophyId);
}
_parent._parent.hideDock();
_global.vtracercall("Skater Kat -> ver 32.01.002");
GameEnvironment.prototype.init = function (self) {
this.self = self;
this.levels = new Array();
this.levels.push(tmpObj);
this.bgType = new Array("", "City", "Country", "Desert", "Highway");
this.listOfSounds = new Array();
this.objType = new Array();
this.curLevel = 1;
this.maxScreenAcceleration = 30;
this.frameRate = 30;
this.enabled = false;
this.MAX_LEVELS = 49;
this.TROPHY_RECEIVE_LEVELS = 17;
this.receivedTrophy = false;
this.statisticsEnv = new GameStatistics(this, this.self.display_panel, this.curLevel);
this.levelEnv = new Level(this, levelNum, this.statisticsEnv);
this.godMode = false;
this.godModeTimer = 0;
this.GOD_TIMER_LIMIT = 1000;
this.DIE_COLOR_TIMER_LIMIT = 2000;
this.GAME_VIEW_ID = 1037;
this.DBID_TROPHY = 694;
};
GameEnvironment.prototype.addLevel = function (level, type, speed, arrChanceObs, arrChanceBonus, stageLength) {
var _local2 = new Object();
_local2.level = level;
_local2.type = type;
_local2.speed = speed;
_local2.arrChanceObs = arrChanceObs;
_local2.arrChanceBonus = arrChanceBonus;
_local2.chanceBonus = chanceBonus;
_local2.chanceRepair = chanceRepair;
_local2.stageLength = stageLength;
this.levels.push(_local2);
};
GameEnvironment.prototype.getLevel = function (lvlNum) {
if (lvlNum > 0) {
return(this.levels[lvlNum]);
}
return(undefined);
};
GameEnvironment.prototype.getMaxAcceleration = function () {
return(this.maxScreenAcceleration);
};
GameEnvironment.prototype.chgLevelProp = function (lvlNum, propName, value) {
this.levels[lvlNum][propName] = value;
};
GameEnvironment.prototype.getChanceBonus = function (lvlNum, propName) {
if (arguments.length == 2) {
return(this.levels[lvlNum].arrChanceBonus[propName]);
}
return(this.levels[lvlNum].arrChanceBonus);
};
GameEnvironment.prototype.getChanceObstacle = function (lvlNum, propName) {
if (arguments.length == 2) {
return(this.levels[lvlNum].arrChanceBonus[propName]);
}
return(this.levels[lvlNum].arrChanceObs);
};
GameEnvironment.prototype.isGameEnabled = function () {
return(this.enabled);
};
GameEnvironment.prototype.setGameEnabled = function (value) {
this.enabled = value;
};
GameEnvironment.prototype.setLevel = function (lvlNum) {
this.curLevel = lvlNum;
};
GameEnvironment.prototype.addSound = function (nameSound, soundObj) {
this.listOfSounds.push({name:nameSound, music:soundObj});
};
GameEnvironment.prototype.getSound = function (nameSound) {
var _local3;
iCnt = 0;
while (iCnt < this.listOfSounds.length) {
obj = this.listOfSounds[iCnt];
if (obj.name == nameSound) {
return(obj.music);
}
iCnt++;
}
return(undefined);
};
GameEnvironment.prototype.initLevel = function (levelNum) {
if ((levelNum == this.MAX_LEVELS) && (!this.self.isTutorialMode())) {
this.gameOver(false);
return(false);
}
if ((((levelNum != this.TROPHY_RECEIVE_LEVELS) && (!this.receivedTrophy)) || (this.self.isTutorialMode())) || (this.receivedTrophy)) {
this.setLevel(levelNum);
this.levelEnv.setLevelInfo(levelNum);
this.statisticsEnv.chgLevel(levelNum);
this.statisticsEnv.setGameProgressBar(0);
this.character.repairEntireSkateboard();
this.levelEnv.resetLevelValues();
if (!this.self.isTutorialMode()) {
this.levelEnv.loadInLevelSound();
this.levelEnv.resetOccupiedAttachPoints();
if (levelNum > (this.TROPHY_RECEIVE_LEVELS - 1)) {
this.levelEnv.GENERATE_OBSTACLE_FRAME_RATE = 6;
}
}
this.levelEnv.blah = false;
return(true);
}
this.setLevel(levelNum);
this.levelEnv.setLevelInfo(levelNum);
this.statisticsEnv.chgLevel(levelNum);
this.statisticsEnv.setGameProgressBar(0);
this.character.repairEntireSkateboard();
this.levelEnv.resetLevelValues();
this.levelEnv.loadInLevelSound();
this.levelEnv.resetOccupiedAttachPoints();
if (levelNum > (this.TROPHY_RECEIVE_LEVELS - 1)) {
this.levelEnv.GENERATE_OBSTACLE_FRAME_RATE = 6;
}
this.gameOver(true);
return(false);
};
GameEnvironment.prototype.introLevel = function () {
this.setGameEnabled(false);
this.levelEnv.stageStart();
};
GameEnvironment.prototype.getRootMC = function () {
return(this.self);
};
GameEnvironment.prototype.createCharacter = function () {
this.character = new CharacterHero(this, this.self.player, 5000, 2, this.statisticsEnv);
this.character.loadInternalChar("hero");
};
GameEnvironment.prototype.getCharacter = function () {
return(this.character);
};
GameEnvironment.prototype.setTypeObstacleSize = function (type, width, wRange, height, hRange, numOfView, dblJump, pts) {
if (typeof(this.objType[type]) != "object") {
this.objType[type] = new Object();
}
this.objType[type].width = width;
this.objType[type].wRange = wRange;
this.objType[type].height = height;
this.objType[type].hRange = hRange;
this.objType[type].views = numOfView;
this.objType[type].dblJump = dblJump;
this.objType[type].pts = pts;
};
GameEnvironment.prototype.getTypeObstacleSize = function (type) {
var _local2 = this.objType[type];
return([_local2.width, _local2.wRange, _local2.height, _local2.hRange]);
};
GameEnvironment.prototype.getTypeObstacleViews = function (type) {
var _local2 = this.objType[type];
return(_local2.views);
};
GameEnvironment.prototype.getTypeObstaclePts = function (type) {
var _local2 = this.objType[type];
return(_local2.pts);
};
GameEnvironment.prototype.checkCollision = function (charMC, jumpHeight) {
var _local5 = new Array();
var _local2;
var _local12;
var _local11;
var _local10;
var _local13;
_local5 = this.levelEnv.getListOfObstacles();
iCnt = 0;
while (iCnt < _local5.length) {
obstacleObj = _local5[iCnt];
if (obstacleObj.isObjAtZone(2)) {
_local2 = obstacleObj.getOuterMC();
obsInnerMC = obstacleObj.getInnerMC();
flagCollision = false;
if (this.cmpCollision(charMC.hitOuter, _local2.hitOuter, "", 0) && (obstacleObj.getHeight() >= jumpHeight)) {
var _local9;
var _local7;
obsSize = obstacleObj.getSize();
if (obsSize > 1) {
if (((this.cmpCollision(charMC.hitOuter1, _local2.hitOuter, obsInnerMC.hitInnerL, 0) || (this.cmpCollision(charMC.hitOuter1, _local2.hitOuter, obsInnerMC.hitInnerR, 0))) || (this.cmpCollision(charMC.hitOuter2, _local2.hitOuter, obsInnerMC.hitInnerL, 0))) || (this.cmpCollision(charMC.hitOuter2, _local2.hitOuter, obsInnerMC.hitInnerR, 0))) {
flagCollision = true;
} else {
var _local4 = obsSize - 3;
i = 0;
while (i < _local4) {
if (this.cmpCollision(charMC.hitOuter1, _local2.hitOuter, obsInnerMC["hitInner" + i], 0) || (this.cmpCollision(charMC.hitOuter1, _local2.hitOuter, obsInnerMCobsInnerMC["hitInner" + i], 0))) {
flagCollision = true;
break;
}
i++;
}
}
} else if (obsSize == 1) {
if (this.cmpCollision(charMC.hitOuter1, _local2.hitOuter, "", 0) || (this.cmpCollision(charMC.hitOuter2, _local2.hitOuter, "", 0))) {
flagCollision = true;
} else {
flagCollision = false;
}
}
if (flagCollision) {
this.levelEnv.storeRefHitObj(obstacleObj);
obstacleObj.removeObstacleFromPlay();
this.character.setCollidedWithType(obstacleObj.getType());
if (obstacleObj.isBonusObs()) {
this.character.activateEventHitSequence("snd_" + obstacleObj.getType().toLowerCase(), "vgood", 6);
obstacleObj.destroyObstacle();
var _local6;
typeNameObs = obstacleObj.getType();
if (typeNameObs == "Kinzcash") {
this.statisticsEnv.updateStats(this.getTypeObstaclePts(typeNameObs), 1);
} else if (typeNameObs == "Repair") {
this.statisticsEnv.updateStats(this.getTypeObstaclePts(typeNameObs), 0);
this.character.repairSkateboard();
}
return(false);
}
return(true);
}
}
}
iCnt++;
}
return(false);
};
GameEnvironment.prototype.cmpCollision = function (mcObj1, mcObjOuter, mcObjInner, tol) {
obj1Radius = mcObj1._width / 2;
if (typeof(mcObjInner) == "movieclip") {
var _local3 = this.toGlobalPoint(mcObj1._parent, this.self);
var _local6 = new Object();
_local6.x = mcObjInner._x;
_local6.y = mcObjInner._y;
mcObjInner._parent.localToGlobal(_local6);
obj2Radius = mcObjInner._width / 2;
} else if (typeof(mcObjInner) == "string") {
var _local3 = {x:mcObj1._parent._x, y:mcObj1._parent._y};
this.self.localToGlobal(_local3);
var _local6 = this.toGlobalPoint(mcObjOuter, mcObjOuter._parent);
obj2Radius = mcObjOuter._width / 2;
} else {
return(false);
}
return(this.isHit(_local3, _local6, obj1Radius, obj2Radius, tol));
};
GameEnvironment.prototype.isHit = function (point1, point2, rad1, rad2, tol) {
diffX = point2.x - point1.x;
diffY = point2.y - point1.y;
dist = Math.sqrt((diffX * diffX) + (diffY * diffY));
radiusTotal = (rad1 + rad2) + tol;
if (dist <= radiusTotal) {
return(true);
}
return(false);
};
GameEnvironment.prototype.toGlobalPoint = function (mcObj, targ) {
var _local1 = new Object();
_local1.x = mcObj._x;
_local1.y = mcObj._y;
targ.localToGlobal(_local1);
return(_local1);
};
GameEnvironment.prototype.gameOver = function (wonFlag) {
if (wonFlag) {
this.queryForPreviousTrophyWin();
} else {
this.levelEnv.levelOver();
this.character.deleteCharacter();
this.self.gotoAndPlay("gameOver");
}
};
GameEnvironment.prototype.getBGName = function (index) {
return(this.bgType[index]);
};
GameEnvironment.prototype.preLoadBGPlaceHolder = function (lvlNum) {
var _local2;
var _local4;
var _local6;
var _local5;
bgMC = this.self.createEmptyMovieClip("background_mc" + lvlNum, 10 + lvlNum);
bgMC.createEmptyMovieClip("road", 100);
bgMC.createEmptyMovieClip("background", 1);
bgMC._x = bgMC._x - 1000;
bgMC._y = 0;
bgMC._visible = false;
bgMC.top_bg_tile = "background1";
bgMC.gameEnv = this;
_local2 = 1;
while (_local2 <= 3) {
dup = bgMC.background.duplicateMovieClip("background" + _local2, _local2 + 1);
dup._x = 0;
dup._y = -600 + (300 * _local2);
_local2++;
}
jCnt = 1;
while (jCnt <= 4) {
dup = bgMC.road.duplicateMovieClip("road" + jCnt, jCnt + 100);
dup._x = 0;
dup._y = -199 + (199 * jCnt);
jCnt++;
}
var _local7;
preMC = this.self.attachMovie("preloader", "preloaderBG_mc" + lvlNum, 20000 + lvlNum);
if (lvlNum != 1) {
preMC._x = bgMC._x;
}
preMC._visible = false;
bgMC.onEnterFrame = function () {
if (((((((this.bg1 != undefined) && (this.bg2 != undefined)) && (this.bg3 != undefined)) && (this.rd1 != undefined)) && (this.rd2 != undefined)) && (this.rd3 != undefined)) && (this.rd4 != undefined)) {
this.gameEnv["bg" + lvlNum] = true;
this.onEnterFrame = null;
if (this.gameEnv.self.isTutorialMode()) {
preMC.removeMovieClip();
}
}
numBG = this.gameEnv.setDefaultBG(this);
preMC._visible = true;
preMC.progressNumber = numBG * 10;
};
var _local3;
preloadingLevel = this.getLevel(lvlNum);
this.loadAllBG(bgMC, "background", this.getBGName(preloadingLevel.type));
this.loadAllBG(bgMC, "road", this.getBGName(preloadingLevel.type) + "Road");
};
GameEnvironment.prototype.setDefaultBG = function (bgMCHolder) {
var _local2 = 0;
if (((bgMCHolder.background1.getBytesLoaded() >= bgMCHolder.background1.getBytesTotal()) && (bgMCHolder.background1.getBytesTotal() > 0)) && (bgMCHolder.background1.getBytesLoaded() > 0)) {
bgMCHolder.background1.bgL.gotoAndStop(2);
bgMCHolder.background1.bgR.gotoAndStop(2);
bgMCHolder.bg1 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.background2.getBytesLoaded() >= bgMCHolder.background2.getBytesTotal()) && (bgMCHolder.background2.getBytesTotal() > 0)) && (bgMCHolder.background2.getBytesLoaded() > 0)) {
bgMCHolder.background2.bgL.gotoAndStop(1);
bgMCHolder.background2.bgR.gotoAndStop(1);
bgMCHolder.bg2 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.background3.getBytesLoaded() >= bgMCHolder.background3.getBytesTotal()) && (bgMCHolder.background3.getBytesTotal() > 0)) && (bgMCHolder.background3.getBytesLoaded() > 0)) {
bgMCHolder.background3.bgL.gotoAndStop(3);
bgMCHolder.background3.bgR.gotoAndStop(3);
bgMCHolder.bg3 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.background4.getBytesLoaded() >= bgMCHolder.background4.getBytesTotal()) && (bgMCHolder.background4.getBytesTotal() > 0)) && (bgMCHolder.background4.getBytesLoaded() > 0)) {
bgMCHolder.background4.bgL.gotoAndStop(2);
bgMCHolder.background4.bgR.gotoAndStop(2);
bgMCHolder.bg4 = true;
_local2 = _local2 + 1;
}
var _local3;
totalRoadFrames = bgMCHolder.road1.bgRoad._totalFrames;
if (((bgMCHolder.road1.getBytesLoaded() >= bgMCHolder.road1.getBytesTotal()) && (bgMCHolder.road1.getBytesTotal() > 0)) && (bgMCHolder.road1.getBytesLoaded() > 0)) {
bgMCHolder.road1.bgRoad.gotoAndStop(Math.round(Math.random() * totalRoadFrames) + 1);
bgMCHolder.rd1 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.road2.getBytesLoaded() >= bgMCHolder.road2.getBytesTotal()) && (bgMCHolder.road2.getBytesTotal() > 0)) && (bgMCHolder.road2.getBytesLoaded() > 0)) {
bgMCHolder.road2.bgRoad.gotoAndStop(Math.round(Math.random() * totalRoadFrames) + 1);
bgMCHolder.rd2 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.road3.getBytesLoaded() >= bgMCHolder.road3.getBytesTotal()) && (bgMCHolder.road3.getBytesTotal() > 0)) && (bgMCHolder.road3.getBytesLoaded() > 0)) {
bgMCHolder.road3.bgRoad.gotoAndStop(Math.round(Math.random() * totalRoadFrames) + 1);
bgMCHolder.rd3 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.road4.getBytesLoaded() >= bgMCHolder.road4.getBytesTotal()) && (bgMCHolder.road4.getBytesTotal() > 0)) && (bgMCHolder.road4.getBytesLoaded() > 0)) {
bgMCHolder.road4.bgRoad.gotoAndStop(Math.round(Math.random() * totalRoadFrames) + 1);
bgMCHolder.rd4 = true;
_local2 = _local2 + 1;
}
if (((bgMCHolder.road5.getBytesLoaded() >= bgMCHolder.road5.getBytesTotal()) && (bgMCHolder.road5.getBytesTotal() > 0)) && (bgMCHolder.road5.getBytesLoaded() > 0)) {
bgMCHolder.road5.bgRoad.gotoAndStop(Math.round(Math.random() * totalRoadFrames) + 1);
bgMCHolder.rd5 = true;
_local2 = _local2 + 1;
}
return(_local2);
};
GameEnvironment.prototype.loadBGExternal = function (clip, filename) {
clip.loadMovie(filename);
};
GameEnvironment.prototype.loadAllBG = function (bgPlaceHolder, id, name) {
var _local5;
var _local6;
if (_level0.WAPI == undefined) {
fileName = ("bg" + name) + ".swf";
} else {
fileName = ("SWF/ARCADE/GAMES/SkaterKat/bg" + name) + ".swf";
}
iCnt = 1;
while (iCnt <= 5) {
this.loadBGExternal(bgPlaceHolder[id + iCnt], fileName);
iCnt++;
}
};
GameEnvironment.prototype.setInvincibility = function (flag) {
this.godMode = flag;
};
GameEnvironment.prototype.invincibileSetTimer = function () {
this.setInvincibility(true);
var _local3;
charMC = this.getCharacter().getCharacterMC();
var _local2 = new Color(charMC);
this.godModeTimer = setInterval(this, "invincibileCloseTimer", this.GOD_TIMER_LIMIT, _local2, _local2.getTransform());
this.flashModeTimer = setInterval(this, "flashTimer", 10, _local2, _local2.getTransform(), 100, 100, 100);
};
GameEnvironment.prototype.flashTimer = function (colorObj, oldTransform, r, g, b) {
var _local1 = colorObj.getTransform();
if (random(2) == 1) {
_local1.rb = r;
_local1.gb = g;
_local1.bb = b;
colorObj.setTransform(_local1);
} else {
colorObj.setTransform(oldTransform);
}
};
GameEnvironment.prototype.invincibileCloseTimer = function (colorObj, oldTransform) {
clearInterval(this.godModeTimer);
clearInterval(this.flashModeTimer);
this.setInvincibility(false);
colorObj.setTransform(oldTransform);
};
GameEnvironment.prototype.preLoadSoundPlaceHolder = function (lvlNum) {
var _local3;
loadSoundObj = this.getSound("gameMusic2");
var _local2;
preloadingLevel = this.getLevel(lvlNum);
var _local4;
if (_level0.WAPI == undefined) {
musicPath = this.getBGName(preloadingLevel.type).toLowerCase() + ".mp3";
} else {
musicPath = ("SWF/ARCADE/GAMES/SkaterKat/" + this.getBGName(preloadingLevel.type).toLowerCase()) + ".mp3";
}
loadSoundObj.loadSoundExternal(musicPath, false);
};
GameEnvironment.prototype.queryForPreviousTrophyWin = function () {
var _local2 = ((((("RPC(" + _level0.WAPI.getUser().userid) + ",\"AwardTrophy::giveTrophy\",{\"view_DbId\":") + this.GAME_VIEW_ID) + ",\"itemClass_DbId\":") + this.DBID_TROPHY) + "})";
_level0.WAPI.APIToServer(_local2, this, this.previousTrophyWinCallback);
};
GameEnvironment.prototype.previousTrophyWinCallback = function (success, xml) {
var _local2 = xml.tocsTrophy[0];
if (success == true) {
if (Number(_local2.awarded) == 0) {
_global.gameRoot.gameEnv.goGameOver();
} else {
_level0.WAPI.onGetItem(success, xml);
_level0.WAPI.SetViewProgress(_global.gameRoot.gameEnv, _global.gameRoot.gameEnv.goVictory, 1, _global.gameRoot.gameEnv.GAME_VIEW_ID);
}
} else {
_global.gameRoot.gameEnv.goGameOver();
}
};
GameEnvironment.prototype.goVictory = function () {
this.statisticsEnv.setTrophyWon(true);
this.receivedTrophy = true;
this.levelEnv.setOffScreenGame(false);
this.self.gotoAndPlay("victory");
};
GameEnvironment.prototype.goGameOver = function () {
this.levelEnv.levelOver();
this.character.deleteCharacter();
this.self.gotoAndPlay("gameOver");
};
GameStatistics.prototype.init = function (self, gameMenuMC, curLevel) {
this.self = self;
this.curLevel = curLevel;
this.menu_mc = gameMenuMC;
this.score = 0;
this.cash = 0;
this.cashBonus = 0;
this.happiness = 0;
this.win = 2;
this.HAPPINESS_GAIN = 2;
this.HAPPINESS_LOSS = 2;
this.POINTS_PER_FRAME = 19;
this.POINTS_PER_LEVEL = 500;
this.BONUS_POINTS_PER_LEVEL = 50;
this.POINTS_PER_KINZCASH = 150;
this.MAX_LIFE = 4;
this.levelEndBonus = 0;
this.accelerateBonus = 0;
this.trophyReceived = false;
this.chgLevel(curLevel);
};
GameStatistics.prototype.damageMeterUpdate = function (indexWheel, totalDamageLeft, wheelShow_bln) {
this.self.self.stats.debugtext.text = this.self.self.stats.debugtext.text + ((("\nDAMAGE visible =" + wheelShow_bln) + " index=") + indexWheel);
if (wheelShow_bln) {
this.skateframeNum = ((indexWheel == 0) ? 1 : (indexWheel));
this.menu_mc.skateBoard["skate" + indexWheel].gotoAndStop(1);
} else {
this.skateframeNum = indexWheel + 1;
this.menu_mc.skateBoard["skate" + indexWheel].gotoAndPlay(2);
}
this.menu_mc.skateBoard.gotoAndStop(this.skateframeNum);
if (totalDamageLeft == 0) {
this.setWinState(1);
}
};
GameStatistics.prototype.resetDamageMeter = function (totNumWheels) {
var _local3;
iCnt = 1;
while (iCnt <= totNumWheels) {
this.menu_mc.skateBoard["skate" + iCnt].gotoAndStop(1);
iCnt++;
}
this.menu_mc.skateBoard.gotoAndStop(1);
};
GameStatistics.prototype.setWinState = function (exitType) {
this.win = exitType;
};
GameStatistics.prototype.getWinState = function () {
return(this.win);
};
GameStatistics.prototype.addScore = function (num) {
this.score = this.score + num;
if (!this.self.self.isTutorialMode()) {
_global.gameRoot.scoreBarObj.addToScore(num);
}
};
GameStatistics.prototype.addCashBonus = function (num) {
this.cashBonus = this.cashBonus + num;
this.updateCash();
};
GameStatistics.prototype.updateCash = function () {
var _local3;
curPoints = Math.floor(this.score / this.POINTS_PER_KINZCASH);
this.cash = curPoints + this.cashBonus;
if (!this.self.self.isTutorialMode()) {
_global.gameRoot.scoreBarObj.setKinzcash(this.cash);
}
};
GameStatistics.prototype.chgLevel = function (num) {
_global.gameRoot.scoreBarObj.setLevel(num);
this.curLevel = num;
};
GameStatistics.prototype.updateStats = function (addScore, addCash) {
this.addCashBonus(addCash);
this.addScore(addScore);
};
GameStatistics.prototype.updatePlayingStats = function () {
var _local2;
newScoreToAdd = int((this.POINTS_PER_FRAME + this.curLevel) + (Math.floor((1 + this.curLevel) / 2) * this.accelerateBonus));
this.addScore(newScoreToAdd);
this.updateCash();
};
GameStatistics.prototype.updateEndOfLevelStats = function () {
this.levelEndBonus = int(this.POINTS_PER_LEVEL + (this.BONUS_POINTS_PER_LEVEL * this.curLevel));
this.incHappiness();
_global.tracercall("CHANGE LEVEL" + this.happiness);
this.addScore(this.levelEndBonus);
this.updateCash();
};
GameStatistics.prototype.displayGameOverStats = function (clipObj) {
clipObj.gameover_cash = this.getKinzPayout();
clipObj.gameover_score = this.getScore();
var _local4;
rootMC = this.self.getRootMC();
if (this.trophyReceived) {
this.setWinState(2);
}
this.updateHappiness();
switch (_global.tapi_obj.getCurrentTournament().getGameType()) {
case 1 :
_global.tracercall("TOURNAMENT: Best Score");
win = Number(this.getWinState()) + 10;
this.setWinState(win);
break;
case 2 :
_global.tracercall("TOURNAMENT: Best Score Ladder");
win = Number(this.getWinState()) + 20;
this.setWinState(win);
break;
case 3 :
_global.tracercall("TOURNAMENT: PvP Ladder");
break;
case 4 :
_global.tracecall("TOURNAMENT: PvP");
win = Number(this.getWinState()) + 70;
this.setWinState(win);
break;
default :
_global.tracercall("TOURNAMENT: Type Unknown");
}
rootMC.submitGameStats(this.getScore(), this.getKinzPayout(), this.getHappiness(), this.getWinState(), this.getCurLevel());
};
GameStatistics.prototype.getKinzPayout = function () {
return(_global.gameRoot.scoreBarObj.getKinzcash());
};
GameStatistics.prototype.getScore = function () {
return(_global.gameRoot.scoreBarObj.getScore());
};
GameStatistics.prototype.setGameProgressBar = function (barXPos) {
this.menu_mc.progress_bar.scroll._x = barXPos;
};
GameStatistics.prototype.incHappiness = function () {
this.happiness = this.happiness + this.HAPPINESS_GAIN;
};
GameStatistics.prototype.getHappiness = function () {
return(this.happiness);
};
GameStatistics.prototype.updateHappiness = function () {
if (this.getWinState() == 2) {
this.happiness = this.happiness + 20;
}
this.happiness = this.happiness - this.HAPPINESS_LOSS;
};
GameStatistics.prototype.resetAllStats = function (curLevel) {
this.curLevel = curLevel;
this.score = 0;
this.cash = 0;
this.cashBonus = 0;
this.happiness = 0;
this.win = -1;
this.levelEndBonus = 0;
this.updateCash();
this.addScore(0);
};
GameStatistics.prototype.setAccelerateBonus = function (val) {
this.accelerateBonus = val;
};
GameStatistics.prototype.setTrophyWon = function (val) {
this.trophyReceived = val;
};
GameStatistics.prototype.getCurLevel = function () {
_global.tracercall("Returning the current Level the user is on " + _global.gameRoot.scoreBarObj.getLevel());
return(_global.gameRoot.scoreBarObj.getLevel());
};
SkateBoard.prototype.init = function (self, height) {
this.self = self;
this.height = height;
this.numOfWheelsLeft = 4;
this.MAX_NUM_OF_WHEELS = 4;
this.numOfWheelsArr = new Array(-1, 1, 1, 1, 1);
};
SkateBoard.prototype.loseAWheel = function () {
var _local2;
iCnt = 0;
while (iCnt < this.numOfWheelsArr.length) {
if ((this.numOfWheelsArr[iCnt] == 1) && (this.numOfWheelsArr[iCnt] != -1)) {
this.numOfWheelsArr[iCnt] = 0;
this.numOfWheelsLeft = this.numOfWheelsLeft - 1;
break;
}
iCnt++;
}
return(iCnt);
};
SkateBoard.prototype.removeWheelMC = function (wheelIndex) {
this.self["wheel" + wheelIndex]._visible = false;
};
SkateBoard.prototype.getNumberOfWheels = function () {
return(this.numOfWheelsLeft);
};
SkateBoard.prototype.addAWheel = function () {
var _local2;
if (this.getNumberOfWheels() != this.MAX_NUM_OF_WHEELS) {
iCnt = this.numOfWheelsArr.length;
while (iCnt > 0) {
if ((this.numOfWheelsArr[iCnt] == 0) && (this.numOfWheelsArr[iCnt] != -1)) {
this.numOfWheelsArr[iCnt] = 1;
this.numOfWheelsLeft = this.numOfWheelsLeft + 1;
break;
}
iCnt--;
}
} else {
iCnt = 0;
}
return(iCnt);
};
SkateBoard.prototype.addWheelMC = function (wheelIndex) {
this.self["wheel" + wheelIndex]._visible = true;
};
SkateBoard.prototype.resetWheelsMC = function () {
var _local2;
iCnt = 1;
while (iCnt < this.numOfWheelsArr.length) {
this.addWheelMC(iCnt);
this.numOfWheelsArr[iCnt] = 1;
iCnt++;
}
this.numOfWheelsLeft = this.MAX_NUM_OF_WHEELS;
};
CharacterHero.prototype.init = function (self, clip, dep, rotation_speed, statsObj) {
this.self = self;
this.rootMC = this.self.getRootMC();
this.clipHolder = clip;
this.depth = dep;
this.enabled = false;
this.rotationSpeed = rotation_speed;
this.playerRotation = 0;
this.jumpActionOn = false;
this.jumpdoubleActionOn = false;
this.jumpAnimationOn = false;
this.MAX_JUMP_HEIGHT = 60;
this.BOUNCE_OFF_WALLS_ROTATION_RATE = 4;
this.jumpHeight = 0;
this.xScreenPlacement = 386.9;
this.yScreenPlacement = 520;
this.xCharPlayerPos = -38.8;
this.yCharPlayerPos = -76;
this.DEGREE_ROTATE_IDLE = 10;
this.DEGREE_ROTATE_LEFT = 30;
this.DEGREE_ROTATE_RIGHT = 30;
this.BUBBLE_SIZE_SCALE = 70;
this.stats = statsObj;
this.DEFAULT_STATE = "normal";
this.state = this.DEFAULT_STATE;
};
CharacterHero.prototype.reInit = function () {
this.playerRotation = 0;
this.jumpActionOn = false;
this.jumpdoubleActionOn = false;
this.jumpAnimationOn = false;
this.jumpHeight = 0;
this.state = this.DEFAULT_STATE;
};
CharacterHero.prototype.createPlaceHolder = function () {
this.clipHolder = this.rootMC.attachMovie("Webkinz PlaceHolder", "player", this.depth);
this.vBubblePlayer = this.rootMC.attachMovie("vbubble", "vbubble", int(this.depth + 2));
this.vBubblePlayer._visible = false;
this.vBubblePlayer._xscale = (this.vBubblePlayer._yscale = this.BUBBLE_SIZE_SCALE);
this.defaultPosition();
var _local2;
tmpclipHolder = this.rootMC.createEmptyMovieClip("playerHitSound", 1390299);
this.soundGame = new SoundMusic(this, tmpclipHolder, 100);
this.soundGame.createSound();
this.self.addSound("characterHit", this.soundGame);
var _local3;
tmpclipHolder2 = this.rootMC.createEmptyMovieClip("playerSound", int(this.depth + 1));
this.soundChar = new SoundMusic(this, tmpclipHolder2, 100);
this.soundChar.createSound();
this.self.addSound("characterSay", this.soundChar);
};
CharacterHero.prototype.defaultPosition = function () {
this.vBubblePlayer._x = -10000;
this.vBubblePlayer._y = this.yScreenPlacement - 10;
this.clipHolder._x = this.xScreenPlacement;
this.clipHolder._y = this.yScreenPlacement;
this.clipPlayer._x = this.xCharPlayerPos;
this.clipPlayer._y = this.yCharPlayerPos;
this.clipHolder._rotation = 0;
this.playerRotation = 0;
};
CharacterHero.prototype.loadInternalChar = function (linkageID) {
this.createPlaceHolder();
this.clipHolder.attachMovie(linkageID, "hero_mc", 1);
this.clipPlayer = this.clipHolder.hero_mc;
this.clipPlayer.character = this;
this.defaultPosition();
this.clipHolder.hitOuter2._visible = (this.clipHolder.hitOuter1._visible = (this.clipHolder.hitOuter._visible = false));
this.skateboard = new SkateBoard(this.clipPlayer);
this.clipHolder.character = this;
this.clipHolder.cnt = 0;
this.clipHolder.swapDepths(this.depth);
this.clipHolder.onEnterFrame = this.startMoving;
};
CharacterHero.prototype.loadExternalChar = function (fn) {
this.clipPlayer = this.clipHolder.createEmptyMovieClip("hero", 1);
this.clipPlayer.loadMovie(fn);
this.clipPlayer._x = this.xCharPlayerPos;
this.clipPlayer._y = this.yCharPlayerPos;
};
CharacterHero.prototype.moveDirection = function (direction) {
this.direction = direction;
if (direction > 0) {
this.playerRotation = this.playerRotation + (this.rotationSpeed * localMovie.frameWatcher.currentFramerate);
} else {
this.playerRotation = this.playerRotation - (this.rotationSpeed * localMovie.frameWatcher.currentFramerate);
}
traceit("CharacterHero currentFramerate " + localMovie.frameWatcher.currentFramerate);
if (this.playerRotation > 60) {
this.playerRotation = 60;
} else if (this.playerRotation < -60) {
this.playerRotation = -60;
}
};
CharacterHero.prototype.getCharRotation = function () {
return(this.playerRotation);
};
CharacterHero.prototype.startMoving = function () {
if (this.character.self.levelEnv.levelEnabled()) {
var _local2 = this.character;
var _local4;
rotation = _local2.getCharRotation();
this._rotation = rotation;
if (!_local2.jumpdoubleActionOn) {
if ((rotation < _local2.DEGREE_ROTATE_IDLE) && (rotation > (-_local2.DEGREE_ROTATE_IDLE))) {
_local2.clipPlayer.hero.gotoAndStop("idle");
} else if ((rotation > _local2.DEGREE_ROTATE_IDLE) && (rotation < _local2.DEGREE_ROTATE_RIGHT)) {
_local2.clipPlayer.hero.gotoAndStop("right1");
} else if (rotation > _local2.DEGREE_ROTATE_RIGHT) {
_local2.clipPlayer.hero.gotoAndStop("right2");
} else if ((rotation > (-_local2.DEGREE_ROTATE_LEFT)) && (rotation < (-_local2.DEGREE_ROTATE_IDLE))) {
_local2.clipPlayer.hero.gotoAndStop("left1");
} else if (rotation < (-_local2.DEGREE_ROTATE_LEFT)) {
_local2.clipPlayer.hero.gotoAndStop("left2");
}
_local2.jumpMovement(0.8);
}
var _local3;
dx = Math.sin((rotation * Math.PI) / 180) * 16;
_local2.sideMovement(dx);
_local2.detectCollision();
}
};
CharacterHero.prototype.sideMovement = function (move_speed) {
var _local3;
player = this.clipHolder;
if (((player._x + move_speed) > 150) && ((player._x + move_speed) < 650)) {
player._x = player._x + move_speed;
this.vBubblePlayer._x = player._x - 20;
this.rootMC.stats.angle.text = (((Math.Round(move_speed) + "|") + player._rotation) + "|") + player._x;
} else if ((player._x + move_speed) < 150) {
if (this.playerRotation <= -25) {
this.playerRotation = this.playerRotation + this.BOUNCE_OFF_WALLS_ROTATION_RATE;
} else if (this.playerRotation <= -15) {
this.playerRotation = this.playerRotation + 2;
} else if (this.playerRotation <= 0) {
this.playerRotation = this.playerRotation + 1;
}
player._x = 150;
} else if ((player._x + move_speed) > 650) {
if (this.playerRotation >= 25) {
this.playerRotation = this.playerRotation - this.BOUNCE_OFF_WALLS_ROTATION_RATE;
} else if (this.playerRotation > 15) {
this.playerRotation = this.playerRotation - 2;
} else if (this.playerRotation > 0) {
this.playerRotation = this.playerRotation - 1;
}
player._x = 650;
}
};
CharacterHero.prototype.setVisible = function (value) {
this.clipHolder._visible = value;
};
CharacterHero.prototype.moveJump = function (value) {
this.jumpActionOn = value;
if (!this.jumpdoubleActionOn) {
this.rootMC.stats.jumpObstacle.text = "Y";
this.rootMC.stats.doublejumpObstacle.text = "";
} else {
this.rootMC.stats.jumpObstacle.text = "N";
this.rootMC.stats.doublejumpObstacle.text = "";
}
};
CharacterHero.prototype.isCharJumping = function () {
return(this.jumpActionOn || (this.jumpdoubleActionOn));
};
CharacterHero.prototype.checkDoubleJump = function () {
if ((this.jumpActionOn && (!this.jumpdoubleActionOn)) && (this.jumpHeight >= (this.MAX_JUMP_HEIGHT - 20))) {
this.jumpdoubleActionOn = true;
this.moveJump(false);
this.rootMC.stats.doublejumpObstacle.text = "Y";
this.rootMC.stats.jumpObstacle.text = "";
this.gotoState("dbljump");
this.soundGame.stopSound();
this.soundGame.loadSoundInternal("snd_dblJump", true, 1);
return(true);
}
return(false);
};
CharacterHero.prototype.jumpMovement = function (secondsLast) {
var _local2;
limit = this.self.frameRate * secondsLast;
if (this.jumpActionOn) {
if (!this.jumpdoubleActionOn) {
player.cnt = player.cnt + 1;
this.jumpHeight = this.jumpHeight + 2;
this.rootMC.stats.jumpHeight.text = this.jumpHeight;
if ((player.cnt >= limit) && (this.jumpHeight >= this.MAX_JUMP_HEIGHT)) {
this.gotoState("normal");
this.moveJump(false);
player.cnt = 0;
this.jumpHeight = 0;
this.jumpAnimationOn = false;
this.rootMC.cantJump = true;
} else if (!this.jumpAnimationOn) {
this.soundGame.stopSound();
this.soundGame.loadSoundInternal("snd_Jump", true, 1);
this.gotoState("jump");
this.jumpAnimationOn = true;
}
}
}
};
CharacterHero.prototype.detectCollision = function () {
if (this.self.isGameEnabled()) {
if (!this.isCrashed()) {
if (this.self.checkCollision(this.clipHolder, this.jumpHeight)) {
this.damageSkateboard();
}
}
}
};
CharacterHero.prototype.damageSkateboard = function () {
if (!this.self.godMode) {
var _local3;
indexWheel = this.skateboard.loseAWheel();
this.skateboard.removeWheelMC(indexWheel);
if (this.skateboard.getNumberOfWheels() != 0) {
this.gotoState("crash");
_global.tracercall("CharacterHero.damageSkateboard() Crash");
this.activateEventHitSequence("snd_" + this.getCollidedWithType().toLowerCase(), "vhit", 3);
} else {
this.self.setGameEnabled(false);
this.gotoState("fall");
this.activateEventHitSequence("snd_bootsgameover", "vgameover", 3);
}
this.stats.damageMeterUpdate(indexWheel, this.skateboard.getNumberOfWheels(), false);
}
};
CharacterHero.prototype.repairSkateboard = function () {
var _local2;
indexWheel = this.skateboard.addAWheel();
this.skateboard.addWheelMC(indexWheel);
this.stats.damageMeterUpdate(indexWheel, this.skateboard.getNumberOfWheels(), true);
};
CharacterHero.prototype.deleteCharacter = function () {
this.vBubblePlayer.removeMovieClip();
this.clipPlayer.removeMovieClip();
this.soundGame.removeSound();
this.soundChar.removeSound();
};
CharacterHero.prototype.repairEntireSkateboard = function () {
this.skateboard.resetWheelsMC();
this.stats.resetDamageMeter(this.skateboard.MAX_NUM_OF_WHEELS);
};
CharacterHero.prototype.gotoState = function (frameLbl) {
this.state = frameLbl;
this.clipPlayer.gotoAndStop(frameLbl);
};
CharacterHero.prototype.isCrashed = function () {
if ((this.state == "fall") || (this.state == "crash")) {
return(true);
}
return(false);
};
CharacterHero.prototype.getCollidedWithType = function () {
return(this.collidedType);
};
CharacterHero.prototype.setCollidedWithType = function (type) {
this.collidedType = type;
};
CharacterHero.prototype.playSound = function (type, play) {
if (play) {
this.soundGame.loadSoundInternal("snd_" + type, true, 10000);
} else {
this.soundGame.stopSound();
}
};
CharacterHero.prototype.getCharacterMC = function () {
return(this.clipHolder);
};
CharacterHero.prototype.activateEventHitSequence = function (hitSoundName, charSaying, randomCharSayNum) {
_global.tracercall("obstacle type hit charSaying=" + charSaying);
this.soundGame.stopSound();
this.soundGame.loadSoundInternal(hitSoundName, true, 1);
var _local5;
randSound = Math.round(Math.random() * randomCharSayNum) + 1;
this.soundChar.stopSound();
this.soundChar.loadSoundInternal(charSaying + randSound, true, 1);
this.showVoiceBubble(charSaying + randSound);
};
CharacterHero.prototype.showVoiceBubble = function (charnameofmc) {
var _local2;
charMC = this.vBubblePlayer;
charMC._x = this.getCharacterMC()._x;
charMC._visible = true;
charMC.say.createEmptyMovieClip("word", 1);
charMC.say.word.attachMovie(charnameofmc, "letters", 2);
charMC.say._x = -170;
charMC.say._y = -103;
charMC.say.play();
};
SoundMusic.prototype.init = function (self, clip, volume) {
this.self = self;
this.clip = clip;
this.depth = 1000;
this.volume = volume;
this.curVolume = volume;
this.setSoundOn(true);
};
SoundMusic.prototype.createSound = function () {
SoundMusic.cnt = SoundMusic.cnt + 1;
var _local2;
soundMCHolder = this.clip.createEmptyMovieClip("soundClip", this.depth);
if (this.soundObj == undefined) {
}
this.soundObj = new Sound(soundMCHolder);
};
SoundMusic.prototype.addSoundToGroupList = function () {
var _local2;
soundExists = false;
if (typeof(SoundMusic.addToStaticList) == "undefined") {
SoundMusic.addToStaticList = new Array();
}
i = 0;
while (i < SoundMusic.addToStaticList.length) {
if (SoundMusic.addToStaticList[i].getSoundFilePath() == this.getSoundFilePath()) {
soundExists = true;
break;
}
i++;
}
if (!soundExists) {
SoundMusic.addToStaticList.push(this);
}
};
SoundMusic.prototype.loadSoundExternal = function (filename, play, loopTimes) {
this.curFile = filename;
_global.tracercall("\tSoundMusic: Loading sound file: " + this.curFile);
var localObj = this;
this.soundObj.onLoad = function (success) {
function startForDuration() {
_global.tracercall("\t\tStarting duration" + theSound.duration);
if (theSound.duration > 0) {
clearInterval(intID);
localObj.addSoundToGroupList();
if (play) {
if (arguments.length == 3) {
localObj.playSound(loopTimes);
} else {
localObj.playSound();
}
}
}
}
var _local6;
theSound = this;
if (success) {
if (theSound.duration > 0) {
localObj.addSoundToGroupList();
if (play) {
localObj.playSound();
}
} else {
var _local4 = setInterval(startForDuration, 200);
}
} else {
_global.tracercall("SoundMusic.loadSoundExternal FAILED TO load in filename=" + filename);
}
};
this.soundObj.loadSound(this.curFile, false);
};
SoundMusic.prototype.loadSoundInternal = function (linkageID, play, loopTimes) {
this.soundObj.attachSound(linkageID);
this.addSoundToGroupList();
if (play) {
if (arguments.length == 3) {
this.playSound(loopTimes);
}
}
};
SoundMusic.prototype.playSound = function (loop) {
if (arguments.length == 1) {
this.soundObj.start(0, loop);
} else {
this.soundObj.start();
}
if (this.curVolume != 0) {
this.setVolume(this.volume);
}
this.soundOn = true;
};
SoundMusic.prototype.stopSound = function () {
this.soundObj.stop();
this.soundOn = false;
};
SoundMusic.prototype.setVolume = function (vol) {
this.soundObj.setVolume(vol);
this.curVolume = vol;
};
SoundMusic.prototype.isSoundLoaded = function () {
if (this.soundObj.duration > 0) {
return(true);
}
return(false);
};
SoundMusic.prototype.getSoundFilePath = function () {
return(this.curFile);
};
SoundMusic.prototype.isSoundOn = function () {
return(this.soundOn);
};
SoundMusic.prototype.setSoundOn = function (flag) {
this.soundOn = flag;
};
SoundMusic.prototype.removeSound = function () {
this.stopSound();
this.clip.soundClip.removeMovieClip();
delete this.soundObj;
};
Obstacle.prototype.init = function (self, id, linkageID, type, xi, yi, size, speedMovement, isBonus, vhdir) {
if (arguments.length > 0) {
this.self = self;
this.id = id;
this.linkageID = linkageID;
this.typeName = type;
this.speed = speedMovement;
this.size = size;
this.x = xi;
this.y = yi;
this.z = 0;
this.zone = 0;
Obstacle.totalObstacles = Obstacle.totalObstacles + 1;
this.bonusObs = isBonus;
this.vhDir = vhdir;
this.loadInternalObs();
}
};
Obstacle.prototype.loadInternalObs = function () {
var _local6;
var _local7;
var _local3;
var _local8;
rootMC = this.self.rootMC;
this.obMC = rootMC.createEmptyMovieClip("obstacle_" + this.id, int(100 + this.id));
outerCircleLoc = (this.size - 1) * (this.self.PIXEL_SIZE_OF_BLOCK / 2);
if (this.size > 1) {
var _local2 = this.obMC.createEmptyMovieClip(this.linkageID, 1);
_local2.attachMovie("hitAreaOuter", "hitOuter", 1);
_local2.hitOuter._width = (_local2.hitOuter._height = this.self.PIXEL_SIZE_OF_BLOCK * this.size);
_local3 = this.obMC.attachMovie(this.linkageID + "L", "hitInnerL", 2);
oCircleMCR = this.obMC.attachMovie(this.linkageID + "R", "hitInnerR", 3);
_local3._x = 0;
oCircleMCR._x = this.self.PIXEL_SIZE_OF_BLOCK * (this.size - 1);
if ((this.vhDir == 2) && (this.getType().toLowerCase() == "horse")) {
_local3.gotoAndStop(2);
oCircleMCR.gotoAndStop(2);
}
if (this.size > 2) {
var _local5;
iCnt = 0;
while (iCnt < (this.size - 2)) {
var _local4 = this.obMC.attachMovie(this.linkageID, "hitInner" + iCnt, 4 + iCnt);
_local4._x = this.self.PIXEL_SIZE_OF_BLOCK * (iCnt + 1);
_local4.hitInner._visible = false;
if ((this.vhDir == 2) && (this.getType().toLowerCase() == "horse")) {
_local4.gotoAndStop(2);
}
iCnt++;
}
}
_local3.hitInner._visible = false;
oCircleMCR.hitInner._visible = false;
_local2.hitOuter._visible = false;
} else {
var _local2 = this.obMC.createEmptyMovieClip(this.linkageID, 1);
_local2.attachMovie("hitAreaOuter", "hitOuter", 1);
_local2.hitOuter._width = (_local2.hitOuter._height = this.self.PIXEL_SIZE_OF_BLOCK * this.size);
var _local4 = this.obMC.attachMovie(this.linkageID, this.linkageID, 2);
_local2._visible = false;
_local4.hitInner._visible = false;
}
this.obMC._x = (this.x * this.self.PIXEL_SIZE_OF_BLOCK) + (this.self.PIXEL_SIZE_OF_BLOCK / 2);
_local2._x = OuterCircleLoc;
this.obMC._y = (this.y * this.self.PIXEL_SIZE_OF_BLOCK) + 40;
this.obMC._rotation = this.obMC._rotation + (-90 * (this.vhDir - 1));
this.obMC.objObs = this;
this.startMoving();
};
Obstacle.prototype.removeObstacleFromPlay = function () {
this.self.removeObstacleFromList(this.id);
Obstacle.totalObstacles = Obstacle.totalObstacles - 1;
};
Obstacle.prototype.startMoving = function () {
this.obMC.onEnterFrame = function () {
if (Obstacle.action == "move") {
this._y = this._y + Obstacle.speed;
if (this.objObs.vhdir == 1) {
var _local2 = this.objObs.self.PIXEL_SIZE_OF_BLOCK;
} else {
var _local2 = (this.objObs.size + 1) * this.objObs.self.PIXEL_SIZE_OF_BLOCK;
}
if (this._y > 800) {
this.onEnterFrame = null;
this.objObs.removeObstacleFromPlay();
this.objObs.destroyObstacle();
this.objObs.setZone(-1);
} else if (this._y > 400) {
this.objObs.setZone(2);
} else if (this._y > _local2) {
this.objObs.setZone(1);
if (this.objObs.removeFlag == undefined) {
if (this.objObs.vhdir == 2) {
this.objObs.self.removeObstacleAttachPoints(this.objObs.id, this.objObs.x, 1);
} else {
this.objObs.self.removeObstacleAttachPoints(this.objObs.id, this.objObs.x, this.objObs.size);
}
this.objObs.removeFlag = true;
}
} else {
this.objObs.setZone(0);
}
}
};
};
Obstacle.prototype.getPlaceHolderMC = function () {
return(this.obMC);
};
Obstacle.prototype.getOuterMC = function () {
return(this.obMC[this.linkageID]);
};
Obstacle.prototype.getInnerMC = function () {
return(this.obMC);
};
Obstacle.prototype.isObjAtZone = function (zoneNum) {
if (this.zone == zoneNum) {
return(true);
}
return(false);
};
Obstacle.prototype.setZone = function (zoneNum) {
this.zone = zoneNum;
};
Obstacle.prototype.getType = function () {
return(this.typeName);
};
Obstacle.prototype.isBonusObs = function () {
return(this.bonusObs);
};
Obstacle.prototype.destroyObstacle = function () {
this.obMC.removeMovieClip();
};
Obstacle.prototype.getSize = function () {
return(this.size);
};
Obstacle.prototype.getHeight = function () {
return(this.z);
};
Level.prototype.init = function (self, levelNum, statsObj) {
this.self = self;
this.rootMC = this.self.getRootMC();
this.lvlNum = levelNum;
this.lvlInfo = new Object();
this.obstacleObjList = new Array();
this.numOfObstacles = 0;
this.availableStartPtList = new Array();
this.GENERATE_OBSTACLE_FRAME_RATE = 10;
this.PIXEL_SIZE_OF_BLOCK = 40;
this.PIXEL_SECTIONV = 600;
this.HSCREEN_MAX_BLOCKS = 800 / this.PIXEL_SIZE_OF_BLOCK;
this.VSCREEN_MAX_BLOCKS = 600 / this.PIXEL_SIZE_OF_BLOCK;
this.ROFFSET_HSCREEN_INVALID_BLOCKS = 3;
this.DEPTH_ITEMS = new Array(2);
this.stats = statsObj;
this.bgAcceleration = 0;
this.finished_flag = false;
this.lvlSpeed = 0;
this.lvlVelocity = 0;
this.flag_continue = true;
this.endLevelFlag = false;
this.fallFlag = false;
this.reduce_obstacle_frame_rate = 0;
this.REDUCE_OBSTACLES_PER_LEVEL = 16;
this.REDUCE_BY_OBSTACLES = 3;
localMovie.initFramerate();
};
Level.prototype.setLevelInfo = function (lvlNum) {
this.setLevel(lvlNum);
this.lvlInfo = this.self.getLevel(this.lvlNum);
this.lvlSpeed = int(this.lvlInfo.speed);
var _local2 = new Obstacle();
Obstacle.setNewSpeed(this.getSpeed());
delete tmp;
};
Level.prototype.setLevel = function (lvlNum) {
this.lvlNum = lvlNum;
if (lvlNum != this.REDUCE_OBSTACLES_PER_LEVEL) {
var _local4;
perNum = Math.floor(this.lvlNum / this.REDUCE_OBSTACLES_PER_LEVEL) - 1;
perNum = ((perNum >= 0) ? (perNum) : 0);
this.reduce_obstacle_frame_rate = perNum * this.REDUCE_BY_OBSTACLES;
}
_global.tracercall((("\t\t\t\tSET LEVEL " + this.lvlNum) + "reduce=") + this.reduce_obstacle_frame_rate);
gGameroot.redefineFramerate();
};
Level.prototype.getStageLength = function () {
return(int(this.lvlInfo.stageLength));
};
Level.prototype.getType = function () {
return(this.lvlInfo.type);
};
Level.prototype.getSpeed = function () {
this.lvlVelocity = this.lvlSpeed + this.bgAcceleration;
traceit("Skaterkat Level.as framerate " + localMovie.frameWatcher.currentFramerate);
return(this.lvlVelocity * localMovie.frameWatcher.currentFramerate);
};
Level.prototype.setSpeed = function (newSpeed) {
this.lvlSpeed = newSpeed;
};
Level.prototype.setAcceleration = function (speedInc) {
this.bgAcceleration = speedInc;
};
Level.prototype.startLevel = function () {
var _local9;
var _local5;
var _local7;
stageLength = this.getStageLength();
barLength = this.rootMC.display_panel.progress_bar.bar._width;
var _local6;
this.continueGame();
thisLevel = this;
thisLevel.endLevelFlag = false;
thisLevel.finished_flag = false;
thisLevel.fallFlag = false;
Set("this.rootMC.frameCnt:Number", 0);
Set("this.rootMC.frameNum:Number", 0);
this.rootMC.frameNum = this.self.frameRate;
Set("this.rootMC.cnt:Number", 0);
this.rootMC.distance_elapsed = 0;
this.rootMC.last_attached = 0;
this.rootMC.extraDelay = 500;
this.rootMC.decaySpeed = this.getSpeed();
this.rootMC.dist_where_finishline_is = this.PIXEL_SECTIONV * (stageLength - 1);
this.rootMC.dist_done_at = this.PIXEL_SECTIONV * stageLength;
this.rootMC.dirSkid = "";
this.rootMC.now = new Date();
this.rootMC.curTime = 0;
this.rootMC.elapsedTime = 0;
this.rootMC.flagTime = true;
this.rootMC.onEnterFrame = function () {
if (thisLevel.levelEnabled()) {
this.cnt = this.cnt + 1;
if ((this.cnt >= this.frameNum) && (!thisLevel.endLevelFlag)) {
this.cnt = 0;
if (!this.isTutorialMode()) {
thisLevel.stats.updatePlayingStats();
}
}
thisLevel.continueGame();
stageSpeed = thisLevel.getSpeed();
this.distance_elapsed = this.distance_elapsed + Math.round(stageSpeed);
perc_complete = Math.round((this.distance_elapsed / (thisLevel.PIXEL_SECTIONV * stageLength)) * 100);
theFinish_line = this.dist_where_finishline_is - this.distance_elapsed;
if (this.isTutorialMode()) {
perc_complete = 1;
}
if ((theFinish_line <= 0) && (!thisLevel.finished_flag)) {
thisLevel.set_next_check_point();
this.decaySpeed = thisLevel.getSpeed();
}
var _local5;
curCharState = thisLevel.self.getCharacter().state;
if ((perc_complete < 100) && (thisLevel.endLevelFlag == false)) {
var _local6;
scrollBarPos = (perc_complete / 100) * barLength;
thisLevel.stats.setGameProgressBar(scrollBarPos);
if (curCharState == "fall") {
thisLevel.endLevelFlag = true;
thisLevel.finished_flag = true;
thisLevel.fallFlag = true;
}
} else {
if (this.flagTime) {
this.now = new Date();
this.curTime = this.now.getTime();
this.flagTime = false;
} else {
this.now = new Date();
this.elapsedTime = this.now.getTime() - this.curTime;
if ((this.elapsedTime >= 30000) && (!this.isTutorialMode())) {
_global.tracercall("SKA-7 Finished Flag" + this.isTutorialMode());
this.exitGame(0);
this.onEnterFrame = null;
}
}
thisLevel.endLevelFlag = true;
if (curCharState == "fall") {
thisLevel.fallFlag = true;
}
}
if (thisLevel.endLevelFlag) {
thisLevel.self.setGameEnabled(false);
if (thisLevel.finished_flag && (!this.isTutorialMode())) {
_global.tracercall("SKA-7 Finished Flag" + this.isTutorialMode());
var _local7;
gameSound = thisLevel.self.getSound("gameMusic");
if (gameSound.curVolume != 0) {
gameSound.setVolume(Math.ceil((this.decaySpeed / 7) * gameSound.volume));
}
if (thisLevel.fallFlag) {
this.decaySpeed = this.decaySpeed - 0.3;
} else {
this.decaySpeed = this.decaySpeed - 0.7;
var _local3 = thisLevel.self.getCharacter();
if ((_local3.clipHolder._x > 400) && (this.dirSkid == "")) {
this.dirSkid = "left";
} else if ((_local3.clipHolder._x < 400) && (this.dirSkid == "")) {
this.dirSkid = "right";
}
if (this.dirSkid == "left") {
_local3.playerRotation = _local3.playerRotation - 7;
} else if (this.dirSkid == "right") {
if (val != -10) {
val = val - 1;
}
_local3.playerRotation = _local3.playerRotation + 7;
}
}
if (this.decaySpeed <= 0) {
thisLevel.rootMC.pListener.accelerate = false;
_local3.playSound("accelerate", false);
thisLevel.finished_flag = false;
thisLevel.endLevelFlag = false;
thisLevel.setSpeed(0);
Obstacle.setNewSpeed(0);
if (thisLevel.fallFlag == false) {
_local3.gotoState("levelEnd");
} else if (thisLevel.self.getCharacter().state != "fall") {
_local3.gotoState("levelEnd");
}
thisLevel.pauseGame();
delete this.dirSkid;
this.onEnterFrame = null;
}
thisLevel.setSpeed(this.decaySpeed);
Obstacle.setNewSpeed(this.decaySpeed);
thisLevel.rootMC.stats.action.text = ("WAITING FOR END LEVEL " + this.decaySpeed) + (this.distance_elapsed - (this.dist_done_at + this.extraDelay));
}
thisLevel.blah = false;
} else if (theFinish_line > 0) {
this.frameCnt = this.frameCnt + 1;
this.stats.timeObstacle.text = thisLevel.GENERATE_OBSTACLE_FRAME_RATE - this.frameCnt;
var _local4 = thisLevel.GENERATE_OBSTACLE_FRAME_RATE - thisLevel.reduce_obstacle_frame_rate;
if ((thisLevel.blah == false) || (thisLevel.blah == undefined)) {
_global.tracercall(((((((" WHAT IS NUM=" + thisLevel.GENERATE_OBSTACLE_FRAME_RATE) + ", ") + thisLevel.reduce_obstacle_frame_rate) + "this.level=") + thisLevel.lvlNum) + "this.frameCnt") + this.frameCnt);
this.rootMC.stats.bgSpeed.text = ((" obs_frm_rt=" + thisLevel.GENERATE_OBSTACLE_FRAME_RATE) + " obs_reduce_frm_rt=") + thisLevel.reduce_obstacle_frame_rate;
thisLevel.blah = true;
}
if (this.frameCnt >= _local4) {
this.frameCnt = 0;
thisLevel.chanceToCreateObstacle();
}
}
thisLevel.bgFunction();
thisLevel.roadFunction();
} else {
thisLevel.pauseGame();
}
};
this.last_attached = 0;
};
Level.prototype.bgFunction = function () {
thisLevel = this;
var _local2;
i = 1;
while (i <= 3) {
if (thisLevel.bgMC["background" + i]._y >= 600) {
thisLevel.bgMC["background" + i].bgL.gotoAndStop(Math.floor(Math.random() * 3) + 1);
thisLevel.bgMC["background" + i].bgR.gotoAndStop(Math.floor(Math.random() * 3) + 1);
thisLevel.bgMC["background" + i]._y = thisLevel.bgMC[thisLevel.bgMC.top_bg_tile]._y - 300;
thisLevel.bgMC.top_bg_tile = thisLevel.bgMC["background" + i]._name;
}
thisLevel.bgMC["background" + i]._y = thisLevel.bgMC["background" + i]._y + thisLevel.getSpeed();
i++;
}
};
Level.prototype.roadFunction = function () {
thisLevel = this;
var _local2;
i = 1;
while (i <= 4) {
if (thisLevel.bgMC["road" + i]._y >= 594) {
thisLevel.bgMC["road" + i].bgRoad.gotoAndStop(Math.floor(Math.random() * 3) + 1);
thisLevel.bgMC["road" + i]._y = thisLevel.bgMC[thisLevel.bgMC.top_bgRoad_tile]._y - 199;
thisLevel.bgMC.top_bgRoad_tile = thisLevel.bgMC["road" + i]._name;
}
thisLevel.bgMC["road" + i]._y = thisLevel.bgMC["road" + i]._y + thisLevel.getSpeed();
i++;
}
};
Level.prototype.pauseGame = function () {
this.flag_continue = false;
var _local2 = new Obstacle();
Obstacle.stopAllObstacles();
};
Level.prototype.continueGame = function () {
this.flag_continue = true;
var _local2 = new Obstacle();
Obstacle.playAllObstacles();
};
Level.prototype.levelEnabled = function () {
return(this.flag_continue);
};
Level.prototype.endLevel = function () {
this.rootMC.stats.action.text = "END LEVEL";
this.setSpeed(0);
Obstacle.setNewSpeed(0);
this.clearLevel();
this.stats.updateEndOfLevelStats();
if (!this.self.initLevel(this.lvlNum + 1)) {
return(undefined);
}
this.stageEnd();
};
Level.prototype.levelOver = function () {
this.pauseGame();
var _local2;
tmp = new SoundMusic();
SoundMusic.stopAllSounds();
delete tmp;
this.rootMC.stats.action.text = "levelOver";
this.clearLevel();
this.setBackgroundAvailable(this.lvlNum - 1, false);
this.rootMC.stageStart_mc.removeMovieClip();
this.rootMC.stageEnd_mc.removeMovieClip();
this.self.setGameEnabled(false);
this.rootMC.attachMenuVisible(false);
};
Level.prototype.setOffScreenGame = function (val) {
this.pauseGame();
this.setBackgroundAvailable(this.lvlNum - 1, val);
this.self.getCharacter().setVisible(val);
this.rootMC.attachMenuVisible(val);
};
Level.prototype.set_next_check_point = function () {
var _local3;
thisLevel = this;
var _local2 = this.bgMC.attachMovie("finish_line", "checkpoint", 1000);
finish_line_attached = true;
_local2._y = -100;
_local2._x = 400;
_local2.offset = 5;
this.finished_flag = true;
_local2.onEnterFrame = function () {
if (this._y >= 800) {
this.removeMovieClip();
this.onEnterFrame = null;
}
this._y = this._y + thisLevel.getSpeed();
};
};
Level.prototype.chanceToCreateObstacle = function () {
var _local5;
var _local4;
var _local2;
var _local3;
flag = false;
allObstacles = this.self.getChanceObstacle(this.lvlNum);
allBonus = this.self.getChanceBonus(this.lvlNum);
for (j in allBonus) {
randNum = Math.floor(Math.Random() * 100);
if ((allBonus[j] >= randNum) && (allBonus[j] != 0)) {
this.rootMC.stats.createdObstacle.text = this.numOfObstacles;
if (this.createLevelObstacle(j, true)) {
flag = true;
break;
}
}
}
if (flag == false) {
for (i in allObstacles) {
randNum = Math.floor(Math.Random() * 100);
if ((allObstacles[i] >= randNum) && (allObstacles[i] != 0)) {
this.rootMC.stats.createdObstacle.text = this.numOfObstacles;
if (this.createLevelObstacle(i, false)) {
}
}
}
}
};
Level.prototype.createLevelObstacle = function (i, bonusBoolean) {
var _local5;
var _local7;
var _local6;
obstacleLocationOnScreen = new Array();
obstacleLocationInfo = this.findRandomAttachPoints(i);
if (obstacleLocationInfo != undefined) {
nameOfObs = i;
emptySpot = -1;
this.numOfObstacles = this.numOfObstacles + 1;
if (obstacleLocationInfo[3] == 2) {
this.setOccupiedAttachPoints(obstacleLocationInfo[0], 1, this.numOfObstacles);
} else {
this.setOccupiedAttachPoints(obstacleLocationInfo[0], obstacleLocationInfo[2], this.numOfObstacles);
}
if (emptySpot == -1) {
var _local3 = new Obstacle(this, this.numOfObstacles, nameOfObs, nameOfObs, obstacleLocationInfo[0], obstacleLocationInfo[1], obstacleLocationInfo[2], this.getSpeed(), bonusBoolean, obstacleLocationInfo[3]);
this.obstacleObjList.push(_local3);
this.rootMC.stats.debugtext.text = (((((((("Added Created the Obstacle= " + i) + ",") + nameOfObs) + " type=") + this.getType()) + "dir=") + obstacleLocationInfo[3]) + ",") + this.obstacleObjList.length;
} else {
var _local3 = new Obstacle(this, emptySpot, nameOfObs, nameOfObs, obstacleLocationInfo[0], obstacleLocationInfo[1], obstacleLocationInfo[2], this.getSpeed(), bonusBoolean, obstacleLocationInfo[3]);
this.obstacleObjList[emptySpot] = _local3;
this.rootMC.stats.debugtext.text = (((((((("Found Created the Obstacle= " + i) + ",") + nameOfObs) + " type=") + this.getType()) + "dir=") + obstacleLocationInfo[3]) + ",") + this.obstacleObjList.length;
}
this.showAvailSpots();
return(true);
}
return(false);
};
Level.prototype.findEmptySpot = function () {
var _local2 = 0;
while (_local2 < this.obstacleObjList.length) {
if (this.obstacleObjList[_local2] == undefined) {
return(_local2);
}
_local2++;
}
return(-1);
};
Level.prototype.setAvailableAttachPoints = function () {
var _local3;
var _local7;
_local3 = 0;
while (_local3 < this.HSCREEN_MAX_BLOCKS) {
k = 0;
while (k < this.VSCREEN_MAX_BLOCKS) {
var _local2 = boxesPlaceHolder.attachMovie("boxes", "box_" + ((_local3 * this.HSCREEN_MAX_BLOCKS) + k), (_local3 * this.VSCREEN_MAX_BLOCKS) + k);
_local2._y = (k * this.PIXEL_SIZE_OF_BLOCK) + 40;
_local2._x = _local3 * this.PIXEL_SIZE_OF_BLOCK;
_local2._width = (_local2._height = this.PIXEL_SIZE_OF_BLOCK);
var _local6;
newArray = new Array();
newArray.push({id:0, num:k});
k++;
}
this.availableStartPtList.push(newArray);
_local3++;
}
this.setDefaultNonAvailablePoints();
this.showAvailSpots();
};
Level.prototype.setDefaultNonAvailablePoints = function () {
var _local2;
lastIndex = this.HSCREEN_MAX_BLOCKS;
this.availableStartPtList[0][0].id = 2;
this.availableStartPtList[1][0].id = 2;
this.availableStartPtList[2][0].id = 2;
this.availableStartPtList[3][0].id = 2;
this.availableStartPtList[lastIndex - 3][0].id = 2;
this.availableStartPtList[lastIndex - 2][0].id = 2;
this.availableStartPtList[lastIndex - 1][0].id = 2;
};
Level.prototype.setOccupiedAttachPoints = function (indexXPos, spots, id) {
var _local5;
i = indexXPos;
while (i < (indexXPos + spots)) {
this.availableStartPtList[i][0].id = id;
i++;
}
};
Level.prototype.resetOccupiedAttachPoints = function () {
this.setOccupiedAttachPoints(0, this.HSCREEN_MAX_BLOCKS, 0);
this.setDefaultNonAvailablePoints();
};
Level.prototype.findRandomAttachPoints = function (type) {
var _local10;
var _local12;
var _local6;
randomPlaceInCharsPos = 50;
arrayOfIndex = new Array();
var _local9;
sizeObject = new Array();
sizeObject = this.self.getTypeObstacleSize(type);
if (sizeObject[0] == undefined) {
return(undefined);
}
var _local5;
var _local11;
vertical_horizontal_dir = 1;
if (this.self.getTypeObstacleViews(type) == 2) {
if (Math.floor(Math.random() * 100) <= 50) {
range = sizeObject[3];
size = sizeObject[2];
vertical_horizontal_dir = 2;
} else {
range = sizeObject[1];
size = sizeObject[0];
vertical_horizontal_dir = 1;
}
if (size != 1) {
placementSize = Math.ceil(Math.random() * range) + size;
} else {
placementSize = size;
}
} else if (sizeObject[1] == 0) {
placementSize = sizeObject[0];
} else {
placementSize = Math.floor(Math.random() * sizeObject[1]) + sizeObject[0];
}
if (vertical_horizontal_dir == 2) {
arrOfIndex = this.findConsectiveSpace(1);
} else {
arrOfIndex = this.findConsectiveSpace(placementSize);
}
this.rootMC.stats.possibleObstacle.text = arrOfIndex;
if (arrOfIndex.length != 0) {
var _local8;
randSpot = this.findRandomSpot(arrOfIndex);
if ((Math.round(Math.random() * 100) + 1) >= randomPlaceInCharsPos) {
var _local7;
var _local13;
mcChar = this.self.getCharacter().clipHolder;
posTargetOfChar = Math.ceil(mcChar._x / this.PIXEL_SIZE_OF_BLOCK);
if (posTargetOfChar >= (this.HSCREEN_MAX_BLOCKS - this.ROFFSET_HSCREEN_INVALID_BLOCKS)) {
posTargetOfChar = posTargetOfChar - 1;
}
var _local3 = 0;
while (_local3 < arrOfIndex.length) {
if (arrOfIndex[_local3] == posTargetOfChar) {
randSpot = posTargetOfChar;
_global.tracercall("\t\tFOUND" + posTargetOfChar);
break;
}
_local3++;
}
}
return([randSpot, 0, placementSize, vertical_horizontal_dir]);
}
return(undefined);
};
Level.prototype.findConsectiveSpace = function (slots) {
var _local2;
var _local6;
var _local5;
returnList = new Array();
listof = "";
_local2 = 0;
while (_local2 < this.HSCREEN_MAX_BLOCKS) {
listof = listof + ("," + this.availableStartPtList[_local2][0].id);
if (this.availableStartPtList[_local2][0].id == 0) {
if (slots > 1) {
var _local3 = true;
if (((_local2 + slots) - 1) < this.HSCREEN_MAX_BLOCKS) {
j = _local2 + 1;
while (j < (_local2 + slots)) {
if (this.availableStartPtList[j][0].id != 0) {
_local3 = false;
break;
}
j++;
}
if (_local3) {
returnList.push(_local2);
}
}
} else {
returnList.push(_local2);
}
}
if ((_local3 != undefined) && (!_local3)) {
}
_local2++;
}
return(returnList);
};
Level.prototype.removeObstacleAttachPoints = function (id, indexXpos, numOfExtraPieces) {
var _local4;
i = indexXpos;
while (i < (int(indexXpos) + int(numOfExtraPieces))) {
this.availableStartPtList[i][0].id = 0;
i++;
}
this.showAvailSpots();
};
Level.prototype.removeObstacleFromList = function (id) {
this.rootMC.stats.obs.text = "id =" + id;
var _local2 = 0;
while (_local2 < this.obstacleObjList.length) {
if (this.obstacleObjList[_local2].id == id) {
this.obstacleObjList.splice(_local2, 1);
this.rootMC.stats.obs.text = this.rootMC.stats.obs.text + ("\tObject list after " + this.obstacleObjList.length);
break;
}
_local2++;
}
};
Level.prototype.findRandomSpot = function (arrOfIndex) {
indexPos = Math.floor(Math.random() * (arrOfIndex.length - 1));
return(arrOfIndex[indexPos]);
};
Level.prototype.showAvailSpots = function () {
this.rootMC.stats.availObstacle.text = this.availableStartPtList[0][0].id;
var _local2 = 1;
while (_local2 < this.HSCREEN_MAX_BLOCKS) {
this.rootMC.stats.availObstacle.text = this.rootMC.stats.availObstacle.text + ("," + this.availableStartPtList[_local2][0].id);
_local2++;
}
};
Level.prototype.loadInLevelBGGraphics = function () {
var _local2;
if (this.lvlNum != 1) {
oldBGMC = this.rootMC["background_mc" + (this.lvlNum - 1)];
oldBGMC._x = -1000;
oldBGMC._visible = false;
}
this.bgMC = this.rootMC["background_mc" + this.lvlNum];
this.bgMC._visible = true;
this.bgMC._x = 0;
this.rootMC["preloaderBG_mc" + this.lvlNum]._x = 0;
};
Level.prototype.getListOfObstacles = function () {
return(this.obstacleObjList);
};
Level.prototype.chgMaxScrollScreen = function (increaseSpeed) {
var _local2;
newSpeed = Math.floor((this.getSpeed() * increaseSpeed) / 100);
this.setAcceleration(newSpeed);
this.rootMC.stats.bgSpeed.text = (("Accelerated by=" + newSpeed) + " curSpeed=") + this.getSpeed();
Obstacle.setNewSpeed(this.getSpeed());
};
Level.prototype.setBackgroundAvailable = function (index, val) {
this.rootMC["background_mc" + index]._visible = val;
if (val) {
this.rootMC["background_mc" + this.lvlNum]._x = 0;
} else {
this.rootMC["background_mc" + this.lvlNum]._x = -1000;
}
};
Level.prototype.clearLevel = function () {
var _local2;
var _local4;
listObj = this.getListOfObstacles();
var _local3;
iCnt = 0;
while (iCnt < this.numOfObstacles) {
listObj[iCnt].destroyObstacle();
iCnt++;
}
iCnt = 0;
while (iCnt < this.numOfObstacles) {
listObj.pop();
iCnt++;
}
this.storeHittedObj.destroyObstacle();
};
Level.prototype.stageStart = function () {
this.loadInLevelBGGraphics();
selfLevel = this;
this.rootMC["preloaderBG_mc" + this.lvlNum].onEnterFrame = function () {
this.progress = this.progressNumber + "%";
this.loadingAnimation.loadingTitle = "Loading the Background!";
this.gotoAndStop(Math.round((this.progressNumber / 100) * 25));
if (selfLevel.self["bg" + selfLevel.lvlNum] != undefined) {
this.onEnterFrame = null;
this.removeMovieClip();
curSoundObj = selfLevel.self.getSound("gameMusic");
if (curSoundObj.isSoundOn()) {
curSoundObj.playSound(1000);
if (curSoundObj.curVolume == 0) {
curSoundObj.setVolume(0);
} else {
curSoundObj.setVolume(40);
curSoundObj.volume = 40;
}
if ((int(selfLevel.getType()) == 3) && (curSoundObj.curVolume != 0)) {
curSoundObj.setVolume(100);
curSoundObj.volume = 100;
}
}
selfLevel.self.getCharacter().setVisible(true);
selfLevel.self.getCharacter().defaultPosition();
selfLevel.self.setGameEnabled(false);
selfLevel.rootMC.attachMenuVisible(true);
selfLevel.self.getCharacter().gotoState("start");
selfLevel.rootMC.attachMovie("stageStart", "stageStart_mc", 999);
selfLevel.rootMC.stageStart_mc.levelObj = selfLevel;
selfLevel.rootMC.stageStart_mc._y = selfLevel.rootMC.stageStart_mc._y - 100;
}
};
};
Level.prototype.stageStartCallBack = function (mc) {
mc.removeMovieClip();
this.self.getCharacter().gotoState("normal");
this.self.getCharacter().reInit();
this.startLevel();
this.self.setGameEnabled(true);
this.self.preLoadBGPlaceHolder(this.lvlNum + 1);
this.self.preLoadSoundPlaceHolder(this.lvlNum + 1);
};
Level.prototype.stageEnd = function () {
this.self.setGameEnabled(false);
this.rootMC.attachMovie("stageEnd", "stageEnd_mc", 999);
this.rootMC.stageEnd_mc.levelObj = this;
this.rootMC.stageEnd_mc._y = this.rootMC.stageEnd_mc._y - 100;
this.rootMC.stageEnd_mc.bonus = this.stats.levelEndBonus;
};
Level.prototype.stageEndCallBack = function (mc) {
mc.removeMovieClip();
this.stageStart();
};
Level.prototype.resetLevelValues = function () {
this.numOfObstacles = 1;
};
Level.prototype.loadInLevelSound = function () {
var _local2;
var _local3;
if (this.lvlNum != 1) {
loadSoundObj = this.self.getSound("gameMusic2");
curSoundObj = this.self.getSound("gameMusic");
var _local4;
musicPath = loadSoundObj.getSoundFilePath();
curSoundObj.loadSoundExternal(musicPath, false);
} else {
curSoundObj = this.self.getSound("gameMusic");
}
};
Level.prototype.storeRefHitObj = function (obsObj) {
this.storeHittedObj = obsObj;
};
ScorebarObject.prototype.initialize = function () {
this.scoreObject = new VariableHandler(this, "score");
this.levelObject = new VariableHandler(this, "level");
this.kinzcashObject = new VariableHandler(this, "kinzcash");
};
ScorebarObject.prototype.makeCloseButtonVisible = function (truthValue) {
this.scorebarClip.closeWindowButton._visible = truthValue;
};
ScorebarObject.prototype.doSetScoreToUpdateKinzcash = function (truthValue) {
this.setScoreToUpdateKinzcash = truthValue;
};
ScorebarObject.prototype.setRatioToUpdateKinzcash = function (ratio) {
this.scoreKinzcashRatio = ratio;
};
ScorebarObject.prototype.setScorebarClip = function (scorebarClip) {
this.scorebarClip = scorebarClip;
};
ScorebarObject.prototype.setScore = function (score) {
this.scoreObject.setToValue(score);
if (this.setScoreToUpdateKinzcash == true) {
this.setKinzcash(Math.floor(this.scoreObject.getScore() * this.scoreKinzcashRatio));
}
this.scorebarClip.score_txt.text = this.scoreObject.getValue();
};
ScorebarObject.prototype.addToScore = function (addValue) {
this.scoreObject.addToValue(addValue);
if (this.setScoreToUpdateKinzcash == true) {
this.setKinzcash(Math.floor(this.scoreObject.getValue() * this.scoreKinzcashRatio));
}
this.scorebarClip.score_txt.text = this.scoreObject.getValue();
};
ScorebarObject.prototype.getScore = function () {
return(this.scoreObject.getValue());
};
ScorebarObject.prototype.setLevel = function (setValue) {
this.levelObject.setToValue(setValue);
this.scorebarClip.level_txt.text = this.levelObject.getValue();
};
ScorebarObject.prototype.addToLevel = function (addValue) {
this.levelObject.addToValue(addValue);
this.scorebarClip.level_txt.text = this.levelObject.getValue();
};
ScorebarObject.prototype.getLevel = function () {
return(this.levelObject.getValue());
};
ScorebarObject.prototype.setKinzcash = function (kinzcash) {
this.kinzcashObject.setToValue(kinzcash);
this.scorebarClip.cash_txt.text = this.kinzcashObject.getValue();
};
ScorebarObject.prototype.addToKinzcash = function (addValue) {
this.kinzcashObject.addToValue(addValue);
this.scorebarClip.cash_txt.text = this.kinzcashObject.getValue();
};
ScorebarObject.prototype.getKinzcash = function () {
return(this.kinzcashObject.getValue());
};
ScorebarObject.prototype.setNumberOfWebkinz = function (numberOfWebkinz) {
this.numberOfWebkinzObject.setToValue(numberOfWebkinz);
this.scorebarClip.petCountClip.petCountValue.text = numberOfWebkinz;
};
ScorebarObject.prototype.addNumberOfWebkinz = function (numberOfWebkinz) {
this.numberOfWebkinzObject.addToValue(numberOfWebkinz);
this.scorebarClip.petCountClip.petCountValue.text = this.numberOfWebkinzObject.getValue();
};
ScorebarObject.prototype.getNumberOfWebkinz = function (numberOfWebkinz) {
return(this.numberOfWebkinzObject.getValue());
};
ScorebarObject.prototype.testPlayerCheating = function () {
this.levelObject.cheatEngineArray[4] = 33765;
};
ScorebarObject.prototype.playerCheated = function (cheatValue) {
this.mainObject.showPlayerHasCheatedMessage(cheatValue);
};
VariableHandler.prototype.initialize = function () {
this.variableArray = new Array();
this.variableArray.push(0);
if (this.turnOnFakeArray == true) {
this.initializeCheatEngineDetect();
}
};
VariableHandler.prototype.addToValue = function (addThisValue) {
if (this.turnOnFakeArray == true) {
this.cheatEngineDetectAddToValue(addThisValue);
}
this.variableArray.push(addThisValue);
};
VariableHandler.prototype.setToValue = function (setValue) {
if (this.turnOnFakeArray == true) {
this.fakeVariableValue = setValue;
this.setFakeAddresses(setValue);
}
this.variableArray = new Array();
this.variableArray.push(setValue);
};
VariableHandler.prototype.getValue = function () {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.variableArray.length) {
_local3 = _local3 + this.variableArray[_local2];
_local2++;
}
return(_local3);
};
VariableHandler.prototype.initializeCheatEngineDetect = function () {
this.fakeVariableValue = 0;
this.cheatEngineArray = new Array();
var _local2 = 0;
while (_local2 < this.numberOfFakeAddresses) {
this.cheatEngineArray[_local2] = 0;
_local2++;
}
};
VariableHandler.prototype.cheatEngineDetectAddToValue = function (addThisValue) {
this.checkForCheating();
this.fakeVariableValue = this.fakeVariableValue + addThisValue;
this.setFakeAddresses(this.fakeVariableValue);
};
VariableHandler.prototype.setFakeAddresses = function (variableValue) {
var _local2 = 0;
while (_local2 < this.numberOfFakeAddresses) {
this.cheatEngineArray[_local2] = variableValue;
_local2++;
}
};
VariableHandler.prototype.checkForCheating = function () {
var _local3 = false;
var _local4;
var _local2 = 0;
while (_local2 < this.numberOfFakeAddresses) {
if (this.cheatEngineArray[_local2] != this.fakeVariableValue) {
_local3 = true;
_local4 = this.cheatEngineArray[_local2];
}
_local2++;
}
if (_local3 == true) {
this.scorebarObject.playerCheated(_local4);
}
};
var cNoTracer = 0;
var cLocal = 1;
var cTracercall = 2;
var cStracercall = 3;
var gTracer = cLocal;
var gIndent = 0;
var gIndentCharacter = " ";
var gProgramName = "none";
initGroup();
var localMovie = this;
var points_per_kinzcash = 150;
scoreBarObj = new scorebarObject(this, this.display_panel, 1 / points_per_kinzcash, true);
scoreBarObj.setScore(0);
scoreBarObj.setKinzcash(0);
scoreBarObj.setLevel(1);
traceit("Skaterkat Level.as framerate vxx3 " + localMovie.currentFramerate);
this.frameWatcher = localMovie.createEmptyMovieClip("frw", 3000);
this.frameWatcher.currentFramerate = 1;
playBtn.field_txt.text = "PLAY";
instBtn.field_txt.text = "INSTRUCTIONS";
gotoAndPlay ("menu");
function onTimeOut() {
gametimeout = true;
win = 4;
localMovie.gameEnv.statisticsEnv.setWinState(4);
localMovie.gameEnv.levelEnv.levelOver();
localMovie.gameEnv.character.deleteCharacter();
localMovie.gotoAndPlay("gameOver");
}
function initGameProperties() {
localMovie.attachMenuTopBar();
localMovie.flag = true;
localMovie.gameEnv = new GameEnvironment(this);
localMovie.gameEnv.addLevel(1, 1, 15, {Pothole:40, Ditch:25, Pylon:10, Horse:5}, {Kinzcash:2, Repair:1}, 39);
localMovie.gameEnv.addLevel(2, 2, 16, {Pothole:10, Ditch:29, Pylon:44, Horse:5}, {Kinzcash:2, Repair:1}, 42);
localMovie.gameEnv.addLevel(3, 3, 17, {Rock:48, Ditch:5, Pylon:10, Horse:33}, {Kinzcash:2, Repair:1}, 45);
localMovie.gameEnv.addLevel(4, 4, 18, {Rock:10, Ditch:5, Pylon:52, Horse:37}, {Kinzcash:2, Repair:1}, 48);
localMovie.gameEnv.addLevel(5, 1, 19, {Pothole:55, Ditch:40, Pylon:15, Horse:10}, {Kinzcash:4, Repair:2}, 51);
localMovie.gameEnv.addLevel(6, 2, 20, {Pothole:15, Ditch:43, Pylon:58, Horse:10}, {Kinzcash:4, Repair:2}, 54);
localMovie.gameEnv.addLevel(7, 3, 21, {Rock:61, Ditch:10, Pylon:15, Horse:46}, {Kinzcash:4, Repair:2}, 57);
localMovie.gameEnv.addLevel(8, 4, 22, {Rock:15, Ditch:10, Pylon:64, Horse:49}, {Kinzcash:4, Repair:2}, 60);
localMovie.gameEnv.addLevel(9, 1, 23, {Pothole:66, Ditch:51, Pylon:18, Horse:13}, {Kinzcash:6, Repair:3}, 63);
localMovie.gameEnv.addLevel(10, 2, 24, {Pothole:18, Ditch:53, Pylon:68, Horse:13}, {Kinzcash:6, Repair:3}, 66);
localMovie.gameEnv.addLevel(11, 3, 25, {Rock:70, Ditch:13, Pylon:18, Horse:55}, {Kinzcash:6, Repair:3}, 69);
localMovie.gameEnv.addLevel(12, 4, 26, {Rock:18, Ditch:13, Pylon:72, Horse:57}, {Kinzcash:6, Repair:3}, 72);
localMovie.gameEnv.addLevel(13, 1, 27, {Pothole:73, Ditch:58, Pylon:20, Horse:15}, {Kinzcash:8, Repair:4}, 75);
localMovie.gameEnv.addLevel(14, 2, 28, {Pothole:20, Ditch:59, Pylon:74, Horse:15}, {Kinzcash:8, Repair:4}, 78);
localMovie.gameEnv.addLevel(15, 3, 29, {Rock:75, Ditch:15, Pylon:20, Horse:60}, {Kinzcash:8, Repair:4}, 81);
localMovie.gameEnv.addLevel(16, 4, 30, {Rock:20, Ditch:15, Pylon:76, Horse:61}, {Kinzcash:8, Repair:4}, 84);
localMovie.gameEnv.addLevel(17, 1, 40, {Pothole:40, Ditch:25, Pylon:10, Horse:5}, {Kinzcash:2, Repair:0}, 39);
localMovie.gameEnv.addLevel(18, 2, 40, {Pothole:10, Ditch:29, Pylon:44, Horse:5}, {Kinzcash:2, Repair:0}, 42);
localMovie.gameEnv.addLevel(19, 3, 40, {Rock:48, Ditch:5, Pylon:10, Horse:33}, {Kinzcash:2, Repair:0}, 45);
localMovie.gameEnv.addLevel(20, 4, 40, {Rock:10, Ditch:5, Pylon:52, Horse:37}, {Kinzcash:2, Repair:0}, 48);
localMovie.gameEnv.addLevel(21, 1, 40, {Pothole:55, Ditch:40, Pylon:15, Horse:10}, {Kinzcash:4, Repair:0}, 51);
localMovie.gameEnv.addLevel(22, 2, 40, {Pothole:15, Ditch:43, Pylon:58, Horse:10}, {Kinzcash:4, Repair:0}, 54);
localMovie.gameEnv.addLevel(23, 3, 40, {Rock:61, Ditch:10, Pylon:15, Horse:46}, {Kinzcash:4, Repair:0}, 57);
localMovie.gameEnv.addLevel(24, 4, 40, {Rock:15, Ditch:10, Pylon:64, Horse:49}, {Kinzcash:4, Repair:0}, 60);
localMovie.gameEnv.addLevel(25, 1, 40, {Pothole:66, Ditch:51, Pylon:18, Horse:13}, {Kinzcash:6, Repair:0}, 63);
localMovie.gameEnv.addLevel(26, 2, 40, {Pothole:18, Ditch:53, Pylon:68, Horse:13}, {Kinzcash:6, Repair:0}, 66);
localMovie.gameEnv.addLevel(27, 3, 40, {Rock:70, Ditch:13, Pylon:18, Horse:55}, {Kinzcash:6, Repair:0}, 69);
localMovie.gameEnv.addLevel(28, 4, 40, {Rock:18, Ditch:13, Pylon:72, Horse:57}, {Kinzcash:6, Repair:0}, 72);
localMovie.gameEnv.addLevel(29, 1, 40, {Pothole:73, Ditch:58, Pylon:20, Horse:15}, {Kinzcash:8, Repair:0}, 75);
localMovie.gameEnv.addLevel(30, 2, 40, {Pothole:20, Ditch:59, Pylon:74, Horse:15}, {Kinzcash:8, Repair:0}, 78);
localMovie.gameEnv.addLevel(31, 3, 40, {Rock:75, Ditch:15, Pylon:20, Horse:60}, {Kinzcash:8, Repair:0}, 81);
localMovie.gameEnv.addLevel(32, 4, 40, {Rock:20, Ditch:15, Pylon:76, Horse:61}, {Kinzcash:8, Repair:0}, 84);
localMovie.gameEnv.addLevel(33, 1, 40, {Pothole:40, Ditch:25, Pylon:10, Horse:5}, {Kinzcash:2, Repair:0}, 39);
localMovie.gameEnv.addLevel(34, 2, 40, {Pothole:10, Ditch:29, Pylon:44, Horse:5}, {Kinzcash:2, Repair:0}, 42);
localMovie.gameEnv.addLevel(35, 3, 40, {Rock:48, Ditch:5, Pylon:10, Horse:33}, {Kinzcash:2, Repair:0}, 45);
localMovie.gameEnv.addLevel(36, 4, 40, {Rock:10, Ditch:5, Pylon:52, Horse:37}, {Kinzcash:2, Repair:0}, 48);
localMovie.gameEnv.addLevel(37, 1, 40, {Pothole:55, Ditch:40, Pylon:15, Horse:10}, {Kinzcash:4, Repair:0}, 51);
localMovie.gameEnv.addLevel(38, 2, 40, {Pothole:15, Ditch:43, Pylon:58, Horse:10}, {Kinzcash:4, Repair:0}, 54);
localMovie.gameEnv.addLevel(39, 3, 40, {Rock:61, Ditch:10, Pylon:15, Horse:46}, {Kinzcash:4, Repair:0}, 57);
localMovie.gameEnv.addLevel(40, 4, 40, {Rock:15, Ditch:10, Pylon:64, Horse:49}, {Kinzcash:4, Repair:0}, 60);
localMovie.gameEnv.addLevel(41, 1, 40, {Pothole:66, Ditch:51, Pylon:18, Horse:13}, {Kinzcash:6, Repair:0}, 63);
localMovie.gameEnv.addLevel(42, 2, 40, {Pothole:18, Ditch:53, Pylon:68, Horse:13}, {Kinzcash:6, Repair:0}, 66);
localMovie.gameEnv.addLevel(43, 3, 40, {Rock:70, Ditch:13, Pylon:18, Horse:55}, {Kinzcash:6, Repair:0}, 69);
localMovie.gameEnv.addLevel(44, 4, 40, {Rock:18, Ditch:13, Pylon:72, Horse:57}, {Kinzcash:6, Repair:0}, 72);
localMovie.gameEnv.addLevel(45, 1, 40, {Pothole:73, Ditch:58, Pylon:20, Horse:15}, {Kinzcash:8, Repair:0}, 75);
localMovie.gameEnv.addLevel(46, 2, 40, {Pothole:20, Ditch:59, Pylon:74, Horse:15}, {Kinzcash:8, Repair:0}, 78);
localMovie.gameEnv.addLevel(47, 3, 40, {Rock:75, Ditch:15, Pylon:20, Horse:60}, {Kinzcash:8, Repair:0}, 81);
localMovie.gameEnv.addLevel(48, 4, 40, {Rock:20, Ditch:15, Pylon:76, Horse:61}, {Kinzcash:8, Repair:0}, 84);
localMovie.gameEnv.addLevel(49, 1, 15, {Pothole:20, Ditch:25, Pylon:10, Horse:5}, {}, 1000);
localMovie.tutorialNUM = 49;
localMovie.gameEnv.setTypeObstacleSize("Pothole", 1, 0, 1, 0, 1, false, 0);
localMovie.gameEnv.setTypeObstacleSize("Rock", 1, 0, 1, 0, 1, false, 0);
localMovie.gameEnv.setTypeObstacleSize("Ditch", 2, 3, 2, 3, 2, false, 0);
localMovie.gameEnv.setTypeObstacleSize("Pylon", 1, 0, 1, 0, 1, false, 0);
localMovie.gameEnv.setTypeObstacleSize("Horse", 2, 2, 2, 2, 2, true, 0);
localMovie.gameEnv.setTypeObstacleSize("Kinzcash", 1, 0, 1, 0, 1, false, 50);
localMovie.gameEnv.setTypeObstacleSize("Repair", 1, 0, 1, 0, 1, false, 100);
var _local12;
var _local11;
gameMusic = this.createEmptyMovieClip("gameMusic", 1);
gameMusic2 = this.createEmptyMovieClip("gameMusic2", 2);
var _local2 = new SoundMusic(this, localMovie.gameMusic, 40);
var _local3 = new SoundMusic(this, localMovie.gameMusic2, 40);
SoundMusic.removeAllSoundToGroupList();
_local2.createSound();
_local3.createSound();
var _local13;
if (_level0.WAPI == undefined) {
musicPath = "city.mp3";
} else {
musicPath = ("SWF/ARCADE/GAMES/SkaterKat/" + localMovie.gameEnv.getBGName(1).toLowerCase()) + ".mp3";
}
_local2.loadSoundExternal(musicPath, false);
localMovie.gameEnv.addSound("gameMusic", _local2);
localMovie.gameEnv.addSound("gameMusic2", _local3);
}
function initGameListeners() {
Key.removeListener(localMovie.pListener);
localMovie.listenerCreated = true;
localMovie.pListener = new Object();
Key.addListener(localMovie.pListener);
localMovie.pListener.accelerate = false;
localMovie.pListener.crashedSound = false;
localMovie.pListener.cntAccelerate = 0;
_global.tracercall("localMovie.pListener.accelerate = " + localMovie.pListener.accelerate);
localMovie.display_panel.accelerate = false;
localMovie.display_panel.spacedTimes = 0;
localMovie.display_panel.spaceUp = false;
localMovie.display_panel.accPressed = false;
localMovie.display_panel.spcPressed = false;
localMovie.display_panel.spcInc = 1;
localMovie.cantJump = false;
localMovie.display_panel.startcntFrames = 0;
localMovie.display_panel.NUM_FRMS_CANNOT_JUMP = 10;
localMovie.display_panel.onEnterFrame = function () {
if (Key.getCode() == 83) {
localMovie.debug._visible = !localMovie.debug._visible;
}
if ((this.spcPressed && (this.spcInc < 30)) && (this.spcInc >= 0)) {
this.spcInc = this.spcInc + 1;
} else {
this.spcInc = -1;
}
if (localMovie.gameEnv.isGameEnabled()) {
var _local3;
charObj = localMovie.gameEnv.getCharacter();
if (localMovie.cantJump == true) {
this.startcntFrames = this.startcntFrames + 1;
}
if (this.startcntFrames >= this.NUM_FRMS_CANNOT_JUMP) {
localMovie.cantJump = false;
this.startcntFrames = 0;
}
if (!charObj.isCrashed()) {
if (Key.isDown(39) && (!charObj.isCharJumping())) {
charObj.moveDirection(1);
} else if (Key.isDown(37) && (!charObj.isCharJumping())) {
charObj.moveDirection(-1);
}
if ((!charObj.isCharJumping()) && (!charObj.isCrashed())) {
this.spacedTimes = 0;
}
if ((Key.isDown(38) && ((charObj.getCollidedWithType() == "Kinzcash") || (charObj.getCollidedWithType() == "Repair"))) && (!charObj.isCharJumping())) {
charObj.setCollidedWithType("");
charObj.playSound("accelerate", true);
}
if ((((Key.isDown(38) && (!charObj.isCrashed())) && (localMovie.display_panel.spacedTimes == 0)) && (localMovie.pListener.accelerate)) && (!localMovie.display_panel.spcPressed)) {
charObj.gotoState("accelerate");
}
localMovie.pListener.crashedSound = false;
if ((localMovie.pListener.accelerate && (!charObj.isCrashed())) && (!charObj.isCharJumping())) {
if (localMovie.pListener.cntAccelerate >= 30) {
localMovie.gameEnv.statisticsEnv.setAccelerateBonus(1);
} else {
localMovie.pListener.cntAccelerate = localMovie.pListener.cntAccelerate + 1;
}
}
} else if ((((Key.isDown(38) && (!localMovie.pListener.crashedSound)) && (localMovie.pListener.accelerate)) && (!charObj.isCharJumping())) && (localMovie.display_panel.accPressed)) {
localMovie.pListener.crashedSound = true;
charObj.playSound("accelerate", true);
_global.tracercall(("playing sound still while crashing and check this.accelerate=" + localMovie.pListener.accelerate) + this.accPressed);
}
if (((!localMovie.pListener.accelerate) || (charObj.isCharJumping())) || (charObj.isCrashed())) {
localMovie.pListener.cntAccelerate = 0;
localMovie.gameEnv.statisticsEnv.setAccelerateBonus(0);
}
}
};
localMovie.pListener.onKeyDown = function () {
if (localMovie.gameEnv.isGameEnabled()) {
var _local2;
charObj = localMovie.gameEnv.getCharacter();
if (!charObj.isCrashed()) {
if (Key.isDown(32) && (!localMovie.cantJump)) {
if (!localMovie.display_panel.spcPressed) {
localMovie.display_panel.spcPressed = true;
localMovie.display_panel.spcInc = 0;
this.state = "jump";
}
} else if (Key.isDown(Key.Up)) {
localMovie.display_panel.accPressed = true;
if ((!this.accelerate) && (!charObj.isCharJumping())) {
var _local3;
gmLvl = localMovie.gameEnv.levelEnv;
gmLvl.chgMaxScrollScreen(localMovie.gameEnv.getMaxAcceleration());
this.accelerate = true;
charObj.playSound("accelerate", false);
charObj.playSound("accelerate", true);
charObj.gotoState("accelerate");
this.state = "moving";
} else if ((((localMovie.display_panel.spacedTimes == 0) && (this.accelerate)) && (!localMovie.display_panel.spcPressed)) && (this.state == "jump")) {
gmLvl = localMovie.gameEnv.levelEnv;
gmLvl.chgMaxScrollScreen(localMovie.gameEnv.getMaxAcceleration());
this.accelerate = true;
charObj.playSound("accelerate", false);
charObj.playSound("accelerate", true);
charObj.gotoState("accelerate");
this.state = "moving";
}
}
}
}
};
localMovie.pListener.onKeyUp = function () {
if (localMovie.gameEnv.isGameEnabled()) {
var _local3;
charObj = localMovie.gameEnv.getCharacter();
if (!charObj.isCrashed()) {
if ((Key.getCode(Key.getAscii()) == 38) && (this.accelerate)) {
var _local4;
gmLvl = localMovie.gameEnv.levelEnv;
gmLvl.chgMaxScrollScreen(0);
if (!charObj.isCharJumping()) {
if (charObj.state != "fall") {
this.accelerate = false;
_global.tracercall("this.accelerate = " + this.accelerate);
charObj = localMovie.gameEnv.getCharacter();
if (charObj.state != "crash") {
charObj.gotoState("normal");
} else {
charObj.state = "normal";
}
charObj.playSound("accelerate", false);
delete this.crashedSound;
}
localMovie.display_panel.accPressed = false;
}
}
if (Key.getCode(Key.getAscii()) == 32) {
charObj = localMovie.gameEnv.getCharacter();
if (localMovie.display_panel.spcInc != -1) {
if (localMovie.display_panel.spacedTimes < 2) {
localMovie.display_panel.spacedTimes = localMovie.display_panel.spacedTimes + 1;
}
}
if (!localMovie.cantJump) {
localMovie.display_panel.spcPressed = false;
}
if (this.accelerate) {
charObj.playSound("accelerate", false);
}
if ((localMovie.display_panel.spacedTimes == 1) && (!localMovie.display_panel.spcPressed)) {
charObj.moveJump(true);
} else if ((localMovie.display_panel.spacedTimes == 2) && (!localMovie.display_panel.spcPressed)) {
if (!charObj.jumpdoubleActionOn) {
if (charObj.checkDoubleJump()) {
localMovie.display_panel.spacedTimes = localMovie.display_panel.spacedTimes + 1;
_global.tracercall("SkaterKat: dblJumping + " + localMovie.display_panel.spacedTimes);
}
} else {
localMovie.display_panel.spacedTimes = localMovie.display_panel.spacedTimes + 1;
localMovie.stats.debugtext.text = localMovie.stats.debugtext.text + ("\nJumping Double " + this.spacedTimes);
}
}
}
} else if ((Key.getCode(Key.getAscii()) == 38) && (this.accelerate)) {
gmLvl = localMovie.gameEnv.levelEnv;
gmLvl.chgMaxScrollScreen(0);
if (!charObj.isCharJumping()) {
if (charObj.state != "fall") {
this.accelerate = false;
_global.tracercall(" CRASH this.accelerate = " + this.accelerate);
charObj = localMovie.gameEnv.getCharacter();
if (charObj.state != "crash") {
charObj.gotoState("normal");
} else {
charObj.state = "normal";
}
charObj.playSound("accelerate", false);
localMovie.pListener.cntAccelerate = 0;
localMovie.gameEnv.statisticsEnv.setAccelerateBonus(0);
delete this.crashedSound;
}
localMovie.display_panel.accPressed = false;
}
}
}
};
}
function attachMenuTopBar() {
var _local2;
displayMenu = localMovie.attachMovie("display_panel", "display_panel", 10000);
displayMenu._x = 0;
displayMenu._y = 0;
displayMenu.exit_btn.onRelease = function () {
if (localMovie.isTutorialMode()) {
localMovie.gotoAndPlay(1);
localMovie.removeTutorial();
} else {
localMovie.exitGame(0);
}
};
displayMenu.music_mc.onRelease = function () {
var _local2;
gameSoundObj = localMovie.gameEnv.getSound("gameMusic");
if (this._currentFrame == 1) {
gameSoundObj.setVolume(0);
this.gotoAndStop(2);
} else {
gameSoundObj.setVolume(gameSoundObj.volume);
this.gotoAndStop(1);
}
};
localMovie.attachMenuVisible(false);
localMovie.scoreBarObj.setScorebarClip(displayMenu);
}
function attachMenuVisible(makeVisible) {
if (makeVisible) {
localMovie.display_panel._y = 0;
} else {
localMovie.display_panel._y = -1000;
}
}
function exitGame(quitType) {
localMovie.gameEnv.statisticsEnv.setWinState(quitType);
clearInterval(localMovie.gameObjProp.exitInterval);
localMovie.pListener.onMouseDown = undefined;
localMovie.pListener = undefined;
localMovie.display_panel.removeMovieClip();
Mouse.show();
localMovie.gameEnv.gameOver(quitType);
}
function startInstructionsAnimation() {
localMovie._parent._parent.activateArcadeQuit(0);
var _local2;
if (_level0.WAPI == undefined) {
instructionPath = "skater_instruction.swf";
} else {
instructionPath = "SWF/ARCADE/GAMES/SkaterKat/skater_instruction.swf";
}
localMovie.createEmptyMovieClip("instructLayer", 4999);
loadMovie (instructionPath, this.instructLayer);
this.onEnterFrame = function () {
if ((this.instructLayer.getBytesLoaded() > 0) && (this.instructLayer.getBytesLoaded() >= this.instructLayer.getBytesTotal())) {
this.instructLayer.show_me_btn.field_txt.text = "SHOW ME";
this.instructLayer.back_btn.field_txt.text = "MAIN MENU";
this.instructLayer.back_btn.onRelease = function () {
this._parent._parent.gotoAndPlay(1);
localMovie._parent._parent.activateArcadeQuit(1);
this._parent.unloadMovie();
};
this.instructLayer.show_me_btn.onRelease = function () {
this._parent.unloadMovie();
this._parent._parent.playTutorial();
};
this.onEnterFrame = undefined;
}
};
}
function playTutorial() {
localMovie.tutorialMode = true;
localMovie.gameEnv.initLevel(localMovie.tutorialNUM);
localMovie.gameEnv.preLoadBGPlaceHolder(localMovie.tutorialNUM);
localMovie.gameEnv.createCharacter();
localMovie.attachMenuVisible(true);
localMovie.gameEnv.levelEnv.loadInLevelBGGraphics();
localMovie.gameEnv.setGameEnabled(true);
var _local2;
charObj = localMovie.gameEnv.getCharacter();
charObj.setVisible(true);
localMovie.gotoAndPlay("tutorial");
localMovie.pTutorialListener = new Object();
localMovie.pTutorialListener.enable = true;
localMovie.pTutorialListener.onKeyDown = function () {
if ((Key.getCode(Key.getAscii()) == 38) && (localMovie.tutorial.stage == "tutorial2")) {
charObj.gotoState("accelerate");
}
};
localMovie.pTutorialListener.onKeyUp = function () {
if ((Key.getCode(Key.getAscii()) == 38) && (localMovie.tutorial.stage == "tutorial2")) {
localMovie.tutorial.stage = "tutorial3";
localMovie.tutorial.gotoAndPlay("tutorial3");
charObj.gotoState("normal");
}
};
Key.addListener(localMovie.pTutorialListener);
var _local3;
lession = localMovie.attachMovie("Tutorial_Lession", "tutorial", 1001);
lession.stage = "tutorial1";
lession.tutLevel = localMovie.gameEnv.levelEnv;
lession.tutEnv = localMovie.gameEnv;
lession.tutLevel.continueGame();
lession.onEnterFrame = function () {
if ((!charObj.jumpActionOn) && (localMovie.tutorial.stage == "tutorial4")) {
localMovie.tutorial.gotoAndPlay("tutorial4");
}
if (localMovie.tutorial.stage == "tutorial4") {
if (this.flag == undefined) {
this.tutLevel.startLevel();
this.flag = true;
}
charObj.repairEntireSkateboard();
} else if (localMovie.tutorial.stage == "tutorial6") {
this.onEnterFrame = null;
} else {
this.tutLevel.bgFunction();
this.tutLevel.roadFunction();
}
if (Key.isDown(39) && (!charObj.isCharJumping())) {
if (localMovie.tutorial.stage == "tutorial1") {
if (localMovie.tutorialInterval == undefined) {
localMovie.tutorialInterval = setInterval(localMovie.delayTutorial, 5000, "tutorial2");
}
charObj.moveDirection(1);
} else if (localMovie.tutorial.stage == "tutorial4") {
charObj.moveDirection(1);
}
} else if (Key.isDown(37) && (!charObj.isCharJumping())) {
if (localMovie.tutorial.stage == "tutorial1") {
if (localMovie.tutorialInterval == undefined) {
localMovie.tutorialInterval = setInterval(localMovie.delayTutorial, 5000, "tutorial2");
}
charObj.moveDirection(-1);
} else if (localMovie.tutorial.stage == "tutorial4") {
charObj.moveDirection(-1);
}
} else if (Key.isDown(32) && (localMovie.tutorial.stage == "tutorial3")) {
charObj.moveJump(true);
localMovie.tutorial.stage = "tutorial4";
}
};
lession.lessionFive = function () {
localMovie.exitGameSimulation();
};
}
function delayTutorial(nextframeNameTutorial) {
clearInterval(localMovie.tutorialInterval);
delete localMovie.tutorialInterval;
localMovie.tutorial.gotoAndPlay(nextframeNameTutorial);
localMovie.tutorial.stage = nextframeNameTutorial;
localMovie.gameEnv.getCharacter().defaultPosition();
}
function exitGameSimulation() {
localMovie.gameEnv.statisticsEnv.resetAllStats(1);
localMovie.gameEnv.levelEnv.pauseGame();
localMovie.gameEnv.levelEnv.clearLevel();
localMovie.gameEnv.levelEnv.resetOccupiedAttachPoints();
localMovie.gameEnv.setGameEnabled();
}
function endTutorial() {
localMovie.removeTutorial();
localMovie.initGameListeners();
localMovie.initGame();
localMovie._parent._parent.activateArcadeQuit(0);
}
function removeTutorial() {
exitGameSimulation();
localMovie["background_mc" + localMovie.tutorialNUM].removeMovieClip();
localMovie.tutorial.removeMovieClip();
localMovie.instructLayer.removeMovieClip();
Key.removeListener(localMovie.pTutorialListener);
localMovie.gameEnv.getCharacter().deleteCharacter();
localMovie.tutorialMode = false;
localMovie._parent._parent.activateArcadeQuit(1);
}
function initGame() {
localMovie.gameEnv.initLevel(1);
localMovie.gameEnv.preLoadBGPlaceHolder(1);
localMovie.gameEnv.createCharacter();
localMovie.gameEnv.introLevel();
localMovie.attachMenuVisible(true);
var _local1;
theSound = localMovie.gameEnv.getSound("gameMusic");
localMovie.gotoAndPlay("game");
}
function submitGameStats(score, cash, happiness, win) {
localMovie._parent._parent.setTimer("stop");
localMovie._parent._parent.submitStats(score, cash, happiness, win);
}
function isTutorialMode() {
if ((typeof(localMovie.tutorial) == "movieclip") || (localMovie.tutorialMode)) {
return(true);
}
return(false);
}
function returnGameEnvironment() {
return(localMovie.gameEnv);
}
function returnGameEnvironmentLevel(lvlNum) {
var _local1 = localMovie.returnGameEnvironment();
return(_local1.getLevel(lvlNum));
}
function initLevel(levelNum) {
localMovie.levelEnv = new Level(this, levelNum);
localMovie.levelEnv.startLevel();
}
localMovie = this;
_global.vtracercall("SkaterKat.as v1.01.01 R45 SKA-7 ");
var gameObjProp = new Object();
gameObjProp.quitType = 0;
gameObjProp.exitInterval;
var gametimeout = false;
localMovie.tutorialMode = false;
_global.gameRoot = this;
_parent._parent.setTimeOutCallBack(onTimeOut);
initGameProperties();
playBtn.onRelease = function () {
localMovie.initGameListeners();
localMovie.initGame();
localMovie._parent._parent.setTimer("start");
};
instBtn.onRelease = function () {
localMovie.gotoAndPlay("instruction");
localMovie.startInstructionsAnimation();
};
localMovie.instructLayer.removeMovieClip();
stop();
localMovie.stats.pause_btn.onRelease = function () {
localMovie.flag = !localMovie.flag;
localMovie.gameEnv.setGameEnabled(localMovie.flag);
if (!localMovie.flag) {
localMovie.gameEnv.levelEnv.pauseGame();
} else {
localMovie.gameEnv.levelEnv.continueGame();
}
};
localMovie.stats.repair_btn.onRelease = function () {
localMovie.gameEnv.characterHero.repairEntireSkateboard();
};
localMovie.stats.skip_btn.onRelease = function () {
if (localMovie.gameEnv.isGameEnabled()) {
localMovie.gameEnv.levelEnv.pauseGame();
localMovie.gameEnv.levelEnv.endLevel();
localMovie.stats.action.text = "SKIPPING";
} else {
localMovie.stats.action.text = "WAIT TILL AFTER START IS PLAYING";
}
};
localMovie.stats.god_btn.onRelease = function () {
localMovie.gameEnv.setInvincibility(!localMovie.gameEnv.godMode);
localMovie.stats.action.text = "GOD MODE " + localMovie.gameEnv.godMode;
};
Symbol 403 MovieClip Frame 2
stop();
Symbol 403 MovieClip Frame 3
stop();
Symbol 403 MovieClip Frame 4
stop();
Symbol 403 MovieClip Frame 5
stop();
Symbol 403 MovieClip Frame 6
stop();
doneBtn.field_txt.text = "I'M DONE";
doneBtn.onRelease = function () {
gotoAndPlay ("gameOver");
};
Symbol 403 MovieClip Frame 7
function processReplayBtn() {
_parent._parent.hideDock();
gotoAndPlay (1);
}
function processArcadeBtn() {
_parent._parent.backToArcadeMenu();
}
function getGameoverLoadingPath(type) {
var _local3 = _url;
var _local4 = new Array();
_local4 = _local3.split("/");
var _local5 = _local4.length - 1;
_local3 = "";
var _local2 = 0;
while (_local2 < _local5) {
_local3 = _local3 + (_local4[_local2] + "/");
_local2++;
}
if (_level0.WAPI) {
if (type == "S") {
_local3 = _local3 + "../Game_Over_600x450.swf";
} else {
_local3 = _local3 + "../Game_Over_800x600.swf";
}
} else {
_parent.LAPI = _parent._parent.LAPI;
if (type == "S") {
_local3 = _local3 + "../resource/localTest_Game_Over_600x450.swf";
} else {
_local3 = _local3 + "../resource/localTest_Game_Over_800x600.swf";
}
}
return(_local3);
}
stop();
var gameover_cash = 0;
var gameover_score = 0;
gameEnv.statisticsEnv.displayGameOverStats(this);
if (_level0.smartClipHolder != undefined) {
_global.tracercall("FOUND SC");
_level0.smartClipHolder.finishGame(scoreBarObj.getScore());
}
_parent._parent.setTimer("stop");
var gameoverScore = gameover_score;
var gameoverKinzCash = gameover_cash;
gameoverLoader.loadMovie(getGameoverLoadingPath("L"));