Frame 1
stop();
this._lockroot = true;
var gameWidth = 1000;
var gameHeight = 600;
Button.prototype.tabEnabled = false;
Frame 2
var loc_language = "en";
switch (loc_language) {
case "en" :
_level0.loc_water_racer_btn1 = "How2Play";
_level0.loc_water_racer_btn2 = "Play Again";
_level0.loc_water_racer_btn3 = "Close";
_level0.loc_water_racer_head1 = "How2Play";
_level0.loc_water_racer_head2 = "Help Chimpoo win the race";
_level0.loc_water_racer_head3 = " to drive";
_level0.loc_water_racer_head4 = "for Nitro/Boost";
_level0.loc_water_racer_head5 = "Select Map";
_level0.loc_water_racer_head6 = "Lazy River";
_level0.loc_water_racer_head7 = "Chimpoo's Stream";
_level0.loc_water_racer_head8 = "The Beach Coast";
_level0.loc_water_racer_head9 = "Banana Isle";
_level0.loc_water_racer_head10 = "LAP TIMING";
_level0.loc_water_racer_head11 = "LAPS";
_level0.loc_water_racer_head12 = "SPEED";
_level0.loc_water_racer_head13 = "You Lost.\nYou Have Earned";
_level0.loc_water_racer_head14 = "0 Coins";
_level0.loc_water_racer_head15 = "Spacebar";
_level0.loc_water_racer_head16 = "start";
_level0.loc_water_racer_head17 = "4th is bad. Try again.";
_level0.loc_water_racer_head18 = "You Have Earned";
_level0.loc_water_racer_head19 = "You Have Scored";
_level0.loc_water_racer_head20 = "50 Coins";
_level0.loc_water_racer_head21 = "You won this one !";
_level0.loc_water_racer_head22 = "You 're doing good";
_level0.loc_water_racer_head23 = "Keep trying";
_level0.loc_water_racer_head24 = "Fantastic Win!";
_level0.loc_water_racer_head25 = "You beat \u2018em! ";
break;
case "fr" :
_level0.loc_water_racer_btn1 = "Comment jouer";
_level0.loc_water_racer_btn2 = "Play Again";
_level0.loc_water_racer_btn3 = "Close";
_level0.loc_water_racer_head1 = "Comment jouer";
_level0.loc_water_racer_head2 = "Aide le Chimpoo \u00E0 gagner la course";
_level0.loc_water_racer_head3 = "Pour conduire";
_level0.loc_water_racer_head4 = "for Nitro/Boost";
_level0.loc_water_racer_head5 = "Selectionne la carte";
_level0.loc_water_racer_head6 = "Lazy River";
_level0.loc_water_racer_head7 = "Chimpoo's Stream";
_level0.loc_water_racer_head8 = "The Beach Coast";
_level0.loc_water_racer_head9 = "Banana Isle";
_level0.loc_water_racer_head10 = "LAP TIMING";
_level0.loc_water_racer_head11 = "LAPS";
_level0.loc_water_racer_head12 = "SPEED";
_level0.loc_water_racer_head13 = "You Lost.\nYou Have Earned";
_level0.loc_water_racer_head14 = "0 Coins";
_level0.loc_water_racer_head15 = "Spacebar";
_level0.loc_water_racer_head16 = "start";
_level0.loc_water_racer_head17 = "4th is bad. Try again.";
_level0.loc_water_racer_head18 = "You Have Earned";
_level0.loc_water_racer_head19 = "You Have Scored";
_level0.loc_water_racer_head20 = "50 Coins";
_level0.loc_water_racer_head21 = "You won this one !";
_level0.loc_water_racer_head22 = "You 're doing good";
_level0.loc_water_racer_head23 = "Keep trying";
_level0.loc_water_racer_head24 = "Fantastic Win!";
_level0.loc_water_racer_head25 = "You beat \u2018em! ";
break;
case "sp" :
_level0.loc_water_racer_btn1 = "Como jugar";
_level0.loc_water_racer_btn2 = "Play Again";
_level0.loc_water_racer_btn3 = "Close";
_level0.loc_water_racer_head1 = "Como jugar";
_level0.loc_water_racer_head2 = "Ayuda a Chimpoo a ganar la carrera";
_level0.loc_water_racer_head3 = "a conducir";
_level0.loc_water_racer_head4 = "Nitro/Boost";
_level0.loc_water_racer_head5 = "Elige el mapa";
_level0.loc_water_racer_head6 = "Lazy River";
_level0.loc_water_racer_head7 = "Chimpoo's Stream";
_level0.loc_water_racer_head8 = "The Beach Coast";
_level0.loc_water_racer_head9 = "Banana Isle";
_level0.loc_water_racer_head10 = "LAP TIMING";
_level0.loc_water_racer_head11 = "LAPS";
_level0.loc_water_racer_head12 = "SPEED";
_level0.loc_water_racer_head13 = "You Lost.\nYou Have Earned";
_level0.loc_water_racer_head14 = "0 Coins";
_level0.loc_water_racer_head15 = "Spacebar";
_level0.loc_water_racer_head16 = "start";
_level0.loc_water_racer_head17 = "4th is bad. Try again.";
_level0.loc_water_racer_head18 = "You Have Earned";
_level0.loc_water_racer_head19 = "You Have Scored";
_level0.loc_water_racer_head20 = "50 Coins";
_level0.loc_water_racer_head21 = "You won this one !";
_level0.loc_water_racer_head22 = "You 're doing good";
_level0.loc_water_racer_head23 = "Keep trying";
_level0.loc_water_racer_head24 = "Fantastic Win!";
_level0.loc_water_racer_head25 = "You beat \u2018em! ";
break;
default :
_level0.loc_water_racer_btn1 = "How2Play";
_level0.loc_water_racer_btn2 = "Play Again";
_level0.loc_water_racer_btn3 = "Close";
_level0.loc_water_racer_head1 = "How2Play";
_level0.loc_water_racer_head2 = "Help Chimpoo win the race";
_level0.loc_water_racer_head3 = " to drive";
_level0.loc_water_racer_head4 = "for Nitro/Boost";
_level0.loc_water_racer_head5 = "Select Map";
_level0.loc_water_racer_head6 = "Lazy River";
_level0.loc_water_racer_head7 = "Chimpoo's Stream";
_level0.loc_water_racer_head8 = "The Beach Coast";
_level0.loc_water_racer_head9 = "Banana Isle";
_level0.loc_water_racer_head10 = "LAP TIMING";
_level0.loc_water_racer_head11 = "LAPS";
_level0.loc_water_racer_head12 = "SPEED";
_level0.loc_water_racer_head13 = "You Lost.\nYou Have Earned";
_level0.loc_water_racer_head14 = "0 Coins";
_level0.loc_water_racer_head15 = "Spacebar";
_level0.loc_water_racer_head16 = "start";
_level0.loc_water_racer_head17 = "4th is bad. Try again.";
_level0.loc_water_racer_head18 = "You Have Earned";
_level0.loc_water_racer_head19 = "You Have Scored";
_level0.loc_water_racer_head20 = "50 Coins";
_level0.loc_water_racer_head21 = "You won this one !";
_level0.loc_water_racer_head22 = "You 're doing good";
_level0.loc_water_racer_head23 = "Keep trying";
_level0.loc_water_racer_head24 = "Fantastic Win!";
_level0.loc_water_racer_head25 = "You beat \u2018em! ";
}
function _shareScoreHandler(mc, scoreText) {
_root._alienShareScoreFB(scoreText);
}
function _homeShareScoreFB(scoreText) {
var _local1 = flash.external.ExternalInterface.available;
if (_local1) {
flash.external.ExternalInterface.call("g2wShareScore", scoreText);
} else {
getURL (("javascript:g2wShareScore('" + scoreText) + "')");
}
}
function _alienShareScoreFB() {
getURL (_root.obj_game.facebookURL, "_blank");
}
function _shareScoreFB(scoreText) {
var _local3 = new LocalConnection();
var _local2 = _root.fb_local_connection;
_local3.send(_local2, "callFBJS", "g2wShareScore", [scoreText]);
}
function _playAgainHandler(mc) {
Stage.scaleMode = "showAll";
_root.g2w_playagain(true);
}
function _showGameVideo() {
getURL ((("http://www.gangofgamers.com/videotutorial.html?url=" + _root.obj_game.videoID) + "&name=") + _root.obj_game._gameTitle, "_blank");
}
function _calculateScore(limits, score) {
var _local4 = false;
var _local1 = 0;
while (_local1 < (limits.length - 1)) {
if (score <= limits[_local1]) {
return(_local1);
}
_local1++;
}
return(limits.length - 1);
}
function _doGameOver(score, gamestate, showskip, delay) {
clearInterval(_gameoverinterval);
if (delay == undefined) {
delay = 3000;
}
if ((score != undefined) and (gamestate != undefined)) {
_root.partner_score = score;
_root.obj_game._gstatus = gamestate;
_gameoverinterval = setInterval(attachGameOverMc, delay, showskip);
}
}
function attachGameOverMc(showskip) {
stopAllSounds();
clearInterval(_gameoverinterval);
_root.__gameover_mc = _root.attachMovie("_g2w_gameover_mc", "mc_gameover", _root.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
_root.__gameover_mc.showSkip = showskip;
}
function _showAssetPanels(mc) {
if (mc.gameState == "gameover") {
_root._initGameOver(mc);
} else {
_root._initGameCompleted(mc);
}
}
function g2w_playagain(resetlevel) {
_root.__gameover_mc.removeMovieClip();
if (resetlevel) {
_root.game_mc.gameFeed_mc.gotoAndStop(1);
_root.game_mc.gotoAndStop("sel");
_root.gotoAndStop("lblgame");
} else {
_root.game_mc.gameFeed_mc.gotoAndStop(1);
_root.game_mc.timer_mc.gotoAndStop(timer_mc._totalframes);
_root.game_mc.play();
}
}
function g2w_skiplevel() {
_root.__gameover_mc.removeMovieClip();
_root.score = 0;
_root.gameFeed_mc.gotoAndStop(1);
game_mc.gameFeed_mc.gotoAndStop(1);
game_mc.nextLevel();
_root.game_mc.nextLevel();
}
var obj_game = new Array();
obj_game._host = "gog";
obj_game._gameName = "miami_speed_boat";
obj_game._gameTitle = "Miami Speed Boat";
obj_game._g2wGameId = "10049";
obj_game._partnerGameId = "miami_speed_boat";
obj_game._gstatus = "gameover";
obj_game._googleText = "Miami Speed Boat";
obj_game._gameStageW = 650;
obj_game._gameStageH = 530;
obj_game._gameScoreOrder = "desc";
obj_game._gameResolution = (Stage.width + "x") + Stage.height;
obj_game.g2wBot = "";
obj_game.g2wBotId = 10301;
obj_game.videoID = "IQgIhpl8Co4";
obj_game.facebookURL = "http://apps.facebook.com/gangofgamers-games/playpage.php?game=10049";
obj_game.FBShareurl = ("http://www.facebook.com/sharer.php?u=http://apps.facebook.com/gangofgamers-games/play/" + obj_game._g2wGameId) + "";
obj_game.gameoverthumb = "http://www.gangofgamers.com/?utm_source=gog_wrapper&utm_medium=post_rolls&utm_content=miami_speed_boat&utm_campaign=gog_wrapper";
obj_game.gameoverstrip = "http://www.gangofgamers.com/?utm_source=gog_strip&utm_medium=post_rolls&utm_content=miami_speed_boat&utm_campaign=gog_strip";
obj_game.inviziads = (((("http://s1.inviziads.com/lookup.html?g=" + obj_game._g2wGameId) + "&h=") + obj_game._host) + "&l=") + obj_game._gameLanguage;
obj_game.FBMsg = "is racing on the waters of Miami in GangOfGamers\u2019 Miami Speed Boat.Crank up your speed. Play the game.";
var obj_partner = new Array();
obj_partner.partner_name = "gog";
obj_partner.partner_id = 1;
obj_partner.invalid_txt = "Invalid Nickname!";
obj_partner.show_submit = false;
obj_partner.submitURL = "http://www.gangofgamers.com/submit_score.asp";
obj_partner.top10URL = "http://www.gangofgamers.com//get_top_scorer.asp";
obj_partner.lblsubmit = "Enter your GangofGamers Nickname below";
obj_partner.show_g2w_slate = true;
obj_partner.show_register = true;
obj_partner.text_register = "Create Nickname";
obj_partner.url_register = "http://www.gangofgamers.com//register.asp";
obj_partner.clickthru = "http://www.gangofgamers.com/";
obj_partner._allowclick = true;
_initAssetsPanel = function (mcpath) {
Stage.scaleMode = "noScale";
Stage.align = "";
var _local2 = mcpath;
_local2.onEnterFrame = function () {
Stage.scaleMode = "noScale";
Stage.align = "";
};
_local2.overlay_btn.useHandCursor = false;
_local2.gameState = _root.obj_game._gstatus;
};
_initGameOver = function (mcpath) {
var _local2 = mcpath;
if (!_root.checkhost()) {
_local2.gotoAndStop("g2w_spil_gameover");
} else {
_local2.gotoAndStop("g2w_gameover");
}
if (_local2.showSkip) {
_local2.g2w_skipPanel.gotoAndStop("skip");
_local2.g2w_skipPanel.btn_nextLevel.onRelease = function () {
Stage.scaleMode = "showAll";
_root.g2w_skiplevel();
};
}
_local2.g2w_skipPanel.btn_playAgain.onRelease = function () {
Stage.scaleMode = "showAll";
_root.g2w_playagain();
};
};
_initGameCompleted = function (mcpath) {
var _local2 = mcpath;
if (!_root.checkhost()) {
_local2.gotoAndStop("g2w_spil_gamecompleted");
} else {
_local2.gotoAndStop("g2w_gamecompleted");
}
};
var g2w_menu = new ContextMenu();
g2w_menu.hideBuiltInItems();
this.menu = g2w_menu;
checkhost = function () {
swfurl = this._url;
if ((swfurl.indexOf("games2win.com") == -1) && (swfurl.indexOf("gangofgamers.com") == -1)) {
return(false);
}
return(true);
};
_trackClickThru = function (mc) {
if (obj_partner._allowclick) {
mc.hit_area.onRelease = function () {
getURL (obj_partner.clickthru, "_blank");
};
} else {
mc.hit_area.useHandCursor = false;
}
};
String.prototype.trim = function () {
var _local3 = 0;
var _local2 = this.length;
white = new Object();
white._32 = 1;
_local2--;
while (white["_" + ord(this.charAt(_local2))]) {
}
while (white["_" + ord(this.charAt(_local3++))]) {
}
return(this.slice(_local3 - 1, _local2 + 1));
};
Array.prototype.copy = function () {
var _local3 = new Array();
if (this.length == 0) {
for (var _local2 in this) {
_local3[_local2] = this[_local2];
}
}
var _local2 = 0;
while (_local2 < this.length) {
_local3[_local2] = this[_local2];
_local2++;
}
return(_local3);
};
ASSetPropFlags(Array.prototype, "copy", 7);
Button.prototype.tabEnabled = false;
Frame 9
Frame 10
stop();
Instance of Symbol 13 MovieClip in Frame 10
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int((loaded / total) * 100);
load_txt.text = ("Loaded " + percent) + "%";
gotoAndStop(percent);
if (loaded == total) {
_parent.play();
}
}
Frame 18
stop();
Symbol 566 MovieClip Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
getURL (_global.obj_iads.link, "_blank");
};
}
break;
case "NOOP" :
clearInterval(tint1);
Stage.scaleMode = "showAll";
_root.play();
break;
}
}
function get_iads() {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
if (success) {
parse_iads(lv_result);
} else {
Stage.scaleMode = "showAll";
_root.play();
}
};
lv_iads.sendAndLoad(adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function time_delay() {
var _local1 = 0;
tint1 = setInterval(timespam, 1000);
}
function timespam() {
tim++;
trace(((tim + " tim Tim") + " show_time") + show_time);
if (isNaN(tim)) {
clearInterval(tint1);
Stage.scaleMode = "showAll";
trace(Stage.scaleMode);
} else if (tim == show_time) {
clearInterval(tint1);
Stage.scaleMode = "showAll";
_root.play();
trace(Stage.scaleMode);
}
}
function create_assets(mc, _type) {
mc.createEmptyMovieClip("whitebg", 0);
whitebg.beginFill(16750848);
whitebg.moveTo(0, 0);
whitebg.lineTo(0, 0);
whitebg.lineTo(stageWidth, 0);
whitebg.lineTo(stageWidth, stageHeight + 20);
whitebg.lineTo(0, stageHeight + 20);
whitebg.endFill();
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local3 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local2 = new TextFormat();
_local2.align = "right";
_local2.font = "Verdana";
_local2.size = 10;
_local2.underline = true;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("m_txt", mc.getNextHighestDepth(), 0, 0, 120, 22);
b_txt.autoSize = true;
m_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
m_txt.selectable = false;
m_txt.html = true;
b_txt.multiline = true;
b_txt.setNewTextFormat(format);
h_txt.autoSize = true;
h_txt.setNewTextFormat(format);
m_txt.setNewTextFormat(_local2);
h_txt.text = "";
mc.createEmptyMovieClip("progressBar", 500);
}
}
function onLoadInit(mc) {
time_delay();
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
h_txt.text = "Advertisement";
loadMessages();
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start = function () {
game_fps = getFps();
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.start();
progressBar.onEnterFrame = function () {
this.start();
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
b_txt.text = b_txt.text + "\nNote : Clicking on the above Ad won't interrupt your game. Ad link opens in a new window.";
myself._y = b_txt._y - 10;
x = (stageWidth / 2) - (ad_width / 2);
y = (stageHeight / 2) - (ad_height / 2);
mc._x = x;
mc._y = y;
h_txt._x = (x + (ad_width / 2)) - (h_txt._width / 2);
h_txt._y = y - 20;
progressBar._x = (x + (ad_width / 2)) - (progressBar._width / 2);
progressBar._y = (y + 5) + ad_height;
myself.invizi_logo._alpha = 100;
myself.invizi_logo.swapDepths(myself.getNextHighestDepth());
myself.invizi_logo._x = int(progressBar._x);
myself.invizi_logo._y = int(progressBar._y + progressBar._height) + 5;
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 3;
myself.invizi_logo.onRelease = function () {
getURL ("http://www.inviziads.com/index.html?utm_source=4_1&utm_medium=logo&utm_content=default&utm_campaign=invizi", "_blank");
};
b_txt._x = (x + (ad_width / 2)) - (b_txt._width / 2);
b_txt._y = progressBar._y + 38;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
}
function loadMessages() {
lv_messages = new XML();
lv_messages.ignoreWhite = true;
lv_messages.onLoad = function (success) {
if (success) {
totalNodes = lv_messages.firstChild.childNodes.length;
ran = Math.floor(Math.random() * totalNodes);
if (lv_messages.firstChild.childNodes[ran].firstChild == undefined) {
m_txt.htmlText = "<font color='#0066CC'><a href='http://www.inviziads.com/adv-starter-pack.html' target='_blank'>Advertisers, try us out for US$250</a></font>";
} else {
m_txt.htmlText = ((("<font color='#0066CC'><a href='" + lv_messages.firstChild.childNodes[ran].attributes.link) + "' target='_blank'>") + lv_messages.firstChild.childNodes[ran].firstChild) + "</a></font>";
}
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 2;
} else {
m_txt.htmlText = "<font color='#0066CC'><a href='http://inviziads.com' target='_blank'>Advertisers, try us out for US$250</a></font>";
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 2;
}
};
lv_messages.load(messageURL);
}
function pushdata() {
holder.obj_iads = _global.obj_iads;
}
function startdatapush(mc) {
var _local2;
_local2 = setInterval(this, "pushdata", 10);
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
myself.createEmptyMovieClip("holder", 100);
var _local5 = _global.obj_iads.url;
obj_iads = _global.obj_iads;
var _local3 = new Object();
_local3.onLoadComplete = function (target_mc) {
};
var _local4 = new MovieClipLoader();
_local4.addListener(_local3);
_local4.loadClip(_global.obj_iads.url, holder);
} else {
brain();
}
clearInterval(this._parent._parent.int1);
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
function measureComScore() {
var _local1 = new LoadVars();
var _local2 = new LoadVars();
_local1.C1 = 7;
_local1.C2 = 5799339 /* 0x587DAB */;
_local1.C3 = 1;
var _local3 = "http://beacon.scorecardresearch.com/scripts/beacon.dll";
_local1.sendAndLoad(_local3, _local2, "GET");
_local2.onLoad = function (ok) {
if (ok) {
trace("Comscore Success");
} else {
trace("Comscore failed");
}
};
}
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
var time = 0;
var tim = 0;
var show_time = 0;
var tempo = 0;
var tint1;
var stageWidth = 0;
var stageHeight = 0;
var format = new TextFormat();
format.align = "center";
format.font = "Verdana";
format.size = 11;
getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps != 0) && (game_fps != undefined)) {
if (Stage.width > 0) {
stageWidth = Stage.width;
stageHeight = Stage.height;
get_iads();
this.onEnterFrame = null;
}
}
};
myself = this;
signal = true;
var purl = flash.external.ExternalInterface.call("document.URL.toString");
var hurl = escape(_root._url);
var adurl = "http://s1.inviziads.com/lookup.html?";
adurl = adurl + ("g=" + _parent._parent.gameid);
adurl = adurl + "&h=chmp";
adurl = adurl + "&type=pre";
adurl = adurl + "&v=4_52";
adurl = adurl + ("&purl=" + escape(purl));
adurl = adurl + ("&hurl=" + hurl);
adurl = adurl + "&l=en";
adurl = adurl + ("&member=" + _parent._parent.member);
var my_date = new Date();
adurl = adurl + ("&ts=" + my_date.getSeconds());
var messageURL = "http://s1.inviziads.com/template/invizi_messages.xml";
stop();
Stage.scaleMode = "noScale";
Stage.align = "TL";
if ((purl.indexOf(".chimpoo.com") == -1) && (hurl.indexOf(".chimpoo.com") == -1)) {
measureComScore();
}
trace("ADURL : " + adurl);
_level0.hideBlocker();
_root.stop();
Symbol 5 MovieClip [_g2w_gameover_mc] Frame 1
_root._initAssetsPanel(this);
_root._showAssetPanels(this);
Symbol 5 MovieClip [_g2w_gameover_mc] Frame 2
stop();
btn_shareScore.onRelease = function () {
_root._shareScoreHandler(this, _root.obj_game.FBMsg);
};
btn_videoTutorial.onRelease = function () {
_root._showGameVideo();
};
mc_fbshare.onRelease = function () {
getURL (_root.obj_game.FBShareurl, "_blank");
};
Symbol 5 MovieClip [_g2w_gameover_mc] Frame 3
stop();
btn_shareScore.onRelease = function () {
_root._shareScoreHandler(this, _root.obj_game.FBMsg);
};
btn_videoTutorial.onRelease = function () {
_root._showGameVideo();
};
mc_fbshare.onRelease = function () {
getURL (_root.obj_game.FBShareurl, "_blank");
};
Symbol 5 MovieClip [_g2w_gameover_mc] Frame 4
stop();
btn_shareScore.onRelease = function () {
_root._shareScoreHandler(this, _root.obj_game.FBMsg);
};
btn_videoTutorial.onRelease = function () {
_root._showGameVideo();
};
btn_playAgain.onRelease = function () {
_root._playAgainHandler(this);
};
mc_fbshare.onRelease = function () {
getURL (_root.obj_game.FBShareurl, "_blank");
};
Symbol 5 MovieClip [_g2w_gameover_mc] Frame 5
stop();
btn_shareScore.onRelease = function () {
_root._shareScoreHandler(this, _root.obj_game.FBMsg);
};
btn_videoTutorial.onRelease = function () {
_root._showGameVideo();
};
btn_playAgain.onRelease = function () {
_root._playAgainHandler(this);
};
mc_fbshare.onRelease = function () {
getURL (_root.obj_game.FBShareurl, "_blank");
};
Symbol 55 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 1
stop();
gotoAndStop(_root.boatVal);
Symbol 67 MovieClip Frame 2
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 1
stop();
var timerScore = ((600 - _parent._parent.lapTimerVal) * 10);
score_txt.text = timerScore + " Points";
Symbol 130 MovieClip Frame 2
var timerScore = ((600 - _parent._parent.lapTimerVal) * 10);
score_txt.text = timerScore + " Points";
Symbol 130 MovieClip Frame 3
var timerScore = ((600 - _parent._parent.lapTimerVal) * 10);
score_txt.text = timerScore + " Points";
Symbol 134 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 2
var timerScore = ((600 - _parent.lapTimerVal) * 10);
lastScreen.score_txt.text = timerScore + " Points";
_parent.closebutton._visible = false;
_level0.submitGameScore(50, true, _root.game_id, timerScore);
this._parent.gotoAndStop(this._parent._currentframe - 1);
lastScreen.playa_mc.continueBtn.onPress = function () {
this._parent.closebutton._visible = true;
this._parent._parent._parent._parent.playAgain();
gotoAndStop (1);
};
nextl_mc.onPress = function () {
this._parent._parent.nextLevel();
gotoAndStop (1);
};
lastScreen.close_mc.continueBtn.onPress = function () {
this._parent.closebutton._visible = true;
_level0.hideGame(_root.score * _root.ratio, true, _root.game_id);
};
Symbol 134 MovieClip Frame 3
function init() {
var ar = new Array();
if (this._parent.currentposition == 0) {
ar = firstAr;
_level0.submitGameScore(200, true, _root.game_id, timerScore);
level_mc.gotoAndStop(1);
}
if (this._parent.currentposition == 1) {
ar = secondAr;
_level0.submitGameScore(150, true, _root.game_id, timerScore);
level_mc.gotoAndStop(2);
}
if (this._parent.currentposition == 2) {
ar = thirdAr;
_level0.submitGameScore(100, true, _root.game_id, timerScore);
level_mc.gotoAndStop(3);
}
var i = 1;
while (i <= 3) {
eval (("clip" + i) + "_mc").gotoAndStop(ar[i - 1]);
eval (("clip" + i) + "_mc").score_txt.text = "";
eval (("clip" + i) + "_mc").clip_mc._visible = false;
i++;
}
}
var timerScore = ((600 - _parent.lapTimerVal) * 10);
this._parent.gotoAndStop("stopVal");
var firstAr = new Array(1, 2, 3);
var secondAr = new Array(2, 1, 3);
var thirdAr = new Array(2, 3, 1);
_parent.closebutton._visible = false;
init();
score_txt.text = "Score : " + this._parent.score;
playa_mc.continueBtn.onPress = function () {
this._parent.closebutton._visible = true;
this._parent._parent._parent.playAgain();
gotoAndStop (1);
};
nextl_mc.onPress = function () {
this._parent._parent.nextLevel();
gotoAndStop (1);
};
close_mc.continueBtn.onPress = function () {
this._parent.closebutton._visible = true;
_level0.hideGame(_root.score * _root.ratio, true, _root.game_id);
};
Symbol 134 MovieClip Frame 4
function init() {
var ar = new Array();
if (this._parent.currentposition == 0) {
ar = firstAr;
}
if (this._parent.currentposition == 1) {
ar = secondAr;
}
if (this._parent.currentposition == 2) {
ar = thirdAr;
}
var i = 1;
while (i <= 3) {
eval (("clip" + i) + "_mc").gotoAndStop(ar[i - 1]);
eval (("clip" + i) + "_mc").score_txt.text = "";
eval (("clip" + i) + "_mc").clip_mc._visible = false;
i++;
}
}
_root._doGameOver(0, "gamecompleted", false, 3000);
var firstAr = new Array(1, 2, 3);
var secondAr = new Array(2, 1, 3);
var thirdAr = new Array(2, 3, 1);
init();
score_txt.text = "Score : " + this._parent.score;
playa_mc.onPress = function () {
this._parent._parent.playAgain();
gotoAndStop (1);
};
nextl_mc.onPress = function () {
this._parent._parent.nextLevel();
gotoAndStop (1);
};
playa_mc.onPress = function () {
this._parent._parent.gotoAndPlay(1);
gotoAndStop (1);
};
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 2
stop();
Symbol 220 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 2
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 2
stop();
Symbol 231 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 2
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 2
stop();
Symbol 253 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 2
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 2
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 2
stop();
Symbol 266 Button
on (press) {
prevFrame();
}
Symbol 268 Button
on (press) {
nextFrame();
}
Symbol 269 MovieClip Frame 1
tempVal = true;
gotoAndStop (2);
Symbol 269 MovieClip Frame 2
function init(checkCon) {
glow_mc._x = 1000;
var ar = new Array();
var lapTiming = new Array();
if ((this._parent.my_so.data.ar == undefined) || (this._parent.my_so.data.lapTiming == undefined)) {
this._parent.my_so.data.ar = new Array();
this._parent.my_so.data.lapTiming = new Array();
} else {
this._parent.my_so.data.ar[0] = true;
this._parent.my_so.flush();
ar = this._parent.my_so.data.ar;
if (checkCon) {
if (ar[5] != undefined) {
}
}
lapTiming = this._parent.my_so.data.lapTiming;
}
var i = 1;
while (i <= 4) {
var mc = eval (("clip" + i) + "_mc");
mc.b = false;
mc.id = i;
mc.gotoAndStop(2);
if (this._parent.my_so.data.lapTiming[i] != undefined) {
eval (("score" + i) + "_txt").text = this._parent.my_so.data.lapTiming[i];
eval (("score" + i) + "_txt")._visible = false;
} else {
eval (("score" + i) + "_txt").text = "";
if (ar[i] != undefined) {
}
}
eval (("clip" + i) + "_mc").b = ar[i];
clip1_mc.b = true;
eval (("clip" + i) + "_mc").b = true;
mc.onPress = function () {
_parent.currentLevel = this.id;
if (this.b) {
this._parent._parent.gotoAndStop("level" + this.id);
}
};
mc.onEnterFrame = function () {
if (this.b) {
this.gotoAndStop(2);
}
};
i++;
}
}
stop();
if (tempVal) {
tempVal = false;
init(true);
} else {
init();
}
Symbol 269 MovieClip Frame 3
init();
Symbol 333 MovieClip Frame 1
gotoAndPlay(random(20) + 1);
Symbol 333 MovieClip Frame 22
gotoAndPlay (2);
Symbol 348 MovieClip Frame 1
gotoAndPlay(random(30) + 1);
Symbol 348 MovieClip Frame 32
gotoAndPlay (2);
Symbol 352 MovieClip Frame 1
gotoAndPlay(random(25) + 1);
Symbol 352 MovieClip Frame 26
gotoAndPlay (2);
Symbol 356 MovieClip Frame 1
gotoAndPlay(random(40) + 1);
Symbol 356 MovieClip Frame 42
gotoAndPlay (2);
Symbol 378 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 383 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 397 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 398 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 1
Symbol 404 MovieClip Frame 1
boat_mc.gotoAndStop(_root.boatVal);
Symbol 409 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 415 MovieClip Frame 1
stop();
Symbol 415 MovieClip Frame 2
this.onEnterFrame = function () {
t_txt.text = this._text;
};
Symbol 415 MovieClip Frame 52
gotoAndStop (1);
Symbol 420 MovieClip Frame 1
this.onEnterFrame = function () {
t_txt.text = "Level " + this._parent.text;
if (_parent._parent.currentLevel == 1) {
levelName_txt.t_txt.text = "Lazy River";
} else if (_parent._parent.currentLevel == 2) {
levelName_txt.t_txt.text = "Chimpoo's Stream";
} else if (_parent._parent.currentLevel == 3) {
levelName_txt.t_txt.text = "The Beach Coast";
} else if (_parent._parent.currentLevel == 4) {
levelName_txt.t_txt.text = "Banana Isle";
}
};
Symbol 435 MovieClip Frame 2
level_mc.t_txt.text = this.text;
if (_parent.currentLevel == 0) {
} else if (_parent.currentLevel == 1) {
} else if (_parent.currentLevel == 2) {
}
Symbol 435 MovieClip Frame 111
this.b = true;
gotoAndStop (1);
Symbol 459 MovieClip Frame 1
stop();
Symbol 460 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 464 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 465 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 468 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 487 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 488 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 493 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 497 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 499 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 500 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 501 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 504 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 511 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 512 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 517 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 521 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 523 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 524 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 525 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 528 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 535 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 536 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 541 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 544 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 549 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 550 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 551 MovieClip Frame 1
if (this.lap == undefined) {
this.lap = 0;
} else {
this.lap++;
this._parent._parent.pushBoat(this);
if (this.lap >= this._parent._parent.maxLap) {
this.stop();
this._parent._parent.positionAr.push(this);
this.stop();
}
}
Symbol 554 MovieClip Frame 1
clip_mc.onEnterFrame = function () {
this._x = this._parent.dx;
this._y = this._parent.dy;
clip1_mc._x = this._parent.d1x;
clip1_mc._y = this._parent.d1y;
clip2_mc._x = this._parent.d2x;
clip2_mc._y = this._parent.d2y;
clip3_mc._x = this._parent.d3x;
clip3_mc._y = this._parent.d3y;
};
Symbol 559 MovieClip Frame 1
function setLevelObjects(level) {
lapTimerVal = 0;
nitroLeft = true;
positionAr = new Array();
tempArray = new Array();
tempArray1 = new Array();
tempArray2 = new Array();
tempArray3 = new Array();
lapTiming = 120;
levelDone = false;
this.play1 = false;
lastLevel = false;
lap = 0;
checkPointsVal = 0;
nitro_mc.b = true;
nitro_mc.val = 0;
currentposition = 0;
damage_mc.gotoAndStop("0c");
timer_mc.gotoAndStop(timer_mc._totalframes);
aHitPoints = new Array();
aBoats = new Array();
aBeaches = new Array();
aObstacles = new Array();
amcBeach_hit = new Array();
oWind = new Object();
oWind.strength = 5;
oWind.direction = 20;
damage = 0;
timerintervar = 100;
ship_mc = level.ship_mc;
ship_mc.nitro_mc._visible = false;
mcObstacles = level.mcObstacles;
mcBeach = level.mcBeach;
mcBoats = level.mcBoats;
mcTrails = level.mcTrails;
jump_mc = level.jump_mc;
mcBeach_hit = level.mcBeach_hit;
check_mc = level.check_mc;
setHitPointsArray();
setObstaclesArray();
setmcBeach_hit();
setBeachesArray();
setBoatsArray();
checkPoints();
acceleration = 0;
speedX = 10;
speedY = 10;
maxFrwdSpeed = 5;
maxRearSpeed = -2;
maxFrwdAcc = 10;
maxRearAcc = -5;
waterDrag = 0.95;
linSpeed = 0;
speedX = 0;
speedY = 0;
rotSpeed = 0;
maxRotSpeed = 1;
rotAcceleration = 0;
rudder = 0;
position.x = ship_mc._x;
position.y = ship_mc._y;
rotation = ship_mc._rotation;
initGame(level);
levelNo = level._name.substr(5, 1);
if (parseInt(levelNo) == 8) {
lastLevel = true;
}
level_mc = level;
}
function setHitPointsArray(Void) {
for (var _local1 in ship_mc.mcHitPoints) {
aHitPoints.push(ship_mc.mcHitPoints[_local1]);
}
}
function setmcBeach_hit(Void) {
for (var _local1 in mcBeach_hit) {
amcBeach_hit.push(mcBeach_hit[_local1]);
}
}
function setObstaclesArray(Void) {
for (var _local1 in mcObstacles) {
aObstacles.push(mcObstacles[_local1]);
}
}
function setBeachesArray(Void) {
for (var _local1 in mcBeach) {
aBeaches.push(mcBeach[_local1]);
}
}
function setBoatsArray(Void) {
for (var _local1 in mcBoats) {
aBoats.push(mcBoats[_local1]);
}
}
function GameStart() {
wDir_mc.dir_mc._rotation = oWind.direction + 180;
wDir_mc.dir_mc.gotoAndStop(oWind.strength);
if (!levelDone) {
checkKeys();
}
var _local2 = checkCollision(aObstacles);
if (_local2.bHit) {
getDamage();
setPrevPos();
reactOnObstacle(_local2.mcHP, _local2.bFrontSide);
}
var _local3 = checkCollision(amcBeach_hit);
if (_local3.bHit) {
getDamage();
setPrevPos();
reactOnObstacle(_local3.mcHP, _local3.bFrontSide);
}
var _local4 = checkCollision(aBeaches);
if (_local4.bHit) {
onBeach = true;
reactOnBeach(_local4.mcHP, _local4.bFrontSide);
} else {
onBeach = false;
}
var _local1 = checkCollision(aBoats);
if (_local1.bHit) {
getDamage();
rootVar = Math.sqrt((speedX * speedX) + (speedY * speedY));
var _local5 = new Object({x:_local1.mcHP._x, y:_local1.mcHP._y});
ship_mc.mcHitPoints.localToGlobal(_local5);
sinkBoat(_local1.mcObject, _local5, rootVar);
removeFromArray(aBoats, _local1.mcObject);
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
slowDown();
}
saveCurrentPos();
moveBoat();
}
function makeTrails(Void) {
var _local17 = 1 + Math.round(10 * (1 - (Math.abs(linSpeed) / 20)));
if ((trailStep++) < _local17) {
return(undefined);
}
trailStep = 0;
var _local4;
var _local7;
var _local2;
var _local6;
var _local5;
var _local18;
var _local19;
var _local16 = new Array(ship_mc.mcHitPoints.mcLF, ship_mc.mcHitPoints.mcLB, ship_mc.mcHitPoints.mcRF, ship_mc.mcHitPoints.mcRB);
var _local1 = 0;
while (_local1 < 4) {
_local6 = _local16[_local1];
_local4 = mcTrails.getNextHighestDepth();
_local7 = "foam " + _local4;
_local2 = new Object({x:_local6._x, y:_local6._y});
ship_mc.mcHitPoints.localToGlobal(_local2);
mcTrails.globalToLocal(_local2);
var _local3 = ((linSpeed < 0) ? -4 : 4);
if (_local1 < 2) {
_local5 = (rotation + 180) - (_local3 * (20 - Math.abs(linSpeed)));
} else {
_local5 = rotation + (_local3 * (20 - Math.abs(linSpeed)));
}
speedBoatVal = (100 * Math.abs(linSpeed)) / 20;
randomVal5 = 80 + (20 * Math.random());
mcTrails.attachMovie("foam", _local7, _local4, {_x:_local2.x, _y:_local2.y, _rotation:_local5, _alpha:speedBoatVal, _xscale:randomVal5, _yscale:randomVal5});
_local1++;
}
}
function moveBoat(bWithoutWind) {
ship_mc.tail._rotation = rudder * 4;
wheel_mc._rotation = -(rudder * 4);
linSpeed = linSpeed + acceleration;
gare_mc.clip_mc = linSpeed;
if (Math.abs(linSpeed) < 1) {
val = 0;
} else {
var val = Math.floor(linSpeed);
}
speed_txt.text = Math.abs(val);
linSpeed = linSpeed * waterDrag;
rotSpeed = rotSpeed + rotAcceleration;
rotSpeed = rotSpeed * waterDrag;
if (rotSpeed > maxRotSpeed) {
rotSpeed = maxRotSpeed;
} else if (rotSpeed < (-maxRotSpeed)) {
rotSpeed = -maxRotSpeed;
}
rotation = rotation + (rotSpeed - (linSpeed * (rudder * 0.005)));
var _local5 = 0.02;
if (acceleration != 0) {
speedX = speedX + (_local5 * (Math.sin((rotation * Math.PI) / 180) * (linSpeed / 4)));
speedY = speedY + (_local5 * (Math.cos((rotation * Math.PI) / 180) * (linSpeed / 4)));
}
var _local3 = new Object();
_local3.x = Math.cos((rotation * Math.PI) / 180);
_local3.y = -Math.sin((rotation * Math.PI) / 180);
var _local2 = new Object();
var _local4 = Math.sqrt((speedX * speedX) + (speedY * speedY));
if (_local4 == 0) {
_local2.x = 0;
_local2.y = 0;
} else {
_local2.x = speedX / _local4;
_local2.y = speedY / _local4;
}
var _local6 = Math.abs((_local3.x * _local2.x) + (_local3.y * _local2.y));
var _local7 = 0.05;
speedX = speedX * (waterDrag - (_local6 * _local7));
speedY = speedY * (waterDrag - (_local6 * _local7));
mcTmp._rotation = oWind.direction;
var _local1 = new Object();
_local1.x = speedX * 1000;
_local1.y = speedY * 1000;
mcTmp.localToGlobal(_local1);
_local1.x = _local1.x / 1000;
_local1.y = _local1.y / 1000;
if ((_local1.y < (oWind.strength * 0.03)) && (!onBeach)) {
if (!bWithoutWind) {
speedX = speedX + ((0.001 * oWind.strength) * Math.sin((oWind.direction * Math.PI) / 180));
speedY = speedY + ((0.001 * oWind.strength) * Math.cos((oWind.direction * Math.PI) / 180));
} else {
speedX = speedX - ((0.002 * oWind.strength) * Math.sin((oWind.direction * Math.PI) / 180));
speedY = speedY - ((0.002 * oWind.strength) * Math.cos((oWind.direction * Math.PI) / 180));
}
}
position.x = position.x + speedX;
position.y = position.y - speedY;
ship_mc._x = position.x;
ship_mc._y = position.y;
minimap_mc.dx = position.x;
minimap_mc.dy = position.y;
minimap_mc.d1x = level_mc.ship1_mc.clip_mc._x;
minimap_mc.d1y = level_mc.ship1_mc.clip_mc._y;
minimap_mc.d2x = level_mc.ship2_mc.clip_mc._x;
minimap_mc.d2y = level_mc.ship2_mc.clip_mc._y;
minimap_mc.d3x = level_mc.ship3_mc.clip_mc._x;
minimap_mc.d3y = level_mc.ship3_mc.clip_mc._y;
level_mc._y = (-position.y) + (Stage.height / 2);
level_mc._x = (-position.x) + (Stage.width / 2);
ship_mc._rotation = rotation;
if (Math.abs(speedY) <= 0.01) {
speedY = 0;
}
}
function nitro() {
this.gotoAndStop(this.val);
if (this.val > 30) {
nitroLeft = false;
this.b = false;
}
}
function checkKeys(Void) {
if (!jumpB) {
acceleration = 0;
rotAcceleration = 0;
}
ship_mc.nitro_mc._visible = false;
rudder = rudder * 0.8;
if (Key.isDown(38)) {
acceleration = maxFrwdAcc;
}
if (Key.isDown(40)) {
acceleration = maxRearAcc;
}
if (Key.isDown(37)) {
if (rudder < 15) {
rudder = rudder + 1.9;
}
}
if (Key.isDown(39)) {
if (rudder > -15) {
rudder = rudder - 1.9;
}
}
if (Key.isDown(32)) {
if (nitro_mc.b) {
ship_mc.nitro_mc._visible = true;
nitro_mc.val++;
acceleration = 20;
}
}
}
function checkBorders(Void) {
if (position.x < 80) {
slowDown();
position.x = 81;
} else if (position.x > 650) {
slowDown();
position.x = 649;
}
if (position.y < 80) {
slowDown();
position.y = 81;
} else if (position.y > 450) {
slowDown();
position.y = 449;
}
ship_mc._x = position.x;
ship_mc._y = position.y;
}
function slowDown(Void) {
var _local1 = 0.05;
speedX = speedX - (speedX * _local1);
speedY = speedY - (speedY * _local1);
linSpeed = linSpeed - (linSpeed * _local1);
}
function saveCurrentPos(Void) {
stack = new Object();
stack.posX = position.x;
stack.posY = position.y;
stack.linSpeed = linSpeed;
stack.speedX = speedX;
stack.speedY = speedY;
stack.rotation = rotation;
stack.rotSpeed = rotSpeed;
stack.rudder = rudder;
}
function setPrevPos(Void) {
position.x = stack.posX;
position.y = stack.posY;
linSpeed = stack.linSpeed;
speedX = stack.speedX;
speedY = stack.speedY;
rotation = stack.rotation;
rotSpeed = stack.rotSpeed;
}
function reactOnBeach(mcHP, bFrontSide) {
if ((bFrontSide && (linSpeed > 0)) || ((!bFrontSide) && (linSpeed < 0))) {
var _local1 = 0.1;
speedX = speedX - (speedX * _local1);
speedY = speedY - (speedY * _local1);
linSpeed = linSpeed - (linSpeed * _local1);
if (Math.abs(linSpeed) < 0.1) {
linSpeed = 0;
}
}
}
function checkCollision(aObjects, bHasHitArea) {
var _local5;
var _local6;
var _local14 = aObjects.length;
var _local7 = 0;
while (_local7 < _local14) {
_local5 = aObjects[_local7];
if (bHasHitArea) {
_local6 = _local5.mcHitArea;
} else {
_local6 = _local5;
}
if (ship_mc.hitTest(_local6)) {
var _local1;
var _local3;
var _local9 = aHitPoints.length;
var _local2 = 0;
while (_local2 < _local9) {
_local1 = aHitPoints[_local2];
_local3 = {x:_local1._x, y:_local1._y};
ship_mc.mcHitPoints.localToGlobal(_local3);
if (_local6.hitTest(_local3.x, _local3.y, true)) {
var _local4;
if (_local1._y < 0) {
_local4 = true;
} else {
_local4 = false;
}
return(new Object({bHit:true, mcObject:_local5, mcHP:_local1, bFrontSide:_local4}));
}
_local2++;
}
}
_local7++;
}
return(new Object({bHit:false}));
}
function reactOnObstacle(mcHP, bFrontSide) {
var _local7 = 300;
var _local9 = 37;
var _local2 = mcHP._x / _local9;
var _local1 = (-mcHP._y) / _local7;
var _local8 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
var _local3 = _local1 / _local8;
speedX = speedX * ((-_local2) * 0.3);
speedY = speedY * ((-Math.abs(_local1)) * 0.3);
var _local11 = 0.1 + (10 * Math.sqrt((speedX * speedX) + (speedY * speedY)));
if (Math.abs(_local1) > 0) {
var _local6 = (((_local2 * _local1) > 0) ? -1 : 1);
if ((_local2 * _local1) != 0) {
rotSpeed = (_local11 * (1 - Math.abs(_local1))) * _local6;
if (rotSpeed > 1.5) {
rotSpeed = 1.5;
} else if (rotSpeed < -1.5) {
rotSpeed = -1.5;
}
} else {
rotSpeed = 0;
}
}
var _local5;
var _local4;
if (Math.abs(_local2) > 0.7) {
_local5 = (0.4 * ((_local2 > 0) ? -1 : 1)) * Math.cos((rotation * Math.PI) / 180);
_local4 = (0.4 * ((_local2 > 0) ? 1 : -1)) * Math.sin((rotation * Math.PI) / 180);
} else {
_local5 = (-0.1 * _local3) * Math.sin((rotation * Math.PI) / 180);
_local4 = (-0.1 * _local3) * Math.cos((rotation * Math.PI) / 180);
}
speedX = speedX + _local5;
speedY = speedY + _local4;
linSpeed = 0;
acceleration = 0;
rotAcceleration = 0;
var _local10 = true;
moveBoat(_local10);
}
function removeFromArray(array, item) {
var _local1 = 0;
while (_local1 < array.length) {
if (array[_local1] == item) {
array.splice(_local1, 1);
break;
}
_local1++;
}
}
function sinkBoat(mcBoatRef, point, speed) {
var alpha = 100;
var rot = mcBoatRef._rotation;
var scale = mcBoatRef._xscale;
mcBoats.globalToLocal(point);
point.x = mcBoatRef._x - point.x;
point.y = mcBoatRef._y - point.y;
var angleRad = Math.atan2(point.x, -point.y);
mcBoatRef.onEnterFrame = function () {
if ((mcBoatRef._name.toString().substring(0, 4) == "swim") && (!mcBoatRef.b)) {
mcBoatRef.b = true;
putBubble(mcBoatRef, mcBoatRef.man_mc._x, mcBoatRef.man_mc._y, "blood");
}
if (speed > 0.2) {
speed = speed - (speed * 0.1);
mcBoatRef._x = mcBoatRef._x + (speed * Math.sin(angleRad));
mcBoatRef._y = mcBoatRef._y - (speed * Math.cos(angleRad));
} else {
if (alpha > 0) {
alpha = alpha - 5;
rot = rot - 10;
scale = scale - 0.2;
if (((alpha % 3) == 0) && (mcBoatRef._name.toString().substring(0, 4) != "swim")) {
putBubble(mcBoats, this._x, this._y, "bubble");
}
if (((alpha == 90) || (alpha == 50)) && (mcBoatRef._name.toString().substring(0, 4) != "swim")) {
}
} else {
delete mcBoatRef.onEnterFrame;
}
mcBoatRef._alpha = alpha;
if (mcBoatRef._name.toString().substring(0, 4) != "swim") {
mcBoatRef._rotation = rot;
}
mcBoatRef._xscale = (mcBoatRef._yscale = scale);
}
};
}
function putBubble(mcTarget, x, y, mc) {
var _local1 = mcTarget.getNextHighestDepth();
var _local3 = 360 * Math.random();
var _local2 = 50 + (70 * Math.random());
x = x + (16 * (0.5 - Math.random()));
y = y + (16 * (0.5 - Math.random()));
mcTarget.attachMovie(mc, mc + _local1, _local1, {_x:x, _y:y, _rotation:_local3, _xscale:_local2, _yscale:_local2});
}
function jump() {
this._xscale = this._xscale + this.val;
this._yscale = this._yscale + this.val;
this.temp = this.temp + 2;
this.val = this.val * 0.9;
if (this._xscale < 100) {
this._xscale = 100;
this._yscale = 100;
this.val = this.val * -1;
}
this.val = this.val - this.temp;
}
function initGame(level) {
this.onEnterFrame = GameStart;
level.ship_mc.val = 0;
level.ship_mc.temp = 1;
level.ship_mc.onEnterFrame = jump;
level.jump_mc.mc = level.ship_mc;
level.jump_mc.b = true;
level.jump_mc.onEnterFrame = jumpTest;
lapTimerVal = 0;
nitro_mc.val = 1;
nitro_mc.gotoAndStop(1);
nitro_mc.onEnterFrame = nitro;
stopLapTimer();
startLapTimer();
level.ship1_mc.play();
level.ship2_mc.play();
level.ship3_mc.play();
}
function jumpTest() {
if ((checkForCollision(this, this.mc) != null) && (this.b)) {
jumpB = true;
if (Math.abs(linSpeed) < 10) {
} else {
this.mc.val = 5;
this.mc.temp = 1;
var _local2 = Math.floor(linSpeed) + 20;
if (_local2 > 20) {
acceleration = 30;
} else {
acceleration = -30;
}
}
} else {
jumpB = false;
}
}
function startLapTimer() {
gameLapTimer = setInterval(LapTiming, 1000);
}
function stopLapTimer() {
clearInterval(gameLapTimer);
}
function startGameTimer() {
lapTimerVal = 0;
GameTimer = setInterval(reduceGameTimer, 1000);
}
function stopGameTimer() {
clearInterval(GameTimer);
}
function reduceGameTimer() {
interval_txt.text = timerintervar;
if (timerintervar <= 1) {
stopGameTimer();
timer_mc.gotoAndStop(1);
delete this.onEnterFrame;
gameOver("gameOver");
gameFeed_mc.feed = 2;
} else {
timer_mc.gotoAndStop(timerintervar);
timerintervar--;
}
}
function getDamage() {
if (damage > 3) {
damage++;
hit_txt.text = "Damage : " + damage;
} else {
damage++;
hit_txt.text = "Damage : " + damage;
damage_mc.gotoAndStop(("" + damage) + "c");
}
}
function gameOver(str) {
nitroSound_mc.gotoAndStop(1);
clipSound_mc.gotoAndStop(1);
Key.removeListener(myListener);
delete this.onEnterFrame;
clearInterval(levelCompleteTimer);
score = score + (lapTiming * 10);
var _local2 = parseInt(levelNo);
t_txt.text = ((" Game Over : " + levelNo) + " : ") + _local2;
if (lastLevel && (str != "gameOver")) {
_local2 = parseInt(levelNo);
_local2 = _local2 + 1;
levelSave(_local2);
gameFeed_mc.gotoAndStop("gameCompleted");
} else {
gameFeed_mc.gotoAndStop(str);
}
}
function buttonOver() {
this.gotoAndPlay("over");
}
function buttonOut() {
this.gotoAndPlay("out");
}
function playAgain() {
damage = 0;
timerintervar = 100;
var _local2 = parseInt(levelNo);
damage_mc.gotoAndStop("0c");
timer_mc.gotoAndStop(timer_mc._totalframes);
gotoAndPlay(this._currentframe - 1);
closebutton._visible = true;
lapTimerVal = 0;
nitro_mc.val = 1;
nitro_mc.gotoAndStop(1);
}
function nextLevel() {
damage = 0;
timerintervar = 100;
var _local1 = parseInt(levelNo);
_local1 = _local1 + 1;
levelSave(_local1);
gotoAndStop ("levelSel");
}
function checkForCollision(p_clip1, p_clip2, p_alphaTolerance, p_scope) {
if (p_alphaTolerance == undefined) {
p_alphaTolerance = 255;
}
if (p_scope == undefined) {
p_scope = p_clip2._parent;
}
var _local3 = p_clip1.getBounds(p_scope);
var _local2 = p_clip2.getBounds(p_scope);
if (((_local3.xMax < _local2.xMin) || (_local2.xMax < _local3.xMin)) || ((_local3.yMax < _local2.yMin) || (_local2.yMax < _local3.yMin))) {
return(null);
}
var _local1 = {};
_local1.xMin = Math.max(_local3.xMin, _local2.xMin);
_local1.xMax = Math.min(_local3.xMax, _local2.xMax);
_local1.yMin = Math.max(_local3.yMin, _local2.yMin);
_local1.yMax = Math.min(_local3.yMax, _local2.yMax);
var _local8 = new flash.display.BitmapData(_local1.xMax - _local1.xMin, _local1.yMax - _local1.yMin, false);
var _local4 = p_clip1.transform.matrix;
_local4.tx = p_clip1._x - _local1.xMin;
_local4.ty = p_clip1._y - _local1.yMin;
_local8.draw(p_clip1, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, p_alphaTolerance));
_local4 = p_clip2.transform.matrix;
_local4.tx = p_clip2._x - _local1.xMin;
_local4.ty = p_clip2._y - _local1.yMin;
_local8.draw(p_clip2, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, p_alphaTolerance), "difference");
var _local6 = _local8.getColorBoundsRect(4294967295, 4278255615);
if (_local6.width == 0) {
return(null);
}
_local6.x = _local6.x + _local1.xMin;
_local6.y = _local6.y + _local1.yMin;
return(_local6);
}
function checkPoints() {
check_mc.no = 0;
checklen = 0;
for (c in check_mc) {
checklen++;
}
var i = 1;
while (i < checklen) {
var mc = eval (((check_mc + ".check") + i) + "_mc");
mc.id = i;
mc.b = true;
i++;
}
check_mc.onEnterFrame = function () {
for (all in this) {
var _local2 = this[all];
locPoints = {x:_local2._x, y:_local2._y};
check_mc.localToGlobal(locPoints);
if (ship_mc.hitTest(this[all]) && (this[all].b)) {
if (this.no == undefined) {
this.no = this[all].id;
} else {
var _local4 = this.no;
if (this[all].id == 4) {
if ((checkPointsVal == 1) || (checkPointsVal == 0)) {
checkPointsVal = 2;
}
}
if (this[all].id == 7) {
if (checkPointsVal == 2) {
checkPointsVal = 3;
}
}
if (this[all].id == 10) {
if (checkPointsVal == 3) {
checkPointsVal = 4;
}
}
if ((this[all].id == 1) && (checkPointsVal >= 3)) {
for (t in this) {
this[t].b = true;
}
this[all].b = false;
lap++;
checkPointsVal = 0;
pushBoat(ship_mc);
jump_mc.b = true;
jump_mc._visible = true;
var _local3 = lap + 1;
if (_local3 < 4) {
lap_txt.text = (_local3 + "/") + maxLap;
}
this.no = this[all].id;
if (lap >= maxLap) {
positionAr.push(ship_mc);
checkPosition();
gameComplete();
}
} else {
if (_local4 < this[all].id) {
for (t in this) {
this[t].b = true;
}
this[all].b = false;
} else {
for (t in this) {
this[t].b = true;
}
this[all].b = false;
}
this.no = this[all].id;
}
if (this[all].id == 3) {
checkPointsVal = 1;
}
}
}
}
};
}
function gameComplete() {
stopLapTimer();
levelDone = true;
clearInterval(levelCompleteTimer);
if (currentposition == 3) {
stopLapTimer();
Key.removeListener(myListener);
delete this.onEnterFrame;
_global.setTimeout(gameOver, 3000, "gameOver");
} else {
stopLapTimer();
Key.removeListener(myListener);
delete this.onEnterFrame;
_global.setTimeout(gameOver, 3000, "gameC");
}
}
function indexOfAr(inArray, item, startIndex) {
var _local1 = ((startIndex == undefined) ? -1 : (startIndex - 1));
while (_local1++ , _local1 < inArray.length) {
if (inArray[_local1] == item) {
return(_local1);
}
}
return(-1);
}
function removeDuplicates(inArray) {
var _local1;
var _local3 = -1;
var _local2 = new Object();
var _local5 = new Array();
while (_local3++ , _local3 < inArray.length) {
_local1 = inArray[_local3];
if (!_local2[_local1]) {
_local5.push(_local1);
_local2[_local1] = true;
}
}
return(_local5);
}
function checkLapPosition() {
var _local1 = new Array(level_mc.ship2_mc.lap, level_mc.ship2_mc.lap, lap);
currentposition = indexOfAr(_local1, ship_mc);
currentposition_txt.text = "Position : " + Number(currentposition + 1);
}
function checkPosition() {
currentposition = indexOfAr(positionAr, ship_mc);
currentposition_txt.text = "Position : " + Number(currentposition + 1);
}
function LapTiming() {
lapTiming--;
lapTimerVal++;
lapTiming_txt.text = lapTimerVal;
if (lapTiming < 0) {
stopLapTimer();
gameOver("gameOver");
lapTiming = 0;
}
}
function levelStart(level) {
Key.addListener(myListener);
nitro_mc.gotoAndStop(1);
minimap_mc.dx = level.ship_mc._x;
minimap_mc.dy = level.ship_mc._y;
minimap_mc.d1x = level.ship1_mc.clip_mc._x;
minimap_mc.d1y = level.ship1_mc.clip_mc._y;
minimap_mc.d2x = level.ship2_mc.clip_mc._x;
minimap_mc.d2y = level.ship2_mc.clip_mc._y;
minimap_mc.d3x = level.ship3_mc.clip_mc._x;
minimap_mc.d3y = level.ship3_mc.clip_mc._y;
var _local2 = level._name.substr(5, 1);
level.ship_mc.nitro_mc._visible = false;
level.ship1_mc.gotoAndStop(1);
level.ship2_mc.gotoAndStop(1);
level.ship3_mc.gotoAndStop(1);
levelStart_mc.levelmc = level;
levelStart_mc.text = parseInt(_local2);
levelStart_mc.b = false;
levelStart_mc.gotoAndPlay(2);
level._y = (-level.ship_mc._y) + (Stage.height / 2);
level._x = (-level.ship_mc._x) + (Stage.width / 2);
levelStart_mc.onEnterFrame = function () {
if (this.b) {
delete this.onEnterFrame;
setLevelObjects(level);
}
};
}
function pushBoat(val) {
if (val == ship_mc) {
if (lap == 1) {
tempArray = tempArray1;
}
if (lap == 2) {
tempArray = tempArray2;
}
if (lap == 3) {
tempArray = tempArray3;
}
} else {
if (val.lap == 1) {
tempArray = tempArray1;
}
if (val.lap == 2) {
tempArray = tempArray2;
}
if (val.lap == 3) {
tempArray = tempArray3;
}
}
tempArray.push(val);
if (val == ship_mc) {
error_mc.play();
positionVal = Number(indexOfAr(tempArray, ship_mc) + 1);
if (level_mc.ship1_mc.lap > lap) {
error_mc._text = "Position: 4th";
} else {
if (positionVal == 1) {
tempText = "1st";
}
if (positionVal == 2) {
tempText = "2nd";
}
if (positionVal == 3) {
tempText = "3rd";
}
if (positionVal == 4) {
tempText = "4th";
}
error_mc._text = "Position: " + tempText;
}
}
}
function levelSave(num) {
my_so.data.ar[num] = true;
var _local1 = Number(num - 1);
if ((my_so.data.lapTiming[_local1] != undefined) && (my_so.data.lapTiming[_local1] > lapTimerVal)) {
my_so.data.lapTiming[_local1] = lapTimerVal;
} else if (my_so.data.lapTiming[_local1] == undefined) {
my_so.data.lapTiming[_local1] = lapTimerVal;
}
my_so.flush();
}
stop();
var ship_mc;
var mcObstacles;
var mcBeach;
var mcBoats;
var position = new Object();
var levelNo = "0";
var score = 0;
var lastLevel = false;
var checkPointsVal = 0;
var levelDone = false;
var tempArray1 = new Array();
var tempArray2 = new Array();
var tempArray3 = new Array();
var aHitPonts = new Array();
var aBoats = new Array();
var amcBeach_hit = new Array();
var aBeaches = new Array();
var aObstacles = new Array();
var damage = 0;
var acceleration = 0;
var maxFrwdSpeed = 2;
var maxRearSpeed = -2;
var maxFrwdAcc = 0.2;
var maxRearAcc = -0.2;
var waterDrag = 0.99;
var lap = 0;
var maxLap = 3;
var linSpeed = 0;
var speedX = 0;
var speedY = 0;
var acceleration = 0;
var rotSpeed = 0;
var maxRotSpeed = 1;
var rotAcceleration = 0;
var rudder = 0;
var onBeach = false;
var onDock = false;
var isWorking = false;
var timerintervar = 100;
var currentposition = 0;
mcTmp = this.createEmptyMovieClip("mcTmp", 1);
var bWithoutWind = false;
var oWind = new Object();
var positionAr = new Array();
var lapTimerVal = 0;
var currentLevel = 0;
closebutton.onPress = function () {
gotoAndStop (47);
};
mainTimer = setInterval(makeTrails, 1);
var myListener = new Object();
var KeyUp = true;
var KeySpace = true;
myListener.onKeyDown = function () {
if ((Key.getCode() == 38) || ((Key.getCode() == 40) && (KeyUp))) {
clipSound_mc.gotoAndStop(2);
KeyUp = false;
}
if (((Key.getCode() == 32) && (KeySpace)) && (nitroLeft)) {
nitroSound_mc.gotoAndStop(2);
KeySpace = false;
}
if (!nitroLeft) {
nitroSound_mc.gotoAndStop(1);
KeySpace = false;
}
};
myListener.onKeyUp = function () {
if ((Key.getCode() == 38) || (Key.getCode() == 40)) {
clipSound_mc.gotoAndStop(1);
KeyUp = true;
}
if (Key.getCode() == 32) {
nitroSound_mc.gotoAndStop(1);
KeySpace = true;
}
};
stop();
insG_btn.continueBtn.onPress = function () {
this._parent._parent.gotoAndStop("instruction");
};
howToPlay_btn.continueBtn.onPress = function () {
this._parent._parent.gotoAndStop("instruction");
};
Symbol 559 MovieClip Frame 3
stop();
startG_btn.continueBtn.onPress = function () {
_root.boatVal = 2;
gotoAndStop (5);
};
back_btn.continueBtn.onPress = function () {
this._parent._parent.gotoAndStop("start");
};
Symbol 559 MovieClip Frame 4
function init() {
var i = 1;
while (i <= 4) {
var mc = eval (("clip" + i) + "_mc");
mc.id = i;
mc.onPress = function () {
_root.boatVal = this.id;
nextFrame();
};
mc.onRollOver = function () {
clip_mc.gotoAndStop(this.id);
};
i++;
}
}
stop();
init();
Symbol 559 MovieClip Frame 5
stop();
closebutton._visible = true;
var my_so = SharedObject.getLocal("MiamiSpeedBoat", "/");
Symbol 559 MovieClip Frame 7
stop();
levelStart(level1);
closebutton.visible = true;
lap_txt.text = "1/3";
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
Symbol 559 MovieClip Frame 12
stop();
levelStart(level2);
closebutton.visible = true;
lap_txt.text = "1/3";
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
Symbol 559 MovieClip Frame 17
stop();
levelStart(level3);
closebutton.visible = true;
lap_txt.text = "1/3";
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
Symbol 559 MovieClip Frame 22
stop();
levelStart(level4);
closebutton.visible = true;
lap_txt.text = "1/3";
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
Symbol 559 MovieClip Frame 27
stop();
levelStart(level5);
closebutton.visible = true;
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
Symbol 559 MovieClip Frame 32
stop();
levelStart(level6);
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
closebutton.visible = true;
Symbol 559 MovieClip Frame 37
stop();
levelStart(level7);
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
closebutton.visible = true;
Symbol 559 MovieClip Frame 42
stop();
levelStart(level8);
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
closebutton.visible = true;
Symbol 559 MovieClip Frame 47
stopLapTimer();
lapTimerVal = 0;
lapTiming_txt.text = lapTimerVal;
nitroSound_mc.gotoAndStop(1);
clipSound_mc.gotoAndStop(1);
Key.removeListener(myListener);
delete this.onEnterFrame;
clearInterval(levelCompleteTimer);
stopAllSounds();
closebutton._visible = false;
_level0.submitGameScore(0, true, _root.game_id, timerScore);
lastScreen.playa_mc.continueBtn.onPress = function () {
this._parent._parent._parent.playAgain();
closebutton._visible = true;
gotoAndStop (1);
};
nextl_mc.onPress = function () {
this._parent._parent.nextLevel();
gotoAndStop (1);
};
lastScreen.close_mc.continueBtn.onPress = function () {
closebutton._visible = true;
_level0.hideGame(_root.score * _root.ratio, true, _root.game_id);
};
Symbol 563 MovieClip [game_sound_ctrl] Frame 1
_gameSounds = new Sound();
var frame = "on";
changeVol = function (targetvol, step) {
this.onEnterFrame = function () {
var _local3 = _gameSounds.getVolume();
if ((step < 0) and (_local3 <= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 1;
} else if ((step > 0) and (_local3 >= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 0;
} else {
_gameSounds.setVolume(_local3 + step);
}
};
};
if (_root.so_sound == 1) {
frame = "off";
this.gotoAndPlay(frame);
}
this.onRelease = function () {
if (frame == "on") {
frame = "off";
} else {
frame = "on";
}
this.gotoAndPlay(frame);
};
Symbol 563 MovieClip [game_sound_ctrl] Frame 2
stop();
changeVol(100, 5);
Symbol 563 MovieClip [game_sound_ctrl] Frame 3
stop();
changeVol(0, -5);