Frame 1
_global.root = this;
Frame 2
var splashTime = 0;
var doPerformanceTest = false;
var doXMLload = false;
var bytesToLoad = getBytesTotal();
nextFrame();
Frame 3
var st = (getTimer() + splashTime);
play();
Frame 4
play();
Frame 5
if ((_framesloaded > 14) && (getTimer() > st)) {
delete st;
play();
} else {
prevFrame();
}
Frame 10
function loadDisplay(ratioLoaded) {
mc_loader.txt_percent.text = Math.ceil(ratioLoaded * 100) + "%";
mc_loader.txt_percentShadow.text = Math.ceil(ratioLoaded * 100) + "%";
}
function loadXML() {
var Path_SWF;
var Path_XML;
var _local2 = ["cuteName", "cuteName2"];
var _local3 = ["fileName.xml", "fileName2.xml"];
var _local1 = _local2.length;
while (_local1--) {
Classes.XMLloader.loadFile(_local2[_local1], Path_XML + _local3[_local1]);
}
}
function loadInterval(startBytes, totalBytes) {
updateAfterEvent();
var _local1 = (getBytesLoaded() - startBytes) / totalBytes;
if (_local1 < 1) {
loadDisplay(_local1);
} else if (doXMLload) {
if (Classes.XMLloader.allFilesDone) {
done();
}
} else {
done();
}
}
function done() {
loadDisplay(1);
delete loadID;
delete loadInterval;
delete done;
delete xmlNames;
delete xmlFileNames;
mc_loader.isDone = true;
}
mc_loader.stop();
mc_loader.isDone = false;
if (doXMLload) {
loadXML();
}
if (((!doPerformanceTest) && (!doXMLload)) && (getBytesLoaded() >= bytesToLoad)) {
loadDisplay(1);
gotoAndStop ("complete");
} else {
var loadID = setInterval(loadInterval, 0, getBytesLoaded(), bytesToLoad - getBytesLoaded());
loadDisplay(0.001);
stop();
}
Frame 20
_global.performance = new Classes.c_PerformanceTest(null, function () {
gotoAndStop ("complete");
});
stop();
Frame 25
gotoAndStop ("gameInit");
stop();
Frame 30
function Doge_PlayAgain() {
Doge_Close();
_global.bounceEngine.clickQuit();
}
function Doge_Load() {
_level0.createEmptyMovieClip("DOGE", 1500);
_level0.DOGE._x = 25;
_level0.DOGE._y = 75;
}
function Doge_Open(t_score) {
trace("OMG OPEN : " + t_score);
_level0.playerScore = t_score;
_level0.DOGE.loadMovie(_level0.dogePath, 1);
}
function Doge_Close() {
removeMovieClip(_level0.DOGE);
Doge_Load();
}
function Doge_Init(t_path, t_event, t_subject) {
trace("-- Init Doge --");
_level0.dogePath = t_path;
_level0.eventID = t_event;
_level0.subject = t_subject;
_level0.playerScore = 0;
Doge_Load();
}
function Doge_run() {
_level0.DOGE.loadMovie(_level0.dogePath, 1);
}
_global.bounceEngine = new Classes.BWJB_engine(this);
if (_global.bounceEngine.isDoge) {
trace("DOGE");
_level0.fsdPlayAgain = Doge_PlayAgain;
var dogePath = _level0.fsdPath;
var dogeEventID = "dc_baw_jb_9392";
var dogeSubject = "Brandy And Mr. Whiskers - Jungle Bounce";
Doge_Init(dogePath, dogeEventID, dogeSubject);
}
_global.bounceEngine.goTitle();
Frame 35
stop();
Symbol 11 MovieClip Frame 1
stop();
Symbol 11 MovieClip Frame 2
play();
Symbol 11 MovieClip Frame 10
stop();
Symbol 11 MovieClip Frame 11
play();
Symbol 11 MovieClip Frame 19
gotoAndStop (1);
Symbol 318 MovieClip [__Packages.Classes.c_PerformanceTest] Frame 0
class Classes.c_PerformanceTest
{
function c_PerformanceTest (itterations, onComplete) {
var _local1 = this;
trace("-- Run Performance Test --");
if (itterations) {
_local1.loops = itterations;
}
_local1.remainingLoops = _local1.loops;
if (onComplete) {
_local1.onComplete = onComplete;
}
var _local2 = System.capabilities.version.substr(4).split(",");
_local1.flashMajorVersion = Number(_local2[0]);
_local1.flashMinorVersion = Number(_local2[2]);
_local1.complete = false;
_local1.intervalID = setInterval(function (o) {
o.test();
}, 0, _local1);
}
function test() {
var _local3 = this;
if (_local3.remainingLoops <= 0) {
_local3.finalize();
clearInterval(_local3.intervalID);
} else {
_local3.remainingLoops--;
var startTime = getTimer();
var _local2;
var _local1 = 0;
while (_local1 < 6400) {
_local2 = {};
_local1++;
}
_local3.time = _local3.time + (getTimer() - startTime);
}
}
function finalize() {
var _local1 = this;
_local1.score = Math.floor((_local1.loops / _local1.time) * 10000);
if (_local1.flashMajorVersion >= 7) {
_local1.log = Math.log(_local1.score * 0.015);
} else {
_local1.log = Math.log(_local1.score * 0.023);
}
_local1.processor = _local1.log * 1000;
_local1.complete = true;
trace(("-- Performance Complete : " + Math.floor(_local1.processor)) + " --");
_local1.onComplete(_local1);
}
function toString() {
var _local1 = this;
if (_local1.score) {
return((((((((("Loops:\t" + _local1.loops) + "\nFlash Version: \t") + System.capabilities.version) + "\nTotal Time:\t") + _local1.time) + "\nScore: \t") + _local1.score) + "\nProcessor: \t") + _local1.processor);
}
return("Test In Process.");
}
var score = 0;
var time = 0;
var loops = 20;
var complete = false;
}
Symbol 319 MovieClip [__Packages.Classes.BWJB_engine] Frame 0
class Classes.BWJB_engine
{
var soundEngine, paused, gameRoot, canyon;
function BWJB_engine (t_root) {
var _local1 = this;
_local1.gameRoot = t_root;
trace("-- Init CMM Engine --");
_local1.soundMC = _local1.gameRoot.createEmptyMovieClip("soundEngine_mc", 3300);
_local1.soundEngine = new Classes.soundEngine(_local1.soundMC, 1, false);
_local1.soundEngine.createSound("click", "button_click_all.wav");
_local1.soundEngine.createSound("impact1", "button_click_all.wav");
_local1.soundEngine.createSound("thunder", "impact_stormcloud.wav");
_local1.soundEngine.createSound("pickup", "PU_points1.wav");
_local1.soundEngine.createSound("health", "PU_health.wav");
_local1.soundEngine.createSound("music", "music_latin_loop_TEMP.wav");
_local1.soundEngine.createSound("gameover", "music_GameOver_TEMP.wav");
_local1.interval = new Classes.intervalEngine();
_local1.interval.startFlex(function (t_elapsed) {
_global.bounceEngine.stepFrame(t_elapsed);
});
_local1.interval.unpause();
_local1.pause();
_local1.canyon = new Classes.c_canyon();
_local1.canyon.loadData(_local1.loadCanyonData());
}
function stepFrame(t_elapsed) {
var _local1 = this;
_local1.elapsedTime = t_elapsed;
if (!_local1.paused) {
_local1.canyon.step(_local1.elapsedTime);
}
}
function startGame() {
var _local1 = this;
_local1.reset();
_local1.startcanyon();
_local1.isPlaying = true;
}
function stopGame() {
var _local1 = this;
trace("- Stop and Clear game -");
_local1.isPlaying = false;
_local1.stopSound();
_local1.pause();
_local1.clearcanyon();
}
function startMusic() {
soundEngine.playSound("music", 10000);
}
function stopMusic() {
soundEngine.stopSound("music");
}
function reset() {
var _local1 = this;
_local1.canyon.reset();
_local1.n_score = 0;
_local1.pause();
}
function addScore(t_value) {
var _local1 = this;
_local1.n_score = _local1.n_score + t_value;
_local1.updateUI();
trace("Score : " + _local1.n_score);
}
function pause() {
stopMusic();
trace("Pause");
paused = true;
}
function unpause() {
trace("UnPause");
paused = false;
}
function showBounce() {
var _local1 = this;
_local1.gameRoot.bounceText_mc.gotoAndPlay(2);
_local1.gameRoot.bounceText_mc.text_mc.txt.text = "Bounce " + _local1.canyon.n_stage;
_local1.hideChutes();
}
function hideBounce() {
gameRoot.bounceText_mc.gotoAndStop(1);
}
function showChutes() {
var _local2 = this;
_local2.gameRoot.chuteText_mc.gotoAndPlay(2);
var _local1 = _local2.canyon.player.n_lives;
if (_local1 == 1) {
_local2.gameRoot.chuteText_mc.text_mc.txt.text = _local1 + " Chute Left!";
} else {
_local2.gameRoot.chuteText_mc.text_mc.txt.text = _local1 + " Chutes Left!";
}
}
function hideChutes() {
gameRoot.chuteText_mc.gotoAndStop(1);
}
function startcanyon() {
var _local1 = this;
_local1.unpause();
_local1.canyon.mc = _local1.gameRoot.mc_container.createEmptyMovieClip("canyon", 1);
_local1.canyon.create();
}
function clearcanyon() {
canyon.mc.removeMovieClip();
}
function updateUI() {
var _local1 = this;
_local1.gameRoot.txt_score.text = _local1.n_score;
_local1.gameRoot.txt_scoreShadow.text = _local1.n_score;
_local1.gameRoot.txt_lives.text = "x" + _local1.canyon.player.n_lives;
_local1.gameRoot.txt_livesShadow.text = "x" + _local1.canyon.player.n_lives;
}
function clickStart() {
playSound("click");
goHelp();
}
function clickPlay() {
var _local1 = this;
_local1.playSound("click");
if (_local1.isPlaying) {
_local1.clickResume();
} else {
_local1.goGameplay();
_local1.startGame();
}
}
function clickPause() {
var _local1 = this;
_local1.playSound("click");
if (_local1.isDoge) {
_local1.goPauseDoge();
} else {
_local1.goPause();
}
}
function clickResume() {
playSound("click");
goGameplay();
}
function clickQuit() {
var _local1 = this;
_local1.playSound("click");
_local1.stopGame();
_local1.goTitle();
}
function clickSubmit() {
var _local1 = this;
_local1.playSound("click");
_local1.goDoge();
_local1.submitScore();
}
function clickHelp() {
playSound("click");
goHelp();
}
function goTitle() {
pause();
gameRoot.gotoAndStop("title");
}
function goHelp() {
pause();
gameRoot.gotoAndStop("help");
}
function goGameplay() {
var _local1 = this;
if (_local1.isPlaying) {
_local1.startMusic();
}
_local1.unpause();
_local1.gameRoot.gotoAndStop("game");
_local1.hideBounce();
_local1.hideChutes();
_local1.updateUI();
}
function goPause() {
var _local1 = this;
_local1.pause();
_local1.gameRoot.gotoAndStop("pause");
_local1.gameRoot.popup.txt_score.text = _local1.n_score;
_local1.gameRoot.popup.txt_bounce.text = _local1.canyon.n_stage;
}
function goPauseDoge() {
var _local1 = this;
_local1.pause();
_local1.gameRoot.gotoAndStop("pauseDoge");
_local1.gameRoot.popup.txt_score.text = _local1.n_score;
_local1.gameRoot.popup.txt_bounce.text = _local1.canyon.n_stage;
}
function goQuit() {
var _local1 = this;
_local1.gameRoot.gotoAndStop("quit");
_local1.gameRoot.popup.txt_score.text = _local1.n_score;
_local1.gameRoot.popup.txt_bounce.text = _local1.canyon.n_stage;
}
function fadeToBlack() {
if (gameRoot.fadeout._currentFrame == 1) {
gameRoot.fadeout.gotoAndPlay("toBlack");
}
}
function fadeToWhite() {
gameRoot.fadeout.gotoAndPlay("toWhite");
}
function goGameover() {
var _local1 = this;
_local1.fadeToWhite();
_local1.pause();
_local1.stopGame();
_local1.gameRoot.gotoAndStop("gameover");
if (!_local1.isDoge) {
_local1.gameRoot.btn_submit._visible = false;
}
_local1.gameRoot.txt_score.text = _local1.n_score;
_local1.gameRoot.txt_scoreShadow.text = _local1.n_score;
_local1.gameRoot.txt_bounce.text = _local1.canyon.n_stage;
_local1.gameRoot.txt_bounceShadow.text = _local1.canyon.n_stage;
}
function goDoge() {
var _local1 = this;
_local1.gameRoot.gotoAndStop("doge");
_local1.gameRoot.Doge_Open(_local1.n_score);
}
function submitScore() {
}
function attachSounds() {
}
function playSound(t_name, t_loops) {
soundEngine.playSound(t_name, t_loops);
}
function stopSound(t_name) {
var _local1 = t_name;
if (_local1 == undefined) {
_local1 = "music";
}
soundEngine.stopSound(_local1);
}
function changeVolume(t_vol) {
soundEngine.changeVolume(t_vol);
}
function runEditor() {
var _local1 = this;
_local1.editorMouse = {};
_local1.editorMouse.onMouseUp = function () {
trace((("Mouse :" + _xmouse) + " , ") + (_global.bounceEngine.canyon.n_progress - _ymouse));
};
Mouse.addListener(_local1.editorMouse);
}
function loadCanyonData() {
var _local3 = this;
var _local2 = [];
var _local1 = [];
_local1.push({type:"rapid", asset:"rapid_mc", x:140, dist:400, angle:90});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:520});
_local1.push({type:"obs", asset:"cloud_mc", x:210, dist:600});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:800});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:830});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:840});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:960});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1020});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1100});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1150});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1260});
_local1.push({type:"rapid", asset:"rapid_mc", x:60, dist:1300, angle:90});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:220, dist:1370});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1450});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1530});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:1900});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:400});
_local1.push({type:"rapid", asset:"rapid_mc", x:220, dist:430, angle:90});
_local1.push({type:"pickup", asset:"pickup_mc", x:140, dist:480});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:560});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:700});
_local1.push({type:"obs", asset:"cloud_mc", x:110, dist:760});
_local1.push({type:"obs", asset:"cloud_mc", x:160, dist:810});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:830});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:980});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1040});
_local1.push({type:"obs", asset:"cloud_mc", x:160, dist:1090});
_local1.push({type:"pickup", asset:"pickup_mc", x:240, dist:1270});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:160, dist:1210, angle:0});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:1240});
_local1.push({type:"obs", asset:"cloud_mc", x:110, dist:1300});
_local1.push({type:"obs", asset:"cloud_mc", x:160, dist:1350});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:160, dist:1460, angle:180});
_local1.push({type:"pickup", asset:"pickup_mc", x:90, dist:1530});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1520});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1580});
_local1.push({type:"obs", asset:"cloud_mc", x:160, dist:1630});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:220, dist:1700});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1820});
_local1.push({type:"pickup", asset:"pickup_mc", x:60, dist:1900});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1900});
_local1.push({type:"obs", asset:"cloud_mc", x:60, dist:1980});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1980});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:2450});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:200, dist:400, angle:0});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:80, dist:400, angle:180});
_local1.push({type:"obs", asset:"cloud_mc", x:145, dist:460});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:500});
_local1.push({type:"obs", asset:"cloud_mc", x:145, dist:520});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:90, dist:620, angle:0});
_local1.push({type:"obs", asset:"cloud_mc", x:60, dist:680});
_local1.push({type:"obs", asset:"cloud_mc", x:120, dist:720});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:850});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:200, dist:940, angle:0});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:80, dist:940, angle:180});
_local1.push({type:"obs", asset:"cloud_mc", x:145, dist:1000});
_local1.push({type:"obs", asset:"cloud_mc", x:145, dist:1080});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1090});
_local1.push({type:"rapid", asset:"rapid_mc", x:60, dist:1070, angle:90});
_local1.push({type:"obs", asset:"cloud_mc", x:145, dist:1160});
_local1.push({type:"rapid", asset:"rapid_mc", x:60, dist:1170, angle:90});
_local1.push({type:"pickup", asset:"pickup_mc", x:145, dist:1240});
_local1.push({type:"obs", asset:"cloud_mc", x:230, dist:1360});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1480});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1600});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1670});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1720});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:2120});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"obs", asset:"cloud_mc", x:150, dist:350});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:70, dist:450, angle:0});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:580});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:620});
_local1.push({type:"pickup", asset:"pickup_mc", x:230, dist:630});
_local1.push({type:"obs", asset:"cloud_mc", x:150, dist:790});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:200, dist:880, angle:180});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:980});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1000});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1030});
_local1.push({type:"obs", asset:"cloud_mc", x:150, dist:1160});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1170});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1340});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1340});
_local1.push({type:"rapid", asset:"rapid_mc", x:140, dist:1450, angle:90});
_local1.push({type:"obs", asset:"cloud_mc", x:150, dist:1650});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:220, dist:1670});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:70, dist:1750, angle:0});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1880});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1920});
_local1.push({type:"pickup", asset:"pickup_mc", x:230, dist:1930});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:2320});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:300});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:460});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:610});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:740});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:740});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:800});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:850});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:850});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:960});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:1150});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1150});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1290});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1320});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1450});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1450});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1510});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1610});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:1950});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:330});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:330});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:520});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:520});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:600});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:650});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:650});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:790});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:920});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:920});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1000});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1050});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1050});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1250});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1320});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:70, dist:1320});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1450});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1595});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:1965});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:330});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:330});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:140, dist:420, angle:180});
_local1.push({type:"obs", asset:"cloud_mc", x:160, dist:490});
_local1.push({type:"pickup", asset:"pickup_mc", x:225, dist:510});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:80, dist:540, angle:0});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:170, dist:620, angle:0});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:670});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:730});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:180, dist:770, angle:180});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:90, dist:850, angle:180});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:870});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:930});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:80, dist:1000, angle:0});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:170, dist:1080, angle:0});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1140});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1200});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1300});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1300});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:1700});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:400});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:400});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:450});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:600});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:610});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:770});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:850});
_local1.push({type:"obs", asset:"cloud_mc", x:170, dist:960});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1080});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:970});
_local1.push({type:"obs", asset:"cloud_mc", x:200, dist:1190});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1260});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:220, dist:1325});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:1390});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1480});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1510});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1630});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1710});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1810});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1880});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:2040});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:2420});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"rapid", asset:"rapid_mc", x:190, dist:540, angle:90});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:400});
_local1.push({type:"obs", asset:"cloud_mc", x:120, dist:500});
_local1.push({type:"obs", asset:"cloud_mc", x:146, dist:700});
_local1.push({type:"obs", asset:"cloud_mc", x:80, dist:700});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:850});
_local1.push({type:"rapid", asset:"rapid_mc", x:80, dist:800, angle:90});
_local1.push({type:"pickup", asset:"pickup_mc", x:80, dist:900});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1040});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:170, dist:1140});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1200});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1200});
_local1.push({type:"pickup", asset:"pickup_mc", x:140, dist:1270});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1370});
_local1.push({type:"obs", asset:"cloud_mc", x:80, dist:1370});
_local1.push({type:"pickup", asset:"pickup_mc", x:140, dist:1460});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:1560});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:1560});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:1960});
_local2.push(_local1);
_local1 = [];
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:430});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:430});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:500});
_local1.push({type:"obs", asset:"cloud_mc", x:140, dist:650});
_local1.push({type:"rapid", asset:"rapidDiagLeft_mc", x:190, dist:720, angle:180});
_local1.push({type:"obs", asset:"cloud_mc", x:220, dist:780});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:870});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:930});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1060});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1140});
_local1.push({type:"health", asset:"pickupLeaf_mc", x:70, dist:1140});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1230});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:1230});
_local1.push({type:"rapid", asset:"rapid_mc", x:145, dist:1270, angle:90});
_local1.push({type:"pickup", asset:"pickup_mc", x:220, dist:1300});
_local1.push({type:"bridge", asset:"bridge_mc", x:0, dist:1490});
_local1.push({type:"rapid", asset:"rapidDiagRight_mc", x:140, dist:1600, angle:0});
_local1.push({type:"obs", asset:"cloud_mc", x:70, dist:1660});
_local1.push({type:"pickup", asset:"pickup_mc", x:70, dist:1730});
_local1.push({type:"branch", asset:"branchRight_mc", x:280, dist:1820});
_local1.push({type:"branch", asset:"branchLeft_mc", x:0, dist:1850});
_local1.push({type:"floor", asset:"floor_mc", x:_local3.FLOOR_X, dist:2230});
_local2.push(_local1);
return(_local2);
}
var screenHeight = 400;
var screenWidth = 280;
var isDoge = true;
var FLOOR_X = -89.7;
}
Symbol 320 MovieClip [__Packages.Classes.soundEngine] Frame 0
class Classes.soundEngine
{
var o_sounds, o_groups;
function soundEngine (t_path, t_depth, t_overwrite) {
var _local1 = this;
_local1.mc = t_path.createEmptyMovieClip("soundEngine_MC", t_depth);
_local1.o_sounds = new Object();
_local1.o_groups = new Object();
_local1.flagOverwrite = t_overwrite;
_local1.groupCount = 0;
_local1.createGroup(_local1.defaultGroupName);
trace("-- Init Sound Engine -- ");
}
function createGroup(t_name) {
var _local2 = this;
_local2.groupCount++;
var _local1 = _local2.mc.createEmptyMovieClip(t_name, _local2.groupCount);
_local1.soundObject = new Sound(_local1.mc);
_local2.o_groups[t_name] = _local1;
}
function createSound(t_name, t_assetID, t_group) {
var _local3 = this;
var _local2;
if (t_group == undefined) {
_local2 = _local3.o_groups[_local3.defaultGroupName];
} else {
_local2 = _local3.o_groups[t_group];
}
if (_local2 != undefined) {
var _local1 = {};
_local1.soundEffect = new Sound(_local2);
_local1.soundEffect.attachSound(t_assetID);
_local3.o_sounds[t_name] = _local1;
} else {
trace(("Error Locating Group " + t_group) + " for create Sound");
}
}
function playSound(t_name, t_loops) {
var _local2 = t_loops;
var _local1 = o_sounds[t_name];
if (_local1 != undefined) {
if (_local2 == undefined) {
_local2 = 1;
} else if (_local2 == 0) {
_local2 = 1000;
}
if (_global.K_SoundEngine.OverwriteSounds) {
_local1.SoundEffect.stop(_local1.idName);
}
_local1.soundEffect.start(0, _local2);
} else {
trace(("Error - sound " + t_name) + " not found");
}
}
function changeVolume(t_vol, t_name) {
var _local1 = t_name;
if (_local1 == undefined) {
_local1 = defaultGroupName;
}
o_groups[_local1].soundObject.setVolume(t_vol);
}
function stopSound(t_name) {
o_sounds[t_name].soundEffect.stop();
}
var defaultGroupName = "sound";
}
Symbol 321 MovieClip [__Packages.Classes.c_canyon] Frame 0
class Classes.c_canyon
{
var n_layout, a_layouts, mc;
function c_canyon () {
var _local1 = this;
_local1.player = new Classes.c_player("player_mc", _local1);
_local1.player.startX = 140;
_local1.player.canyonLocation = 100;
_local1.a_bgvines_assets = ["bgvine1_mc"];
_local1.leftBank = new Classes.c_bank(["bank_leftTile1"], _local1.LEFTBANK_DEPTH, _local1);
_local1.rightBank = new Classes.c_bank(["bank_rightTile1"], _local1.RIGHTBANK_DEPTH, _local1);
_local1.a_effects = [];
_local1.a_activeEntitys = [];
_local1.n_layout = 0;
}
function loadData(t_data) {
var _local2 = this;
var _local3 = t_data;
_local2.a_layouts = [];
var _local1 = 0;
while (_local1 < _local3.length) {
_local2.a_layouts.push(new Classes.c_layout(_local3[_local1], _local2));
_local1++;
}
}
function create() {
var _local1 = this;
_local1.reset();
_local1.leftBank.clear();
_local1.leftBank.x = 0;
_local1.leftBank.spawn();
_local1.leftBank.HDpoint = _local1.leftBank.x + _local1.BANK_WIDTH;
_local1.rightBank.clear();
_local1.rightBank.x = _global.bounceEngine.screenWidth;
_local1.rightBank.spawn();
_local1.rightBank.HDpoint = _local1.rightBank.x - _local1.BANK_WIDTH;
_local1.player.reset();
_local1.player.clear();
_local1.player.spawn(_local1.n_progress);
_local1.background = _local1.mc.attachMovie("background_mc", "background_mc", _local1.BACK_DEPTH);
_local1.background._x = 0;
_local1.background._y = (-_local1.background._height) + _local1.screenHeight;
_local1.bgvine = new Classes.c_vine(_local1);
_local1.bgvine.reset();
_local1.bgvine.spawn(_local1.mc, _local1.a_bgvines_assets[Math.ceil(Math.random() * _local1.a_bgvines_assets.length) - 1], _local1.VINE_DEPTH, 1);
_local1.jumpFromFloor();
_global.bounceEngine.updateUI();
}
function jumpFromFloor() {
var _local1 = this;
_local1.flowRate = 0;
_local1.endFlag = false;
_local1.floor = new Classes.c_floor("floor_mc", _global.bounceEngine.FLOOR_X, 300, _local1);
_local1.floor.reset();
_local1.floor.spawn(false);
_local1.floor.y = 300;
_local1.floor.update();
_local1.floor.render();
_local1.a_activeEntitys.push(_local1.floor);
_local1.player.startAnim("begin");
}
function prepareLayout() {
var _local1 = this;
if (_local1.n_stage == 1) {
_local1.n_layout = 0;
} else {
var _local2 = false;
var _local3 = _local1.n_layout;
while (!_local2) {
_local1.n_layout = Math.ceil(Math.random() * _local1.a_layouts.length) - 1;
if (_local1.n_layout == 0) {
_local2 = false;
} else if (_local1.n_layout == _local3) {
_local2 = false;
} else {
_local2 = true;
}
}
}
_local1.a_entitys = _local1.a_layouts[_local1.n_layout].a_entitys;
}
function begin() {
var _local1 = this;
trace("-- BEGIN -- ");
_local1.resetLayout();
_local1.resetBounce();
_local1.floor.clear();
}
function step(t_elapsed) {
var _local1 = this;
if (_local1.isRapid == 2) {
if (_local1.flowRate < (_local1.flowRate * _local1.FLOWRATE_RAPIDMAX)) {
_local1.flowRate = _local1.flowRate + (_local1.FLOWRATE_BASE * _local1.FLOWRATE_RAPID);
}
_local1.isRapid = 1;
} else if (_local1.isRapid == 1) {
_local1.flowRate = _local1.FLOWRATE_BASE + (_local1.FLOWRATE_INCREASE * _local1.n_stage);
_local1.isRapid = 0;
}
var flow = _local1.flowRate;
if (_local1.accelerating) {
flow = flow * _local1.ACCEL_PERCENT;
_local1.accelerating = false;
}
if (_local1.decelerating) {
flow = flow * _local1.DECEL_PERCENT;
_local1.decelerating = false;
}
_local1.n_progress = _local1.n_progress + (flow * t_elapsed);
flow = _local1.magnitudeToVector(flow, _local1.flowDirection);
if (flow.y < 0) {
_local1.background._y = ((-_local1.background._height) + _local1.screenHeight) * ((_local1.n_progress - _local1.screenHeight) / (_local1.n_canyonLength - _local1.screenHeight));
_local1.bgvine.y = ((-_local1.bgvine.mc._height) + _local1.screenHeight) * ((_local1.n_progress - _local1.screenHeight) / (_local1.n_canyonLength - _local1.screenHeight));
} else if (flow.y > 0) {
_local1.background._y = ((-_local1.background._height) + _local1.screenHeight) * (1 - Math.abs(_local1.n_progress / -1750));
_local1.bgvine.y = ((-_local1.bgvine.mc._height) + _local1.screenHeight) * (1 - Math.abs(_local1.n_progress / -1750));
}
_local1.bgvine.render();
var _local3 = _local1.a_activeEntitys.length;
while (_local3--) {
var _local2 = _local1.a_activeEntitys[_local3];
_local2.update(flow, t_elapsed);
_local2.move(t_elapsed);
_local2.render();
if ((_local2.y + _local2.baseHeight) < 0) {
_local2.clear();
_local1.a_activeEntitys.splice(_local3, 1);
_local3++;
} else if (_local2.isBroken) {
if ((_local2.y - _local2.baseHeight) > _local1.screenHeight) {
_local2.clear();
_local1.a_activeEntitys.splice(_local3, 1);
_local3++;
}
}
}
if (_local1.endFlag) {
if (((_local1.floor.y < 380) && (_local1.player.state != "drop")) && (_local1.player.state != "hidden")) {
_local1.player.startAnim("drop");
} else if ((_local1.floor.y < 300) && (_local1.flowRate > 0)) {
_local1.flowRate = 0;
}
} else if (flow.y < 0) {
var t_done = false;
while (t_done == false) {
if (_local1.a_entitys[_local1.n_currentIndex].canyonLocation <= (_local1.n_progress + _local1.SPAWN_AHEAD)) {
if (!_local1.a_entitys[_local1.n_currentIndex].isSpawned) {
_local1.a_entitys[_local1.n_currentIndex].reset();
_local1.a_entitys[_local1.n_currentIndex].spawn(_local1.n_progress);
_local1.a_activeEntitys.push(_local1.a_entitys[_local1.n_currentIndex]);
}
_local1.n_currentIndex++;
if (_local1.n_currentIndex > (_local1.a_entitys.length - 1)) {
t_done = true;
}
} else {
t_done = true;
}
}
}
_local3 = _local1.a_effects.length;
while (_local3--) {
if (_local1.a_effects[_local3].update(t_elapsed)) {
_local1.a_effects.splice(_local3, 1);
} else {
_local1.a_effects[_local3].move(t_elapsed);
_local1.a_effects[_local3].render();
}
}
_local1.leftBank.update(flow, t_elapsed);
_local1.rightBank.update(flow, t_elapsed);
_local1.player.update(t_elapsed);
_local1.runHD(t_elapsed);
_local1.player.move(t_elapsed);
_local1.player.render();
}
function reachEnd(t_floor) {
var _local1 = this;
_local1.endFlag = true;
_local1.floor = t_floor;
_global.bounceEngine.addScore(100);
_local1.n_stage++;
}
function runHD(t_elapsed) {
var _local1 = this;
var t_x = (_local1.player.x + (_local1.player.velocity.x * t_elapsed));
var t_y = (_local1.player.y + (_local1.player.velocity.y * t_elapsed));
if ((t_x - _local1.player.radius) < _local1.leftBank.HDpoint) {
_local1.player.invertVelocityX();
_local1.player.x = _local1.leftBank.HDpoint + _local1.player.radius;
_local1.player.decayVelocityX(_local1.BANK_DECAY * Math.abs(_local1.player.velocity.x / 3));
}
if ((t_x + _local1.player.radius) > _local1.rightBank.HDpoint) {
_local1.player.invertVelocityX();
_local1.player.x = _local1.rightBank.HDpoint - _local1.player.radius;
_local1.player.decayVelocityX(_local1.BANK_DECAY * Math.abs(_local1.player.velocity.x / 3));
}
if (!_local1.player.isAnimating) {
if ((t_y - _local1.player.radius) < 0) {
_local1.player.invertVelocityY();
_local1.player.y = 0 + _local1.player.radius;
_local1.player.decayVelocityY(_local1.BANK_DECAY);
}
if ((t_y + _local1.player.radius) > _local1.screenHeight) {
_local1.player.invertVelocityY();
_local1.player.y = _local1.screenHeight - _local1.player.radius;
_local1.player.decayVelocityY(_local1.BANK_DECAY);
}
var _local3 = _local1.a_activeEntitys.length;
var _local2;
var t_collision;
while (_local3--) {
_local2 = _local1.a_activeEntitys[_local3];
t_collision = _local2.runHitTest(_local1.player, t_elapsed);
if (t_collision && (_local2.y > 0)) {
_local2.runHitResponse_player(_local1.player, t_elapsed);
}
}
if (_local1.player.velocity.y > 180) {
_local1.player.velocity.y = 180;
} else if (_local1.player.velocity.y < -180) {
_local1.player.velocity.y = -180;
}
if (_local1.player.velocity.x > 180) {
_local1.player.velocity.x = 180;
} else if (_local1.player.velocity.x < -180) {
_local1.player.velocity.x = -180;
}
}
}
function reset() {
var _local1 = this;
_local1.screenHeight = _global.bounceEngine.screenHeight;
_local1.n_stage = 1;
_local1.GRAVITY = _local1.magnitudeToVector(300, 90);
_local1.resetLayout();
_local1.resetBounce();
_local1.a_entitys = [];
}
function resetBounce() {
var _local1 = this;
_local1.flowRate = _local1.FLOWRATE_BASE + (_local1.FLOWRATE_INCREASE * _local1.n_stage);
_local1.n_progress = _local1.screenHeight;
_local1.n_canyonLength = _local1.a_layouts[_local1.n_layout].getLength();
_local1.endFlag = false;
_local1.accelerating = false;
_local1.decelerating = false;
_local1.isRapid = 0;
_local1.n_currentIndex = 0;
_local1.n_entityDepth = _local1.ENTITY_DEPTH_MAX;
_local1.n_foreDepth = _local1.FORE_DEPTH_MAX;
var _local2 = _local1.a_effects.length;
while (_local2--) {
_local1.a_effects[_local2].clear();
_local1.a_effects.splice(_local2, 1);
}
_local1.a_activeEntitys = [];
}
function resetLayout() {
a_layouts[n_layout].reset();
}
function clearNonFloor() {
var _local2 = this;
var _local1 = _local2.a_activeEntitys.length;
while (_local1--) {
if (_local2.a_activeEntitys[_local1].TYPE != "floor") {
_local2.a_activeEntitys[_local1].clear();
}
}
}
function spawnEffect(t_assetID, t_x, t_y, t_movement, t_gravity) {
var _local2 = t_movement;
var _local3 = this;
var _local1 = new Classes.c_effect(t_assetID, t_x, t_y, _local3);
_local1.render();
if ((_local2 != null) && (_local2 != undefined)) {
_local1.replaceVector(_local2, 1);
}
if (t_gravity) {
_local1.gravityVector = _local3.GRAVITY;
}
_local3.a_effects.push(_local1);
return(_local1);
}
function spawnAsset(t_assetID, t_type) {
var _local1 = this;
var _local2;
if (t_type == "player") {
_local2 = _local1.PLAYER_DEPTH;
} else if (t_type == "floor") {
_local2 = _local1.FLOOR_DEPTH;
} else {
_local2 = _local1.n_entityDepth;
_local1.n_entityDepth--;
if (_local1.n_entityDepth < _local1.ENTITY_DEPTH_MIN) {
_local1.n_entityDepth = _local1.ENTITY_DEPTH_MAX;
}
}
return(_local1.mc.attachMovie(t_assetID, t_assetID + _local2, _local2));
}
function spawnForeAsset(t_assetID) {
var _local1 = this;
var _local2 = _local1.n_foreDepth;
_local1.n_foreDepth--;
if (_local1.n_foreDepth < _local1.FORE_DEPTH_MIN) {
_local1.n_foreDepth = _local1.FORE_DEPTH_MAX;
}
return(_local1.mc.attachMovie(t_assetID, t_assetID + _local2, _local2));
}
function spawnBank(t_assetID, t_depth) {
return(mc.attachMovie(t_assetID, t_assetID + t_depth, t_depth));
}
function magnitudeToVector(t_magnitude, t_angle) {
var _local2;
var _local1;
var _local3 = t_angle * (Math.PI/180);
_local2 = t_magnitude * Math.cos(_local3);
_local2 = Math.round(_local2 * 100) / 100;
_local1 = t_magnitude * Math.sin(_local3);
_local1 = Math.round(_local1 * 100) / 100;
return(new Classes.Vector(_local2, _local1, 0));
}
var flowDirection = 270;
var FLOWRATE_BASE = 90;
var FLOWRATE_INCREASE = 5;
var FLOWRATE_RAPID = 0.25;
var FLOWRATE_RAPIDMAX = 4;
var SPAWN_AHEAD = 30;
var ACCEL_PERCENT = 1.4;
var DECEL_PERCENT = 0.7;
var LEFTBANK_DEPTH = 680;
var RIGHTBANK_DEPTH = 683;
var PLAYER_DEPTH = 500;
var RAPID_ACCEL = 250;
var RAPID_MAX = 200;
var BANK_DECAY = 1;
var BANK_WIDTH = 23;
var ENTITY_DEPTH_MIN = 100;
var ENTITY_DEPTH_MAX = 480;
var FORE_DEPTH_MIN = 510;
var FORE_DEPTH_MAX = 580;
var BACK_DEPTH = 98;
var VINE_DEPTH = 99;
var FLOOR_DEPTH = 690;
}
Symbol 322 MovieClip [__Packages.Classes.Vector] Frame 0
class Classes.Vector
{
function Vector (x, y, z) {
var _local1 = this;
var _local2 = z;
var _local3 = y;
if ((x || (_local3)) || (_local2)) {
_local1.x = (x ? (x) : 0);
_local1.y = (_local3 ? (_local3) : 0);
_local1.z = (_local2 ? (_local2) : 0);
}
}
function loc(x, y, z) {
var _local1 = this;
_local1.x = x;
_local1.y = y;
_local1.z = z;
}
function copy() {
var _local1 = this;
return(new Classes.Vector(_local1.x, _local1.y, _local1.z));
}
function copyTo(a) {
var _local1 = a;
var _local2 = this;
_local1.x = _local2.x;
_local1.y = _local2.y;
_local1.z = _local2.z;
}
function copyFrom(a) {
var _local1 = a;
var _local2 = this;
_local2.x = _local1.x;
_local2.y = _local1.y;
_local2.z = _local1.z;
}
function distanceToVector(a) {
var _local3 = a.x - x;
var _local2 = a.y - y;
var _local1 = a.z - z;
return(Math.sqrt(((_local3 * _local3) + (_local2 * _local2)) + (_local1 * _local1)));
}
function distanceToCoordinates(x, y, z) {
var _local3 = this.x - x;
var _local2 = this.y - y;
var _local1 = this.z - z;
return(Math.sqrt(((_local3 * _local3) + (_local2 * _local2)) + (_local1 * _local1)));
}
function get magnitude() {
var _local1 = this;
return(Math.sqrt(((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z)));
}
function get length() {
var _local1 = this;
return(Math.sqrt(((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z)));
}
function set length(newLength) {
var _local1 = this;
var _local2 = newLength / Math.sqrt(((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z));
_local1.x = _local1.x * _local2;
_local1.y = _local1.y * _local2;
_local1.z = _local1.z * _local2;
//return(_local1.__get__length());
}
function dot(v) {
var _local1 = v;
var _local2 = this;
return(((_local2.x * _local1.x) + (_local2.y * _local1.y)) + (_local2.z * _local1.z));
}
function cross(v) {
var _local1 = v;
var _local2 = this;
if (!_local1) {
_local1 = VECPZ;
}
trace("Z: " + ((_local2.x * _local1.y) - (_local2.y * _local1.x)));
return(new Classes.Vector((_local2.y * _local1.z) - (_local2.z * _local1.y), (_local2.z * _local1.x) - (_local2.x * _local1.z), (_local2.x * _local1.y) - (_local2.y * _local1.x)));
}
function normalize() {
var _local1 = this;
var _local2 = Math.sqrt(((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z));
_local1.x = _local1.x / _local2;
_local1.y = _local1.y / _local2;
_local1.z = _local1.z / _local2;
return(_local1);
}
function getNormalized() {
var _local1 = this;
var _local2 = Math.sqrt(((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z));
return(new Classes.Vector(_local1.x / _local2, _local1.y / _local2, _local1.z / _local2));
}
function multiply(scalar) {
var _local1 = this;
var _local2 = scalar;
_local1.x = _local1.x * _local2;
_local1.y = _local1.y * _local2;
_local1.z = _local1.z * _local2;
}
function sum(v) {
var _local1 = v;
var _local2 = this;
_local2.x = _local2.x + _local1.x;
_local2.y = _local2.y + _local1.y;
_local2.z = _local2.z + _local1.z;
}
function subtract(v) {
var _local1 = v;
var _local2 = this;
_local2.x = _local2.x - _local1.x;
_local2.y = _local2.y - _local1.y;
_local2.z = _local2.z - _local1.z;
}
function divide(scalar) {
var _local1 = this;
var _local2 = scalar;
if (!_local2) {
_local1.x = 0;
_local1.y = 0;
_local1.z = 0;
} else {
_local1.x = _local1.x / _local2;
_local1.y = _local1.y / _local2;
_local1.z = _local1.z / _local2;
}
}
function reverse() {
var _local1 = this;
_local1.x = _local1.x * -1;
_local1.y = _local1.y * -1;
_local1.z = _local1.z * -1;
}
function getReversed() {
var _local1 = this;
return(new Classes.Vector(-_local1.x, -_local1.y, -_local1.z));
}
function toString() {
var _local1 = this;
return(((((("Vector(" + _local1.x) + ",") + _local1.y) + ",") + _local1.z) + ")");
}
static var ZERO = new Classes.Vector(0, 0, 0);
static var VECPX = new Classes.Vector(1, 0, 0);
static var VECNX = new Classes.Vector(-1, 0, 0);
static var VECPY = new Classes.Vector(0, 1, 0);
static var VECNY = new Classes.Vector(0, -1, 0);
static var VECPZ = new Classes.Vector(0, 0, 1);
static var VECNZ = new Classes.Vector(0, 0, -1);
var x = 0;
var y = 0;
var z = 0;
}
Symbol 323 MovieClip [__Packages.Classes.c_bank] Frame 0
class Classes.c_bank
{
function c_bank (t_assets, t_depth, t_canyon) {
var _local1 = this;
_local1.assets = t_assets;
_local1.canyon = t_canyon;
_local1.n_currentDepth = (_local1.BASE_DEPTH = t_depth);
_local1.x = 0;
}
function clear() {
var _local1 = this;
_local1.bottomMC.removeMovieClip();
_local1.bottomMC = undefined;
_local1.topMC.removeMovieClip();
_local1.topMC = undefined;
}
function spawn() {
var _local1 = this;
_local1.bottomMC = _local1.spawnPiece();
_local1.topMC = _local1.spawnPiece();
}
function spawnPiece() {
var _local1 = this;
var _local3 = 0;
if ((_local1.bottomMC.depth == _local1.n_currentDepth) || (_local1.topMC.depth == _local1.n_currentDepth)) {
_local1.n_currentDepth++;
}
var _local2 = _local1.canyon.spawnBank(_local1.assets[_local3], _local1.n_currentDepth);
_local2._x = _local1.x;
_local2.depth = _local1.n_currentDepth;
if (_local1.n_currentDepth == _local1.BASE_DEPTH) {
_local1.n_currentDepth++;
} else {
_local1.n_currentDepth = _local1.BASE_DEPTH;
}
return(_local2);
}
function update(t_flow, t_elapsed) {
var _local1 = this;
_local1.topMC._y = _local1.topMC._y + (t_flow.y * t_elapsed);
_local1.bottomMC._y = _local1.topMC._y + _local1.topMC._height;
if (t_flow.y < 0) {
if ((_local1.topMC._y + _local1.topMC._height) < 0) {
_local1.topMC.removeMovieClip();
_local1.topMC = _local1.bottomMC;
_local1.bottomMC = _local1.spawnPiece();
_local1.bottomMC._y = _local1.topMC._y + _local1.topMC._height;
}
} else if (_local1.bottomMC._y > _local1.canyon.screenHeight) {
_local1.bottomMC.removeMovieClip();
_local1.bottomMC = _local1.topMC;
_local1.topMC = _local1.spawnPiece();
_local1.topMC._y = _local1.bottomMC._y - _local1.topMC._height;
}
}
}
Symbol 324 MovieClip [__Packages.Classes.c_entity] Frame 0
class Classes.c_entity
{
var mc, x, y, radius, velocity;
function c_entity (t_assetID, t_canyon) {
var _local1 = this;
_local1.assetID = t_assetID;
_local1.canyon = t_canyon;
_local1.x = 0;
_local1.y = 0;
}
function spawn(t_canyonDistance) {
var _local1 = this;
_local1.mc = _local1.canyon.spawnAsset(_local1.assetID, _local1.TYPE);
if (_local1.mc != undefined) {
_local1.isSpawned = true;
} else {
trace("ERROR SPAWNING ASSET " + _local1.assetID);
}
_local1.y = _local1.canyon.screenHeight - (t_canyonDistance - _local1.canyonLocation);
_local1.x = _local1.startX;
_local1.mc._x = -1000;
_local1.mc._y = -1000;
_local1.baseWidth = _local1.mc._width;
_local1.baseHeight = _local1.mc._height;
_local1.radius = _local1.baseWidth / 2;
}
function update(t_flow, t_elapsed) {
var _local1 = this;
_local1.replaceVector(t_flow);
_local1.addVector(_local1.gravityVector, 1);
_local1.addVector(_local1.movementVector, 1);
_local1.rotation = _local1.rotation + (_local1.spin * t_elapsed);
}
function move(t_elapsed) {
var _local1 = this;
_local1.x = _local1.x + (_local1.velocity.x * t_elapsed);
_local1.y = _local1.y + (_local1.velocity.y * t_elapsed);
}
function render() {
var _local1 = this;
_local1.mc._x = _local1.x - (_local1.baseWidth / 2);
_local1.mc._y = _local1.y - (_local1.baseHeight / 2);
_local1.mc._rotation = _local1.rotation;
}
function clear() {
mc.removeMovieClip();
reset();
}
function reset() {
var _local1 = this;
_local1.velocity = new Classes.Vector(0, 0, 0);
_local1.gravityVector = _local1.canyon.magnitudeToVector(0, 0);
_local1.movementVector = _local1.canyon.magnitudeToVector(0, 0);
_local1.rotation = 0;
_local1.spin = 0;
_local1.isSpawned = false;
_local1.isBroken = false;
}
function runHitTest(t_target, t_elapsed) {
var _local1 = t_target;
var _local3 = (x - _local1.x) + (_local1.velocity.x * t_elapsed);
var _local2 = (y - _local1.y) + (_local1.velocity.y * t_elapsed);
var distance = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (distance <= (_local1.radius + radius)) {
return(true);
}
return(false);
}
function runHitResponse_player(t_player) {
}
function replaceVector(t_vector) {
velocity = t_vector.copy();
}
function addVector(t_vector, t_timeElapsed, maxVelocity, xMult, yMult, zMult) {
var _local1 = maxVelocity;
var _local2 = this;
var _local3 = yMult;
if (xMult == undefined) {
xMult = 1;
}
if (_local3 == undefined) {
_local3 = 1;
}
if (_local1 == undefined) {
_local1 = 1000;
}
if (Math.abs(_local2.velocity.x) < _local1) {
_local2.velocity.x = _local2.velocity.x + ((t_vector.x * t_timeElapsed) * xMult);
}
if (Math.abs(_local2.velocity.y) < _local1) {
_local2.velocity.y = _local2.velocity.y + ((t_vector.y * t_timeElapsed) * _local3);
}
}
function decayVelocityX(t_decay) {
var _local1 = this;
if (_local1.velocity.x > 0) {
_local1.velocity.x = _local1.velocity.x - t_decay;
if (_local1.velocity.x < 0) {
_local1.velocity.x = 0;
}
} else if (_local1.velocity.x < 0) {
_local1.velocity.x = _local1.velocity.x + t_decay;
if (_local1.velocity.x > 0) {
_local1.velocity.x = 0;
}
}
}
function decayVelocityY(t_decay) {
var _local1 = this;
if (_local1.velocity.y > 0) {
_local1.velocity.y = _local1.velocity.y - t_decay;
if (_local1.velocity.y < 0) {
_local1.velocity.y = 0;
}
} else if (_local1.velocity.y < 0) {
_local1.velocity.y = _local1.velocity.y + t_decay;
if (_local1.velocity.y > 0) {
_local1.velocity.y = 0;
}
}
}
function invertVelocityX() {
velocity.x = velocity.x * -1;
}
function invertVelocityY() {
velocity.y = velocity.y * -1;
}
var isBouyant = false;
}
Symbol 325 MovieClip [__Packages.Classes.c_player] Frame 0
class Classes.c_player extends Classes.c_entity
{
var n_lives, isAnimating, state;
function c_player (t_assetID, t_canyon) {
var _local1 = this;
super();
_local1.isBouyant = true;
_local1.assetID = t_assetID;
_local1.canyon = t_canyon;
}
function reset() {
var _local1 = this;
_local1.n_lives = 3;
_local1.n_health = _local1.MAX_HEALTH;
_local1.isAnimating = false;
_local1.state = "none";
super.reset();
}
function takeDamage() {
var _local1 = this;
trace("DAMAGE");
_local1.n_health--;
_local1.mc.head.gotoAndPlay(2);
_local1.mc.bang.gotoAndPlay(2);
_local1.canyon.spawnEffect("effect_leaf", _local1.x + 15, _local1.y - 20, _local1.canyon.magnitudeToVector(140, 270), false);
if (_local1.n_health <= 0) {
_local1.loseLife();
_local1.startAnim("fall");
_local1.mc.chuteFrame = 4;
} else {
_local1.mc.chuteFrame = (_local1.MAX_HEALTH - _local1.n_health) + 1;
_local1.invincibleTimer = _local1.INVINCIBLE_MAX;
_local1.mc.chute.invincibleFlash_mc.gotoAndPlay(2);
}
_local1.mc.chute.gotoAndStop(_local1.mc.chuteFrame);
}
function addHealth(t_amount) {
var _local1 = this;
_local1.n_health = _local1.n_health + t_amount;
if (_local1.n_health > _local1.MAX_HEALTH) {
_local1.n_health = _local1.MAX_HEALTH;
}
_local1.mc.chuteFrame = (_local1.MAX_HEALTH - _local1.n_health) + 1;
_local1.mc.chute.gotoAndStop(_local1.mc.chuteFrame);
}
function loseLife() {
var _local1 = this;
_local1.n_lives--;
_local1.n_health = _local1.MAX_HEALTH;
_global.bounceEngine.updateUI();
if (_local1.n_lives > 0) {
_global.bounceEngine.showChutes();
}
}
function checkLives() {
if (n_lives > 0) {
return(true);
}
return(false);
}
function update(t_elapsed) {
var _local1 = this;
var _local2 = t_elapsed;
if (_local1.isAnimating) {
switch (_local1.state) {
case "fall" :
_local1.addVector(_local1.gravityVector, _local2);
if (_local1.y > 250) {
_local1.startAnim("return");
}
break;
case "return" :
_local1.addVector(_local1.gravityVector, _local2);
_local1.addVector(_local1.movementVector, _local2);
if ((_local1.velocity.y > 0) && (_local1.y < 200)) {
_local1.stopAnim();
}
break;
case "death" :
_local1.addVector(_local1.gravityVector, _local2);
if (_local1.y > 250) {
_global.bounceEngine.fadeToBlack();
}
if (_local1.y > (_local1.canyon.screenHeight + _local1.mc._height)) {
_global.bounceEngine.goGameover();
}
break;
case "locked" :
_local1.canyon.floor.mc.mc_brandy._x = _local1.x - _local1.canyon.floor.x;
_local1.decayVelocityX((_local1.DECELERATION * 1.5) * _local2);
break;
case "drop" :
_local1.addVector(_local1.gravityVector, _local2);
_local1.canyon.floor.mc.mc_brandy._x = _local1.x - _local1.canyon.floor.x;
if (_local1.y > 280) {
_local1.startAnim("hidden");
}
break;
case "launch" :
targetHeight = -1500;
if (_local1.canyon.n_progress > targetHeight) {
_local1.y = 270 - (170 * Math.abs(_local1.canyon.n_progress / targetHeight));
} else {
_local1.startAnim("settle");
_global.bounceEngine.hideBounce();
}
break;
case "settle" :
var targetHeight = -1750;
if (_local1.canyon.n_progress > -1749) {
var t_ratio = Math.abs((_local1.canyon.n_progress + 1500) / (targetHeight + 1500));
_local1.y = 100 - (40 * t_ratio);
_local1.canyon.flowRate = -1500 + (1500 * t_ratio);
if (((_local1.y < 70) && (_local1.mc._currentFrame < 47)) && (_local1.mc._currentFrame > 20)) {
trace(_local1.mc._currentFrame);
_local1.mc.gotoAndPlay("recover");
}
} else {
_local1.stopAnim();
_local1.canyon.begin();
}
}
} else {
var _local3 = _local1.DECELERATION * _local2;
var t_accel = _local1.ACCELERATION;
if (_local1.invincibleTimer > 0) {
_local1.invincibleTimer = _local1.invincibleTimer - _local2;
if (_local1.invincibleTimer <= 0) {
_local1.mc.chute.invincibleFlash_mc.gotoAndStop(1);
}
}
var xmove = false;
var ymove = false;
if (Key.isDown(38)) {
if (_local1.velocity.y > 0) {
_local1.decayVelocityY(_local3);
}
if (_local1.y < 50) {
_local1.decayVelocityY(_local3);
_local1.canyon.decelerating = true;
} else {
_local1.addVector(_local1.canyon.magnitudeToVector(t_accel, 270), _local2, _local1.MAX_VELOCITY);
}
ymove = true;
_local1.mc.gotoAndStop("slow");
}
if (Key.isDown(40)) {
if (_local1.velocity.y < 0) {
_local1.decayVelocityY(_local3);
}
if (_local1.y > (_local1.canyon.screenHeight / 4)) {
_local1.decayVelocityY(_local3);
_local1.canyon.accelerating = true;
} else {
_local1.addVector(_local1.canyon.magnitudeToVector(t_accel, 90), _local2, _local1.MAX_VELOCITY);
}
ymove = true;
_local1.mc.gotoAndStop("fast");
}
if (Key.isDown(37)) {
if (_local1.velocity.x > 0) {
_local1.decayVelocityX(_local3);
}
_local1.addVector(_local1.canyon.magnitudeToVector(t_accel, 180), _local2, _local1.MAX_VELOCITY);
xmove = true;
_local1.mc.gotoAndStop("left");
}
if (Key.isDown(39)) {
if (_local1.velocity.x < 0) {
_local1.decayVelocityX(_local3);
}
_local1.addVector(_local1.canyon.magnitudeToVector(t_accel, 0), _local2, _local1.MAX_VELOCITY);
xmove = true;
_local1.mc.gotoAndStop("right");
}
if ((_local1.y > (_local1.canyon.screenHeight / 4)) && (_local1.velocity.y < 5)) {
_local1.addVector(_local1.canyon.magnitudeToVector(250, 270), _local2, _local1.MAX_VELOCITY);
}
if ((!ymove) && (_local1.velocity.y != 0)) {
_local1.decayVelocityY(_local3);
}
if ((!xmove) && (_local1.velocity.x != 0)) {
_local1.decayVelocityX(_local3);
}
if ((!ymove) && (!xmove)) {
_local1.mc.gotoAndStop("middle");
}
}
}
function startAnim(t_type) {
var _local1 = this;
trace("ANIMATE: " + t_type);
_local1.isAnimating = true;
_local1.state = t_type;
switch (_local1.state) {
case "begin" :
_local1.mc._visible = false;
_local1.canyon.floor.mc.mc_brandy.anim.gotoAndPlay("levelstart");
_local1.reset();
return;
case "launch" :
_local1.mc.gotoAndStop("upnochute");
_local1.canyon.n_progress = 0;
_local1.canyon.endFlag = false;
_local1.y = 270;
_local1.mc._visible = true;
_local1.render();
_local1.canyon.prepareLayout();
_local1.replaceVector(_local1.canyon.magnitudeToVector(0, 270));
_local1.canyon.flowRate = -1500;
_global.bounceEngine.showBounce();
return;
case "settle" :
_local1.replaceVector(_local1.canyon.magnitudeToVector(0, 270));
return;
case "fall" :
_local1.gravityVector = _local1.canyon.GRAVITY;
_local1.mc.gotoAndStop("hit");
return;
case "return" :
if (_local1.checkLives()) {
_local1.mc.chuteFrame = 1;
_local1.invincibleTimer = _local1.INVINCIBLE_MAX;
_local1.gravityVector = _local1.canyon.GRAVITY;
_local1.mc.chute.invincibleFlash_mc.gotoAndPlay(2);
_local1.replaceVector(_local1.canyon.magnitudeToVector(300, 270));
var _local2 = _local1.canyon.spawnEffect("effect_vine", _local1.x + 15, _local1.y - 20, _local1.canyon.magnitudeToVector(100, 310), true);
_local2.spin = 20;
_local1.mc.gotoAndPlay("recover");
} else {
_local1.startAnim("death");
}
return;
case "death" :
_local1.gravityVector = _local1.canyon.GRAVITY;
return;
case "locked" :
_local1.mc.gotoAndStop("middle");
_local1.gravityVector = new Classes.Vector(0, 0, 0);
return;
case "drop" :
_local1.mc.gotoAndPlay("drop");
_local1.replaceVector(_local1.canyon.magnitudeToVector(100, 90));
_local1.gravityVector = _local1.canyon.GRAVITY;
return;
case "hidden" :
if (_local1.checkLives()) {
_local1.mc._visible = false;
_local1.mc.chuteFrame = (_local1.MAX_HEALTH - _local1.n_health) + 1;
_local1.gravityVector = new Classes.Vector(0, 0, 0);
_local1.canyon.floor.mc.mc_brandy.anim.gotoAndPlay("levelend");
_local1.canyon.clearNonFloor();
} else {
_global.bounceEngine.goGameover();
}
}
}
function stopAnim() {
trace(" STOP ANIM");
isAnimating = false;
state = "none";
}
var MAX_HEALTH = 3;
var ACCELERATION = 210;
var DECELERATION = 160;
var MAX_VELOCITY = 150;
var INVINCIBLE_MAX = 2;
var TYPE = "player";
}
Symbol 326 MovieClip [__Packages.Classes.c_vine] Frame 0
class Classes.c_vine extends Classes.c_entity
{
var startX, canyon;
function c_vine (t_canyon) {
super();
startX = 0;
canyon = t_canyon;
}
function render() {
var _local1 = this;
_local1.mc._x = _local1.x;
_local1.mc._y = _local1.y;
}
function spawn(t_path, t_asset, t_depth) {
var _local1 = this;
_local1.mc = t_path.attachMovie(t_asset, "vine", t_depth);
_local1.isSpawned = true;
_local1.x = _local1.startX;
_local1.y = (-_local1.mc._height) + _local1.canyon.screenHeight;
_local1.mc._x = -1000;
_local1.mc._y = -1000;
_local1.baseWidth = _local1.mc._width;
_local1.baseHeight = _local1.mc._height;
_local1.radius = _local1.baseWidth / 2;
}
var TYPE = "vine";
}
Symbol 327 MovieClip [__Packages.Classes.c_floor] Frame 0
class Classes.c_floor extends Classes.c_entity
{
function c_floor (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.canyon = t_canyon;
_local1.x = t_x;
_local1.y = 0;
_local1.canyonLocation = t_dist;
}
function spawn(t_end) {
var _local1 = this;
_local1.mc = _local1.canyon.spawnAsset(_local1.assetID, _local1.TYPE);
_local1.y = _local1.canyon.screenHeight;
_local1.mc._x = -1000;
_local1.mc._y = -1000;
_local1.baseWidth = 0;
_local1.baseHeight = 0;
_local1.radius = 0;
_local1.mc.mc_brandy._x = _local1.canyon.player.x - _local1.x;
if (t_end != false) {
_local1.canyon.reachEnd(_local1);
}
}
var TYPE = "floor";
}
Symbol 328 MovieClip [__Packages.Classes.c_layout] Frame 0
class Classes.c_layout
{
var a_entitys;
function c_layout (t_data, t_canyon) {
var _local1 = t_data;
var _local2 = this;
_local2.canyon = t_canyon;
_local1.sortOn("dist", Array.ASCENDING);
_local2.a_entitys = [];
var c = 0;
while (c < _local1.length) {
_local1[c].dist = _local1[c].dist + 150;
if (_local1[c].type == "obs") {
_local2.a_entitys.push(new Classes.c_obstacle(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
} else if (_local1[c].type == "branch") {
_local2.a_entitys.push(new Classes.c_branch(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
} else if (_local1[c].type == "bridge") {
_local2.a_entitys.push(new Classes.c_bridge(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
} else if (_local1[c].type == "pickup") {
_local2.a_entitys.push(new Classes.c_pickup(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
} else if (_local1[c].type == "health") {
_local2.a_entitys.push(new Classes.c_health(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
} else if (_local1[c].type == "gate") {
_local2.a_entitys.push(new Classes.c_gate(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
} else if (_local1[c].type == "rapid") {
_local2.a_entitys.push(new Classes.c_rapid(_local1[c].asset, _local1[c].x, _local1[c].dist, _local1[c].angle, _local2.canyon));
} else if (_local1[c].type == "floor") {
_local2.a_entitys.push(new Classes.c_floor(_local1[c].asset, _local1[c].x, _local1[c].dist, _local2.canyon));
}
c++;
}
var t_newArray = [];
var _local3 = _local2.a_entitys;
var t_currentWinner;
var c;
while (_local3.length > 0) {
t_currentWinner = 0;
c = _local3.length;
while (c--) {
if (_local3[c].canyonLocation < _local3[t_currentWinner].canyonLocation) {
t_currentWinner = c;
}
}
t_newArray.push(_local3[t_currentWinner]);
_local3.splice(t_currentWinner, 1);
}
_local2.a_entitys = t_newArray;
}
function getLength() {
return(a_entitys[a_entitys.length - 1].canyonLocation);
}
function reset() {
var _local2 = this;
var _local1 = _local2.a_entitys.length;
while (_local1--) {
_local2.a_entitys[_local1].clear();
_local2.a_entitys[_local1].reset();
}
}
}
Symbol 329 MovieClip [__Packages.Classes.c_obstacle] Frame 0
class Classes.c_obstacle extends Classes.c_entity
{
var mc, isBroken, radius, baseWidth;
function c_obstacle (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.startX = t_x;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
}
function breakOff() {
mc.gotoAndPlay("break");
_global.bounceEngine.playSound("thunder");
isBroken = true;
}
function spawn(t_canyonDistance, t_type) {
super.spawn(t_canyonDistance, t_type);
radius = (baseWidth * 0.7) / 2;
}
function runHitResponse_player(t_player, t_elapsed) {
var _local1 = t_player;
var _local3 = this;
if (!_local3.isBroken) {
var _local2 = new Classes.Vector(_local1.x - _local3.x, _local1.y - _local3.y, 0);
_local2.normalize();
var a1 = _local1.velocity.dot(_local2);
var a2 = _local3.velocity.dot(_local2);
var optimizedP = (2 * (a1 - a2));
_local2.multiply(optimizedP);
_local1.velocity.subtract(_local2);
if (_local1.invincibleTimer <= 0) {
_local1.takeDamage();
}
trace((("POW : " + _local1.velocity.x) + " , ") + _local1.velocity.y);
_local3.breakOff();
}
}
var TYPE = "obstacle";
}
Symbol 330 MovieClip [__Packages.Classes.c_branch] Frame 0
class Classes.c_branch extends Classes.c_obstacle
{
function c_branch (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.startX = t_x;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
}
function render() {
var _local1 = this;
var _local2 = 0;
if (_local1.assetID == "branchRight_mc") {
_local2 = _local1.baseWidth;
}
_local1.mc._x = _local1.x - _local2;
_local1.mc._y = _local1.y - (_local1.baseHeight / 2);
}
function runHitTest(t_target, t_elapsed) {
var _local1 = this;
var _local2 = t_target;
var t_x = (_local2.x + (_local2.velocity.x * t_elapsed));
var t_y = (_local2.y + (_local2.velocity.y * t_elapsed));
var _local3 = _local1.baseWidth;
var t_height = (_local1.baseHeight / 2);
if ((((t_y < (_local1.y + t_height)) && (t_y > (_local1.y - t_height))) || (((t_y - _local2.radius) < (_local1.y + t_height)) && ((t_y - _local2.radius) > (_local1.y - t_height)))) || (((t_y + _local2.radius) > (_local1.y - t_height)) && ((t_y + _local2.radius) < (_local1.y + t_height)))) {
if ((((t_x < (_local1.x + _local3)) && (t_x > (_local1.x - _local3))) || (((t_x - _local2.radius) < (_local1.x + _local3)) && ((t_x - _local2.radius) > (_local1.x - _local3)))) || (((t_x + _local2.radius) > (_local1.x - _local3)) && ((t_x + _local2.radius) < (_local1.x + _local3)))) {
return(true);
}
}
return(false);
}
function breakOff() {
var _local1 = this;
_local1.mc.gotoAndStop("break");
_local1.isBroken = true;
_global.bounceEngine.playSound("impact1");
var t_xoffset = (_local1.baseWidth / 2);
var _local2 = 90;
if (_local1.assetID == "branchRight_mc") {
t_xoffset = (-_local1.baseWidth) / 2;
_local2 = -90;
}
var _local3 = "effect_rightbranch";
if (_local1.assetID == "branchLeft_mc") {
_local3 = "effect_leftbranch";
}
var t_effect = _local1.canyon.spawnEffect(_local3, _local1.x + t_xoffset, _local1.y, null, true);
t_effect.spin = _local2;
}
var TYPE = "obstacle";
}
Symbol 331 MovieClip [__Packages.Classes.c_bridge] Frame 0
class Classes.c_bridge extends Classes.c_obstacle
{
var mcFore;
function c_bridge (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.foreAssetID = t_assetID + "Fore";
_local1.startX = 0;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
}
function clear() {
mcFore.removeMovieClip();
super.clear();
}
function spawn(t_canyonDistance, t_type) {
var _local1 = this;
_local1.bridgeState = Math.ceil(Math.random() * 4);
_local1.mc = _local1.canyon.spawnAsset(_local1.assetID, _local1.TYPE);
if (_local1.mc != undefined) {
_local1.isSpawned = true;
} else {
trace("ERROR SPAWNING ASSET " + _local1.assetID);
}
_local1.mcFore = _local1.canyon.spawnForeAsset(_local1.foreAssetID);
_local1.mc.gotoAndStop(_local1.bridgeState);
_local1.mcFore.gotoAndStop(_local1.bridgeState);
_local1.y = _local1.canyon.screenHeight - (t_canyonDistance - _local1.canyonLocation);
_local1.x = _local1.startX;
_local1.mc._x = -1000;
_local1.mc._y = -1000;
_local1.mcFore._x = -1000;
_local1.mcFore._y = -1000;
_local1.baseWidth = _local1.mc._width;
_local1.baseHeight = _local1.mc._height;
}
function runHitTest(t_target, t_elapsed) {
var _local1 = t_target;
var _local2 = this;
var t_x = (_local1.x + (_local1.velocity.x * t_elapsed));
var _local3 = _local1.y + (_local1.velocity.y * t_elapsed);
var t_width = _local2.baseWidth;
var t_height = (_local2.baseHeight / 2);
var safety_left = (_local2.x + _local2.mc.mc_safety._x);
var safety_right = (safety_left + _local2.mc.mc_safety._width);
if ((((_local3 < (_local2.y + t_height)) && (_local3 > (_local2.y - t_height))) || (((_local3 - _local1.radius) < (_local2.y + t_height)) && ((_local3 - _local1.radius) > (_local2.y - t_height)))) || (((_local3 + _local1.radius) > (_local2.y - t_height)) && ((_local3 + _local1.radius) < (_local2.y + t_height)))) {
if ((((t_x < safety_right) && (t_x > safety_left)) && (((t_x - _local1.radius) < safety_right) && ((t_x - _local1.radius) > safety_left))) && (((t_x + _local1.radius) > safety_left) && ((t_x + _local1.radius) < safety_right))) {
return(false);
}
return(true);
}
return(false);
}
function render() {
var _local1 = this;
var oldY = _local1.mc._y;
_local1.mc._x = _local1.x;
_local1.mc._y = _local1.y - (_local1.baseHeight / 2);
_local1.mcFore._x = _local1.x;
_local1.mcFore._y = _local1.y - (_local1.baseHeight / 2);
}
function breakOff(t_elapsed) {
var _local1 = this;
var _local3 = [];
if (_local1.mc._currentFrame != 1) {
_local3.push({name:"effect_bridgeSlat1", x:56.9, y:18.9});
}
if (_local1.mc._currentFrame != 2) {
_local3.push({name:"effect_bridgeSlat2", x:96.3, y:22.8});
}
if (_local1.mc._currentFrame != 3) {
_local3.push({name:"effect_bridgeSlat2", x:139.8, y:22.8});
}
if (_local1.mc._currentFrame != 4) {
_local3.push({name:"effect_bridgeSlat1", x:175.3, y:18.9});
}
_local1.mc.gotoAndPlay("break");
_local1.mcFore.gotoAndStop("break");
var t_velocity;
var _local2 = _local3.length;
while (_local2--) {
t_velocity = _local1.canyon.magnitudeToVector(225 + (Math.random() * 50), 240 + (Math.random() * 60));
_local1.canyon.spawnEffect(_local3[_local2].name, _local1.x + _local3[_local2].x, _local1.y + _local3[_local2].y, t_velocity, true);
}
_global.bounceEngine.playSound("impact1");
_local1.isBroken = true;
_local1.canyon.player.invertVelocityY();
}
var TYPE = "obstacle";
}
Symbol 332 MovieClip [__Packages.Classes.c_pickup] Frame 0
class Classes.c_pickup extends Classes.c_entity
{
var mc;
function c_pickup (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.startX = t_x;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
}
function spawn(t_canyonDistance, t_type) {
super.spawn(t_canyonDistance, t_type);
mc.gotoAndStop(Math.ceil(Math.random() * mc._totalFrames));
}
function pickup() {
var _local1 = this;
_global.bounceEngine.addScore(_local1.value);
_global.bounceEngine.playSound("pickup");
_local1.mc.flower.gotoAndPlay(2);
_local1.isBroken = true;
}
function runHitResponse_player(t_player) {
var _local1 = this;
if (_local1.isSpawned && (!_local1.isBroken)) {
_local1.pickup();
}
}
var value = 50;
var TYPE = "pickup";
}
Symbol 333 MovieClip [__Packages.Classes.c_health] Frame 0
class Classes.c_health extends Classes.c_entity
{
function c_health (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.startX = t_x;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
}
function spawn(t_canyonDistance, t_type) {
super.spawn(t_canyonDistance, t_type);
}
function pickup() {
var _local1 = this;
_local1.canyon.player.addHealth(1);
_global.bounceEngine.playSound("health");
_local1.mc.gotoAndPlay(2);
_local1.isBroken = true;
}
function runHitResponse_player(t_player) {
var _local1 = this;
if (_local1.isSpawned && (!_local1.isBroken)) {
_local1.pickup();
}
}
var TYPE = "pickup";
}
Symbol 334 MovieClip [__Packages.Classes.c_gate] Frame 0
class Classes.c_gate extends Classes.c_entity
{
function c_gate (t_assetID, t_x, t_dist, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.startX = t_x;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
}
}
Symbol 335 MovieClip [__Packages.Classes.c_rapid] Frame 0
class Classes.c_rapid extends Classes.c_entity
{
function c_rapid (t_assetID, t_x, t_dist, t_angle, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.startX = t_x;
_local1.canyonLocation = t_dist;
_local1.canyon = t_canyon;
_local1.angle = t_angle;
}
function runHitTest(t_target, t_elapsed) {
var _local1 = this;
var _local2 = t_target;
var t_x = (_local2.x + (_local2.velocity.x * t_elapsed));
var t_y = (_local2.y + (_local2.velocity.y * t_elapsed));
var _local3 = _local1.baseWidth / 2;
var t_height = (_local1.baseHeight / 2);
if ((((t_x < (_local1.x + _local3)) && (t_x > (_local1.x - _local3))) || (((t_x - _local2.radius) < (_local1.x + _local3)) && ((t_x - _local2.radius) > (_local1.x - _local3)))) || (((t_x + _local2.radius) > (_local1.x - _local3)) && ((t_x + _local2.radius) < (_local1.x + _local3)))) {
if ((((t_y < (_local1.y + t_height)) && (t_y > (_local1.y - t_height))) || (((t_y - _local2.radius) < (_local1.y + t_height)) && ((t_y - _local2.radius) > (_local1.y - t_height)))) || (((t_y + _local2.radius) > (_local1.y - t_height)) && ((t_y + _local2.radius) < (_local1.y + t_height)))) {
return(true);
}
}
return(false);
}
function runHitResponse_player(t_player, t_elapsed) {
var _local1 = this;
var _local2 = t_player;
var _local3 = t_elapsed;
var t_x = (_local2.x + (_local2.velocity.x * _local3));
var t_y = (_local2.y + (_local2.velocity.y * _local3));
if (((t_y + _local2.radius) > (_local1.y - (_local1.baseHeight / 2))) && ((t_y + _local2.radius) < (_local1.y + (_local1.baseHeight / 2)))) {
_local2.addVector(_local1.canyon.magnitudeToVector(_local1.canyon.RAPID_ACCEL, _local1.angle), _local3, _local1.canyon.RAPID_MAX);
if (_local1.angle == 90) {
_local1.canyon.isRapid = 2;
}
} else if (_local2.velocity.y < 0) {
_local2.addVector(_local1.canyon.magnitudeToVector(_local1.canyon.RAPID_ACCEL * 2, _local1.angle), _local3, _local1.canyon.RAPID_MAX);
} else {
_local2.addVector(_local1.canyon.magnitudeToVector(_local1.canyon.RAPID_ACCEL, _local1.angle), _local3, _local1.canyon.RAPID_MAX);
}
}
var TYPE = "rapid";
}
Symbol 336 MovieClip [__Packages.Classes.c_effect] Frame 0
class Classes.c_effect extends Classes.c_entity
{
function c_effect (t_assetID, t_x, t_y, t_canyon) {
var _local1 = this;
super();
_local1.assetID = t_assetID;
_local1.x = t_x;
_local1.y = t_y;
_local1.canyon = t_canyon;
_local1.mc = _local1.canyon.spawnAsset(_local1.assetID, _local1.TYPE);
if (_local1.mc != undefined) {
_local1.isSpawned = true;
} else {
trace("ERROR SPAWNING EFFECT " + _local1.assetID);
}
_local1.baseWidth = _local1.mc._width;
_local1.baseHeight = _local1.mc._height;
_local1.reset();
}
function update(t_elapsed) {
var _local1 = this;
if (_local1.mc._currentFrame == _local1.mc._totalFrames) {
_local1.clear();
return(true);
}
_local1.addVector(_local1.gravityVector, t_elapsed);
_local1.rotation = _local1.rotation + (_local1.spin * t_elapsed);
return(false);
}
var TYPE = "effect";
}
Symbol 337 MovieClip [__Packages.Classes.intervalEngine] Frame 0
class Classes.intervalEngine
{
var paused, interval;
function intervalEngine () {
reset();
}
function startFlat(t_function, t_fps) {
var _local1 = this;
_local1.updateFunction = t_function;
_local1.FPS = t_fps;
_local1.updateInterval = 1 / _local1.FPS;
_local1.interval = setInterval(_local1.flatStep, 0, _local1);
trace(("-- Init Flat Interval at " + _local1.FPS) + " fps --");
}
function startFlex(t_function) {
var _local1 = this;
_local1.updateFunction = t_function;
_local1.lastElapsed = _local1.MAX_FRAMETIME;
_local1.interval = setInterval(_local1.flexStep, 0, _local1);
trace("-- Init Flex Interval --");
}
function pause() {
trace("-- Interval Paused");
paused = true;
}
function unpause() {
trace("-- Interval UnPaused");
paused = false;
}
function reset() {
var _local1 = this;
_local1.clear();
_local1.frameTime = 0;
_local1.lastUpdate = getTimer() / 1000;
_local1.paused = true;
}
function clear() {
if (interval != undefined) {
clearInterval(interval);
}
}
function flatStep(t_engine) {
t_engine.flatUpdater();
}
function flatUpdater() {
var _local1 = this;
if (_local1.paused) {
} else {
var _local2 = (-_local1.lastUpdate) + ((_local1.lastUpdate = getTimer() / 1000));
_local1.frameTime = _local1.frameTime + _local2;
if (_local1.frameTime < _local1.updateInterval) {
} else {
_local1.updateFunction(_local1.updateInterval);
_local1.frameTime = 0;
if (_local1.UPDATE_AFTER) {
updateAfterEvent();
}
}
}
}
function flexStep(t_engine) {
t_engine.flexUpdater();
}
function flexUpdater() {
var _local1 = this;
if (_local1.paused) {
_local1.lastUpdate = getTimer() * 0.001;
} else {
var _local2 = Math.min(_local1.MAX_FRAMETIME, (-_local1.lastUpdate) + ((_local1.lastUpdate = getTimer() * 0.001)));
_local2 = _local1.lastElapsed - Math.max(-_local1.MAX_TIMEDIFF, Math.min(_local1.MAX_TIMEDIFF, _local1.lastElapsed - _local2));
_local1.lastElapsed = _local2;
_local1.updateFunction(_local2);
if (_local1.UPDATE_AFTER) {
updateAfterEvent();
}
}
}
var UPDATE_AFTER = true;
var MAX_TIMEDIFF = 0.005;
var MAX_FRAMETIME = 0.05;
}
Symbol 51 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 11
if (_parent.isDone) {
play();
} else {
gotoAndPlay (1);
}
Symbol 67 MovieClip Frame 32
_parent.gotoAndPlay("done");
Symbol 68 MovieClip Frame 16
_parent.gotoAndStop("performance");
Symbol 81 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 13
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 13
stop();
Symbol 89 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 13
stop();
Symbol 90 MovieClip [pickup_mc] Frame 1
stop();
Symbol 103 MovieClip [cloud_mc] Frame 1
stop();
Symbol 103 MovieClip [cloud_mc] Frame 2
play();
Symbol 103 MovieClip [cloud_mc] Frame 6
stop();
Symbol 109 MovieClip [branchLeft_mc] Frame 1
stop();
Symbol 111 MovieClip [branchRight_mc] Frame 1
stop();
Symbol 138 MovieClip [bridge_mc] Frame 1
stop();
Symbol 138 MovieClip [bridge_mc] Frame 14
stop();
Symbol 143 MovieClip [bridge_mcFore] Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 164 MovieClip [player_mc] Frame 1
stop();
chute.gotoAndStop(chuteFrame);
if (_global.bounceEngine.canyon.player.invincibleTimer <= 0) {
chute.invincibleFlash_mc.gotoAndStop(1);
} else {
chute.invincibleFlash_mc.gotoAndPlay(2);
}
Symbol 164 MovieClip [player_mc] Frame 2
stop();
Symbol 164 MovieClip [player_mc] Frame 33
stop();
Symbol 164 MovieClip [player_mc] Frame 50
chute.gotoAndStop(chuteFrame);
chute.invincibleFlash_mc.gotoAndStop(1);
Symbol 164 MovieClip [player_mc] Frame 51
gotoAndPlay ("prep");
Symbol 178 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 7
_global.bounceEngine.canyon.player.startAnim("launch");
Symbol 180 MovieClip Frame 8
gotoAndStop ("wait");
Symbol 180 MovieClip Frame 15
play();
Symbol 180 MovieClip Frame 41
if (_global.bounceEngine.paused == false) {
_global.bounceEngine.startMusic();
}
_global.bounceEngine.canyon.player.startAnim("launch");
Symbol 180 MovieClip Frame 42
gotoAndStop ("wait");
Symbol 189 MovieClip [pickupLeaf_mc] Frame 1
stop();
Symbol 189 MovieClip [pickupLeaf_mc] Frame 9
stop();
Symbol 198 MovieClip Frame 1
stop();
Symbol 205 Button
on (release) {
_global.bounceEngine.clickStart();
}
Symbol 214 Button
on (release) {
_global.bounceEngine.clickPlay();
}
Symbol 229 Button
on (release) {
nextFrame();
}
Symbol 243 Button
on (release) {
prevFrame();
}
Symbol 245 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 1
stop();
Symbol 257 Button
on (release) {
_global.bounceEngine.clickPause();
}
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 4
stop();
Symbol 272 MovieClip Frame 1
stop();
Symbol 277 Button
on (release) {
_global.bounceEngine.clickQuit();
}
Symbol 279 Button
on (release) {
_global.bounceEngine.clickResume();
}
Symbol 285 MovieClip Frame 1
stop();
Symbol 289 Button
on (release) {
_global.bounceEngine.clickSubmit();
}
Symbol 291 Button
on (release) {
_global.bounceEngine.clickHelp();
}
Symbol 302 Button
on (release) {
_global.bounceEngine.clickSubmit();
}
Symbol 305 Button
on (release) {
_global.bounceEngine.clickPlay();
}