Frame 2
stop();
Symbol 96 MovieClip Frame 2
stop();
Symbol 114 MovieClip [mc_50] Frame 1
#initclip 63
Object.registerClass("mc_50", TreasureAward);
#endinitclip
Symbol 115 MovieClip [mc_49] Frame 1
#initclip 13
Object.registerClass("mc_49", TreasureAward);
#endinitclip
Symbol 116 MovieClip [mc_48] Frame 1
#initclip 14
Object.registerClass("mc_48", TreasureAward);
#endinitclip
Symbol 117 MovieClip [mc_47] Frame 1
#initclip 15
Object.registerClass("mc_47", TreasureAward);
#endinitclip
Symbol 118 MovieClip [mc_46] Frame 1
#initclip 16
Object.registerClass("mc_46", TreasureAward);
#endinitclip
Symbol 119 MovieClip [mc_45] Frame 1
#initclip 17
Object.registerClass("mc_45", TreasureAward);
#endinitclip
Symbol 120 MovieClip [mc_44] Frame 1
#initclip 18
Object.registerClass("mc_44", TreasureAward);
#endinitclip
Symbol 121 MovieClip [mc_43] Frame 1
#initclip 19
Object.registerClass("mc_43", TreasureAward);
#endinitclip
Symbol 122 MovieClip [mc_42] Frame 1
#initclip 20
Object.registerClass("mc_42", TreasureAward);
#endinitclip
Symbol 123 MovieClip [mc_41] Frame 1
#initclip 21
Object.registerClass("mc_41", TreasureAward);
#endinitclip
Symbol 124 MovieClip [mc_40] Frame 1
#initclip 22
Object.registerClass("mc_40", TreasureAward);
#endinitclip
Symbol 125 MovieClip [mc_39] Frame 1
#initclip 23
Object.registerClass("mc_39", TreasureAward);
#endinitclip
Symbol 126 MovieClip [mc_38] Frame 1
#initclip 24
Object.registerClass("mc_38", TreasureAward);
#endinitclip
Symbol 127 MovieClip [mc_37] Frame 1
#initclip 25
Object.registerClass("mc_37", TreasureAward);
#endinitclip
Symbol 128 MovieClip [mc_36] Frame 1
#initclip 26
Object.registerClass("mc_36", TreasureAward);
#endinitclip
Symbol 129 MovieClip [mc_35] Frame 1
#initclip 27
Object.registerClass("mc_35", TreasureAward);
#endinitclip
Symbol 130 MovieClip [mc_34] Frame 1
#initclip 28
Object.registerClass("mc_34", TreasureAward);
#endinitclip
Symbol 131 MovieClip [mc_33] Frame 1
#initclip 29
Object.registerClass("mc_33", TreasureAward);
#endinitclip
Symbol 132 MovieClip [mc_32] Frame 1
#initclip 30
Object.registerClass("mc_32", TreasureAward);
#endinitclip
Symbol 133 MovieClip [mc_31] Frame 1
#initclip 31
Object.registerClass("mc_31", TreasureAward);
#endinitclip
Symbol 135 MovieClip [door_hitArea_mc] Frame 1
this.isWalkArea = true;
Symbol 198 MovieClip Frame 1
function loadListener() {
var _local6 = load_mc._framesloaded;
var _local4 = load_mc._totalframes;
var _local8 = int((_local6 / _local4) * 100);
var _local7 = Math.round(load_mc.getBytesLoaded() / 1024);
var _local5 = Math.round(load_mc.getBytesTotal() / 1024);
var _local2 = Math.round((_local7 / _local5) * 100);
if (Number(_local2) < Number(enoughLoaded)) {
var _local3;
if ((_local2 > 10) && (_local2 < 20)) {
_local3 = "2";
} else if ((_local2 > 20) && (_local2 <= 30)) {
_local3 = "3";
} else if ((_local2 > 30) && (_local2 <= 40)) {
_local3 = "4";
} else if ((_local2 > 40) && (_local2 <= 50)) {
_local3 = "5";
} else if ((_local2 > 50) && (_local2 <= 60)) {
_local3 = "6";
} else if ((_local2 > 60) && (_local2 <= 70)) {
_local3 = "7";
} else if ((_local2 > 70) && (_local2 <= 80)) {
_local3 = "8";
} else if ((_local2 > 80) && (_local2 <= 90)) {
_local3 = "9";
} else if ((_local2 > 90) && (_local2 <= 100)) {
_local3 = "10";
} else if (_local2 <= 10) {
_local3 = "1";
}
if (current_framelabel != _local3) {
gotoAndPlay(_local3);
current_framelabel = _local3;
}
} else {
_local6 = load_mc._framesloaded;
_local7 = Math.round(load_mc.getBytesLoaded() / 1024);
this.onEnterFrame = null;
delete this.onEnterFrame;
gotoAndPlay ("10");
}
}
var load_mc = this._parent._parent._parent;
var enoughLoaded = 75;
var current_framelabel;
this.onEnterFrame = loadListener;
Symbol 198 MovieClip Frame 8
stop();
Symbol 198 MovieClip Frame 16
stop();
Symbol 198 MovieClip Frame 24
stop();
Symbol 198 MovieClip Frame 32
stop();
Symbol 198 MovieClip Frame 40
stop();
Symbol 198 MovieClip Frame 48
stop();
Symbol 198 MovieClip Frame 56
stop();
Symbol 198 MovieClip Frame 64
stop();
Symbol 198 MovieClip Frame 71
stop();
Symbol 198 MovieClip Frame 95
this._parent.play();
Symbol 207 Button
on (release) {
stopAllSounds();
_parent._parent.GameConfig.setGameLevel("hard");
_parent.onSceneDone();
}
Symbol 208 Button
on (release) {
stopAllSounds();
_parent._parent.GameConfig.setGameLevel("easy");
_parent.onSceneDone();
}
Symbol 209 MovieClip Frame 31
stop();
Symbol 209 MovieClip Frame 72
stop();
Symbol 273 MovieClip [mc_0] Frame 1
#initclip 32
Object.registerClass("mc_0", TreasureAward);
#endinitclip
Symbol 276 MovieClip Frame 2
stop();
Symbol 277 MovieClip [mc_1] Frame 1
#initclip 33
Object.registerClass("mc_1", TreasureAward);
#endinitclip
Symbol 278 MovieClip [mc_2] Frame 1
#initclip 34
Object.registerClass("mc_2", TreasureAward);
#endinitclip
Symbol 279 MovieClip [mc_3] Frame 1
#initclip 35
Object.registerClass("mc_3", TreasureAward);
#endinitclip
Symbol 280 MovieClip [mc_4] Frame 1
#initclip 36
Object.registerClass("mc_4", TreasureAward);
#endinitclip
Symbol 281 MovieClip [mc_5] Frame 1
#initclip 37
Object.registerClass("mc_5", TreasureAward);
#endinitclip
Symbol 282 MovieClip [mc_6] Frame 1
#initclip 38
Object.registerClass("mc_6", TreasureAward);
#endinitclip
Symbol 283 MovieClip [mc_7] Frame 1
#initclip 39
Object.registerClass("mc_7", TreasureAward);
#endinitclip
Symbol 284 MovieClip [mc_8] Frame 1
#initclip 40
Object.registerClass("mc_8", TreasureAward);
#endinitclip
Symbol 285 MovieClip [mc_9] Frame 1
#initclip 41
Object.registerClass("mc_9", TreasureAward);
#endinitclip
Symbol 286 MovieClip [mc_10] Frame 1
#initclip 42
Object.registerClass("mc_10", TreasureAward);
#endinitclip
Symbol 288 MovieClip [mc_12] Frame 1
#initclip 43
Object.registerClass("mc_12", TreasureAward);
#endinitclip
Symbol 289 MovieClip [mc_13] Frame 1
#initclip 44
Object.registerClass("mc_13", TreasureAward);
#endinitclip
Symbol 290 MovieClip [mc_14] Frame 1
#initclip 45
Object.registerClass("mc_14", TreasureAward);
#endinitclip
Symbol 291 MovieClip [mc_15] Frame 1
#initclip 46
Object.registerClass("mc_15", TreasureAward);
#endinitclip
Symbol 292 MovieClip [mc_16] Frame 1
#initclip 47
Object.registerClass("mc_16", TreasureAward);
#endinitclip
Symbol 293 MovieClip [mc_17] Frame 1
#initclip 48
Object.registerClass("mc_17", TreasureAward);
#endinitclip
Symbol 294 MovieClip [mc_18] Frame 1
#initclip 49
Object.registerClass("mc_18", TreasureAward);
#endinitclip
Symbol 295 MovieClip [mc_19] Frame 1
#initclip 50
Object.registerClass("mc_19", TreasureAward);
#endinitclip
Symbol 296 MovieClip [mc_20] Frame 1
#initclip 51
Object.registerClass("mc_20", TreasureAward);
#endinitclip
Symbol 297 MovieClip [mc_21] Frame 1
#initclip 52
Object.registerClass("mc_21", TreasureAward);
#endinitclip
Symbol 298 MovieClip [mc_22] Frame 1
#initclip 53
Object.registerClass("mc_22", TreasureAward);
#endinitclip
Symbol 299 MovieClip [mc_23] Frame 1
#initclip 54
Object.registerClass("mc_23", TreasureAward);
#endinitclip
Symbol 300 MovieClip [mc_24] Frame 1
#initclip 55
Object.registerClass("mc_24", TreasureAward);
#endinitclip
Symbol 301 MovieClip [mc_25] Frame 1
#initclip 56
Object.registerClass("mc_25", TreasureAward);
#endinitclip
Symbol 302 MovieClip [mc_26] Frame 1
#initclip 57
Object.registerClass("mc_26", TreasureAward);
#endinitclip
Symbol 303 MovieClip [mc_27] Frame 1
#initclip 58
Object.registerClass("mc_27", TreasureAward);
#endinitclip
Symbol 304 MovieClip [mc_28] Frame 1
#initclip 59
Object.registerClass("mc_28", TreasureAward);
#endinitclip
Symbol 305 MovieClip [mc_29] Frame 1
#initclip 60
Object.registerClass("mc_29", TreasureAward);
#endinitclip
Symbol 306 MovieClip [mc_30] Frame 1
#initclip 61
Object.registerClass("mc_30", TreasureAward);
#endinitclip
Symbol 307 MovieClip Frame 1
stop();
Symbol 309 MovieClip Frame 1
function printMe() {
var _local2 = new PrintJob();
if (_local2.start()) {
if (_local2.addPage(this, {xMin:0, xMax:612, yMin:0, yMax:792})) {
_local2.send();
}
}
}
function init(tArray) {
if (tArray == null) {
tArray = new Array();
}
var _local3 = tArray.length;
var _local4 = "mc_" + _local3;
var _local5 = this.attachMovie(_local4, "p_mc", this.getNextHighestLevel(), {_x:15, _y:25});
_local5.init(tArray);
}
Symbol 309 MovieClip Frame 2
stop();
Symbol 378 Button
on (release) {
stopAllSounds();
this._parent._parent._parent.SceneMgr.playSceneNext();
}
Symbol 379 MovieClip Frame 21
stop();
Symbol 380 MovieClip Frame 189
function getTens(n) {
if (n > 100) {
n = n % 100;
}
return(Math.floor(n / 10));
}
function getOnes(n) {
if (n > 10) {
n = n % 10;
}
return(n);
}
function setTens(n) {
var _local1 = "";
if (n != 0) {
_local1 = String(n);
}
tens_txt.text = _local1;
}
function setOnes(n) {
ones_txt.text = String(n);
}
var tArray = [];
tArray = _parent._parent.GameConfig.getTreasureList();
var numItems = tArray.length;
setTens(getTens(numItems));
setOnes(getOnes(numItems));
Symbol 380 MovieClip Frame 350
stop();
buttons_mc.print_btn.onRelease = function () {
var _local4 = _parent._parent.GameConfig.getTreasureList();
var _local3 = _root;
_local3.printable_mc.init(_local4);
_local3.printable_mc.printMe();
};
buttons_mc.done_btn.onRelease = function () {
gotoAndPlay ("fadeOut");
};
Symbol 380 MovieClip Frame 362
onSceneDone();
Symbol 499 MovieClip Frame 1
stop();
Symbol 500 Button
on (release) {
gotoAndPlay ("white3");
}
Symbol 516 MovieClip Frame 1
Symbol 516 MovieClip Frame 1239
this.gotoAndPlay(1);
Symbol 535 MovieClip Frame 880
stop();
Symbol 535 MovieClip Frame 998
stopAllSounds();
_parent.onSceneDone();
stop();
Symbol 537 MovieClip [game_mc] Frame 1
stop();
if (DoraGame != undefined) {
delete DoraGame;
}
var DoraGame = new GameEngine(this);
Symbol 537 MovieClip [game_mc] Frame 2
stop();
onSceneDone();
Symbol 540 MovieClip Frame 47
gotoAndPlay ("static");
Symbol 540 MovieClip Frame 64
stop();
Symbol 541 MovieClip Frame 47
gotoAndPlay ("static");
Symbol 541 MovieClip Frame 64
stop();
Symbol 542 MovieClip Frame 47
gotoAndPlay ("static");
Symbol 542 MovieClip Frame 64
stop();
Symbol 576 Button
on (release) {
this.gotoAndPlay("outro");
}
Symbol 620 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 77
Symbol 629 MovieClip Frame 91
stop();
Symbol 737 MovieClip Frame 1
demo_time.text = this._parent._parent.GameConfig.getGameLength();
Symbol 737 MovieClip Frame 456
gem01.gotoAndPlay("catch");
Symbol 737 MovieClip Frame 493
cupcake01.gotoAndPlay("catch");
Symbol 737 MovieClip Frame 539
coin01.gotoAndPlay("catch");
Symbol 737 MovieClip Frame 601
gem02.gotoAndPlay("catch");
Symbol 737 MovieClip Frame 652
_parent.onSceneDone();
stop();
Symbol 743 MovieClip [level_transition_mc] Frame 1
stop();
Symbol 743 MovieClip [level_transition_mc] Frame 2
Symbol 743 MovieClip [level_transition_mc] Frame 94
gotoAndStop ("off");
Symbol 745 MovieClip [interfaceClass_mc] Frame 1
#initclip 62
Object.registerClass("interfaceClass_mc", Interface);
#endinitclip
Symbol 748 MovieClip [FPS_DISPLAY_MC] Frame 1
function startFPS_listener() {
ticks = 0;
this.onEnterFrame = oef;
if (oncePerSecondInterval == undefined) {
oncePerSecondInterval = setInterval(oncePerSecond, 1000);
}
}
function oef() {
ticks++;
}
function oncePerSecond() {
var _local1 = ticks - oldticks;
if (_local1 > doc_fps) {
fpsText = (doc_fps + "/") + doc_fps;
} else {
if (_local1 < 25) {
}
fpsText = (_local1 + "/") + doc_fps;
}
oldticks = ticks;
}
var doc_fps = 60;
if (this._parent.fspDisplay != false) {
startFPS_listener();
}
Symbol 748 MovieClip [FPS_DISPLAY_MC] Frame 2
stop();
Symbol 766 MovieClip [wheel_mc] Frame 1
hitArea_mc._visible = false;
Symbol 770 MovieClip [treasure_gem] Frame 47
gotoAndPlay ("static");
Symbol 770 MovieClip [treasure_gem] Frame 64
stop();
this.removeMovieClip();
Symbol 772 MovieClip [treasure_cupcake] Frame 47
gotoAndPlay ("static");
Symbol 772 MovieClip [treasure_cupcake] Frame 64
stop();
this.removeMovieClip();
Symbol 773 MovieClip [treasure_coin] Frame 47
gotoAndPlay ("static");
Symbol 773 MovieClip [treasure_coin] Frame 64
stop();
this.removeMovieClip();
Symbol 801 MovieClip Frame 1
stop();
Symbol 801 MovieClip Frame 6
stop();
Symbol 801 MovieClip Frame 11
stop();
Symbol 847 MovieClip Frame 12
gotoAndPlay ("trip");
Symbol 847 MovieClip Frame 24
stop();
Symbol 848 MovieClip Frame 84
piggytrip.gotoAndPlay("fall");
Symbol 848 MovieClip Frame 104
stop();
if (this.beenThere != undefined) {
if (this.beenThere == true) {
piggytrip.gotoAndStop(piggytrip._totalframes);
}
}
_parent.spawnBarrels();
Symbol 852 MovieClip Frame 1
Symbol 852 MovieClip Frame 76
gotoAndPlay ("loop");
Symbol 867 MovieClip Frame 12
gotoAndPlay ("trip");
Symbol 867 MovieClip Frame 24
stop();
Symbol 868 MovieClip Frame 30
stop();
Symbol 881 MovieClip Frame 12
gotoAndPlay ("trip");
Symbol 881 MovieClip Frame 24
stop();
Symbol 882 MovieClip Frame 30
stop();
Symbol 883 MovieClip [ship_level_04] Frame 1
stop();
Symbol 893 MovieClip Frame 1
stop();
Symbol 893 MovieClip Frame 60
stop();
Symbol 899 MovieClip Frame 1
stop();
Symbol 899 MovieClip Frame 40
stop();
Symbol 917 MovieClip Frame 1
stop();
Symbol 917 MovieClip Frame 6
stop();
Symbol 917 MovieClip Frame 11
stop();
Symbol 918 MovieClip Frame 135
piggytrip.gotoAndPlay("fall");
Symbol 918 MovieClip Frame 152
stop();
if (this.beenThere != undefined) {
if (this.beenThere == true) {
piggytrip.gotoAndStop(piggytrip._totalframes);
}
}
_parent.spawnBarrels();
Symbol 921 MovieClip [ship_level_03] Frame 1
stop();
Symbol 922 MovieClip Frame 144
piggytrip.gotoAndPlay("fall");
Symbol 922 MovieClip Frame 161
stop();
if (this.beenThere != undefined) {
if (this.beenThere == true) {
piggytrip.gotoAndStop(piggytrip._totalframes);
}
}
_parent.spawnBarrels();
Symbol 925 MovieClip [ship_level_02] Frame 1
stop();
Symbol 926 MovieClip Frame 1
stop();
Symbol 926 MovieClip Frame 76
play();
Symbol 926 MovieClip Frame 141
this.gotoAndPlay("loop");
Symbol 949 MovieClip Frame 26
gotoAndPlay ("walk");
Symbol 949 MovieClip Frame 27
stop();
Symbol 949 MovieClip Frame 33
stop();
Symbol 949 MovieClip Frame 39
stop();
Symbol 949 MovieClip Frame 45
stop();
Symbol 958 MovieClip Frame 26
gotoAndPlay ("walk");
Symbol 958 MovieClip Frame 27
stop();
Symbol 958 MovieClip Frame 33
stop();
Symbol 958 MovieClip Frame 39
stop();
Symbol 958 MovieClip Frame 45
stop();
Symbol 974 MovieClip Frame 26
gotoAndPlay ("walk");
Symbol 974 MovieClip Frame 27
stop();
Symbol 974 MovieClip Frame 33
stop();
Symbol 974 MovieClip Frame 39
stop();
Symbol 974 MovieClip Frame 45
stop();
Symbol 1003 MovieClip Frame 1
Symbol 1003 MovieClip Frame 26
gotoAndPlay ("walk");
Symbol 1003 MovieClip Frame 27
stop();
Symbol 1003 MovieClip Frame 33
stop();
Symbol 1003 MovieClip Frame 39
stop();
Symbol 1003 MovieClip Frame 45
stop();
Symbol 1003 MovieClip Frame 51
play();
Symbol 1003 MovieClip Frame 74
gotoAndPlay ("climb");
Symbol 1003 MovieClip Frame 77
stop();
Symbol 1023 MovieClip Frame 26
gotoAndPlay ("walk");
Symbol 1023 MovieClip Frame 27
stop();
Symbol 1023 MovieClip Frame 33
stop();
Symbol 1023 MovieClip Frame 39
stop();
Symbol 1024 MovieClip [dora_sprite_mc] Frame 1
stop();
hitArea_mc._visible = false;
Symbol 1031 MovieClip [crate] Frame 1
var zDepth = 10;
top_mc._visible = false;
hitArea_mc._visible = false;
Symbol 1040 MovieClip Frame 1
this.isWalkArea = true;
Symbol 1062 MovieClip Frame 35
stop();
Symbol 1062 MovieClip Frame 43
stop();
this.removeMovieClip();
Symbol 1090 Button
on (release) {
var temp_id = setInterval(function (mc) {
var _local1 = mc._parent._parent._parent.game_shell_mc;
_local1.SceneMgr.playAgain();
}, 1000, this);
}
Symbol 1091 MovieClip Frame 26
stop();
Symbol 1100 MovieClip Frame 1172
stop();
Symbol 1101 MovieClip Frame 127
stop();
this.removeMovieClip();
Symbol 1105 MovieClip Frame 127
stop();
this.removeMovieClip();
Symbol 1111 MovieClip [__Packages.GameEngine] Frame 0
class GameEngine
{
var owner, timeline, sceneArray, sceneIdx, sceneIdx_last, iso, Hero, obstacle_start_x, obstacle_start_y, iface_mc, lastMove, levels_array, level_num, AudioMgr, audio_bg_loop;
function GameEngine (_timeline, instanceName) {
owner = this;
timeline = _timeline;
timeline.owner = owner;
init();
setFrameRate();
}
function setFrameRate() {
var _local2 = 61;
FPS.setFPS(_local2, timeline);
}
function init() {
defineVars();
AudioMgr_Init();
createInterface();
defineLevels();
createLevel();
buildWorld();
createHero();
mainListener_start();
mouseFollow_start();
mouseRotate_start();
}
function attachDebugWindow() {
var _local4 = "FPS_DISPLAY_MC";
var _local2 = timeline;
var _local5 = _local2.getNextHighestDepth();
var _local6 = _local4 + _local5;
var _local3 = _local2.attachMovie(_local4, _local6, _local5);
_local3._x = 550;
_local3._y = 20;
}
function defineVars() {
sceneArray = [];
sceneIdx = 0;
sceneIdx_last = 0;
(iso);// not popped
(Hero);// not popped
hero_linkageName = "dora_sprite_mc";
Hero_start_x = 300;
Hero_start_y = 300;
obstacle_start_x = 0;
obstacle_start_y = 0;
doPosition = false;
doRotate = false;
doJump = false;
doCheckBounds = true;
doObstacleWalk = false;
doUpdateLadderPos = false;
depth_lowest0 = -16000;
depth_lowest1 = -15000;
(iface_mc);// not popped
(lastMove);// not popped
doBarrelAnimate = false;
barrelResetting = false;
timeBtwnBarrels = 500;
barrelVOPlayed = false;
mousetween_ticks = 0;
total_possible_items = 50;
levels_array = [];
level_num = 0;
isLevelTranstioning = false;
treasure_collected_array = [];
treasure_collected_gem = false;
treasure_collected_coin = false;
treasure_collected_cupcake = false;
treasureCollectedCurrLevel = 0;
className = "GameEngine";
classVersion = "01";
(AudioMgr);// not popped
playDoorSound = false;
dopiggieVO = false;
piggieVO_active = false;
doRandomVO = false;
randomVO_idx = 0;
randomVO_Array = ["fakesound", "fakesound", "dpth_dvo_05a.wav", "fakesound", "fakesound", "dpth_dvo_05i.wav", "fakesound", "fakesound", "dpth_dvo_05b.wav", "fakesound", "fakesound", "dpth_dvo_07b.wav"];
(audio_bg_loop);// not popped
audio_loop_linkage_array = ["dpa_musiclevel_01.wav", "dpa_musiclevel_02.wav", "dpa_musiclevel_03.wav", "dpa_musiclevel_04.wav"];
level_num = 0;
}
function createInterface() {
var _local2 = timeline._parent;
iface_mc = _local2.attachMovie("interfaceClass_mc", "i", 10);
iface_mc.init(owner);
iface_mc.startGame();
}
function removeInterface() {
iface_mc.removeMovieClip();
}
function barrelAnimate_start() {
doBarrelAnimate = true;
getCurrentLevel().barrel_mc._visible = true;
if (!barrelVOPlayed) {
barrelVOPlayed = true;
AudioMgr.vo_PlaySequence(timeline, "dpth_dvo_09.wav", "dpth_dvo_10.wav");
}
}
function barrelAnimate_stop() {
doBarrelAnimate = false;
getCurrentLevel().barrel_mc._visible = false;
}
function barrelAnimate() {
if (doBarrelAnimate) {
var _local4 = barrelVelocity;
var _local2 = getCurrentLevel().barrel_mc;
var _local7 = _local2.delta_x;
var _local6 = _local2.delta_y;
var _local8 = _local2.barrel_start_x;
var _local9 = _local2.barrel_start_y;
var _local3 = false;
var _local5 = 50;
_local3 = _local2._x > (Stage.width + _local5);
_local3 = _local2._y > (Stage.height + _local5);
if (_local3) {
barrelReset(_local2);
_local3 = false;
return(undefined);
}
_local2._x = _local2._x + (_local7 * _local4);
_local2._y = _local2._y + (_local6 * _local4);
}
}
function barrelReset(barrel_mc) {
if (!barrelResetting) {
barrelResetting = true;
clearInterval(owner.timeline.barrel_interval);
timeline.barrel_interval = setInterval(function (owner) {
clearInterval(owner.timeline.barrel_interval);
var _local2 = barrel_mc.barrel_start_x;
var _local3 = barrel_mc.barrel_start_y;
barrel_mc._x = _local2;
barrel_mc._y = _local3;
barrel_mc._visible = true;
owner.barrelResetting = false;
owner.Hero_activate();
}, timeBtwnBarrels, owner);
}
}
function barrelCollision() {
var _local3 = Hero.HeroSprite_mc.hitArea_mc;
var _local2 = getCurrentLevel().barrel_mc;
if (_local3.hitTest(_local2)) {
if (!Hero.isJumping) {
barrelHitHero(_local2);
}
}
}
function barrelHitHero(barrel_mc) {
if (Hero.anim_state != "sit") {
AudioMgr.vo_Play(timeline, "dpth_dvo_11a.wav");
}
barrel_mc._visible = false;
barrelReset();
if (((Hero.dir == "W") || (Hero.dir == "NW")) || (Hero.dir == "SW")) {
var _local2 = Hero.getMC()._x - 5;
} else {
var _local2 = Hero.getMC()._x + 5;
}
Hero.setPos(_local2, Hero.getMC()._y);
Hero_deactivate();
Hero.sit();
}
function defineLevels() {
levels_array = [];
levels_array[levels_array.length] = new Level(timeline, owner, false, [false, false], [300, 300], [300, 300], "ship_level_01", "b01", [[67, 189], [86, 255], [236, 184], [279, 250], [342, 213], [449, 184], [527, 250]], null, null, [[275.5, 70]], null, null, [[423, 250, 100, 100, "next"]]);
levels_array[levels_array.length] = new Level(timeline, owner, false, [false, false], [450, 205], [80, 320], "ship_level_02", "b02", [[9, 271], [375, 265], [219, 270], [246, 217], [362, 135], [448, 271]], [[285, 230, 1.5, 1.5]], [[100, 213]], [[226, 100]], null, [[509.8, -9.7, "ladder_mc1"]], [[0, 169, 30, 200, "next"]]);
levels_array[levels_array.length] = new Level(timeline, owner, false, [false, false], [520, 300], [175, 215], "ship_level_03", "b03", [[150, 228.8], [170, 160], [200, 233], [345, 271], [361.9, 222.5], [431.9, 270.8], [537.1, 270.8], [544.1, 205]], [[475, 230, -1.5, 1.5]], [[260, 213]], [[18, 111]], null, [[75.8, -9.7, "ladder_mc2"]], [[575, 250, 50, 200, "last"]]);
levels_array[levels_array.length] = new Level(timeline, owner, true, [false, false], [300, 300], [300, 300], "ship_level_04", "b04", [[70, 174.5], [99, 132.8], [150, 132.8], [141, 109.8], [174.9, 219.5], [269.9, 141.5], [222.8, 262.8], [270.7, 219.5], [308.6, 262.8], [394.7, 215.5], [412.6, 258.8], [487.6, 210.8]], [[500, 230, -1.5, 1.5]], null, null, [[181.4, 128.2]], null, [[230, 250, 1, 1, "last"]]);
}
function createLevel() {
attachLevel();
buildLevel();
startMusicLoop(audio_loop_linkage_array[level_num]);
}
function attachLevel() {
var _local2 = getCurrentLevel();
_local2.attach();
}
function removeLevel() {
var _local5 = getCurrentLevel();
var _local4 = _local5.remove_mc_array;
var _local3 = _local4.length;
while (_local3--) {
var _local2 = _local4[_local3];
_local2.swapDepths(10000);
_local2.removeMovieClip();
}
}
function buildLevel() {
var _local2 = getCurrentLevel();
_local2.build();
}
function getCurrentLevel() {
return(levels_array[level_num]);
}
function getCurrentLevelMC() {
var _local2 = getCurrentLevel();
return(_local2.getMC());
}
function lastLevel() {
Hero.isJumping = false;
Hero_deactivate();
Hero.isJumpingDelay = false;
Hero.isJumpingOffObstacle = false;
Hero.isOnObstacle = false;
Hero.isOnLadder = false;
removeLevel();
treasureCollectedCurrLevel = 0;
playDoorSound = false;
if (level_num > 1) {
level_num--;
} else {
level_num = 0;
}
levelTransition_play();
AudioMgr.vo_StopAll();
AudioMgr.sound_StopAll();
if (level_num == 2) {
AudioMgr.sound_Play(timeline, "dpa_downstairs.wav");
}
if (level_num == 0) {
AudioMgr.sound_Play(timeline, "dpa_upstairs.wav");
}
var temp_id = setInterval(function (owner) {
clearInterval(temp_id);
owner.showLevelLast();
}, 1000, owner);
}
function showLevelLast() {
createLevel();
barrelAnimate_stop();
timeline.barrel_start_int = setInterval(function (owner) {
clearInterval(owner.timeline.barrel_start_int);
owner.barrelAnimate_start();
}, barrelStartTime, owner);
timeline.piggieVO_start_int = setInterval(function (owner) {
clearInterval(owner.timeline.piggieVO_start_int);
owner.piggieVO_start();
}, 4000, owner);
var _local3 = getCurrentLevel().startpos_last[0];
var _local2 = getCurrentLevel().startpos_last[1];
Hero.setPos(_local3, _local2);
Hero.stand();
Hero.getMC()._visible = true;
doCheckBounds = true;
var Hero_activate_int = setInterval(function (owner) {
clearInterval(Hero_activate_int);
owner.Hero_activate();
owner.isLevelTranstioning = false;
}, 1000, owner);
}
function nextLevel() {
Hero.isJumping = false;
Hero_deactivate();
Hero.isJumpingDelay = false;
Hero.isJumpingOffObstacle = false;
Hero.isOnObstacle = false;
Hero.isOnLadder = false;
removeLevel();
treasureCollectedCurrLevel = 0;
playDoorSound = false;
if (level_num < (levels_array.length - 1)) {
level_num++;
}
levelTransition_play();
AudioMgr.vo_StopAll();
AudioMgr.sound_StopAll();
if (level_num == 1) {
AudioMgr.sound_Play(timeline, "dpa_downstairs.wav");
}
if (level_num == 3) {
AudioMgr.sound_Play(timeline, "dpa_upstairs.wav");
}
var temp_id2 = setInterval(function (owner) {
clearInterval(temp_id2);
owner.createLevel();
owner.barrelAnimate_stop();
}, 700, owner);
var temp_id = setInterval(function (owner) {
clearInterval(temp_id);
owner.showLevelNext();
}, 1000, owner);
}
function showLevelNext() {
timeline.barrel_start_int = setInterval(function (owner) {
clearInterval(owner.timeline.barrel_start_int);
owner.barrelAnimate_start();
}, barrelStartTime, owner);
timeline.piggieVO_start_int = setInterval(function (owner) {
clearInterval(owner.timeline.piggieVO_start_int);
owner.piggieVO_start();
}, 4000, owner);
var _local3 = getCurrentLevel().startpos_next[0];
var _local2 = getCurrentLevel().startpos_next[1];
Hero.setPos(_local3, _local2);
Hero.stand();
Hero.getMC()._visible = true;
doCheckBounds = true;
var Hero_activate_int = setInterval(function (owner) {
clearInterval(Hero_activate_int);
owner.Hero_activate();
owner.isLevelTranstioning = false;
}, 1000, owner);
}
function levelTransition_play() {
var _local2 = iface_mc.level_transition_mc;
_local2.gotoAndPlay("trans_anim");
}
function startTimer() {
iface_mc.startTimer();
}
function AudioMgr_Init() {
AudioMgr = new AudioManager(timeline);
}
function startMusicLoop(_audio_bg_loop) {
AudioMgr.music_Stop(audio_bg_loop);
audio_bg_loop = _audio_bg_loop;
AudioMgr.music_Play(timeline, audio_bg_loop, 0, 500);
}
function randomVO_start() {
var _local2 = 10000;
doRandomVO = true;
var randomVO_int = setInterval(function (owner) {
if (owner.doRandomVO) {
owner.randomVO_play();
} else {
clearInterval(randomVO_int);
}
}, _local2, owner);
}
function randomVO_play() {
if (!AudioMgr.isVOPlaying()) {
if (randomVO_idx < (randomVO_Array.length - 1)) {
randomVO_idx++;
} else {
randomVO_idx = 0;
}
var _local3 = randomVO_Array.length - 1;
if ((level_num == 3) && (randomVO_idx == _local3)) {
randomVO_idx = 0;
}
var _local2 = randomVO_Array[randomVO_idx];
if (_local2 != "fakesound") {
AudioMgr.vo_Play(timeline, _local2);
}
}
}
function randomVO_stop() {
doRandomVO = false;
}
function piggieVO_start() {
if (!piggieVO_active) {
piggieVO_active = true;
var _local2 = 15000;
dopiggieVO = true;
var piggieVO_int = setInterval(function (owner) {
if (owner.dopiggieVO) {
owner.piggieVO_play();
} else {
clearInterval(piggieVO_int);
this.piggieVO_active = false;
}
}, _local2, owner);
}
}
function piggieVO_play() {
if (!AudioMgr.isVOPlaying()) {
AudioMgr.vo_Play(timeline, "piggie_giggle_01.wav");
}
}
function piggieVO_stop() {
dopiggieVO = false;
}
function buildWorld() {
iso = new Isometric(timeline, owner, 10, 10);
iso.init();
}
function createHero() {
var _local3 = Hero_start_x;
var _local2 = Hero_start_y;
Hero = new HeroSprite(timeline, owner, hero_linkageName, hero_linkageName, _local3, _local2);
}
function createCrate() {
var _local4 = "crate_mc";
var _local3 = timeline;
var _local5 = _local3.getNextHighestDepth();
var _local6 = _local4;
var _local2 = _local3.attachMovie(_local4, _local6, _local5);
_local2._depth = _local5;
_local2._x = 425;
_local2._y = 213;
}
function checkTreasure() {
var _local5 = Hero.HeroSprite_mc.hitArea_mc;
var _local4 = getCurrentLevel().treasure_mc_array;
var _local3 = _local4.length;
while (_local3--) {
var _local2 = _local4[_local3];
if (_local5.hitTest(_local2)) {
gotTreasure(_local2);
}
}
}
function gotTreasure(t_mc_hitArea) {
var _local2 = t_mc_hitArea;
if (!_local2.caught) {
_local2.caught = true;
treasureCollectedCurrLevel++;
if (_local2._type == "gem") {
if (!treasure_collected_gem) {
treasure_collected_gem = true;
AudioMgr.sound_Play(timeline, "Diamond_01.wav");
AudioMgr.vo_Play(timeline, "dpth_dvo_04alth.wav");
} else {
AudioMgr.sound_Play(timeline, "Diamond_01.wav", 0, 0, owner.randomVO_play, owner);
AudioMgr.sound_Play(timeline, "Diamond_01.wav", 0, 0, owner.randomVO_play, owner);
}
} else if (_local2._type == "coin") {
if (!treasure_collected_coin) {
treasure_collected_coin = true;
AudioMgr.sound_Play(timeline, "Coin_01.wav");
AudioMgr.vo_Play(timeline, "dpth_dvo_04altg.wav");
} else {
AudioMgr.sound_Play(timeline, "Coin_01.wav", 0, 0, owner.randomVO_play, owner);
}
} else if (!treasure_collected_cupcake) {
treasure_collected_cupcake = true;
AudioMgr.sound_Play(timeline, "cupcake_01.wav");
AudioMgr.vo_Play(timeline, "dpth_dvo_04alti.wav");
} else {
AudioMgr.sound_Play(timeline, "cupcake_01.wav", 0, 0, owner.randomVO_play, owner);
}
_local2.gotoAndPlay("catch");
iface_mc.incrementScore();
treasure_collected_array[treasure_collected_array.length] = _local2._type;
if (treasure_collected_array.length > (total_possible_items - 1)) {
timeExpired("timeout_02_mc");
} else if (treasureCollectedCurrLevel >= getCurrentLevel().treasure_pos_array.length) {
owner.playDoorSound = true;
var atc_interval = setInterval(function (owner) {
clearInterval(atc_interval);
if (owner.playDoorSound) {
owner.AudioMgr.sound_Play(this.timeline, "dpa_go_through_door.wav");
}
}, 10000, owner);
}
}
}
function checkLadder() {
if (!Hero.isOnLadder) {
if (!Hero.isJumping) {
if (level_num != 2) {
var _local3 = Hero.HeroSprite_mc.hitArea_top_mc;
var _local2 = getCurrentLevel().ladder_mc.hitArea_mc;
if (_local3.hitTest(_local2)) {
Hero_attachToLadder(_local2);
}
} else if (getCurrentLevel().hasKey) {
var _local3 = Hero.HeroSprite_mc.hitArea_top_mc;
var _local2 = getCurrentLevel().ladder_mc.hitArea_mc;
if (_local3.hitTest(_local2)) {
Hero_attachToLadder(_local2);
}
}
}
} else {
checkOnLadder();
}
}
function checkOnLadder() {
var _local4 = Hero.HeroSprite_mc.hitArea_mc;
var _local3 = getCurrentLevel().ladder_mc.hitArea_low_mc;
if (_local4.hitTest(_local3)) {
var _local2 = Hero.getMC();
if (!_local2.isClimbingUp) {
Hero_removeFromLadder();
}
}
_local4 = Hero.HeroSprite_mc;
var _local5 = getCurrentLevel().ladder_mc.hitArea_top_mc;
if (_local4.hitTest(_local5)) {
var _local2 = Hero.getMC();
if (_local2.isClimbingUp) {
if (level_num == 1) {
lastLevel();
} else {
nextLevel();
}
}
}
}
function Hero_attachToLadder(_ladder_mc) {
doCheckBounds = false;
Hero.isOnLadder = true;
Hero_deactivate();
var _local7 = Hero.HeroSprite_mc;
var _local5 = _ladder_mc;
if (level_num == 1) {
Hero.setDir("NE");
} else {
Hero.setDir("NW");
}
Hero.climb();
var _local2 = Hero.getMC();
var _local3 = getCurrentLevel().ladder_pos_array[0][0];
if (level_num == 1) {
var _local4 = _local3;
} else {
var _local4 = _local3 + 65;
}
_local2._x = _local4;
_local2._y = Hero.getMC()._y;
doUpdateLadderPos = true;
var start_ladder_int = setInterval(function (owner) {
clearInterval(start_ladder_int);
owner.Hero_start_updateLadderPos();
}, 400, owner);
}
function Hero_start_updateLadderPos() {
var ladder_interval = setInterval(function (owner) {
if (owner.doUpdateLadderPos) {
owner.Hero_updateLadderPos();
} else {
clearInterval(ladder_interval);
}
}, 30, owner);
}
function Hero_updateLadderPos() {
if (owner.doUpdateLadderPos) {
var _local4 = getCurrentLevel().ladder_mc;
var _local8 = _local4._y + _local4._height;
var _local7 = owner.timeline._ymouse;
if (_local7 < _local8) {
var _local2 = Hero.getMC();
var _local3 = getCurrentLevel().ladder_pos_array[0][0];
_local2.isClimbingUp = _local7 <= _local2._y;
if (level_num == 1) {
var _local9 = _local3;
} else {
var _local9 = _local3 + 65;
}
var _local6 = 2;
_local7 = owner.timeline._ymouse;
var _local5 = int(int(_local7 - _local2._y) / _local6);
if (_local5 == 0) {
mousetween_ticks++;
if (mousetween_ticks > 10) {
Hero.stand();
mousetween_ticks = 0;
}
} else if (Hero.anim_state == "stand") {
Hero.climb();
}
_local2._y = _local2._y + _local5;
_local2._x = _local9;
updateAfterEvent(_local2._y);
}
} else {
clearInterval(owner.timeline.ladder_interval);
return(undefined);
}
}
function Hero_removeFromLadder() {
var _local2 = Hero.getMC();
doCheckBounds = true;
doUpdateLadderPos = false;
Hero.stand();
var _local5 = getCurrentLevel().ladder_pos_array[0][2];
if (_local5 == "ladder_mc1") {
var _local4 = _local2._x - 30;
var _local3 = _local2._y + 10;
Hero.setPos(_local4, _local3);
} else {
var _local4 = _local2._x + 40;
var _local3 = _local2._y + 10;
Hero.setPos(_local4, _local3);
}
var remove_interval = setInterval(function (owner) {
clearInterval(remove_interval);
owner.Hero.isOnLadder = false;
owner.Hero_activate();
}, 400, owner);
}
function checkDoor() {
if (getCurrentLevel().hasKey || (level_num == 2)) {
var _local3 = Hero.HeroSprite_mc.hitArea_mc;
var _local2 = getCurrentLevel().door_mc;
if (_local3.hitTest(_local2)) {
gotDoor(_local2);
}
}
}
function gotDoor(_door_hitArea_mc) {
if (!isLevelTranstioning) {
isLevelTranstioning = true;
var _local3 = _door_hitArea_mc.level_target;
doCheckBounds = false;
Hero_deactivate();
if (level_num == 0) {
var _local5 = (_door_hitArea_mc._x + _door_hitArea_mc._width) - 22;
var _local4 = (_door_hitArea_mc._y + _door_hitArea_mc._height) - 35;
Hero.setPos(_local5, _local4);
Hero.setDir("NE");
Hero.climbDown();
var gotDoor_id = setInterval(function (owner, level_target) {
clearInterval(gotDoor_id);
if (level_target == "next") {
owner.nextLevel();
} else {
owner.lastLevel();
}
}, 300, owner, _local3);
} else if (_local3 == "next") {
owner.nextLevel();
} else {
owner.lastLevel();
}
}
}
function checkToolStar() {
if (Hero.isJumping) {
if (!getCurrentLevel().hasKey) {
var _local3 = Hero.HeroSprite_mc;
var _local2 = getCurrentLevel().tool_star_mc.tool_star_mc_content.hitArea_mc;
if (_local3.hitTest(_local2)) {
gotToolStar(_local2);
}
}
}
}
function gotToolStar(t_mc_hitArea_mc) {
if (!getCurrentLevel().hasKey) {
getCurrentLevel().hasKey = true;
var t_mc = t_mc_hitArea_mc._parent;
t_mc.gotoAndPlay("disappear");
if (!AudioMgr.isVOPlaying()) {
AudioMgr.vo_Play(timeline, "dpth_dvo_07c.wav");
}
AudioMgr.sound_Play(timeline, "Toolstar_01.wav");
var _local2 = getCurrentLevelMC().door_mc;
_local2.gotoAndPlay("open");
}
}
function mainListener() {
owner.Hero_rotate();
owner.Hero_position();
owner.Hero_jump();
owner.checkBounds();
owner.collisionDetection();
owner.checkTreasure();
owner.checkToolStar();
owner.checkLadder();
owner.checkDoor();
owner.barrelAnimate();
owner.barrelCollision();
}
function mainListener_start() {
timeline.onEnterFrame = mainListener;
}
function mainListener_stop() {
timeline.onEnterFrame = null;
delete timeline.onEnterFrame;
}
function Hero_activate() {
if (!Hero.isActivated) {
if (!Hero.isOnLadder) {
Hero.getMC()._visible = true;
Hero.isActivated = true;
mouseFollow_start();
mouseRotate_start();
}
}
}
function Hero_deactivate() {
if (Hero.isActivated) {
Hero.isActivated = false;
doJump = false;
mouseFollow_stop();
mouseRotate_stop();
}
}
function Hero_rotate() {
if (doRotate) {
Hero.rotateDir();
}
}
function Hero_position() {
if (doPosition) {
Hero.mouseTween();
}
}
function Hero_jump() {
if (doJump) {
Hero.jump_handleJump();
}
}
function mouseFollow_start() {
if ((!Hero.isOnLadder) && (!isLevelTranstioning)) {
doPosition = true;
}
}
function mouseFollow_stop() {
doPosition = false;
owner.parentClass.jump_stop();
}
function mouseRotate_start() {
doRotate = true;
}
function mouseRotate_stop() {
doRotate = false;
}
function jump_start() {
doJump = true;
doRotate = false;
doPosition = false;
}
function jump_stop() {
Hero.setLastValidPos(getHitTestArray());
doJump = false;
doRotate = true;
doPosition = true;
doCheckBounds = true;
checkBounds();
}
function collisionDetection() {
var _local14 = Hero.dir;
var _local4 = Hero.HeroSprite_mc.hitArea_mc;
if (Hero.isOnObstacle) {
if (!Hero.isJumping) {
Hero.setPos(obstacle_start_x, obstacle_start_y);
updateAfterEvent(Hero.getMC()._x);
Hero.stand();
}
timeline.crate_mc.swapDepths(depth_lowest0);
return(undefined);
}
var _local12 = getCurrentLevel().wheel_mc;
var _local16 = getCurrentLevel().crates_array[0];
if (Hero.isJumping) {
var _local13 = _local16.tN;
var _local23 = _local16.tS;
var _local21 = _local16.tW;
var _local22 = _local16.tE;
var _local20 = [_local16, _local12.overlap_mc, _local13, _local23, _local21, _local22];
} else {
var _local13 = _local16.cN;
var _local23 = _local16.cS;
var _local21 = _local16.cW;
var _local22 = _local16.cE;
var _local20 = [_local16.overlap_mc, _local12.overlap_mc, _local13, _local23, _local21, _local22];
}
var _local2 = [];
var _local8;
var _local15 = _local20.length;
var _local19 = true;
while (_local15--) {
var _local3 = _local20[_local15];
if (_local4.hitTest(_local3)) {
dtrace("collision : " + _local3);
_local19 = false;
if (_local3 == timeline.crate_mc.overlap_mc) {
var _local11 = timeline.crate_mc._y + (timeline.crate_mc._height / 2);
var _local7 = {x:_local4._x, y:_local4._y};
_local4._parent.localToGlobal(_local7);
var _local10 = _local7.y;
if (_local10 < _local11) {
zOrder(_local4, _local13);
}
} else {
timeline.crate_mc.swapDepths(depth_lowest0);
}
if (_local3 == _local12.overlap_mc) {
zOrder(_local4, _local3);
} else {
_local12.swapDepths(depth_lowest1);
}
if (_local3 == _local22) {
var _local9 = "E";
_local2.push("W");
_local2.push("NW");
_local2.push("SW");
}
if (_local3 == _local21) {
var _local9 = "W";
_local2.push("E");
_local2.push("NE");
_local2.push("SE");
}
if (_local3 == _local13) {
var _local9 = "N";
_local2.push("S");
_local2.push("SW");
_local2.push("SE");
}
if (_local3 == _local23) {
var _local9 = "S";
_local2.push("N");
_local2.push("NW");
_local2.push("NE");
}
var _local6 = _local2.length;
while (_local6--) {
var _local5 = _local2[_local6];
if (_local14 == _local5) {
_local8 = true;
}
}
if (_local8) {
if (Hero.isJumping) {
obstacleWalk_start(_local3);
} else {
Hero_onObstacleBorder(_local9);
}
} else {
mouseFollow_start();
}
}
}
if (_local19) {
_local16.swapDepths(depth_lowest0);
_local12.swapDepths(depth_lowest1);
}
}
function Hero_onObstacleBorder(_stopDir) {
var _local2 = _stopDir;
Hero_posLastValid();
if (_local2 == "N") {
Hero.do_x = true;
Hero.do_y = false;
} else if (_local2 == "S") {
Hero.do_x = true;
Hero.do_y = false;
} else if (_local2 == "W") {
Hero.do_x = false;
Hero.do_y = true;
} else if (_local2 == "E") {
Hero.do_x = false;
Hero.do_y = true;
}
}
function obstacleWalk_start(ht_mc) {
Hero.jump_stop();
Hero.isOnObstacle = true;
doObstacleWalk = true;
doCheckBounds = false;
var _local3 = timeline.crate_mc;
var _local2 = {x:_local3.landing_pad_mc._x, y:_local3.landing_pad_mc._y};
ht_mc._parent.localToGlobal(_local2);
Hero.setPos(_local2.x, _local2.y);
obstacle_start_x = _local2.x;
obstacle_start_y = _local2.y;
Hero.stand();
doPosition = false;
}
function obstacleWalk_stop() {
Hero.isOnObstacle = false;
doObstacleWalk = false;
Hero.getMC()._x = obstacle_start_x + 20;
Hero.getMC()._y = obstacle_start_y - 20;
Hero.walk();
doCheckBounds = true;
}
function Hero_Unstick() {
var _local5 = Hero.dir;
var _local4;
var _local3;
var _local2 = 3;
switch (_local5) {
case "N" :
_local4 = 0;
_local3 = -_local2;
break;
case "E" :
_local4 = _local2;
_local3 = 0;
break;
case "W" :
_local4 = -_local2;
_local3 = 0;
break;
case "S" :
_local4 = 0;
_local3 = _local2;
break;
case "NW" :
_local4 = -_local2;
_local3 = -_local2;
break;
case "NE" :
_local4 = _local2;
_local3 = -_local2;
break;
case "SW" :
_local4 = -_local2;
_local3 = _local2;
break;
case "SE" :
_local4 = _local2;
_local3 = _local2;
}
Hero.getMC()._x = Hero.getMC()._x + _local4;
Hero.getMC()._y = Hero.getMC()._y + _local3;
}
function getHitTestArray() {
var _local3 = getCurrentLevel().b_mc.border_mc;
var _local2 = [];
_local2[_local2.length] = _local3.walk_area_mc0;
_local2[_local2.length] = _local3.walk_area_mc1;
_local2[_local2.length] = _local3.walk_area_mc2;
_local2[_local2.length] = _local3.walk_area_mc3;
_local2[_local2.length] = _local3.walk_area_mc4;
_local2[_local2.length] = _local3.walk_area_mc5;
_local2[_local2.length] = _local3.walk_area_mc6;
_local2[_local2.length] = _local3.walk_area_mc7;
_local2[_local2.length] = _local3.walk_area_mc8;
_local2[_local2.length] = _local3.walk_area_mc9;
_local2[_local2.length] = _local3.walk_area_mc10;
_local2[_local2.length] = _local3.walk_area_mc11;
_local2[_local2.length] = _local3.walk_area_mc12;
_local2[_local2.length] = _local3.walk_area_mc13;
return(_local2);
}
function Hero_posLastValid() {
Hero.getMC()._x = Hero.lastValid_x;
Hero.getMC()._y = Hero.lastValid_y;
}
function Hero_onBorder(hitTestArray) {
Hero_posLastValid();
var _local3 = Hero.dir;
if (_local3 == "NW") {
if (Hero.isValidDir("NE", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
} else if (Hero.isValidDir("SW", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
} else {
Hero_posLastValid();
}
} else if (_local3 == "NE") {
if (Hero.isValidDir("NW", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
} else if (Hero.isValidDir("SE", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
} else {
Hero_posLastValid();
}
} else if (_local3 == "SW") {
if (Hero.isValidDir("SE", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
} else if (Hero.isValidDir("NW", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
} else {
Hero_posLastValid();
}
} else if (_local3 == "SE") {
if (Hero.isValidDir("SW", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
} else if (Hero.isValidDir("NE", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
} else {
Hero_posLastValid();
}
} else if (_local3 == "N") {
if (Hero.isValidDir("NE", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
Hero.moveToDir("E");
} else if (Hero.isValidDir("NW", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
Hero.moveToDir("W");
} else {
Hero_posLastValid();
}
} else if (_local3 == "S") {
if (Hero.isValidDir("SE", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
Hero.moveToDir("E");
} else if (Hero.isValidDir("SW", hitTestArray)) {
Hero.do_x = true;
Hero.do_y = false;
Hero.moveToDir("W");
} else {
Hero_posLastValid();
}
} else if (_local3 == "W") {
if (Hero.isValidDir("NW", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
Hero.moveToDir("N");
} else if (Hero.isValidDir("SW", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
Hero.moveToDir("S");
} else {
Hero_posLastValid();
}
} else if (_local3 == "E") {
if (Hero.isValidDir("NE", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
Hero.moveToDir("N");
} else if (Hero.isValidDir("SE", hitTestArray)) {
Hero.do_x = false;
Hero.do_y = true;
Hero.moveToDir("S");
} else {
Hero_posLastValid();
}
} else {
Hero_posLastValid();
}
}
function checkBounds() {
if (doCheckBounds) {
var _local4 = getCurrentLevel().b_mc.border_mc;
var _local7 = Hero.HeroSprite_mc.hitArea_mc;
var _local2 = [];
_local2[_local2.length] = _local4.walk_area_mc0;
_local2[_local2.length] = _local4.walk_area_mc1;
_local2[_local2.length] = _local4.walk_area_mc2;
_local2[_local2.length] = _local4.walk_area_mc3;
_local2[_local2.length] = _local4.walk_area_mc4;
_local2[_local2.length] = _local4.walk_area_mc5;
_local2[_local2.length] = _local4.walk_area_mc6;
_local2[_local2.length] = _local4.walk_area_mc7;
_local2[_local2.length] = _local4.walk_area_mc8;
_local2[_local2.length] = _local4.walk_area_mc9;
_local2[_local2.length] = _local4.walk_area_mc10;
_local2[_local2.length] = _local4.walk_area_mc11;
_local2[_local2.length] = _local4.walk_area_mc12;
_local2[_local2.length] = _local4.walk_area_mc13;
var _local6 = false;
var _local5 = _local2.length;
while (_local5--) {
var _local3 = _local2[_local5];
if (_local7.hitTest(_local3)) {
_local6 = true;
}
}
if (_local6) {
if (!Hero.isJumping) {
Hero_onBorder(_local2);
if (lastMove == "jump") {
lastMove = "walk";
}
}
} else {
Hero.lastValid_x = Hero.getMC()._x;
Hero.lastValid_y = Hero.getMC()._y;
Hero.do_x = true;
Hero.do_y = true;
mouseFollow_start();
}
} else if (!Hero.isJumping) {
if (lastMove == "jump") {
lastMove = "walk";
}
}
}
function zOrder(hero_mc, obstacle_mc) {
var _local1 = obstacle_mc._parent;
_local1.swapDepths(16000);
}
function getGameConfigManager() {
return(timeline._parent.GameConfig);
}
function GameConfigManager_setScore() {
var _local2 = iface_mc.getScore();
getGameConfigManager().setScore(_local2);
}
function GameConfigManager_setTreasureList() {
var _local2 = treasure_collected_array;
getGameConfigManager().setTreasureList(_local2);
}
function getSceneMgr() {
return(timeline._parent.SceneMgr);
}
function startGame() {
var _local2 = getSceneMgr();
_local2.sceneNum = 4;
}
function timeExpired(_linkage_name) {
GameConfigManager_setScore();
GameConfigManager_setTreasureList();
iface_mc.clearTimer();
cleanUp();
attachScreen_timeExpired(_linkage_name);
var te_id = setInterval(function (owner) {
clearInterval(te_id);
owner.endGame();
}, 8000, owner);
}
function attachScreen_timeExpired(_linkage_name) {
if (_linkage_name == undefined) {
var _local3 = "timeout_01_mc";
} else {
var _local3 = _linkage_name;
}
var _local2 = timeline;
var _local4 = _local2.getNextHighestDepth();
var _local5 = _local3 + _local4;
var _local6 = _local2.attachMovie(_local3, _local5, _local4);
}
function endGame() {
iface_mc.setScore(0);
removeInterface();
destroyClass();
timeline._parent.SceneMgr.playSceneNext();
}
function cleanUp() {
piggieVO_stop();
AudioMgr.music_Stop(audio_loop_linkage_array[level_num]);
randomVO_stop();
barrelAnimate_stop();
Hero_deactivate();
Hero.destroyHeroSprite();
mainListener_stop();
GameConfigManager_setScore();
}
function deleteAllVars() {
delete sceneArray;
delete sceneIdx;
delete sceneIdx_last;
delete iso;
delete Hero;
delete hero_linkageName;
delete Hero_start_x;
delete Hero_start_y;
delete obstacle_start_x;
delete obstacle_start_y;
delete doPosition;
delete doRotate;
delete doJump;
delete doCheckBounds;
delete doObstacleWalk;
delete doUpdateLadderPos;
delete depth_lowest0;
delete depth_lowest1;
delete iface_mc;
delete lastMove;
delete doBarrelAnimate;
delete barrelResetting;
delete timeBtwnBarrels;
delete barrelVOPlayed;
delete mousetween_ticks;
delete total_possible_items;
delete levels_array;
delete level_num;
delete isLevelTranstioning;
delete treasure_collected_array;
delete treasure_collected_gem;
delete treasure_collected_coin;
delete treasure_collected_cupcake;
delete treasureCollectedCurrLevel;
delete className;
delete classVersion;
delete AudioMgr;
delete playDoorSound;
delete dopiggieVO;
delete piggieVO_active;
delete doRandomVO;
delete randomVO_idx;
delete randomVO_Array;
delete audio_bg_loop;
delete audio_loop_linkage_array;
}
function destroyClass() {
deleteAllVars();
defineVars();
}
function dtrace(output) {
timeline.debugger.text = output;
}
var hero_linkageName = "dora_sprite_mc";
var Hero_start_x = 300;
var Hero_start_y = 300;
var doPosition = false;
var doRotate = false;
var doJump = false;
var doCheckBounds = true;
var doObstacleWalk = false;
var doUpdateLadderPos = false;
var depth_lowest0 = -16000;
var depth_lowest1 = -15000;
var doBarrelAnimate = false;
var barrelResetting = false;
var timeBtwnBarrels = 500;
var barrelVOPlayed = false;
var barrelStartTime = 8000;
var barrelVelocity = 0.75;
var mousetween_ticks = 0;
var total_possible_items = 50;
var isLevelTranstioning = false;
var treasure_collected_array = [];
var treasure_collected_gem = false;
var treasure_collected_coin = false;
var treasure_collected_cupcake = false;
var treasureCollectedCurrLevel = 0;
var className = "GameEngine";
var classVersion = "01";
var playDoorSound = false;
var dopiggieVO = false;
var piggieVO_active = false;
var doRandomVO = false;
var randomVO_idx = 0;
var randomVO_Array = ["fakesound", "fakesound", "dpth_dvo_05a.wav", "fakesound", "fakesound", "dpth_dvo_05i.wav", "fakesound", "fakesound", "dpth_dvo_05b.wav", "fakesound", "fakesound"];
var audio_loop_linkage_array = ["dpa_musiclevel_01.wav", "dpa_musiclevel_02.wav", "dpa_musiclevel_03.wav", "dpa_musiclevel_04.wav"];
}
Symbol 1112 MovieClip [__Packages.Isometric] Frame 0
class Isometric
{
var owner, timeline, parentClass, maxx, maxz, theta, alpha, sinTheta, cosTheta, sinAlpha, cosAlpha;
function Isometric () {
}
function Iso(_timeline, _parentClass, _maxx, _maxz) {
owner = this;
timeline = _timeline;
parentClass = _parentClass;
maxx = _maxx;
maxz = _maxz;
}
function init() {
var _local3 = 30;
var _local2 = 45;
theta = (_local3 * Math.PI) / 180;
alpha = (_local2 * Math.PI) / 180;
sinTheta = Math.sin(theta);
cosTheta = Math.cos(theta);
sinAlpha = Math.sin(alpha);
cosAlpha = Math.cos(alpha);
}
function mapToScreen(xpp, ypp, zpp) {
var _local3 = ypp;
var _local4 = (xpp * cosAlpha) + (zpp * sinAlpha);
var _local2 = (zpp * cosAlpha) - (xpp * sinAlpha);
var _local6 = _local4;
var _local5 = (_local3 * cosTheta) - (_local2 * sinTheta);
return([_local6, _local5]);
}
function mapToIsoWorld(screenX, screenY) {
var _local2 = ((screenX / cosAlpha) - (screenY / (sinAlpha * sinTheta))) * (1 / ((cosAlpha / sinAlpha) + (sinAlpha / cosAlpha)));
var _local3 = (1 / cosAlpha) * (screenX - (_local2 * sinAlpha));
return([_local3, _local2]);
}
function calculateDepth(x, y, z) {
var _local4 = 5;
x = Math.abs(x) * _local4;
y = Math.abs(y);
z = Math.abs(z) * _local4;
var _local2 = maxx;
var _local5 = maxz;
var _local7 = (_local2 * (_local5 - 1)) + z;
var _local6 = ((_local2 * (z - 1)) + x) + (_local7 * Math.abs(y));
return(_local6);
}
var className = "Iso";
var classVersion = "01";
}
Symbol 1113 MovieClip [__Packages.HeroSprite] Frame 0
class HeroSprite
{
var owner, timeline, parentClass, HeroSpriteName, linkageName, x, y, mouse_friction_current, iso, doShadow, isOnLadder, HeroSprite_mc, doMouseTween, sprite, isActivated, isStanding, anim_state, dir, lastValid_x, lastValid_y, curr_x, curr_y, last_x, last_y, isJumping, start_jump_x, start_jump_y, start_jump_dir, isJumpingOffObstacle, isJumpingSouthOffObstacle, end_jump_x, end_jump_y, hta;
function HeroSprite (_timeline, _parentClass, _HeroSpriteName, _linkageName, __x, __y) {
owner = this;
timeline = _timeline;
parentClass = _parentClass;
HeroSpriteName = _HeroSpriteName;
linkageName = _linkageName;
x = __x;
y = __y;
init();
}
function init() {
mouse_friction_current = mouse_friction_default;
iso = owner.parentClass.iso;
attachHeroSprite();
setDir("E");
doShadow = true;
isOnLadder = false;
}
function attachHeroSprite() {
var _local4 = linkageName;
var _local3 = timeline;
var _local2 = _local3.getNextHighestDepth();
var _local5 = _local4 + _local2;
HeroSprite_mc = _local3.attachMovie(_local4, _local5, _local2);
HeroSprite_mc.owner = owner;
HeroSprite_mc._x = x;
HeroSprite_mc._y = y;
HeroSprite_mc._depth = _local2;
HeroSprite_mc.onMouseDown = function () {
this.owner.jump();
};
doMouseTween = true;
sprite = {x:50, y:-100, z:-100, ymov:0, clip:HeroSprite_mc, shadowClip:timeline.shadow_jump};
jump();
isActivated = true;
}
function getMC() {
return(HeroSprite_mc);
}
function resetPos() {
HeroSprite_mc._x = x;
HeroSprite_mc._y = y;
}
function mouseFollow() {
rotateDir();
mouseTween();
}
function mouseTween() {
var _local2 = HeroSprite_mc;
if (doMouseTween) {
var _local3 = mouse_friction_current;
var _local6 = owner.timeline._xmouse;
var _local7 = owner.timeline._ymouse;
var _local4 = int(int(_local6 - _local2._x) / _local3);
var _local5 = int(int(_local7 - _local2._y) / _local3);
if ((_local4 == 0) && (_local5 == 0)) {
mousetween_ticks++;
if (mousetween_ticks > 10) {
isStanding = true;
stand();
mousetween_ticks = 0;
}
} else if (anim_state == "stand") {
walk();
isStanding = false;
}
if (do_x) {
_local2._x = _local2._x + _local4;
}
if (do_y) {
_local2._y = _local2._y + _local5;
}
updateAfterEvent(_local2._x);
}
}
function animateToTarget(__x, __y) {
if (!isAnimatingToTarget) {
isAnimatingToTarget = true;
doMouseTween = false;
var animateToTarget_interval = setInterval(function (owner) {
var _local1 = owner.HeroSprite_mc;
var _local3 = owner.mouse_friction_current;
var _local6 = __x;
var _local7 = __y;
var _local4 = int(int(_local6 - _local1._x) / _local3);
var _local5 = int(int(_local7 - _local1._y) / _local3);
if ((_local4 == 0) && (_local5 == 0)) {
clearInterval(animateToTarget_interval);
owner.isAnimatingToTarget = false;
owner.doMouseTween = true;
owner.correctPosition();
return(undefined);
}
_local1._x = _local1._x + _local4;
_local1._y = _local1._y + _local5;
updateAfterEvent(_local1._x);
}, 30, owner);
}
}
function correctPosition(hitTestArray) {
var _local3 = dir;
if (_local3 == "NW") {
if (isValidDir("NE", hitTestArray)) {
moveToDir("NE");
} else if (isValidDir("SW", hitTestArray)) {
moveToDir("SW");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "NE") {
if (isValidDir("NW", hitTestArray)) {
moveToDir("NW");
} else if (isValidDir("SE", hitTestArray)) {
moveToDir("SE");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "SW") {
if (isValidDir("SE", hitTestArray)) {
moveToDir("SE");
} else if (isValidDir("NW", hitTestArray)) {
moveToDir("NW");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "SE") {
if (isValidDir("SW", hitTestArray)) {
moveToDir("SW");
} else if (isValidDir("NE", hitTestArray)) {
moveToDir("NE");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "N") {
if (isValidDir("E", hitTestArray)) {
moveToDir("E");
} else if (isValidDir("W", hitTestArray)) {
moveToDir("W");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "S") {
if (isValidDir("E", hitTestArray)) {
moveToDir("E");
} else if (isValidDir("W", hitTestArray)) {
moveToDir("W");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "W") {
if (isValidDir("N", hitTestArray)) {
moveToDir("N");
} else if (isValidDir("S", hitTestArray)) {
moveToDir("S");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else if (_local3 == "E") {
if (isValidDir("N", hitTestArray)) {
moveToDir("N");
} else if (isValidDir("S", hitTestArray)) {
moveToDir("S");
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
} else {
getMC()._x = lastValid_x;
getMC()._y = lastValid_y;
}
lastValid_x = getMC()._x;
lastValid_y = getMC()._y;
}
function rotateDir() {
var _local2 = getMouseAngle();
if (_local2 >= 157.5) {
setDir("W");
} else if (_local2 <= -112.5) {
setDir("NW");
} else if (_local2 <= -67.5) {
setDir("N");
} else if (_local2 <= -22.5) {
setDir("NE");
} else if (_local2 <= 22.5) {
setDir("E");
} else if (_local2 <= 67.5) {
setDir("SE");
} else if (_local2 <= 112.5) {
setDir("S");
} else {
setDir("SW");
}
}
function getMouseAngle() {
var _local2 = HeroSprite_mc;
curr_x = _local2._x;
curr_y = _local2._y;
var _local6 = _local2._parent._xmouse - curr_x;
var _local5 = _local2._parent._ymouse - curr_y;
var _local3 = Math.atan2(_local5, _local6);
var _local4 = int(radiansToDegrees(_local3));
last_x = curr_x;
last_y = curr_y;
return(_local4);
}
function radiansToDegrees(radians) {
return((radians / Math.PI) * 180);
}
function setPos(__x, __y) {
var _local2 = HeroSprite_mc;
_local2._x = __x;
_local2._y = __y;
curr_x = _local2._x;
curr_y = _local2._y;
last_x = curr_x;
last_y = curr_y;
}
function setDir(_dir) {
dir = _dir;
var _local2 = HeroSprite_mc;
_local2.gotoAndStop(_dir);
}
function jump() {
if (isJumping) {
return(undefined);
}
if (isJumpingDelay) {
return(undefined);
}
if (isOnLadder) {
return(undefined);
}
isJumping = true;
isJumpingDelay = true;
parentClass.lastMove = "jump";
parentClass.AudioMgr.sound_Play(timeline, "jumping_01.wav");
start_jump_x = HeroSprite_mc._x;
start_jump_y = HeroSprite_mc._y;
last_x = start_jump_x;
last_y = start_jump_y;
start_jump_dir = dir;
if (isOnObstacle) {
isJumpingOffObstacle = true;
}
if (isOnObstacle && (((start_jump_dir == "S") || (start_jump_dir == "SW")) || (start_jump_dir == "SE"))) {
isJumpingSouthOffObstacle = true;
}
sprite.ymov = ymov;
sprite.x = iso.mapToIsoWorld(sprite.clip._x, sprite.clip._y)[0];
sprite.y = 0;
sprite.z = iso.mapToIsoWorld(sprite.clip._x, sprite.clip._y)[1];
jump_anim();
sprite.shadowClip._visible = true;
owner.parentClass.jump_start();
}
function getPosArray() {
var _local14 = start_jump_x - end_jump_x;
var _local13 = start_jump_y - end_jump_y;
var _local9;
var _local8;
if (_local14 > 0) {
_local9 = 1;
} else {
_local9 = -1;
}
if (_local13 > 0) {
_local8 = 1;
} else {
_local8 = -1;
}
var _local4 = 4;
var _local5 = [];
if ((_local14 * _local9) > (_local13 * _local8)) {
var _local10 = int(_local14 / _local4);
} else {
var _local10 = int(_local13 / _local4);
}
if (_local10 < 0) {
var _local10 = _local10 * -1;
}
var _local12 = _local14 * (-_local9);
var _local11 = _local13 * (-_local8);
var _local3 = end_jump_x;
var _local2 = end_jump_y;
while (_local10--) {
_local5[_local5.length] = {x:_local3, y:_local2};
if (_local3 >= _local12) {
_local3 = _local3 + (_local4 * _local9);
}
if (_local2 >= _local11) {
_local2 = _local2 + (_local4 * _local8);
}
}
return(_local5);
}
function kickBack(_hta) {
hta = _hta;
var _local6 = getOppositeDir(dir);
var _local5 = _local6;
var _local2 = 3;
var _local4 = lastValid_x;
var _local3 = lastValid_y;
if (_local5 == "N") {
var _local8 = _local4;
var _local7 = _local3 - _local2;
animateToTarget(_local8, _local7);
} else if (_local5 == "S") {
var _local8 = _local4;
var _local7 = _local3 + _local2;
animateToTarget(_local8, _local7);
} else if (_local5 == "W") {
var _local8 = _local4 - _local2;
var _local7 = _local3;
animateToTarget(_local8, _local7);
} else if (_local5 == "E") {
var _local8 = _local4 + _local2;
var _local7 = _local3;
animateToTarget(_local8, _local7);
} else if (_local5 == "NW") {
var _local8 = _local4 - _local2;
var _local7 = _local3 - _local2;
animateToTarget(_local8, _local7);
} else if (_local5 == "NE") {
var _local8 = _local4 + _local2;
var _local7 = _local3 - _local2;
animateToTarget(_local8, _local7);
} else if (_local5 == "SW") {
var _local8 = _local4 - _local2;
var _local7 = _local3 + _local2;
animateToTarget(_local8, _local7);
} else if (_local5 == "SE") {
var _local8 = _local4 + _local2;
var _local7 = _local3 + _local2;
animateToTarget(_local8, _local7);
}
}
function getOppositeDir(_dir) {
if (_dir == "N") {
return("S");
}
if (_dir == "S") {
return("N");
}
if (_dir == "W") {
return("E");
}
if (_dir == "E") {
return("W");
}
if (_dir == "NW") {
return("SE");
}
if (_dir == "NE") {
return("SW");
}
if (_dir == "SW") {
return("NE");
}
if (_dir == "SE") {
return("NW");
}
}
function moveToDir(_dir) {
var _local2 = 2;
var _local4 = HeroSprite_mc._x;
var _local3 = HeroSprite_mc._y;
if (_dir == "N") {
var _local7 = _local4;
var _local6 = _local3 - _local2;
setPos(_local7, _local6);
} else if (_dir == "S") {
var _local7 = _local4;
var _local6 = _local3 + _local2;
setPos(_local7, _local6);
} else if (_dir == "W") {
var _local7 = _local4 - _local2;
var _local6 = _local3;
setPos(_local7, _local6);
} else if (_dir == "E") {
var _local7 = _local4 + _local2;
var _local6 = _local3;
setPos(_local7, _local6);
} else if (_dir == "NW") {
var _local7 = _local4 - _local2;
var _local6 = _local3 - _local2;
setPos(_local7, _local6);
} else if (_dir == "NE") {
var _local7 = _local4 + _local2;
var _local6 = _local3 - _local2;
setPos(_local7, _local6);
} else if (_dir == "SW") {
var _local7 = _local4 - _local2;
var _local6 = _local3 + _local2;
setPos(_local7, _local6);
} else if (_dir == "SE") {
var _local7 = _local4 + _local2;
var _local6 = _local3 + _local2;
setPos(_local7, _local6);
}
lastValid_x = HeroSprite_mc._x;
lastValid_y = HeroSprite_mc._y;
updateAfterEvent(HeroSprite_mc._y);
}
function isValidDir(_dir, hitTestArray) {
var _local4 = true;
var _local10 = 10;
var _local12 = HeroSprite_mc._x;
var _local11 = HeroSprite_mc._y;
if (_dir == "N") {
var _local16 = _local12;
var _local15 = _local11 - _local10;
} else if (_dir == "S") {
var _local16 = _local12;
var _local15 = _local11 + _local10;
} else if (_dir == "W") {
var _local16 = _local12 - _local10;
var _local15 = _local11;
} else if (_dir == "E") {
var _local16 = _local12 + _local10;
var _local15 = _local11;
} else if (_dir == "NW") {
var _local16 = _local12 - _local10;
var _local15 = _local11 - _local10;
} else if (_dir == "NE") {
var _local16 = _local12 + _local10;
var _local15 = _local11 - _local10;
} else if (_dir == "SW") {
var _local16 = _local12 - _local10;
var _local15 = _local11 + _local10;
} else if (_dir == "SE") {
var _local16 = _local12 + _local10;
var _local15 = _local11 + _local10;
}
var _local13 = [{x:_local16, y:_local15}];
var _local9 = _local13.length;
while (_local9--) {
var _local6 = _local13[_local9];
var _local7 = getMC().hitArea_mc;
setPos(_local6.x, _local6.y);
var _local5 = false;
var _local3 = hitTestArray.length;
while (_local3--) {
var _local2 = hitTestArray[_local3];
if (_local7.hitTest(_local2)) {
_local4 = false;
_local5 = true;
return(_local4);
}
}
if (!_local5) {
return(_local4);
}
}
}
function setLastValidPos(hitTestArray) {
var _local9 = getPosArray().reverse();
var _local8 = _local9.length;
while (_local8--) {
var _local5 = _local9[_local8];
var _local6 = getMC().hitArea_mc;
setPos(_local5.x, _local5.y);
var _local4 = false;
var _local3 = hitTestArray.length;
while (_local3--) {
var _local2 = hitTestArray[_local3];
if (_local6.hitTest(_local2)) {
_local4 = true;
}
}
if (!_local4) {
return(_local5);
}
}
}
function jump_stop() {
end_jump_x = getMC()._x;
end_jump_y = getMC()._y;
var isJumping_int = setInterval(function (owner) {
clearInterval(isJumping_int);
owner.isJumpingDelay = false;
}, 500, owner);
owner.isJumping = false;
isJumpingOffObstacle = false;
isJumpingSouthOffObstacle = false;
if (isOnObstacle) {
owner.parentClass.obstacleWalk_stop();
}
stand();
owner.parentClass.jump_stop();
sprite.shadowClip._visible = false;
}
function jump_handleJump() {
jump_anim();
sprite.ymov = sprite.ymov + gravity;
sprite.y = sprite.y + sprite.ymov;
if (isJumpingOffObstacle) {
if (isJumpingSouthOffObstacle) {
owner.parentClass.timeline.crate_mc.swapDepths(-16000);
}
if (start_jump_dir == "S") {
sprite.z = sprite.z - 5;
sprite.x = sprite.x + 4;
} else if (start_jump_dir == "SW") {
sprite.z = sprite.z - 6;
sprite.x = sprite.x + 1;
} else if (start_jump_dir == "SE") {
sprite.z = sprite.z - 1;
sprite.x = sprite.x + 6;
} else if (start_jump_dir == "N") {
sprite.z = sprite.z + 0.5;
} else if (start_jump_dir == "NW") {
sprite.z = sprite.z - 2;
} else if (start_jump_dir == "NE") {
sprite.z = sprite.z + 1;
sprite.x = sprite.x + 2;
} else if (start_jump_dir == "E") {
sprite.z = sprite.z - 1;
sprite.x = sprite.x + 4;
} else if (start_jump_dir == "W") {
sprite.z = sprite.z - 4;
sprite.x = sprite.x - 1;
}
} else if (start_jump_dir == "S") {
sprite.z = sprite.z - 3;
sprite.x = sprite.x + 2;
} else if (start_jump_dir == "SW") {
sprite.z = sprite.z - 3;
sprite.x = sprite.x + 1;
} else if (start_jump_dir == "SE") {
sprite.z = sprite.z - 1;
sprite.x = sprite.x + 3;
} else if (start_jump_dir == "N") {
sprite.z = sprite.z + 3;
sprite.x = sprite.x - 2;
} else if (start_jump_dir == "NW") {
sprite.z = sprite.z + 1;
sprite.x = sprite.x - 3;
} else if (start_jump_dir == "NE") {
sprite.z = sprite.z + 3;
sprite.x = sprite.x - 1;
} else if (start_jump_dir == "E") {
sprite.z = sprite.z + 2;
sprite.x = sprite.x + 1;
} else if (start_jump_dir == "W") {
sprite.z = sprite.z - 2;
sprite.x = sprite.x - 1;
}
if (sprite.y > 0) {
sprite.y = 0;
sprite.ymov = (-Math.abs(sprite.ymov)) * decay;
} else if (sprite.last_y >= 0) {
jump_stop();
}
sprite.last_y = sprite.y;
var _local2 = iso.mapToScreen(sprite.x, sprite.y, sprite.z);
sprite.clip._x = _local2[0];
sprite.clip._y = _local2[1];
_local2 = iso.mapToScreen(sprite.x, 0, sprite.z);
sprite.shadowClip._x = _local2[0];
sprite.shadowClip._y = _local2[1];
}
function jump_anim() {
var _local2 = "jump";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndStop(_local2);
anim_state = _local2;
}
function climb() {
var _local2 = "climb";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndPlay(_local2);
anim_state = _local2;
}
function climbDown() {
var _local2 = "climb2";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndStop(_local2);
anim_state = _local2;
}
function crateWalk() {
var _local2 = "walk";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndStop(_local2);
anim_state = _local2;
}
function walk() {
var _local2 = "walk";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndPlay(_local2);
anim_state = _local2;
}
function stand() {
var _local2 = "stand";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndStop(_local2);
anim_state = _local2;
}
function sit() {
var _local2 = "sit";
var _local3 = HeroSprite_mc[HeroSprite_sub_mc];
_local3.gotoAndStop(_local2);
anim_state = _local2;
}
function destroyHeroSprite() {
HeroSprite_mc.removeMovieClip();
}
function onHeroSpriteDone() {
parentClass.playHeroSpriteNext();
}
var do_x = true;
var do_y = true;
var HeroSprite_sub_mc = "dora_mc";
var className = "HeroSprite";
var classVersion = "01";
var isJumpingDelay = false;
var isOnObstacle = false;
var isAnimatingToTarget = false;
var mousetween_ticks = 0;
var mouse_friction_default = 10;
var speed = 7;
var gravity = 1;
var decay = 0.2;
var ymov = -14;
}
Symbol 1114 MovieClip [__Packages.AudioManager] Frame 0
class AudioManager
{
var owner, timeline, soundArray, musicArray, voArray, soundContainer, musicContainer, voContainer;
function AudioManager (_timeline) {
owner = this;
timeline = _timeline;
init();
}
function init() {
createAudioArrays();
createAudioContainers();
}
function createAudioArrays() {
soundArray = [];
musicArray = [];
voArray = [];
}
function createAudioContainers() {
var _local4 = "soundContainer";
var _local2 = timeline;
var _local3 = _local2.getNextHighestDepth();
var _local5 = _local4 + _local3;
soundContainer = _local2.createEmptyMovieClip(_local5, _local3);
_local4 = "musicContainer";
_local2 = timeline;
_local3 = _local2.getNextHighestDepth();
_local5 = _local4 + _local3;
musicContainer = _local2.createEmptyMovieClip(_local5, _local3);
_local4 = "voContainer";
_local2 = timeline;
_local3 = _local2.getNextHighestDepth();
_local5 = _local4 + _local3;
voContainer = _local2.createEmptyMovieClip(_local5, _local3);
}
function audioCallback(callbackFunction, callbackScope, callbackParams) {
callbackFunction.apply(callbackScope, callbackParams);
}
function isSoundPlaying() {
var _local2 = false;
for (var _local3 in soundArray) {
_local2 = soundArray[_local3].isPlaying;
}
return(_local2);
}
function sound_Play(timeline, snd, offset, loops, _callbackFunction, _callbackScope, _callbackParams) {
offset = ((offset != undefined) ? (offset) : 0);
loops = ((loops != undefined) ? (loops) : 0);
var _local4 = ((vol != undefined) ? (vol) : 100);
var _local6 = soundContainer;
soundArray[snd] = new Sound(_local6);
var _local2 = soundArray[snd];
_local2.owner = owner;
_local2.callbackObject = {callbackFunction:_callbackFunction, callbackScope:_callbackScope, callbackParams:_callbackParams};
_local2.attachSound(snd);
_local2.onSoundComplete = sound_onComplete;
_local2.setVolume(_local4);
_local2.start(offset, loops);
_local2.isPlaying = true;
}
function sound_onComplete() {
var _local2 = this;
_local2.isPlaying = false;
_local2.owner.audioCallback(_local2.callbackObject.callbackFunction, _local2.callbackObject.callbackScope, _local2.callbackObject.callbackParams);
}
function sound_Stop(snd) {
var _local2 = soundArray[snd];
_local2.isPlaying = false;
_local2.stop();
}
function sound_StopAll() {
for (var _local3 in soundArray) {
var _local2 = soundArray[_local3];
_local2.isPlaying = false;
_local2.stop();
}
soundArray = [];
}
function music_Play(timeline, snd, offset, loops, _callbackFunction, _callbackScope, _callbackParams) {
offset = ((offset != undefined) ? (offset) : 0);
loops = ((loops != undefined) ? (loops) : 0);
var _local4 = ((vol != undefined) ? (vol) : 100);
var _local6 = musicContainer;
musicArray[snd] = new Sound(_local6);
var _local2 = musicArray[snd];
_local2.owner = owner;
_local2.callbackObject = {callbackFunction:_callbackFunction, callbackScope:_callbackScope, callbackParams:_callbackParams};
_local2.onSoundComplete = music_onComplete;
_local2.attachSound(snd);
_local2.setVolume(_local4);
_local2.start(offset, loops);
_local2.isPlaying = true;
}
function music_onComplete() {
var _local2 = this;
_local2.isPlaying = false;
_local2.owner.audioCallback(_local2.callbackObject.callbackFunction, _local2.callbackObject.callbackScope, _local2.callbackObject.callbackParams);
}
function music_Stop(snd) {
var _local2 = musicArray[snd];
_local2.stop();
}
function vo_Play(timeline, snd, offset, loops, _callbackFunction, _callbackScope, _callbackParams) {
if (voArray[snd].isPlaying != true) {
voArray = [];
offset = ((offset != undefined) ? (offset) : 0);
loops = ((loops != undefined) ? (loops) : 0);
var _local5 = ((vol != undefined) ? (vol) : 100);
var _local6 = voContainer;
voArray[snd] = new Sound(_local6);
var _local2 = voArray[snd];
_local2.owner = owner;
_local2.callbackObject = {callbackFunction:_callbackFunction, callbackScope:_callbackScope, callbackParams:_callbackParams};
_local2.onSoundComplete = vo_onComplete;
_local2.attachSound(snd);
_local2.setVolume(_local5);
_local2.start(offset, loops);
_local2.isPlaying = true;
someVOIsPlaying = true;
}
}
function vo_PlaySequence(timeline, snd1, snd2) {
vo_Play(timeline, snd1, 0, 0, vo_Play, owner, [timeline, snd2]);
}
function vo_onComplete() {
var _local2 = this;
_local2.isPlaying = false;
someVOIsPlaying = false;
_local2.owner.audioCallback(_local2.callbackObject.callbackFunction, _local2.callbackObject.callbackScope, _local2.callbackObject.callbackParams);
}
function vo_Stop(snd) {
var _local2 = voArray[snd];
_local2.isPlaying = false;
someVOIsPlaying = false;
_local2.stop();
}
function isVOPlaying() {
for (var _local2 in voArray) {
if (voArray[_local2].isPlaying) {
return(true);
}
}
}
function vo_StopAll() {
for (var _local3 in voArray) {
var _local2 = voArray[_local3];
_local2.isPlaying = false;
_local2.stop();
}
voArray = [];
someVOIsPlaying = false;
}
var className = "AudioManager";
var classVersion = "01";
var someVOIsPlaying = false;
}
Symbol 1115 MovieClip [__Packages.FPS] Frame 0
class FPS
{
static var currFPS, temp_mc;
function FPS () {
}
static function setFPS(_newFPS, _path) {
var _local5 = _newFPS;
currFPS = _local5;
var _local2 = _path;
if (_local2 == undefined) {
_local2 = _root;
}
var _local15 = _local2.getNextHighestDepth();
var _local3 = "fps_mc";
var _local10 = ".fps";
var _local9 = ("fps" + _local5) + _local10;
var _local4 = _local2;
var _local14 = _local4._url.split("://")[0] == "http";
if (_local14) {
var _local6 = _local4._url.toString();
var _local8 = _local6.split("/");
var _local11 = _local8[_local8.length - 1];
var _local7 = String_searchReplace(_local6, _local11, "");
} else {
var _local6 = _local4._url.toString();
var _local8 = _local6.split("/");
var _local11 = _local8[_local8.length - 1];
var _local7 = String_searchReplace(_local6, _local11, "");
}
_root.tracer.text = _local7 + path2files;
var _local12 = (_local7 + path2files) + _local9;
if (temp_mc._name != _local3) {
temp_mc = _local2.createEmptyMovieClip(_local3, _local15);
}
temp_mc.loadMovie(_local12);
var _local13 = temp_mc._name == _local3;
return(_local13);
}
static function String_searchReplace(string_ref, string_find, string_replace) {
var _local1 = string_ref.split(string_find);
return(_local1.join(string_replace));
}
static function getFPS() {
return(currFPS);
}
static function setFPS_toDefault() {
var _local2 = "fps_mc";
currFPS = 0;
temp_mc.unloadMovie();
temp_mc.removeMovieClip();
var _local1 = temp_mc._name != _local2;
return(_local1);
}
static function setPathToFiles(_path2files) {
path2files = _path2files;
return(path2files);
}
static var className = "FPS";
static var path2files = "fps_files/";
}
Symbol 1116 MovieClip [__Packages.Level] Frame 0
class Level
{
var owner, timeline, parentClass, hasKey, startsOnLadder, linkageName, b_linkageName, treasure_pos_array, barrel_pos_array, crate_pos_array, toolstar_pos_array, wheel_pos_array, ladder_pos_array, door_pos_array, level_mc, barrel_mc, tool_star_mc, wheel_mc, ladder_mc, door_mc, b_mc;
function Level (_timeline, _parentClass, _hasKey, _startsOnLadder, _startpos_next, _startpos_last, _linkageName, _b_linkageName, _treasure_pos_array, _barrel_pos_array, _crate_pos_array, _toolstar_pos_array, _wheel_pos_array, _ladder_pos_array, _door_pos_array) {
owner = this;
timeline = _timeline;
parentClass = _parentClass;
hasKey = _hasKey;
startsOnLadder = _startsOnLadder;
startpos_next = _startpos_next;
startpos_last = _startpos_last;
linkageName = _linkageName;
b_linkageName = _b_linkageName;
treasure_pos_array = _treasure_pos_array;
barrel_pos_array = _barrel_pos_array;
crate_pos_array = _crate_pos_array;
toolstar_pos_array = _toolstar_pos_array;
wheel_pos_array = _wheel_pos_array;
ladder_pos_array = _ladder_pos_array;
door_pos_array = _door_pos_array;
}
function init() {
}
function getMC() {
return(level_mc);
}
function getTreasureData() {
return(treasure_pos_array);
}
function getBarrelData() {
return(treasure_pos_array);
}
function getCrateData() {
return(treasure_pos_array);
}
function getToolStarData() {
return(toolstar_pos_array);
}
function getWheelData() {
return(wheel_pos_array);
}
function attach() {
var _local2 = linkageName;
var _local4 = timeline;
var _local3 = level_mc_depth;
var _local5 = _local2 + _local3;
level_mc = _local4.attachMovie(_local2, _local5, _local3);
level_mc.owner = owner;
doOpenDoor();
doPigAnim();
}
function doOpenDoor() {
if (hasKey) {
level_mc.door_mc.gotoAndStop("ajar");
}
}
function doPigAnim() {
if (pigAnimPlayed) {
var _local2 = level_mc.pigs_mc;
_local2.gotoAndStop(_local2._totalframes);
_local2.piggytrip.gotoAndStop(_local2.piggytrip._totalframes);
} else {
pigAnimPlayed = true;
}
}
function remove() {
removeMCs();
level_mc.removeMovieClip();
}
function removeMCs() {
var _local2 = remove_mc_array.length;
while (_local2--) {
remove_mc_array[_local2].removeMovieClip();
}
}
function build() {
crates_array = [];
remove_mc_array = [];
buildDoor();
buildTreasure();
buildCrates();
buildToolStar();
buildBorders();
buildWheel();
buildBarrels();
buildLadder();
}
function buildTreasure() {
if (treasure_pos_array != null) {
treasure_pos_array.reverse();
var _local7 = treasure_pos_array.length;
var _local4 = treasure_linkage_array.length;
while (_local7--) {
_local4++;
if (_local4 > (treasure_linkage_array.length - 1)) {
_local4 = 0;
}
var _local3 = treasure_linkage_array[_local4];
var _local5 = level_mc;
var _local6 = _local5.getNextHighestDepth();
var _local8 = _local3 + _local6;
var _local2 = _local5.attachMovie(_local3, _local8, _local6);
_local2._linkage = _local3;
_local2._type = _local3.split("_")[1];
treasure_mc_array[treasure_mc_array.length] = _local2;
remove_mc_array.push(_local2);
_local2._x = treasure_pos_array[_local7][0];
_local2._y = treasure_pos_array[_local7][1];
}
}
}
function buildBarrels() {
if (barrel_pos_array != null) {
var _local2 = 0;
var _local4 = "barrel_mc";
var _local3 = level_mc;
var _local5 = _local3.getNextHighestDepth();
var _local6 = _local4 + _local5;
barrel_mc = _local3.attachMovie(_local4, _local6, _local5);
barrel_mc.owner = owner;
barrel_mc.barrel_start_x = barrel_pos_array[_local2][0];
barrel_mc.barrel_start_y = barrel_pos_array[_local2][1];
barrel_mc.delta_x = barrel_pos_array[_local2][2];
barrel_mc.delta_y = barrel_pos_array[_local2][3];
if (barrel_mc.delta_x < 0) {
barrel_mc._xscale = -100;
}
barrel_mc._x = barrel_mc.barrel_start_x;
barrel_mc._y = barrel_mc.barrel_start_y;
remove_mc_array.push(barrel_mc);
}
}
function buildCrates() {
if (crate_pos_array != null) {
var _local3 = 0;
var _local6 = "crate_mc";
var _local5 = timeline;
var _local7 = _local5.getNextHighestDepth();
var _local4 = _local6;
if (timeline[_local4] != undefined) {
var _local2 = timeline[_local4];
_local2._x = crate_pos_array[_local3][0];
_local2._y = crate_pos_array[_local3][1];
} else {
var _local2 = _local5.attachMovie(_local6, _local4, _local7);
crates_array.push(_local2);
remove_mc_array.push(_local2);
_local2._depth = _local7;
_local2._x = crate_pos_array[_local3][0];
_local2._y = crate_pos_array[_local3][1];
}
} else {
var _local5 = timeline.crate_mc;
if (_local5 != undefined) {
_local5.removeMovieClip();
}
}
}
function buildToolStar() {
if (toolstar_pos_array != null) {
if (!hasKey) {
var _local3 = tool_star_linkage_array[0];
var _local2 = level_mc;
var _local4 = _local2.getNextHighestDepth();
var _local5 = _local3;
tool_star_mc = _local2.attachMovie(_local3, _local5, _local4);
remove_mc_array.push(tool_star_mc);
tool_star_mc.owner = owner;
tool_star_mc._x = toolstar_pos_array[0][0];
tool_star_mc._y = toolstar_pos_array[0][1];
}
}
}
function buildWheel() {
if (wheel_pos_array != null) {
var _local5 = 0;
var _local3 = "wheel_mc";
var _local2 = timeline;
var _local4 = _local2.getNextHighestDepth();
var _local6 = _local3 + _local4;
wheel_mc = _local2.attachMovie(_local3, _local6, _local4);
remove_mc_array.push(wheel_mc);
wheel_mc.owner = owner;
wheel_mc._x = wheel_pos_array[_local5][0];
wheel_mc._y = wheel_pos_array[_local5][1];
}
}
function buildLadder() {
if (ladder_pos_array != null) {
var _local2 = 0;
var _local4 = ladder_pos_array[_local2][2];
var _local3 = level_mc;
var _local5 = _local3.getNextHighestDepth();
var _local6 = _local4 + _local5;
ladder_mc = _local3.attachMovie(_local4, _local6, _local5);
remove_mc_array.push(ladder_mc);
ladder_mc.owner = owner;
ladder_mc._x = ladder_pos_array[_local2][0];
ladder_mc._y = ladder_pos_array[_local2][1];
}
}
function buildDoor() {
if (door_pos_array != null) {
var _local2 = 0;
var _local4 = "door_hitArea_mc";
var _local3 = level_mc;
var _local5 = _local3.getNextHighestDepth();
var _local6 = _local4 + _local5;
door_mc = _local3.attachMovie(_local4, _local6, _local5);
remove_mc_array.push(door_mc);
door_mc.owner = owner;
door_mc._x = door_pos_array[_local2][0];
door_mc._y = door_pos_array[_local2][1];
door_mc._width = door_pos_array[_local2][2];
door_mc._height = door_pos_array[_local2][3];
door_mc.level_target = door_pos_array[_local2][4];
}
}
function buildBorders() {
var _local3 = b_linkageName;
var _local2 = level_mc;
var _local4 = _local2.getNextHighestDepth();
var _local5 = _local3 + _local4;
b_mc = _local2.attachMovie(_local3, _local5, _local4);
b_mc.owner = owner;
}
var remove_mc_array = [];
var pigAnimPlayed = false;
var level_mc_depth = -16384;
var crates_array = [];
var startpos_next = [];
var startpos_last = [];
var treasure_linkage_array = ["treasure_coin", "treasure_cupcake", "treasure_gem"];
var treasure_mc_array = [];
var treasure_collected_array = [];
var tool_star_linkage_array = ["tool_star_mc"];
var className = "Level";
var classVersion = "01";
}
Symbol 1117 MovieClip [__Packages.TreasureAward] Frame 0
class TreasureAward extends MovieClip
{
function TreasureAward () {
super();
}
function init(a) {
var _local2 = 0;
for (var _local4 in this) {
if (_local4 != "bg_mc") {
this[_local4].gotoAndStop(a[_local2]);
_local2++;
}
}
}
}
Symbol 1118 MovieClip [__Packages.Interface] Frame 0
class Interface extends MovieClip
{
var m_currTime, timeline, _parent, m_engine, m_maxTime, m_score, m_startTime, m_timer, time_txt, score_txt;
function Interface () {
super();
m_currTime = "";
timeline = _parent;
}
function init(engine) {
m_engine = engine;
}
function startGame() {
var _local2 = getLevelDiff();
if (_local2 == "easy") {
m_maxTime = 240000 /* 0x03A980 */;
} else {
m_maxTime = 120000 /* 0x01D4C0 */;
}
displayTime(computeTimeStr(0));
startTimer();
m_score = 0;
}
function startTimer() {
clearTimer();
var _local2 = new Date();
m_startTime = _local2.getTime();
m_timer = new PTTimer(0.25, this, "update", true);
}
function update() {
var _local3 = new Date();
var _local4 = _local3.getTime();
var _local2 = _local4 - m_startTime;
displayTime(computeTimeStr(_local2));
if (_local2 >= m_maxTime) {
clearTimer();
m_engine.timeExpired();
}
}
function clearTimer() {
if (m_timer != null) {
m_timer.destroy();
}
m_timer = null;
}
function computeTimeStr(elapsed) {
var _local3 = Math.ceil((m_maxTime - elapsed) / 1000);
var _local5 = Math.floor(_local3 / 60);
var _local4 = _local3 % 60;
var _local2 = String(_local4);
if (_local4 < 10) {
_local2 = "0" + _local2;
}
return((_local5 + ":") + _local2);
}
function displayTime(str) {
if (str != m_currTime) {
m_currTime = str;
time_txt.text = m_currTime;
}
}
function getLevelDiff() {
var _local2 = timeline.GameConfig.getGameLevel();
return(_local2);
}
function displayScore(str) {
score_txt.text = str;
}
function incrementScore() {
m_score++;
var _local2 = m_score.toString();
displayScore(_local2);
}
function setScore(num) {
m_score = num;
}
function getScore() {
return(m_score);
}
}
Symbol 1119 MovieClip [__Packages.PTTimer] Frame 0
class PTTimer
{
var intId, timeOutSecs, cbObj, cbFunc, loop;
function PTTimer (secs, cbObj, cbFunc, loop) {
intId = -1;
timeOutSecs = secs;
this.cbObj = cbObj;
this.cbFunc = cbFunc;
this.loop = Boolean(loop);
startMyTimer();
}
function interval() {
if (!loop) {
stopMyTimer();
}
cbObj[cbFunc]();
}
function startMyTimer() {
if (intId != -1) {
stopMyTimer();
}
intId = setInterval(this, "interval", timeOutSecs * 1000);
}
function stopMyTimer() {
if (intId != -1) {
clearInterval(intId);
intId = -1;
}
}
function setTimeout(secs) {
timeOutSecs = secs;
}
function destroy() {
stopMyTimer();
}
}
Symbol 1120 MovieClip [__Packages.GameConfigManager] Frame 0
class GameConfigManager
{
var game_level, game_treasure_list, game_score;
function GameConfigManager () {
}
function getGameLevel() {
return(game_level);
}
function setGameLevel(_game_level) {
game_level = _game_level;
}
function getGameLength() {
if (game_level == "easy") {
var _local2 = "4:00";
} else {
var _local2 = "2:00";
}
return(_local2);
}
function setTreasureList(_game_treasure_list) {
game_treasure_list = _game_treasure_list;
}
function getTreasureList() {
return(game_treasure_list);
}
function setScore(_game_score) {
game_score = _game_score;
}
function getScore() {
return(game_score);
}
function destroyClass() {
game_treasure_list = [];
game_score = 0;
}
}
Symbol 1121 MovieClip [__Packages.SceneManager] Frame 0
class SceneManager
{
var owner, timeline, sceneArray, sceneIdx_last, sceneIdx;
function SceneManager (_timeline) {
owner = this;
timeline = _timeline;
init();
}
function init() {
sceneArray = new Array();
setCurrentScene(0);
setLastScene(0);
}
function getLastScene() {
return(sceneIdx_last);
}
function setLastScene(sceneNum) {
sceneIdx_last = sceneNum;
}
function getCurrentScene() {
return(sceneIdx);
}
function setCurrentScene(sceneNum) {
sceneIdx = sceneNum;
}
function addScene(sceneName, linkageName, x, y) {
var _local3 = owner;
var _local2 = new Scene(timeline, owner, sceneName, linkageName, x, y);
sceneArray.push(_local2);
}
function playScene(sceneNum) {
var _local2 = sceneNum;
var _local3 = sceneArray[getLastScene()];
_local3.destroyScene();
var _local4 = sceneArray[_local2];
_local4.attachScene();
setLastScene(_local2);
setCurrentScene(_local2);
}
function playSceneNext() {
var _local2 = getCurrentScene() + 1;
playScene(_local2);
}
function playScenePrevious() {
var _local2 = getCurrentScene() - 1;
playScene(_local2);
}
function playSceneFirst() {
var _local2 = 0;
playScene(_local2);
}
function playSceneLast() {
var _local2 = sceneArray.length - 1;
playScene(_local2);
}
function startGame() {
var _local2 = 4;
playScene(_local2);
}
function endGame() {
var _local2 = sceneArray.length - 1;
playScene(_local2);
}
function playAgain() {
reload();
}
function reload() {
timeline.GameConfig.destroyClass();
var _local2 = timeline._parent;
_local2.loadMovie(_local2._url);
}
function destroyClass() {
}
var className = "SceneManager";
var classVersion = "01";
}
Symbol 1122 MovieClip [__Packages.Scene] Frame 0
class Scene
{
var owner, timeline, parentClass, sceneName, linkageName, x, y, scene_mc;
function Scene (_timeline, _parentClass, _sceneName, _linkageName, __x, __y) {
owner = this;
timeline = _timeline;
parentClass = _parentClass;
sceneName = _sceneName;
linkageName = _linkageName;
x = __x;
y = __y;
}
function attachScene() {
var _local3 = linkageName;
var _local2 = timeline;
var _local4 = _local2.getNextHighestDepth();
var _local5 = _local3 + _local4;
scene_mc = _local2.attachMovie(_local3, _local5, _local4);
scene_mc.owner = owner;
scene_mc._x = x;
scene_mc._y = y;
scene_mc.onSceneDone = function () {
this.owner.onSceneDone();
};
}
function destroyScene() {
scene_mc.removeMovieClip();
}
function onSceneDone() {
parentClass.playSceneNext();
}
var className = "Scene";
var classVersion = "01";
}
Symbol 1110 MovieClip Frame 1
if (GameConfig != undefined) {
delete GameConfig;
}
if (SceneMgr != undefined) {
delete SceneMgr;
}
var GameConfig = new GameConfigManager();
var SceneMgr = new SceneManager(this);
SceneMgr.addScene("title", "title_mc", -77.6, -9.8);
SceneMgr.addScene("intro", "intro_mc", -7, -6.5);
SceneMgr.addScene("demo", "demo_mc", -78.7, -31);
SceneMgr.addScene("game", "game_mc", 0, 0);
SceneMgr.addScene("outro", "outro_mc", 0, 0);
SceneMgr.addScene("tune_in", "tune_in_mc", 0, 0);
SceneMgr.playSceneFirst();