Frame 1
NewgroundsAPI.connectMovie(125);
stop();
Frame 3
function initialise() {
sounds.push(new Sound());
sounds[0].attachSound("cannon");
sounds.push(new Sound());
sounds[1].attachSound("bomb");
sounds.push(new Sound());
sounds[2].attachSound("waterloop");
sounds.push(new Sound());
sounds[3].attachSound("splash");
sounds.push(new Sound());
sounds[4].attachSound("sandsnd");
sounds.push(new Sound());
sounds[5].attachSound("gull1");
sounds.push(new Sound());
sounds[6].attachSound("gull2");
sounds.push(new Sound());
sounds[7].attachSound("gull3");
sounds.push(new Sound());
sounds[8].attachSound("gold");
sounds.push(new Sound());
sounds[9].attachSound("whale");
sounds.push(new Sound());
sounds[10].attachSound("bite");
music.push(new Sound());
music[0].attachSound("theme");
music.push(new Sound());
music[1].attachSound("menum");
music[1].start(0, 9999);
i = 1;
while (i < 9) {
wtrs.push(new Sound());
wtrs[i - 1].attachSound("water" + i);
i++;
}
this.createEmptyMovieClip("arro", -1);
arro.createEmptyMovieClip("image", 2);
arro.image.attachBitmap(flash.display.BitmapData.loadBitmap("arrow"), 0, "auto", false);
arro.image._x = -64;
arro.image._y = -64;
arro.createEmptyMovieClip("image2", 0);
arro.image2.createEmptyMovieClip("img", 0);
arro.image2.img.attachBitmap(flash.display.BitmapData.loadBitmap("ghost"), 0, "auto", false);
arro.image2.img._x = -64;
arro.image2.img._y = -64;
arro._y = 64;
arro.createTextField("dist", 1, -64, 48, 128, 32);
arro._alpha = 0;
this.createEmptyMovieClip("world", 0);
world.createEmptyMovieClip("clouds", -2);
this.createEmptyMovieClip("back", -3);
this.createEmptyMovieClip("menu", 7);
menu.createEmptyMovieClip("back", 0);
menu.back.attachBitmap(flash.display.BitmapData.loadBitmap("menuback"), 0, "auto", false);
menuBtn("plybtn", 50, "Play").onPress = function () {
gamePaused = false;
menuOpen = false;
sounds[8].start();
music[1].stop("menum");
if (!musicPlaying) {
music[0].start(0, 99999);
musicPlaying = true;
}
};
menuBtn("hlpbtn", 100, "Tutorial").onPress = function () {
tutorial = true;
tutpage = 0;
menuOpen = false;
sounds[8].start();
};
menuBtn("scrbtn", 150, "Highscores");
menuBtn("spnbtn", 200, "More Great Games");
this.createEmptyMovieClip("buyMenu", 5);
buyMenu.createEmptyMovieClip("back", 0);
buyMenu.back.attachBitmap(flash.display.BitmapData.loadBitmap("buymenu"), 0, "auto", false);
buyMenu._y = -450;
buyMenu.createTextField("goldNo", 2, 137, 418, 192, 32);
buyMenu.createTextField("costNo", 3, 487, 418, 192, 32);
buyMenu.currCost = "";
buyMenu.createEmptyMovieClip("scoreShow", 1);
buyMenu.scoreShow.attachBitmap(flash.display.BitmapData.loadBitmap("scores"), 0, "auto", false);
buyMenu.scoreShow._y = 450;
buyMenu.scoreShow.createTextField("best", 1, 96, 5, 64, 32);
buyMenu.scoreShow.createTextField("curr", 2, 96, 35, 64, 32);
buyMenu.scoreShow.createEmptyMovieClip("qual", 3);
buyMenu.scoreShow.createEmptyMovieClip("mute", 4);
buyMenu.scoreShow.qual.attachBitmap(flash.display.BitmapData.loadBitmap("Q"), 0);
buyMenu.scoreShow.qual.onPress = function () {
if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else if (_quality == "HIGH") {
_quality = "LOW";
}
};
buyMenu.scoreShow.mute.attachBitmap(flash.display.BitmapData.loadBitmap("M"), 0);
buyMenu.scoreShow.mute.onPress = function () {
if (musicPlaying) {
music[0].stop("theme");
} else {
music[0].start(0, 99999);
}
musicPlaying = !musicPlaying;
};
buyMenu.scoreShow.qual._x = 668;
buyMenu.scoreShow.mute._x = 668;
buyMenu.scoreShow.qual._y = 418;
buyMenu.scoreShow.mute._y = 386;
buyMenu.createEmptyMovieClip("msgs", 5);
buyMenu.msgs._x = 350;
buyMenu.msgs._y = 675;
buyMenu.createEmptyMovieClip("cont", 4);
buyMenu.cont.attachBitmap(flash.display.BitmapData.loadBitmap("continuebtn"), 0, "auto", false);
buyMenu.cont._x = 286;
buyMenu.cont._y = 416;
buyMenu.cont.onPress = function () {
pirate.removeProjectile();
buyMode = false;
gamePaused = false;
boyancy = ItemInfo.masts[currItems[2]][0] / 2;
waterResist = ItemInfo.ships[currItems[1]][0];
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
sounds[8].start();
if (((((currItems[0] == 4) && (currItems[1] == 4)) && (currItems[2] == 4)) && (currItems[3] == 4)) && (currItems[4] == 4)) {
scored.upgradeBtn.removeMovieClip();
}
};
this.createEmptyMovieClip("scored", 6);
scored.createEmptyMovieClip("image", 0);
scored.image.attachBitmap(flash.display.BitmapData.loadBitmap("scored"), 0, "auto", false);
scored.createEmptyMovieClip("upgradeBtn", 1);
scored.createEmptyMovieClip("submitBtn", 2);
scored.createEmptyMovieClip("menuBtn", 3);
scored.createEmptyMovieClip("contBtn", 4);
scored.upgradeBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.submitBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.menuBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.contBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.upgradeBtn.createTextField("txt", 1, 0, 4, 270, 40);
scored.submitBtn.createTextField("txt", 1, 0, 4, 270, 40);
scored.menuBtn.createTextField("txt", 1, 0, 4, 270, 40);
scored.contBtn.createTextField("txt", 1, 0, 4, 270, 40);
txtFmt3 = new TextFormat();
txtFmt3.size = 32;
txtFmt3.color = 16777215 /* 0xFFFFFF */;
txtFmt3.align = "center";
txtFmt3.bold = true;
txtFmt3.font = "Pieces of Eight";
scored.createTextField("currscore", scored.getNextHighestDepth(), 215, 117, 270, 40);
scored.currscore.selectable = false;
scored.upgradeBtn.txt.text = "UPGRADE MENU";
scored.submitBtn.txt.text = "SUBMIT HIGHSCORE";
scored.menuBtn.txt.text = "MAIN MENU";
scored.contBtn.txt.text = "CONTINUE";
fmt.size = 24;
scored.upgradeBtn.txt.setTextFormat(fmt);
scored.upgradeBtn.txt.embedFonts = true;
scored.submitBtn.txt.setTextFormat(fmt);
scored.submitBtn.txt.embedFonts = true;
scored.menuBtn.txt.setTextFormat(fmt);
scored.menuBtn.txt.embedFonts = true;
scored.contBtn.txt.setTextFormat(fmt);
scored.contBtn.txt.embedFonts = true;
fmt.size = 32;
scored.upgradeBtn.txt.selectable = false;
scored.submitBtn.txt.selectable = false;
scored.menuBtn.txt.selectable = false;
scored.contBtn.txt.selectable = false;
scored.upgradeBtn.onPress = function () {
gamePaused = true;
buyMode = true;
scoredShow = false;
sounds[8].start();
};
scored.submitBtn.onPress = function () {
gamePaused = true;
sounds[8].start();
};
scored.menuBtn.onPress = function () {
gamePaused = true;
scoredShow = false;
menuOpen = true;
pirate.removeProjectile();
buyMode = false;
boyancy = ItemInfo.masts[currItems[2]][0] / 2;
waterResist = ItemInfo.ships[currItems[1]][0];
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
sounds[8].start();
};
scored.contBtn.onPress = function () {
gamePaused = false;
scoredShow = false;
pirate.removeProjectile();
buyMode = false;
gamePaused = false;
boyancy = ItemInfo.masts[currItems[2]][0] / 2;
waterResist = ItemInfo.ships[currItems[1]][0];
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
sounds[8].start();
};
scored.upgradeBtn._x = 215;
scored.submitBtn._x = 215;
scored.menuBtn._x = 215;
scored.contBtn._x = 215;
scored.upgradeBtn._y = 185;
scored.submitBtn._y = 230;
scored.menuBtn._y = 275;
scored.contBtn._y = 320;
scored._y = -450;
scoredShow = false;
txtFmt = new TextFormat();
txtFmt.size = 16;
txtFmt.color = 16777215 /* 0xFFFFFF */;
txtFmt.font = "arial";
txtFmt.bold = true;
txtFmt2 = new TextFormat();
txtFmt2.size = 20;
txtFmt2.color = 16777215 /* 0xFFFFFF */;
txtFmt2.font = "arial";
txtFmt2.bold = true;
txtFmt2.align = "center";
buyMenu.scoreShow.best.text = 0;
buyMenu.scoreShow.curr.text = 0;
buyMenu.scoreShow.best.setTextFormat(txtFmt);
buyMenu.scoreShow.curr.setTextFormat(txtFmt);
var _local3 = 0;
while (_local3 < 4) {
var _local2 = 0;
while (_local2 < 5) {
buyMenu[(("btn_" + _local3) + "_") + _local2] = new BuyButton(_local3, _local2);
_local2++;
}
_local3++;
}
back.attachBitmap(flash.display.BitmapData.loadBitmap("backdrop"), 0, "auto", false);
world.createEmptyMovieClip("water", 4);
cloud1 = new CloudObject();
cloud2 = new CloudObject();
splashArr = new Array();
splashes = 0;
controls = new Array();
controls[0] = [65, 68];
controls[1] = [37, 39];
scapeDown = false;
waterLevel = 386;
airResist = 0;
waterResist = 0.02;
gravity = 0.5;
boyancy = 0.5;
currItems = [1, 1, 1, 1, 1];
cannon = new CannonObject("can_mc", 1);
mouseAngle = 0;
holdClick = false;
gamePaused = true;
menuOpen = true;
gold = 0;
tutpage = 0;
buyMode = false;
cannon.minAngle = -75;
cannon.maxAngle = -15;
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.power = 0;
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
shipAngleMax = 45;
cannon.mc._x = 64;
cannon.mc._y = 350;
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
this.createEmptyMovieClip("sea", 1);
sea.attachBitmap(flash.display.BitmapData.loadBitmap("sea"), 0, "auto", false);
sea._y = waterLevel;
someListener = new Object();
someListener.onMouseDown = function () {
if (!gamePaused) {
holdClick = true;
}
};
someListener.onMouseUp = function () {
holdClick = false;
};
Mouse.addListener(someListener);
this.createEmptyMovieClip("tutor", this.getNextHighestDepth());
tutor._x = 700;
i = 0;
while (i < 8) {
tutor.createEmptyMovieClip("p" + i, i);
tutor["p" + i].attachBitmap(flash.display.BitmapData.loadBitmap("tut" + (i + 1)), 0);
tutor["p" + i]._x = i * 700;
i++;
}
tutor.onEnterFrame = function () {
if (tutorial) {
tutor._x = tutor._x + (((tutpage * -700) - tutor._x) * 0.1);
if (tutpage != 0) {
tutor.hlp._x = tutor.hlp._x + (((tutpage * 700) - tutor.hlp._x) * 0.1);
} else {
tutor.hlp.text = "CLICK TO CONTINUE";
tutor.hlp.setTextFormat(fmt);
tutor.hlp.embedFonts = true;
}
if (tutpage == 7) {
tutor.hlp._y = tutor.hlp._y + ((250 - tutor.hlp._y) * 0.1);
tutor.hlp.text = "CLICK TO PLAY";
tutor.hlp.setTextFormat(fmt);
tutor.hlp.embedFonts = true;
}
} else {
tutor._x = tutor._x + ((700 - tutor._x) * 0.1);
tutor.hlp._x = 0;
tutor.hlp._y = 410;
}
};
tutor.onPress = function () {
sounds[8].start();
tutpage++;
if (tutpage == 8) {
tutpage = 0;
tutorial = false;
gamePaused = false;
tutor._x = 700;
music[1].stop();
if (!musicPlaying) {
music[0].start(0, 99999);
musicPlaying = true;
}
}
};
tutor.createTextField("hlp", 8, 0, 410, 700, 50);
tutor.hlp.text = "CLICK TO CONTINUE";
tutor.hlp.setTextFormat(fmt);
tutor.hlp.embedFonts = true;
}
function menuBtn(nam, yy, txt) {
menu.createEmptyMovieClip(nam, menu.getNextHighestDepth());
var mc = menu[nam];
mc.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0);
mc._x = 400;
mc._y = yy;
mc.createTextField("lbl", 1, 0, 0, 270, 40);
mc.lbl.text = txt;
mc.lbl.setTextFormat(fmt);
mc.lbl.embedFonts = true;
mc.onRollOver = function () {
mc.attachBitmap(flash.display.BitmapData.loadBitmap("button2"), 0);
};
mc.onRollOut = function () {
mc.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0);
};
return(mc);
}
function onEnterFrame() {
mouseAngle = Math.atan2(_ymouse - cannon.mc._y, _xmouse - cannon.mc._x);
mouseAngle = (mouseAngle / Math.PI) * 180;
if ((!pirate.active) && (!gamePaused)) {
cannon.rotateBarrel(mouseAngle);
}
rotSpeed = new Number();
rotSpeed = (Key.isDown(controls[0][1]) || (Key.isDown(controls[1][1]))) - (Key.isDown(controls[0][0]) || (Key.isDown(controls[1][0])));
rotSpeed = rotSpeed * ItemInfo.wheels[currItems[3]][0];
if (!gamePaused) {
cloud1.moveCloud();
cloud2.moveCloud();
pirate.moveProjectile(rotSpeed);
pirate.onSand = false;
i = 0;
while (i < obstacles.length) {
obstacles[i].checkHit(pirate.mc, pirate);
i++;
}
i = obstacles.length;
if (holdClick && (!pirate.active)) {
cannon.power = cannon.power + cannon.inc;
if (cannon.power < cannon.minPower) {
cannon.power = cannon.minPower;
cannon.inc = 1;
} else if (cannon.power > cannon.maxPower) {
cannon.power = cannon.maxPower;
cannon.inc = -1;
}
} else if (((!holdClick) && (!pirate.active)) && (cannon.power >= cannon.minPower)) {
i = 0;
while (i < obstacles.length) {
obstacles[i].mc.removeMovieClip();
i++;
}
i = 0;
while (i < splashArr.length) {
splashArr[i].mc.removeMovieClip();
i++;
}
obstacles = new Array();
splashArr = new Array();
canx = cannon.mc._x + (Math.cos((cannon.angle * Math.PI) / 180) * 64);
cany = cannon.mc._y + (Math.sin((cannon.angle * Math.PI) / 180) * 64);
pirate = new ProjectileObject("proj", new flash.geom.Point(canx, cany), cannon.angle, cannon.power, 0);
pirate.bitmap1 = flash.display.BitmapData.loadBitmap("pirate" + currItems[0]);
pirate.bitmap2 = flash.display.BitmapData.loadBitmap("mast" + currItems[2]);
pirate.bitmap3 = flash.display.BitmapData.loadBitmap("ship" + currItems[1]);
pirate.updateGraphics();
lastDist = -700;
cannon.power = 0;
sounds[0].start();
} else if (pirate.active) {
if (pirate.mc._y < 0) {
arro._x = pirate.mc._x + world._x;
arro.image2._rotation = pirate.mc._rotation;
arro.dist.text = -Math.floor(pirate.mc._y / 10);
arro.dist.setTextFormat(txtFmt2);
} else {
arro.dist.text = "";
}
buyMenu.scoreShow.best.text = Math.floor(pirate.distance / 100);
if (Number(buyMenu.scoreShow.best.text) > Number(buyMenu.scoreShow.curr.text)) {
buyMenu.scoreShow.curr.text = buyMenu.scoreShow.best.text;
buyMenu.scoreShow.curr.setTextFormat(txtFmt);
}
buyMenu.scoreShow.best.setTextFormat(txtFmt);
cannon.fireCannon();
if (pirate.mc._x > ((lastDist + 500) + (Math.random() * 250))) {
if ((Math.random() < 0.5) || (lastDist == -700)) {
if ((Math.random() < 0.33) || (lastDist == -700)) {
effectArr = new Array(4);
effectArr[0] = [(16 * Math.random()) + 8, 0, 0];
effectArr[1] = [0, ((8 * Math.random()) - 12) * ItemInfo.masts[currItems[2]][0], (Math.random() * 4) - 2];
effectArr[2] = [0, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, _root.waterLevel + 24), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("obstacle4");
obstacles[i].updateGraphics();
i++;
} else if (Math.random() < 0.5) {
effectArr = new Array(4);
effectArr[0] = [(8 * Math.random()) + 4, 0, 0];
effectArr[1] = [0, ((8 * Math.random()) - 12) * ItemInfo.masts[currItems[2]][0], (Math.random() * 4) - 2];
effectArr[2] = [0, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, _root.waterLevel - ((Math.random() * 256) + 64)), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("seagul1");
obstacles[i].gull = true;
obstacles[i].updateGraphics();
i++;
} else {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, ((8 * Math.random()) - 24) * ItemInfo.masts[currItems[2]][0], (Math.random() * 6) - 3];
effectArr[2] = [0, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, _root.waterLevel + 24), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("obstacle5");
obstacles[i].whale = true;
obstacles[i].updateGraphics();
i++;
}
} else if (Math.random() < (1 - ItemInfo.pirates[currItems[0]][1])) {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, 0, 0];
effectArr[2] = [0, 0, 0];
effectArr[3] = 2;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, (Math.random() * 100) + 250), effectArr, world.getNextHighestDepth());
i++;
} else if (Math.random() < 0.25) {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, ((2 * Math.random()) - 4) * ItemInfo.masts[currItems[2]][0], (Math.random() * 6) - 3];
effectArr[2] = [0.75, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 900, _root.waterLevel), effectArr, world.getNextHighestDepth());
obstacles[i].shark = true;
i++;
} else if (Math.random() < 0.5) {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, -2, 0];
effectArr[2] = [0.9, 0, 0];
effectArr[3] = 1;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 900, _root.waterLevel), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("obstacle" + String(Math.floor(Math.random() * 3) + 1));
obstacles[i].updateGraphics();
i++;
}
lastDist = pirate.mc._x;
}
}
j = 0;
while (j < splashArr.length) {
splashArr[j].fadeWater(j);
j++;
}
pirate.mc.swapDepths(world.getNextHighestDepth());
world.water.swapDepths(world.getNextHighestDepth());
}
if (buyMode) {
buyMenu.currCost = "";
buyMenu.currGold = gold;
buyMenu._y = buyMenu._y + ((-buyMenu._y) * 0.1);
if (buyMenu._y > -2) {
buyMenu._y = 0;
}
xx = 0;
while (xx < 4) {
yy = 0;
while (yy < 5) {
buyMenu[(("btn_" + xx) + "_") + yy].checkClick(_xmouse, _ymouse - buyMenu._y, Key.isDown(1));
yy++;
}
xx++;
}
buyMenu.goldNo.text = buyMenu.currGold;
buyMenu.costNo.text = buyMenu.currCost;
buyMenu.goldNo.setTextFormat(txtFmt);
if (buyMenu.currCost > buyMenu.currGold) {
txtFmt.color = 13369344 /* 0xCC0000 */;
}
buyMenu.costNo.setTextFormat(txtFmt);
txtFmt.color = 16777215 /* 0xFFFFFF */;
} else {
buyMenu._y = buyMenu._y + ((-450 - buyMenu._y) * 0.1);
if (buyMenu._y < -448) {
buyMenu._y = -450;
}
}
if (scoredShow) {
scored._y = scored._y + ((-scored._y) * 0.1);
if (scored._y > -2) {
scored._y = 0;
es = Number(scored.currscore.text);
ts = Math.floor(pirate.distance / 100);
if (es < ts) {
scored.currscore.text = Math.ceil(es + ((ts - es) / 8));
if (nxtnse <= 0) {
nxtnse = 4;
sounds[8].start();
}
}
nxtnse--;
}
scored.currscore.setTextFormat(txtFmt3);
} else {
scored._y = scored._y + ((-450 - scored._y) * 0.1);
if (scored._y < -448) {
scored._y = -450;
}
}
if (menuOpen) {
menu._y = menu._y + ((-menu._y) * 0.1);
if (menu._y > -2) {
menu._y = 0;
}
if (Key.isDown(27)) {
if (!scapeDown) {
menuOpen = false;
gamePaused = false;
}
scapeDown = true;
} else {
scapeDown = false;
}
} else {
menu._y = menu._y + ((-450 - menu._y) * 0.1);
if (menu._y < -448) {
menu._y = -450;
}
if (Key.isDown(27)) {
if ((!scapeDown) && (!gamePaused)) {
menuOpen = true;
gamePaused = true;
}
scapeDown = true;
} else {
scapeDown = false;
}
}
}
stop();
var txtFmt;
var txtFmt3;
var cloud1;
var cloud2;
var splashArr;
var splashes;
var controls;
var scapeDown;
var waterLevel;
var airResist;
var waterResist;
var gravity;
var boyancy;
var currItems;
var pirate;
var cannon;
var mouseAngle;
var obstacles;
var msgs;
var lastDist;
var holdClick;
var gamePaused;
var menuOpen;
var gold;
var scoredShow;
var buyMode;
var tutorial;
var tutpage;
var nxtnse;
var shipAngleMax;
var someListener;
var sounds = new Array();
var music = new Array();
var wtrs = new Array();
var fmt = new TextFormat();
fmt.size = 32;
fmt.font = "Pieces of Eight";
fmt.align = "center";
fmt.color = 16763904 /* 0xFFCC00 */;
var bla = new TextFormat();
bla.size = 24;
bla.font = "Pieces of Eight";
bla.align = "center";
bla.color = 16763904 /* 0xFFCC00 */;
var musicPlaying = false;
initialise();
Symbol 20 MovieClip Frame 40
stop();
Symbol 34 Button
on (press) {
tellTarget (_root) {
nextFrame();
};
}
Symbol 35 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 10 MovieClip in Symbol 36 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("lastframe");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndPlay("loaded");
}
}
Symbol 36 MovieClip Frame 101
play();
Symbol 36 MovieClip Frame 165
stop();
Symbol 42 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 48 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 50 MovieClip Frame 1
function startAd(ngad_url) {
trace("opening " + ngad_url);
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!");
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 223 MovieClip [__Packages.ObstacleObject] Frame 0
class ObstacleObject
{
var mc, trueEffects, xspeedInc, xspeedAbs, xspeedMul, yspeedInc, yspeedAbs, yspeedMul, rspeedInc, rspeedAbs, rspeedMul, rabs, cabs, origy, hit, hitB, bitmap;
function ObstacleObject (instName, startPosition, effects, depth) {
_root.world.createEmptyMovieClip(instName, depth);
mc = _root.world[instName];
mc.createEmptyMovieClip("image", 0);
mc._x = startPosition.x;
mc._y = startPosition.y;
trueEffects = new Array(3);
trueEffects[0] = [effects[0][0] != 0, effects[0][1] != 0, effects[0][2] != 0];
trueEffects[1] = [effects[1][0] != 0, effects[1][1] != 0, effects[1][2] != 0];
trueEffects[2] = [effects[2][0] != 0, effects[2][1] != 0, effects[2][2] != 0];
xspeedInc = effects[0][0];
xspeedAbs = effects[1][0];
xspeedMul = effects[2][0];
yspeedInc = effects[0][1];
yspeedAbs = effects[1][1];
yspeedMul = effects[2][1];
rspeedInc = effects[0][2];
rspeedAbs = effects[1][2];
rspeedMul = effects[2][2];
rabs = ((effects[3] == 1) ? 1 : 0);
cabs = ((effects[3] == 2) ? 1 : 0);
origy = mc._y - 16;
hit = false;
hitB = false;
}
function updateGraphics() {
mc.image.attachBitmap(bitmap, 0, "auto", false);
mc.image._x = -(mc.image._width / 2);
mc.image._y = 64 - mc.image._height;
}
function checkHit(objMc, objVar) {
if (!hit) {
if (mc._x > ((-_root.world._x) - 64)) {
if (cabs) {
animFrame++;
if (animFrame > 17) {
animFrame = 1;
}
bitmap = flash.display.BitmapData.loadBitmap("coin" + Math.floor(animFrame));
updateGraphics();
}
if (gull) {
animFrame++;
if (animFrame > 12) {
animFrame = 1;
}
bitmap = flash.display.BitmapData.loadBitmap("seagul" + Math.floor(animFrame));
mc._xscale = 50;
mc._yscale = 50;
if (mc._y < origy) {
yspeed = yspeed + 0.5;
} else {
yspeed = yspeed - 0.5;
}
mc._y = mc._y + yspeed;
updateGraphics();
}
if (whale) {
if (mc._y < origy) {
yspeed = yspeed + 0.25;
} else {
yspeed = yspeed - 0.25;
}
mc._y = mc._y + yspeed;
}
if (shark) {
animFrame++;
if (animFrame > 8) {
animFrame = 1;
}
bitmap = flash.display.BitmapData.loadBitmap("shark" + Math.floor(animFrame));
updateGraphics();
}
var _local6 = Math.sqrt(Math.pow(objMc._x - mc._x, 2) + Math.pow((objMc._y + 16) - mc._y, 2));
if (rabs) {
if ((objMc._y + 16) < (mc._y - 16)) {
_local6 = 64;
}
} else if (cabs) {
_local6 = Math.sqrt(Math.pow(objMc._x - mc._x, 2) + Math.pow((objMc._y + 16) - mc._y, 2));
_local6 = _local6 * 1.5;
}
if (_local6 < 64) {
if (trueEffects[0][0]) {
objVar.xspeed = objVar.xspeed + xspeedInc;
}
if (trueEffects[1][0]) {
objVar.xspeed = xspeedAbs;
}
if (trueEffects[2][0]) {
objVar.xspeed = objVar.xspeed * xspeedMul;
}
if (trueEffects[0][1]) {
objVar.yspeed = objVar.yspeed + yspeedInc;
}
if (trueEffects[1][1]) {
objVar.yspeed = yspeedAbs;
}
if (trueEffects[2][1]) {
objVar.yspeed = objVar.yspeed * yspeedMul;
}
if (trueEffects[0][2]) {
objVar.rspeed = objVar.rspeed + rspeedInc;
}
if (trueEffects[1][2]) {
objVar.rspeed = rspeedAbs;
}
if (trueEffects[2][2]) {
objVar.rspeed = objVar.rspeed * rspeedMul;
}
if (rabs != 0) {
objMc._rotation = objMc._rotation + ((-objMc._rotation) * 0.5);
objVar.onSand = true;
if (!hitB) {
hitB = true;
_root.sounds[4].start();
}
objMc._y = mc._y - 24;
} else {
if (cabs) {
_root.sounds[8].start();
_root.pirate.distance = _root.pirate.distance + 2500;
splodeFrame = 16;
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, true));
_local3++;
}
mc.removeMovieClip();
} else if (gull) {
_root.sounds[Math.floor(Math.random() * 3) + 5].start();
var _local3 = 0;
while (_local3 < 8) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, false));
_root.splashArr[_root.splashArr.length - 1].fe = true;
_local3++;
}
} else if (whale) {
_root.sounds[9].start();
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, _root.waterLevel), 12, false));
_local3++;
}
} else if (shark) {
_root.sounds[10].start();
_root.pirate.distance = _root.pirate.distance - 2500;
if (_root.pirate.distance < 0) {
_root.pirate.distance = 0;
}
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, _root.waterLevel), 12, true));
_local3++;
}
yspeed = -4;
mc._rotation = 45;
} else {
_root.sounds[1].start();
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, _root.waterLevel), 12, false));
_local3++;
}
}
hit = true;
}
}
} else {
hit = true;
_root.obstacleArr.splice(0, 1);
mc.removeMovieClip();
}
} else if ((((splodeFrame < 16) && (!gull)) && (!whale)) && (!shark)) {
splodeFrame = splodeFrame + 0.75;
bitmap = flash.display.BitmapData.loadBitmap("explosion" + Math.round(splodeFrame));
updateGraphics();
} else if ((splodeFrame < 10) && (gull)) {
splodeFrame = splodeFrame + 0.75;
bitmap = flash.display.BitmapData.loadBitmap("gullhit" + Math.round(splodeFrame));
mc._y = mc._y + 4;
updateGraphics();
} else if (gull) {
mc._y = mc._y + 4;
if (mc._x > ((-_root.world._x) - 64)) {
_root.obstacleArr.splice(0, 1);
mc.removeMovieClip();
}
} else if (whale || (shark)) {
if (shark) {
mc._y = mc._y + yspeed;
yspeed = yspeed + 0.5;
if (mc._rotation > -90) {
mc._rotation = mc._rotation - 4;
}
} else {
mc._y = mc._y + 4;
}
if (mc._x <= ((-_root.world._x) - 64)) {
_root.obstacleArr.splice(0, 1);
mc.removeMovieClip();
}
}
}
var splodeFrame = 0;
var animFrame = 1;
var gull = false;
var whale = false;
var shark = false;
var yspeed = 0;
}
Symbol 224 MovieClip [__Packages.ProjectileObject] Frame 0
class ProjectileObject
{
var onSand, mc, maxAngle, xspeed, yspeed, distance, rspeed, active, stopTimer, lastRot, alive, bitmap1, bitmap2, bitmap3, nurot;
function ProjectileObject (instName, startPosition, startAngle, startSpeed, depth) {
onSand = false;
_root.world.createEmptyMovieClip(instName, depth);
mc = _root.world[instName];
mc.createEmptyMovieClip("image", 0);
mc.image.createEmptyMovieClip("pirate", 1);
mc.image.createEmptyMovieClip("mast", 0);
mc.image.createEmptyMovieClip("ship", 2);
mc._x = startPosition.x;
mc._y = startPosition.y;
mc._rotation = startAngle;
maxAngle = _root.shipAngleMax;
xspeed = Math.cos((startAngle * Math.PI) / 180) * startSpeed;
yspeed = Math.sin((startAngle * Math.PI) / 180) * startSpeed;
distance = 0;
rspeed = 0;
active = true;
stopTimer = 0;
lastRot = 0;
alive = true;
}
function updateGraphics() {
mc.image.pirate.attachBitmap(bitmap1, 0, "auto", false);
mc.image.mast.attachBitmap(bitmap2, 0, "auto", false);
mc.image.ship.attachBitmap(bitmap3, 0, "auto", false);
var _local3 = ItemInfo.ships[_root.currItems[1]][1];
mc.image.mast._x = 32;
mc.image.mast._y = -64 - _local3;
mc.image.pirate._x = 48;
mc.image.pirate._y = 16 - _local3;
mc.image._x = -64;
mc.image._y = -48;
}
function moveProjectile(angleAdd) {
if (active) {
if (xspeed > 32) {
xspeed = xspeed + ((32 - xspeed) * 0.1);
}
rspeed = rspeed + angleAdd;
if (rspeed > 8) {
rspeed = 8;
} else if (rspeed < -8) {
rspeed = -8;
}
mc._rotation = mc._rotation + rspeed;
if (((mc._y + 16) < (_root.waterLevel + 16)) && ((mc._y + 16) > (_root.waterLevel - 16))) {
var _local5 = Math.floor(Math.sqrt(((xspeed * xspeed) * 0.125) + ((yspeed * yspeed) * 0.125)));
if (Math.random() < (xspeed / 32)) {
_root.wtrs[Math.floor(Math.random() * 8)].start();
}
var _local3 = 0;
while (_local3 < _local5) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point((mc._x + 32) + (Math.cos((mc._rotation * Math.PI) / 180) * -16), _root.waterLevel), 6, false));
_local3++;
}
}
if ((mc._y + 16) < _root.waterLevel) {
xspeed = xspeed * (1 - _root.airResist);
yspeed = yspeed * (1 - _root.airResist);
yspeed = yspeed + _root.gravity;
lastRot = lastRot + rspeed;
} else {
var _local6 = Math.sqrt(mc._rotation * mc._rotation);
_local6 = _local6 / 180;
if ((mc._rotation < maxAngle) && (mc._rotation > (-maxAngle))) {
if ((lastRot >= 180) || (lastRot <= -180)) {
nurot = Math.sqrt(Math.pow(lastRot, 2));
nurot = nurot + 180;
distance = distance + (5000 * Math.floor(nurot / 360));
_root.sounds[8].start();
var _local4 = 0;
while (_local4 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, true));
_local4++;
}
if (lastRot >= 180) {
_root.msgs.push(new HudMsg("flip1"));
} else {
_root.msgs.push(new HudMsg("flip2"));
}
}
if (lastRot != 0) {
lastRot = 0;
}
rspeed = rspeed + ((_local6 * (xspeed / 8)) * ItemInfo.pirates[_root.currItems[0]][0]);
yspeed = yspeed * (1 - _root.waterResist);
if ((yspeed > 0) && (!((mc._rotation > 175) || (mc._rotation < -175)))) {
yspeed = yspeed * (-_root.boyancy);
mc._y = _root.waterLevel - 16;
}
} else {
if (alive) {
_root.sounds[3].start(0.1);
var _local4 = 0;
while (_local4 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, false));
_local4++;
}
alive = false;
}
if (mc._rotation > 0) {
rspeed = (180 - mc._rotation) * 0.05;
} else {
rspeed = (-180 - mc._rotation) * 0.05;
}
yspeed = yspeed + 0.5;
xspeed = xspeed * 0.9;
}
xspeed = xspeed * (1 - _root.waterResist);
}
if (xspeed < 0.25) {
stopTimer++;
if (stopTimer > 24) {
_root.gold = _root.gold + Math.round(distance / 100);
stopTimer = 0;
active = false;
_root.gamePaused = true;
_root.scoredShow = true;
_root.scored.currscore.text = 0;
_root.nxtnse = 4;
}
} else {
stopTimer = 0;
}
mc._x = mc._x + xspeed;
mc._y = mc._y + yspeed;
distance = distance + xspeed;
if (mc._x > 350) {
_root.world._x = _root.world._x + ((((-mc._x) + 350) - _root.world._x) * 0.25);
}
if (mc._y < 0) {
_root.arro._alpha = (-mc._y) / 2;
if (_root.arro._alpha > 100) {
_root.arro._alpha = 100;
}
} else {
_root.arro._alpha = 0;
}
} else {
_root.world._x = _root.world._x + ((-_root.world._x) * 0.25);
_root.world._y = _root.world._y + ((-_root.world._y) * 0.25);
}
}
function removeProjectile() {
active = false;
mc.removeMovieClip();
}
}
Symbol 225 MovieClip [__Packages.ItemInfo] Frame 0
class ItemInfo
{
function ItemInfo () {
}
static var pirates = ["", [1, 0.8], [0.75, 0.6], [0.5, 0.4], [0.25, 0.2]];
static var ships = ["", [0.075, 0, 0.03], [0.05, 4, 0.02], [0.025, 4, 0.01], [0.01, 12, 0]];
static var masts = ["", [1], [1.25], [1.5], [1.75]];
static var wheels = ["", [0.2], [0.3], [0.4], [0.5]];
static var cannons = ["", [4, 24, 204, 204, 204], [6, 32, 40, 119, 138], [8, 40, 31, 31, 31], [10, 48, 1, 38, 186]];
static var costs = [[0, 200, 600, 1800], [0, 175, 525, 1575], [0, 150, 450, 1350], [0, 125, 375, 1125], [0, 100, 300, 900]];
static var buyPositions = [[187, 280, 372, 465], [52, 128, 204, 279, 355]];
}
Symbol 226 MovieClip [__Packages.WaterSplash] Frame 0
class WaterSplash
{
var life, radius, mc, xspeed, yspeed;
function WaterSplash (position, speedMult, coins) {
_root.splashes++;
life = (Math.random() * 25) + 75;
if (!coins) {
radius = (Math.random() * 25) + 25;
} else {
radius = (Math.random() * 50) + 25;
}
var _local3 = "spl" + _root.splashes;
_root.world.water.createEmptyMovieClip(_local3, _root.world.water.getNextHighestDepth());
mc = _root.world.water[_local3];
mc.createEmptyMovieClip("image", 0);
if (coins) {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("coin"), 0, "auto", false);
} else if (!_root.pirate.onSand) {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("water"), 0, "auto", false);
} else {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("sand"), 0, "auto", false);
}
mc._xscale = (mc._yscale = radius);
mc._alpha = life;
mc.image._x = -(radius / 2);
mc.image._y = -(radius / 2);
mc._x = position.x;
mc._y = position.y;
xspeed = ((Math.random() * speedMult) * 2) - speedMult;
yspeed = -(Math.random() * speedMult);
}
function fadeWater(index) {
if (!_root.gamePaused) {
if (fe) {
if (mc._y < _root.waterLevel) {
yspeed = yspeed + (_root.gravity / 4);
}
if (!fea) {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("feather"), 0, "auto", false);
mc._xscale = 200;
mc._yscale = 200;
mc._rotation = Math.random() * 360;
fea = true;
}
} else if (mc._y < _root.waterLevel) {
yspeed = yspeed + _root.gravity;
}
life = life - 4;
mc._alpha = life;
mc._x = mc._x + xspeed;
mc._y = mc._y + yspeed;
if ((life <= 0) || (mc._y >= _root.waterLevel)) {
mc.removeMovieClip();
_root.splashArr.splice(index, 1);
}
}
}
var fe = false;
var fea = false;
}
Symbol 227 MovieClip [__Packages.HudMsg] Frame 0
class HudMsg
{
function HudMsg (bitmap) {
var mc;
var _local2 = _root.buyMenu.msgs.getNextHighestDepth();
_root.buyMenu.msgs.createEmptyMovieClip("msg" + _local2, _local2);
mc = _root.buyMenu.msgs["msg" + _local2];
mc.attachBitmap(flash.display.BitmapData.loadBitmap(bitmap), 0);
mc._x = (-mc._width) / 2;
mc._y = (-mc._height) / 2;
mc.onEnterFrame = function () {
if (mc._alpha <= 0) {
mc.removeMovieClip();
return(undefined);
}
mc._y = mc._y - 1;
mc._alpha = mc._alpha - 1;
};
}
}
Symbol 228 MovieClip [__Packages.CannonObject] Frame 0
class CannonObject
{
var mc, format, inc, fireCount, barrel, base, maxAngle, angle, minAngle, power, minPower, maxPower;
function CannonObject (instName, depth) {
_root.world.createEmptyMovieClip(instName, depth);
mc = _root.world[instName];
mc.createTextField("angl", 3, 4, -24, 32, 32);
mc.angl.selectable = false;
format = new TextFormat();
format.color = 16777215 /* 0xFFFFFF */;
format.font = "arial";
mc.createEmptyMovieClip("barrel", 0);
mc.barrel.createEmptyMovieClip("image", 1);
mc.createEmptyMovieClip("ff", 4);
mc.ff.createEmptyMovieClip("fire", 0);
mc.createEmptyMovieClip("base", 2);
mc.base.createEmptyMovieClip("bitmap", 0);
mc.createEmptyMovieClip("powerDisp", 1);
inc = 1;
fireCount = 13;
}
function updateGraphics() {
mc.barrel.image.removeMovieClip();
mc.barrel.createEmptyMovieClip("image", 1);
mc.base.image.removeMovieClip();
mc.base.createEmptyMovieClip("image", 0);
var _local6 = new flash.geom.Transform(mc.barrel);
var _local4 = ItemInfo.cannons[_root.currItems[4]][2];
var _local5 = ItemInfo.cannons[_root.currItems[4]][3];
var _local7 = ItemInfo.cannons[_root.currItems[4]][4];
var _local3 = new flash.geom.ColorTransform(1, 1, 1, 1, -_local4, -_local5, -_local7, 0);
_local6.colorTransform = _local3;
mc.barrel.image.attachBitmap(barrel, 0, "auto", false);
mc.base.image.attachBitmap(base, 0, "auto", false);
mc.barrel.image._x = -32;
mc.barrel.image._y = -64;
mc.barrel._x = 16;
mc.base.image._x = -64;
mc.base.image._y = -64;
mc.powerDisp._x = -36;
mc.powerDisp._y = 16;
}
function updateFire(no) {
mc.ff.fire.removeMovieClip();
mc.ff.createEmptyMovieClip("fire", 4);
mc.ff.fire._x = 64;
mc.ff.fire._y = -32;
mc.ff._x = 16;
mc.ff._rotation = mc.barrel._rotation;
mc.ff.fire.attachBitmap(flash.display.BitmapData.loadBitmap("fire" + no), 0);
}
function rotateBarrel(inputAngle) {
if (inputAngle > maxAngle) {
angle = maxAngle;
} else if (inputAngle < minAngle) {
angle = minAngle;
} else {
angle = inputAngle;
}
mc.angl.text = Math.round(-angle);
mc.angl.setTextFormat(format);
mc.barrel._rotation = mc.barrel._rotation + ((angle - mc.barrel._rotation) * 0.25);
mc.powerDisp.clear();
mc.powerDisp.moveTo(0, 0);
mc.powerDisp.beginFill(3355443, 100);
mc.powerDisp.lineTo(98, 0);
mc.powerDisp.lineTo(98, 12);
mc.powerDisp.lineTo(0, 12);
mc.powerDisp.endFill();
if (power > 0) {
mc.powerDisp.moveTo(0, 0);
mc.powerDisp.beginFill(13382451, 100);
mc.powerDisp.lineTo(((power - minPower) / (maxPower - minPower)) * 98, 0);
mc.powerDisp.lineTo(((power - minPower) / (maxPower - minPower)) * 98, 12);
mc.powerDisp.lineTo(0, 12);
mc.powerDisp.endFill();
barrel = flash.display.BitmapData.loadBitmap("cannon" + Math.ceil((((power - minPower) / (maxPower - minPower)) * 4) + 1));
fireCount = 1;
updateGraphics();
}
}
function fireCannon() {
if (Math.round(fireCount) < 13) {
if (Math.round(fireCount) < 7) {
barrel = flash.display.BitmapData.loadBitmap("cannon" + Math.round(fireCount + 5));
}
updateFire(Math.round(fireCount));
updateGraphics();
fireCount = fireCount + 0.75;
} else if (Math.round(fireCount) == 13) {
mc.ff.fire.removeMovieClip();
fireCount++;
}
}
}
Symbol 229 MovieClip [__Packages.BuyButton] Frame 0
class BuyButton
{
var xx, yy, mc, fmt, fmt2, bitmap;
function BuyButton (xpos, ypos) {
xx = xpos;
yy = ypos;
var _local3 = "btn" + _root.buyMenu.getNextHighestDepth();
_root.buyMenu.createEmptyMovieClip(_local3, _root.buyMenu.getNextHighestDepth());
mc = _root.buyMenu[_local3];
mc._x = ItemInfo.buyPositions[0][xx];
mc._y = ItemInfo.buyPositions[1][yy];
mc.createTextField("cost", 1, 4, 36, 48, 16);
mc.cost.text = "Owned";
mc.cost.selectable = false;
fmt = new TextFormat();
fmt.font = "arial";
fmt.size = 12;
fmt.color = 16777215 /* 0xFFFFFF */;
fmt.align = "right";
fmt.bold = true;
fmt2 = new TextFormat();
fmt2.font = "arial";
fmt2.size = 12;
fmt2.color = 16711680 /* 0xFF0000 */;
fmt2.align = "right";
fmt2.bold = true;
}
function checkClick(mouseX, mouseY, mouseC) {
if (((_root.gold < ItemInfo.costs[yy][xx]) && (_root.currItems[yy] == xx)) || (_root.currItems[yy] < xx)) {
bitmap = flash.display.BitmapData.loadBitmap("menubtn2");
mc.attachBitmap(bitmap, 0);
if ((((mouseX > mc._x) && (mouseX < (mc._x + 56))) && (mouseY > mc._y)) && (mouseY < (mc._y + 56))) {
_root.buyMenu.currCost = ItemInfo.costs[yy][xx];
}
mc.cost.text = ItemInfo.costs[yy][xx];
mc.cost.setTextFormat(fmt2);
} else if ((_root.gold >= ItemInfo.costs[yy][xx]) && (_root.currItems[yy] == xx)) {
mc.cost.text = ItemInfo.costs[yy][xx];
mc.cost.setTextFormat(fmt);
if ((((mouseX > mc._x) && (mouseX < (mc._x + 56))) && (mouseY > mc._y)) && (mouseY < (mc._y + 56))) {
bitmap = flash.display.BitmapData.loadBitmap("menubtn4");
mc.attachBitmap(bitmap, 0);
_root.buyMenu.currCost = ItemInfo.costs[yy][xx];
if (mouseC) {
_root.gold = _root.gold - _root.buyMenu.currCost;
_root.buyMenu.currGold = _root.gold;
_root.currItems[yy] = xx + 1;
}
} else {
bitmap = flash.display.BitmapData.loadBitmap("menubtn1");
mc.attachBitmap(bitmap, 0);
}
} else {
bitmap = flash.display.BitmapData.loadBitmap("menubtn3");
mc.attachBitmap(bitmap, 0);
mc.cost.text = "Owned";
mc.cost.setTextFormat(fmt);
}
}
}
Symbol 230 MovieClip [__Packages.CloudObject] Frame 0
class CloudObject
{
var isle, mc, bitmap;
function CloudObject () {
isle = false;
var _local3 = "cloud" + _root.world.clouds.getNextHighestDepth();
_root.world.clouds.createEmptyMovieClip(_local3, _root.world.clouds.getNextHighestDepth());
mc = _root.world.clouds[_local3];
if (!isle) {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 6) + 1));
} else {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 4) + 7));
}
mc.attachBitmap(bitmap, 0, "auto", false);
mc._x = Math.random() * 700;
if (!isle) {
mc._y = Math.random() * 200;
mc._alpha = 100;
} else {
mc._y = _root.waterLevel - 64;
mc._alpha = 33;
}
}
function moveCloud() {
if (mc._x < ((-_root.world._x) - 192)) {
isle = Boolean(Math.round(Math.random()));
if (!isle) {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 6) + 1));
} else {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 4) + 7));
}
mc.attachBitmap(bitmap, 0, "auto", false);
mc._x = (-_root.world._x) + 700;
mc._x = mc._x + (Math.random() * 700);
if (!isle) {
mc._y = Math.random() * 200;
mc._alpha = 100;
} else {
mc._y = _root.waterLevel - 64;
mc._alpha = 33;
}
} else if (mc._x > ((-_root.world._x) + 700)) {
isle = Boolean(Math.round(Math.random()));
if (!isle) {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 6) + 1));
} else {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 4) + 7));
}
mc.attachBitmap(bitmap, 0, "auto", false);
mc._x = (-_root.world._x) - 192;
mc._x = mc._x - (Math.random() * 700);
if (!isle) {
mc._y = Math.random() * 200;
mc._alpha = 100;
} else {
mc._y = _root.waterLevel - 64;
mc._alpha = 33;
}
}
}
}
Symbol 211 MovieClip Frame 1
stop();