Frame 1
var trackerVars_get = new LoadVars();
var trackerVars_send = new LoadVars();
trackerVars_send.gameID = _root.gameID;
trackerVars_get.onLoad = function (success) {
if (success) {
trace("Your gameplay has been tracked succesfully");
}
};
addGamePlay = function () {
trace("ADD GAMEPLAY NOW!");
trace("Game ID: " + trackerVars_send.gameID);
trackerVars_send.sendAndLoad(_root.trackerURL, trackerVars_get, "POST");
};
_global.home = this;
gk1 = "pukeThePirate";
loadVariables (userInfoURL, this);
gotKey = true;
_global.loadScores = function (score, obj) {
delete home.scoreList;
home.scoreList = new LoadVars();
home.scoreList.onLoad = function (success) {
if (success) {
for (var _local1 in home.scoreList) {
}
setScores(1, obj);
} else {
setScores(0, obj);
}
};
if (score != undefined) {
trace("You have submitted a score to the list: " + score);
home.scoreList.load(score);
} else {
var _local2 = (home.highScoresURL + "?gk=") + home.gk1;
home.scoreList.load(_local2);
}
};
_global.getScores = function (score, obj) {
if ((score != undefined) || (score != null)) {
var _local1 = score;
var _local3 = (((((((((home.highScoresURL + "?gk=") + home.gk1) + "&uk=") + home.userKey) + "&s=") + _local1) + "&es=") + encrypt(_local1)) + "&sd=") + home.seed;
loadScores(_local3, obj);
} else {
loadScores(null, obj);
}
};
_global.setScores = function (type, obj) {
if (type) {
if (home.scoreList.rank != undefined) {
home.returnedInfo = "Good Job, you've made the list. Your RANK is " + home.scoreList.rank;
} else {
home.returnedInfo = "You're score did not make the list";
}
var _local1 = 1;
while (_local1 <= 10) {
obj["total_" + _local1] = (home.scoreList[("hs_" + _local1) + "_score"] + " pts - ") + home.scoreList[("hs_" + _local1) + "_username"];
_local1++;
}
}
};
_global.clearScores = function (obj) {
var _local1 = 1;
while (_local1 <= 10) {
obj["total_" + _local1] = "";
_local1++;
}
obj.total_1 = "Retrieving...";
};
_global.encrypt = function (encScore) {
encScore = encScore.toString();
my_date = new Date();
my_date.hours = my_date.getUTCHours();
my_date.minutes = my_date.getUTCMinutes();
my_date.seconds = my_date.getUTCSeconds();
if (my_date.seconds < 10) {
my_date.seconds = "0" + my_date.seconds;
}
if (my_date.minutes < 10) {
my_date.minutes = "0" + my_date.minutes;
}
if (my_date.hours < 10) {
my_date.hours = "0" + my_date.hours;
}
home.seed = ((((my_date.hours + ":") + my_date.minutes) + ":") + my_date.seconds) + ":28";
charList = new Array(2, 8, 10, 5, 4, 1, 11, 7);
keyChars = new Array();
i = 0;
while (i < 8) {
var _local1 = charList[i];
keyChars.push(seed.charAt(_local1 - 1));
i++;
}
snafuText = "";
i = 0;
while (i < encScore.length) {
tempHolder = keyChars.shift();
keyChars.push(tempHolder);
tempName = "ascii" + i;
tempName = encScore.charCodeAt(i) + Math.round(tempHolder);
snafuText = snafuText + String.fromCharCode(tempName);
i++;
}
return(snafuText);
};
var percent = 0;
stop();
onEnterFrame = function () {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
var _local3 = _local2 * 100;
trace("Loading Game: " + int(_local3));
_root.percent = int(_local3);
if (_local2 == 1) {
trace("Game Loaded");
delete onEnterFrame;
gotoAndStop (3);
}
};
Frame 3
Stage.scaleMode = "noScale";
var gameMain = (new com.kaboose.games.PukeThePirate.Main(this));
stop();
Sound.prototype.atcPlay = function (id, loops, offset) {
this.attachSound(id);
if (this.position <= 0) {
if ((loops <= 0) || (loops == undefined)) {
if (offset != undefined) {
this.start();
} else {
this.start(offset, 0);
}
} else if (offset != undefined) {
this.start(offset, loops);
} else {
this.start(0, loops);
}
}
this.onSoundComplete = function () {
};
};
Symbol 7 MovieClip [destroyEnemyBlue] Frame 20
stop();
this.removeMovieClip();
Symbol 9 MovieClip [rd1_grndA_01] Frame 1
var linkageName = "rd1_grndA_01";
Symbol 11 MovieClip [rd1_grassPatch_01] Frame 1
var linkageName = "rd1_grassPatch_01";
Symbol 13 MovieClip [rd1_palmTree_01] Frame 1
var linkageName = "rd1_palmTree_01";
Symbol 831 MovieClip [__Packages.com.kaboose.games.PukeThePirate.Main] Frame 0
class com.kaboose.games.PukeThePirate.Main
{
function Main (targetContainer) {
if (_instance != undefined) {
refreshMain(targetContainer);
return;
}
_instance = this;
AdManager.initialize();
new com.kaboose.games.worldengine.LevelLoader();
new com.kaboose.games.PukeThePirate.RenderLayers(targetContainer);
var _local3 = com.kaboose.games.PukeThePirate.RenderLayers._instance.renderLayer;
new com.kaboose.modules.Console.initialize();
_local3.BASE_BG.attachMovie("mainBG", "mainBG", 0);
_global.MainMenuMusic = new Sound();
_global.MainMenuMusic.attachSound("musicMainMenu");
_global.MainMenuMusic.start(0, 99999);
initMenus();
}
function initMenus() {
new com.kaboose.games.PukeThePirate.ui.menus.MainMenu();
}
function refreshMain(targetContainer) {
new com.kaboose.games.PukeThePirate.RenderLayers(targetContainer);
new com.kaboose.utils.FrameStatistics(com.kaboose.games.PukeThePirate.RenderLayers._instance.devBase(), 1);
com.kaboose.games.PukeThePirate.RenderLayers._instance.renderLayer.BASE_BG.attachMovie("mainBG", "mainBG", 0);
initMenus();
}
static var _instance = undefined;
}
Symbol 832 MovieClip [__Packages.AdManager] Frame 0
class AdManager
{
static var _instance;
var ad_int, clickArea, copy_fmt, copy_tf, dispatchEvent;
function AdManager (opac, col, adViewTime) {
_instance = this;
mx.events.EventDispatcher.initialize(this);
if (col != undefined) {
overlayColour = col;
}
if (opac != undefined) {
overlayOpacity = opac;
}
if (adViewTime != undefined) {
adTime = adViewTime;
}
flash.external.ExternalInterface.addCallback("flashResume", this, resumeGame);
flash.external.ExternalInterface.addCallback("adLoaded", this, adLoaded);
}
static function initialize(opac, col, adViewTime) {
if (_instance == undefined) {
_instance = new AdManager(opac, col, adViewTime);
}
}
static function getInstance() {
return(_instance);
}
static function setOverlayOpacity(opac) {
_instance.overlayOpacity = opac;
}
static function setOverlayColour(col) {
_instance.overlayColour = "0x" + col;
}
static function setAdTime(tm) {
_instance.adTime = tm;
}
static function loadAD(x, y) {
trace("adman.loadAD()");
if (_root._url.indexOf("http") != -1) {
flash.external.ExternalInterface.call("GameOverlay.displayGameOverlayAD", "overlay", x, y);
_instance.createClickArea(x, y);
} else {
trace("local domain");
_instance.resumeGame();
}
}
static function killAD() {
flash.external.ExternalInterface.call("GameOverlay.killOverlay", "overlay");
clearInterval(_instance.ad_int);
_instance.clickArea.swapDepths(1048000);
_instance.clickArea.removeMovieClip();
}
function startTimer() {
clearInterval(ad_int);
}
function createClickArea(x, y) {
clickArea = _root.createEmptyMovieClip("click area", _root.getNextHighestDepth());
clickArea.beginFill(overlayColour, overlayOpacity);
clickArea.moveTo(0, 0);
clickArea.lineTo(Stage.width, 0);
clickArea.lineTo(Stage.width, Stage.height);
clickArea.lineTo(0, Stage.height);
clickArea.lineTo(0, 0);
clickArea.endFill();
if (copy_fmt == undefined) {
copy_fmt = new TextFormat();
copy_fmt.align = "right";
copy_fmt.font = "_sans";
copy_fmt.size = 11;
copy_fmt.bold = true;
copy_fmt.color = 16777215 /* 0xFFFFFF */;
copy_fmt.underline = true;
}
var _local3 = clickArea.createEmptyMovieClip("textHolder", 3);
copy_tf = _local3.createTextField("copy", 2, -5, 5, Stage.width, 25);
copy_tf.text = ("CLICK HERE TO SKIP AD - Game Will Automatically Resume After " + adTime) + " seconds";
copy_tf.setTextFormat(copy_fmt);
var _local7 = 0;
var _local13 = 1;
var _local10 = 1.1;
var _local9 = 1.1;
var _local11 = 16;
var _local5 = 3;
var _local8 = false;
var _local12 = false;
var _local6 = new flash.filters.GlowFilter(_local7, _local13, _local10, _local9, _local11, _local5, _local8, _local12);
var _local4 = new Array();
_local4.push(_local6);
_local3.filters = _local4;
clickArea.onPress = killAD;
}
function resumeGame(param) {
dispatchEvent({type:"resumeGame"});
killAD();
}
function adLoaded() {
dispatchEvent({type:"adLoaded"});
ad_int = setInterval(mx.utils.Delegate.create(this, timerComplete), adTime * 1000);
}
function timerComplete() {
Trace.out("ad timer complete");
clearInterval(ad_int);
killAD();
}
var overlayOpacity = 60;
var overlayColour = 0;
var adTime = 10;
}
Symbol 833 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 834 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 835 MovieClip [__Packages.Trace] Frame 0
class Trace
{
static var _instance;
function Trace () {
AsBroadcaster.initialize(this);
}
static function initialize() {
if (_instance == undefined) {
_instance = new Trace();
}
}
static function out(message, level) {
if (level == undefined) {
level = DebugLevel.INFO;
}
if (level.setPrefix != undefined) {
level.label = level.setPrefix;
}
var _local2 = String(message);
_instance.broadcastMessage("onTraceOut", _local2, level);
trace(level.label + _local2);
}
static function list(item) {
out("" + item, DebugLevel.INFO);
for (var _local3 in item) {
var _local1 = DebugLevel.INFO;
_local1.setPrefix = "\t" + _local3;
out(" = " + item[_local3], _local1);
}
}
static function recursive(item) {
if (typeof(item) == "object") {
for (var _local5 in item) {
if (typeof(item[_local5]) == "object") {
out(_local5, {setPrefix:"-- \t", messageColor:"#FF9900"});
arguments.callee(item[_local5]);
} else {
out((_local5 + " = ") + item[_local5], {setPrefix:"\t"});
}
}
} else {
out(item.toString());
}
}
static function subscribe(listener) {
initialize();
_instance.addListener(listener);
}
static function unsubscribe(listener) {
_instance.removeListener(listener);
}
}
Symbol 836 MovieClip [__Packages.DebugLevel] Frame 0
class DebugLevel
{
function DebugLevel () {
}
static var ASSERT = {label:"ASSERTION : ", labelColor:"#CCFFFF", messageColor:undefined};
static var DEBUG = {label:"DEBUG : ", labelColor:"#00FF00", messageColor:undefined};
static var INFO = {label:"INFO : ", labelColor:"#FF99CC", messageColor:undefined};
static var WARN = {label:"WARNING : ", labelColor:"#FFFF00", messageColor:undefined};
static var ERROR = {label:"ERROR : ", labelColor:"#FF9900", messageColor:undefined};
static var NONE = {label:""};
}
Symbol 837 MovieClip [__Packages.com.kaboose.games.worldengine.LevelLoader] Frame 0
class com.kaboose.games.worldengine.LevelLoader
{
static var _instance;
function LevelLoader () {
_instance = this;
}
function loadLevel(level, WORLD) {
var _local1 = new level[undefined](WORLD);
for (var _local8 in _local1.backgrounds) {
WORLD.AddBKGLayer(_local1.backgrounds[_local8][0], _local1.backgrounds[_local8][1], _local1.backgrounds[_local8][2], _local1.backgrounds[_local8][3], _local1.backgrounds[_local8][4], _local1.backgrounds[_local8][5]);
}
if (_local1.matte != undefined) {
WORLD.addStaticMatte(_local1.matte);
}
var _local11 = _local1.pickups.length / 3;
var _local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 3;
var _local9 = _local1.pickups[_local5 + 2];
for (var _local10 in com.kaboose.games.PukeThePirate.GamePickups.ITEM_LIST) {
if (com.kaboose.games.PukeThePirate.GamePickups.ITEM_LIST[_local10] == _local9.toString()) {
var _local7 = _local1.pickups[_local5];
var _local6 = _local1.pickups[_local5 + 1];
var _local4 = com.kaboose.games.PukeThePirate.GamePickups.ATTRIBUTE_LIST[_local10];
var _local3 = new com.kaboose.games.PukeThePirate.GamePickups.CLASS_LIST[_local10](_local7, _local6, _local4);
WORLD.pickups.push(_local3);
}
}
_local8++;
}
_local11 = _local1.dropTiles.length / 9;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 9;
WORLD.generateDropTile(_local1.dropTiles[_local5], _local1.dropTiles[_local5 + 1], _local1.dropTiles[_local5 + 2], _local1.dropTiles[_local5 + 3], _local1.dropTiles[_local5 + 4] - 1, _local1.dropTiles[_local5 + 5], _local1.dropTiles[_local5 + 6], _local1.dropTiles[_local5 + 7], _local1.dropTiles[_local5 + 8]);
_local8++;
}
_local11 = _local1.cTiles.length / 5;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 5;
WORLD.generateTile(_local1.cTiles[_local5], _local1.cTiles[_local5 + 1], _local1.cTiles[_local5 + 2], _local1.cTiles[_local5 + 3] - 1, _local1.cTiles[_local5 + 4]);
_local8++;
}
_local11 = _local1.hazards.length / 6;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 6;
WORLD.generateHazardTile(_local1.hazards[_local5], _local1.hazards[_local5 + 1], _local1.hazards[_local5 + 2], _local1.hazards[_local5 + 3], _local1.hazards[_local5 + 4] - 1, _local1.hazards[_local5 + 5]);
_local8++;
}
_local11 = _local1.spikeTraps.length / 6;
_local8 = 0;
while (_local8 < _local11) {
trace("load Spike Trap");
var _local5 = _local8 * 6;
WORLD.generateSpikeTrap(_local1.spikeTraps[_local5], _local1.spikeTraps[_local5 + 1], _local1.spikeTraps[_local5 + 2], _local1.spikeTraps[_local5 + 3], _local1.spikeTraps[_local5 + 4] - 1, _local1.spikeTraps[_local5 + 5]);
_local8++;
}
_local11 = _local1.containers.length / 7;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 7;
WORLD.generateContainer(_local1.containers[_local5], _local1.containers[_local5 + 1], _local1.containers[_local5 + 2], _local1.containers[_local5 + 3], _local1.containers[_local5 + 4] - 1, _local1.containers[_local5 + 5], _local1.containers[_local5 + 6]);
_local8++;
}
_local11 = _local1.trapDoors.length / 6;
_local8 = 0;
while (_local8 < _local11) {
trace("trappy");
var _local5 = _local8 * 6;
WORLD.generateTrapDoor(_local1.trapDoors[_local5], _local1.trapDoors[_local5 + 1], _local1.trapDoors[_local5 + 2], _local1.trapDoors[_local5 + 3], _local1.trapDoors[_local5 + 4] - 1, _local1.trapDoors[_local5 + 5]);
_local8++;
}
_local11 = _local1.cannons.length / 6;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 6;
WORLD.generateCannon(_local1.cannons[_local5], _local1.cannons[_local5 + 1], _local1.cannons[_local5 + 2], _local1.cannons[_local5 + 3], _local1.cannons[_local5 + 4] - 1, _local1.cannons[_local5 + 5]);
_local8++;
}
_local11 = _local1.cSlabs.length / 6;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 6;
WORLD.generateTileSlab(_local1.cSlabs[_local5], _local1.cSlabs[_local5 + 1], _local1.cSlabs[_local5 + 2], _local1.cSlabs[_local5 + 3], _local1.cSlabs[_local5 + 4] - 1, _local1.cSlabs[_local5 + 5]);
_local8++;
}
_local11 = _local1.movers.length / 12;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 12;
WORLD.generateMover(_local1.movers[_local5], _local1.movers[_local5 + 1], _local1.movers[_local5 + 2], _local1.movers[_local5 + 3], _local1.movers[_local5 + 4] - 1, _local1.movers[_local5 + 5], _local1.movers[_local5 + 6], _local1.movers[_local5 + 7], _local1.movers[_local5 + 8], _local1.movers[_local5 + 9], _local1.movers[_local5 + 10], _local1.movers[_local5 + 11]);
_local8++;
}
_local11 = _local1.stompers.length / 10;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 10;
WORLD.generateStomper(_local1.stompers[_local5], _local1.stompers[_local5 + 1], _local1.stompers[_local5 + 2], _local1.stompers[_local5 + 3], _local1.stompers[_local5 + 4] - 1, _local1.stompers[_local5 + 5], _local1.stompers[_local5 + 6], _local1.stompers[_local5 + 7], _local1.stompers[_local5 + 8], _local1.stompers[_local5 + 9]);
_local8++;
}
_local11 = _local1.enemies.length / 4;
_local8 = 0;
while (_local8 < _local11) {
var _local5 = _local8 * 4;
WORLD.generateEnemy(_local1.enemies[_local5], _local1.enemies[_local5 + 1], _local1.enemies[_local5 + 2], _local1.enemies[_local5 + 3]);
_local8++;
}
}
}
Symbol 838 MovieClip [__Packages.com.kaboose.games.worldengine.WorldRenderer] Frame 0
class com.kaboose.games.worldengine.WorldRenderer
{
var worldContainer, matteContainer, bkgContainer, mc, worldMatrix, oX, oY, oTiles, oW, oH, oldax, olday, scrollX, xPos, playerScreenX, playerSpawnX, scrollY, yPos, playerScreenY, playerSpawnY, oX_oW, oY_oH, areaWidth, areaHeight, movementReference, XMIN, XMAX, YMIN, YMAX, GRAV, DRAG, FRICTION, TILERAD;
function WorldRenderer ($target) {
trace("* Instantiate WorldRenderer *");
worldContainer = $target;
matteContainer = $target.createEmptyMovieClip("matteContainer", 0);
bkgContainer = $target.createEmptyMovieClip("worldBKGContainer", 1);
mc = $target.createEmptyMovieClip("mapObjects", 2);
worldMatrix = new flash.geom.Matrix();
oX = [];
oY = [];
oTiles = [];
oW = [];
oH = [];
}
function init() {
trace("= Initializing WorldRenderer =");
oldax = null;
olday = null;
if (!scrollX) {
xPos = sOffX;
} else {
xPos = (sOffX + playerSpawnX) - playerScreenX;
}
if (!scrollY) {
yPos = sOffY;
} else {
yPos = (sOffY + playerSpawnY) - playerScreenY;
}
oX_oW = [];
oY_oH = [];
nOfVisObj = 0;
var _local3 = 0;
while (_local3 < oX.length) {
oX_oW[_local3] = oX[_local3] + oW[_local3];
oY_oH[_local3] = oY[_local3] + oH[_local3];
_local3++;
}
registerObjects();
trace("Total objects in level: " + oX.length);
trace("movers: " + movers.length);
trace("stompers: " + stompers.length);
trace("pickups: " + pickups.length);
trace("enemies: " + _global.game.enemies.length);
}
function resetPosition() {
if (!scrollX) {
xPos = sOffX;
} else {
xPos = (sOffX + playerSpawnX) - playerScreenX;
}
if (!scrollY) {
yPos = sOffY;
} else {
yPos = (sOffY + playerSpawnY) - playerScreenY;
}
mc._x = sOffX - Math.round(xPos);
mc._y = sOffY - Math.round(yPos);
}
function resetPlayer() {
_global.game.PlayerObj.colObj.pos.x = playerSpawnX;
_global.game.PlayerObj.colObj.oldpos.x = playerSpawnX;
_global.game.PlayerObj.colObj.pos.y = playerSpawnY;
_global.game.PlayerObj.colObj.oldpos.y = playerSpawnY;
_global.game.PlayerObj.stunned = false;
_global.game.PlayerObj.alive = true;
_global.game.PlayerObj.flying = false;
_global.game.PlayerObj.onMover = false;
Key.addListener(_global.game.PlayerObj.playerKey);
}
function resetDropTiles() {
trace("resetDropTIles()");
for (var _local2 in dropTiles) {
trace("drop tile loop: " + _local2);
dropTiles[_local2].restore();
}
}
function addStaticMatte($linkage) {
new com.kaboose.games.worldengine.StaticWorldLayer($linkage, matteContainer, 1, areaWidth, areaHeight, 0, 0, false);
}
function AddBKGLayer($linkageClipToUse, $speed, $offsetx, $offsety, $transparent, $frame) {
var _local2 = bkgLayers.length;
var _local3 = bkgContainer.createEmptyMovieClip("container" + _local2, _local2);
bkgLayers.push(new com.kaboose.games.worldengine.StaticWorldLayer($linkageClipToUse, _local3, $speed, areaWidth, areaHeight, $offsetx, $offsety, $transparent, $frame));
}
function MoveBKGLayers($dx, $dy) {
for (var _local2 in bkgLayers) {
bkgLayers[_local2].container.mc.transform.matrix = worldMatrix;
}
}
function unloadLevel() {
delete _global.game.PlayerObj;
oX = new Array();
oY = new Array();
for (var _local5 in oTiles) {
var _local3 = oTiles[n];
var _local5 = _local3.length / tileAttributeCount;
var _local4 = oTiles[n][4];
while (_local5--) {
_local4 = _local3[(_local5 * tileAttributeCount) + 4];
}
}
oTiles = new Array();
oW = new Array();
oH = new Array();
oX_oW = new Array();
oY_oH = new Array();
for (var _local5 in mc) {
if (typeof(mc[_local5]) == "movieclip") {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc[_local5]);
}
}
movementReference = null;
worldMatrix.identity();
for (var _local5 in matteContainer) {
for (var n in matteContainer[_local5]) {
matteContainer[_local5][n][0].dispose();
}
}
matteContainer.mc.removeMovieClip();
for (var _local5 in bkgLayers) {
for (var n in bkgLayers[_local5].container.bmpDataArray) {
trace("loop through bmpDataArray: " + n);
bkgLayers[_local5].container.bmpDataArray[n][0].dispose();
}
bkgLayers[_local5].container.removeMovieClip();
}
bkgLayers = new Array();
for (var _local5 in dropTiles) {
delete dropTiles[_local5];
}
dropTiles = new Array();
for (var _local5 in movingObjects) {
delete movingObjects[_local5];
}
movingObjects = new Array();
for (var _local5 in dynamicObjects) {
delete dynamicObjects[_local5];
}
dynamicObjects = new Array();
for (var _local5 in movers) {
delete movers[_local5];
movers.splice(int(_local5), 1);
}
movers = new Array();
for (var _local5 in stompers) {
delete stompers[_local5];
stompers.splice(int(_local5), 1);
}
stompers = new Array();
for (var _local5 in projectiles) {
delete projectiles[_local5];
projectiles.splice(int(_local5), 1);
}
projectiles = new Array();
for (var _local5 in pickups) {
delete pickups[_local5];
pickups.splice(int(_local5), 1);
}
pickups = new Array();
for (var _local5 in _global.game.enemies) {
delete _global.game.enemies[_local5];
_global.game.enemies.splice(int(_local5), 1);
}
_global.game.enemies = new Array();
for (var _local5 in _global.game.spriteBuffers) {
_global.game.spriteBuffers[_local5].destroyAllSprites();
}
}
function SetPlayerSpawn(x, y) {
playerSpawnX = x;
playerSpawnY = y;
}
function SetPlayerScreenPosition(x, y) {
playerScreenX = x;
playerScreenY = y;
}
function SetArea(width, height) {
areaWidth = width;
areaHeight = height;
}
function SetScroll(dir, val) {
this["scroll" + dir.toUpperCase()] = val;
}
function SetWorldBounds(xmin, xmax, ymin, ymax) {
XMIN = xmin;
XMAX = xmax;
YMIN = ymin;
YMAX = ymax;
}
function SetGravity(grav) {
GRAV = grav;
}
function SetDrag(drag) {
DRAG = drag;
}
function SetFriction(friction) {
FRICTION = friction;
}
function SetTileSize(size) {
TILERAD = size;
}
function setMovementReference($obj) {
trace("Setting new Movement Reference to " + $obj);
movementReference = $obj;
}
function drawObject(n) {
var _local9 = false;
var _local5 = oTiles[n];
var _local8 = mc.createEmptyMovieClip(n, n);
_local8._x = oX[n];
_local8._y = oY[n];
var _local3 = _local5.length / tileAttributeCount;
if (_local3 != 1) {
_local9 = true;
}
while (_local3--) {
var _local4 = tileAttributeCount;
var _local6 = _local5[(_local3 * _local4) + 4];
var _local2 = _local8.attachMovie(_local5[_local3 * _local4], _local3, _local3);
_local2.cacheAsBitmap();
_local2.gotoAndStop(_local5[(_local3 * _local4) + 1]);
_local2.objectID = n;
_local2._xscale = _local5[(_local3 * _local4) + 5];
_local2._yscale = _local5[(_local3 * _local4) + 6];
_local6.setClip(_local2);
if (_local6 instanceof com.kaboose.games.worldengine.Container) {
if (_local6.opened) {
_local2.gotoAndStop("opened");
trace("its open");
} else {
_local2.gotoAndStop("closed");
trace("its closed");
}
}
if (_local9) {
_local2._x = _local5[(_local3 * _local4) + 2];
_local2._y = _local5[(_local3 * _local4) + 3];
}
}
nOfVisObj++;
}
function updateObject(index) {
var _local3 = oTiles[index][4];
if (_local3.colObj == undefined) {
oX[index] = (oTiles[index][2] = _local3.pos.x);
oY[index] = (oTiles[index][3] = _local3.pos.y);
} else {
oX[index] = (oTiles[index][2] = _local3.colObj.pos.x);
oY[index] = (oTiles[index][3] = _local3.colObj.pos.y);
}
oX_oW[index] = oX[index] + _local3.xw;
oY_oH[index] = oY[index] + _local3.yw;
}
function killProjectiles() {
for (var _local2 in projectiles) {
projectiles[_local2].destroy(_local2);
}
}
function getZone(obj) {
var _local2 = {x:Number, y:Number};
if (obj.colObj == undefined) {
_local2.x = int(obj.pos.x / areaWidth);
_local2.y = int(obj.pos.y / areaHeight);
} else {
_local2.x = int(obj.colObj.pos.x / areaWidth);
_local2.y = int(obj.colObj.pos.y / areaHeight);
}
return(_local2);
}
function registerObjects() {
if (!((areaWidth > 0) && (areaHeight > 0))) {
trace("check area dimensions are defined");
return(undefined);
}
a = [];
var _local7 = Math.max;
var _local4 = 0;
while (_local4 < oX.length) {
var _local9 = _local7(int(oX[_local4] / areaWidth), 0);
var _local6 = _local7(int(oY[_local4] / areaHeight), 0);
var _local8 = _local7(int(oX_oW[_local4] / areaWidth), 0);
var _local5 = _local7(int(oY_oH[_local4] / areaHeight), 0);
var _local2 = _local9;
while (_local2 <= _local8) {
var _local3 = _local6;
while (_local3 <= _local5) {
if (a[_local2] == undefined) {
a[_local2] = [];
}
if (a[_local2][_local3] == undefined) {
a[_local2][_local3] = [];
}
a[_local2][_local3][_local4] = true;
_local3++;
}
_local2++;
}
_local4++;
}
}
function checkScrollLimit() {
scrollLeft = true;
scrollRight = true;
if (xPos <= XMIN) {
scrollRight = false;
scrollLeft = true;
var _local3 = XMIN + playerScreenX;
if (_global.game.PlayerObj.colObj.pos.x < _local3) {
xPos = XMIN;
scrollLeft = false;
}
}
if (xPos >= (XMAX - areaWidth)) {
scrollRight = true;
scrollLeft = false;
var _local3 = XMAX - playerScreenX;
if (_global.game.PlayerObj.colObj.pos.x > _local3) {
xPos = XMAX - areaWidth;
scrollRight = false;
}
}
}
function updateScreenPos($dx, $dy) {
if (scrollX) {
if ($dx < 0) {
if (scrollRight) {
xPos = xPos + $dx;
}
} else if ($dx > 0) {
if (scrollLeft) {
xPos = xPos + $dx;
}
}
}
if (scrollY) {
yPos = yPos + $dy;
}
}
function render() {
var _local13 = Math.round(xPos);
var _local12 = Math.round(yPos);
var _local8 = int(_local13 / areaWidth);
var _local7 = int(_local12 / areaHeight);
if ((_local8 == oldax) && (_local7 == olday)) {
for (var _local3 in mc) {
if (!oV[_local3]) {
var _local11 = t[4];
_local11.offScreen();
removeMovieClip(mc[_local3]);
nOfVisObj--;
break;
}
}
} else {
oldax = _local8;
olday = _local7;
ar = [];
for (var _local3 in a[_local8][_local7]) {
ar[_local3] = true;
}
for (var _local3 in a[_local8 + 1][_local7]) {
ar[_local3] = true;
}
for (var _local3 in a[_local8][_local7 + 1]) {
ar[_local3] = true;
}
for (var _local3 in a[_local8 + 1][_local7 + 1]) {
ar[_local3] = true;
}
}
var _local18 = oX;
var _local15 = oY;
var _local16 = oX_oW;
var _local14 = oY_oH;
var _local20 = _local13 + areaWidth;
var _local19 = _local12 + areaHeight;
delete oV;
oV = [];
var _local3 = 0;
while (_local3 <= ar.length) {
if (_local16[_local3] > _local13) {
if (_local18[_local3] < _local20) {
if (_local14[_local3] > _local12) {
if (_local15[_local3] < _local19) {
oV[_local3] = true;
var t = oTiles[_local3];
var _local11 = t[4];
_local11.onScreen();
if (t[4].bounds == undefined) {
if (!mc[_local3]) {
drawObject(_local3);
}
}
var _local6 = t.length / tileAttributeCount;
while (_local6--) {
var _local4 = t[(_local6 * tileAttributeCount) + 4];
var _local5 = _local4 instanceof com.kaboose.games.worldengine.Mover;
if (!_local5) {
if (_local4 != null) {
if (_local4.CTYPE > 0) {
_global.game.PlayerObj.collideVsTile(_local4);
}
}
}
}
}
}
}
}
_local3++;
}
var _local22 = mc._x;
var _local21 = mc._y;
var _local10 = (sOffX - _local13) - _local22;
var _local9 = (sOffY - _local12) - _local21;
worldMatrix.translate(_local10, _local9);
mc.transform.matrix = worldMatrix;
MoveBKGLayers();
for (var _local6 in movingObjects) {
movingObjects[_local6].onGameLoop(_local6);
}
for (var _local6 in dynamicObjects) {
dynamicObjects[_local6].onGameLoop(_local6);
}
var _local17 = movers.length;
var _local6 = 0;
while (_local6 < _local17) {
movers[_local6].onGameLoop(_local10, _local9);
_local6++;
}
_local17 = pickups.length;
_local6 = 0;
while (_local6 < _local17) {
pickups[_local6].onGameLoop(_local10, _local9, _local6);
_local6++;
}
_local17 = stompers.length;
_local6 = 0;
while (_local6 < _local17) {
stompers[_local6].onGameLoop(_local10, _local9);
_local6++;
}
_local17 = projectiles.length;
_local6 = 0;
while (_local6 < _local17) {
projectiles[_local6].onGameLoop(_local6, _local10, _local9);
_local6++;
}
}
function collisionTileCheck(objRef) {
var _local11 = Math.round(objRef.colObj.pos.x);
var _local10 = Math.round(objRef.colObj.pos.y);
var _local7 = int(_local11 / areaWidth);
var _local6 = int(_local10 / areaHeight);
var _local4 = [];
for (var _local9 in a[_local7][_local6]) {
_local4[_local9] = true;
}
for (var _local9 in a[_local7 + 1][_local6]) {
_local4[_local9] = true;
}
for (var _local9 in a[_local7][_local6 + 1]) {
_local4[_local9] = true;
}
for (var _local9 in a[_local7 + 1][_local6 + 1]) {
_local4[_local9] = true;
}
for (var _local9 in _local4) {
var _local5 = oTiles[_local9];
var _local3 = _local5.length / tileAttributeCount;
while (_local3--) {
var _local2 = _local5[(_local3 * tileAttributeCount) + 4];
if (_local2.CTYPE > 0) {
objRef.collideVsTile(_local2);
}
}
}
}
function generateEnemy(classObject, startx, starty, attributes) {
var _local7 = (TILERAD * 2) * (classObject.width / 100);
var _local6 = (TILERAD * 2) * (classObject.height / 100);
var _local2 = new classObject[undefined](startx, starty, oX.length, attributes);
dynamicObjects.push(_local2);
oX.push(startx);
oY.push(starty);
oTiles.push([classObject.LIB_REF, null, startx, starty, _local2, 100, 100]);
oW.push(_local7);
oH.push(_local6);
}
function generateMapObject(startx, starty, scaleX, scaleY, libRef) {
var _local3 = (TILERAD * 2) * (scaleX / 100);
var _local2 = (TILERAD * 2) * (scaleY / 100);
var _local4 = new com.kaboose.games.worldengine.MapObject(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2, libRef);
oX.push(startx);
oY.push(starty);
oTiles.push([libRef, null, startx, starty, _local4, 100, 100]);
oW.push(_local3);
oH.push(_local2);
}
function generateDropTile(x, y, width, height, dropSpeed, dropDelay, dropDistance, colTileType, tileset) {
trace("gen drop");
var _local4 = (TILERAD * 2) * (width / 100);
var _local3 = (TILERAD * 2) * (height / 100);
var _local8 = colTileType + 1;
var _local2 = new com.kaboose.games.worldengine.DropTile(x + (_local4 / 2), y + (_local3 / 2), _local4, _local3, dropSpeed, dropDelay, dropDistance, tileset, oX.length);
_local2.SetState(1);
dropTiles.push(_local2);
oX.push(x);
oY.push(y);
oTiles.push([tileset, 1, x, y, _local2, 100, 100]);
oW.push(_local4);
oH.push(_local3);
}
function generateContainer(startx, starty, scaleX, scaleY, type, tileset, contents) {
var _local3 = (TILERAD * 2) * (scaleX / 100);
var _local2 = (TILERAD * 2) * (scaleY / 100);
var _local5 = type + 1;
var _local4 = new com.kaboose.games.worldengine.Container(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2, tileset, contents);
_local4.SetState(_local5);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local4, 100, 100]);
oW.push(_local3);
oH.push(_local2);
}
function generateTrapDoor(startx, starty, scaleX, scaleY, type, tileset, contents) {
var _local3 = (TILERAD * 2) * (scaleX / 100);
var _local2 = (TILERAD * 2) * (scaleY / 100);
var _local5 = type + 1;
var _local4 = new com.kaboose.games.worldengine.TrapDoor(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2, tileset, oX.length);
_local4.SetState(_local5);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local4, 100, 100]);
oW.push(_local3);
oH.push(_local2);
}
function generateCannon(startx, starty, scaleX, scaleY, type, tileset) {
var _local3 = (TILERAD * 2) * (scaleX / 100);
var _local2 = (TILERAD * 2) * (scaleY / 100);
var _local7 = type;
var _local4 = new com.kaboose.games.PukeThePirate.enemies.Cannon(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2, tileset);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local7 + 1, startx, starty, _local4, 100, 100]);
oW.push(_local3);
oH.push(_local2);
}
function generateMover(startx, starty, scaleX, scaleY, type, tileset, xspeed, yspeed, boundsTop, boundsRight, boundsBottom, boundsLeft) {
var _local4 = (TILERAD * 2) * (scaleX / 100);
var _local3 = (TILERAD * 2) * (scaleY / 100);
var _local5 = type + 1;
var _local6 = [boundsTop, boundsRight, boundsBottom, boundsLeft];
var _local2 = new com.kaboose.games.worldengine.Mover(xspeed, yspeed, _local6, startx + (_local4 / 2), starty + (_local3 / 2), _local4, _local3, tileset);
_local2.SetState(_local5);
movers.push(_local2);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local2, scaleX, scaleY]);
oW.push(_local4);
oH.push(_local3);
}
function generateStomper(startx, starty, scaleX, scaleY, type, tileset, attackSpeed, reloadSpeed, boundsTop, boundsBottom) {
var _local4 = (TILERAD * 2) * (scaleX / 100);
var _local3 = (TILERAD * 2) * (scaleY / 100);
var _local5 = type + 1;
var _local6 = [boundsTop, boundsBottom];
var _local2 = new com.kaboose.games.worldengine.Stomper(attackSpeed, reloadSpeed, _local6, startx + (_local4 / 2), starty + (_local3 / 2), _local4, _local3, tileset, oX.length);
_local2.SetState(_local5);
stompers.push(_local2);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local2, (scaleX / TILERAD) * 100, (scaleY / TILERAD) * 100]);
oW.push(_local4);
oH.push(_local3);
}
function generateTile(startx, starty, scale, type, tileset) {
var _local2 = (TILERAD * 2) * (scale / 100);
var _local4 = type + 1;
tileset = undefined;
var _local3 = new com.kaboose.games.worldengine.CollisionTile(startx + (_local2 / 2), starty + (_local2 / 2), _local2, _local2);
_local3.SetState(_local4);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local4 + 1, startx, starty, _local3, scale, scale]);
oW.push(_local2);
oH.push(_local2);
}
function generateHazardTile(startx, starty, scaleX, scaleY, type, tileset) {
var _local3 = (TILERAD * 2) * (scaleX / 100);
var _local2 = (TILERAD * 2) * (scaleY / 100);
var _local5 = type + 1;
var _local4 = new com.kaboose.games.worldengine.HazardTile(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2, tileset);
_local4.SetState(_local5);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local4, scaleX, scaleY]);
oW.push(_local3);
oH.push(_local2);
}
function generateSpikeTrap(startx, starty, width, height, type, tileset) {
trace("gen SpikeTrap");
var _local3 = (TILERAD * 2) * (width / 100);
var _local2 = (TILERAD * 2) * (height / 100);
var _local5 = type + 1;
var _local4 = new com.kaboose.games.worldengine.SpikeTrap(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2, tileset);
_local4.SetState(_local5);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local4, 100, 100]);
oW.push(_local3);
oH.push(_local2);
}
function generateTileSlab(startx, starty, scaleX, scaleY, type, tileset) {
var _local3 = (TILERAD * 2) * (scaleX / 100);
var _local2 = (TILERAD * 2) * (scaleY / 100);
var _local5 = type + 1;
var _local4 = new com.kaboose.games.worldengine.CollisionTile(startx + (_local3 / 2), starty + (_local2 / 2), _local3, _local2);
_local4.SetState(_local5);
oX.push(startx);
oY.push(starty);
oTiles.push([tileset, _local5 + 1, startx, starty, _local4, scaleX, scaleY]);
oW.push(_local3);
oH.push(_local2);
}
function generatePrefab(startx, starty, scale, map, tileset) {
var _local13 = map[0].length;
var _local18 = map.length;
var _local8 = TILERAD * (scale / 100);
var _local10 = _local8 * 2;
var _local9 = _local8 * 2;
var _local14 = new Array();
var _local3 = 0;
while (_local3 < _local18) {
var _local2 = 0;
while (_local2 < _local13) {
if (map[_local3][_local2] != 0) {
var _local6 = _local2 * _local10;
var _local5 = _local3 * _local9;
var _local7 = map[_local3][_local2];
var _local4 = new com.kaboose.games.worldengine.CollisionTile((_local6 + startx) + _local8, (_local5 + starty) + _local8, _local10, _local9);
_local4.SetState(_local7);
_local14.push(tileset, _local7 + 1, _local6, _local5, _local4, scale, scale);
}
_local2++;
}
_local3++;
}
oX.push(startx);
oY.push(starty);
oTiles.push(_local14);
oW.push(_local13 * _local10);
oH.push(_local18 * _local9);
}
var bkgLayers = [];
var movers = [];
var stompers = [];
var projectiles = [];
var pickups = [];
var containers = [];
var dropTiles = [];
var movingObjects = [];
var dynamicObjects = [];
var tileAttributeCount = 7;
var oV = [];
var ar = [];
var a = [];
var nOfVisObj = 0;
var sOffX = 0;
var sOffY = 0;
var scrollLeft = true;
var scrollRight = true;
}
Symbol 839 MovieClip [__Packages.com.kaboose.games.worldengine.StaticWorldLayer] Frame 0
class com.kaboose.games.worldengine.StaticWorldLayer
{
var speed, container, mc;
function StaticWorldLayer (clipToDraw, superContainer, $speed, maskW, maskH, $offsetx, $offsety, $transparent, frame) {
speed = $speed;
container = superContainer;
mc = superContainer.createEmptyMovieClip("mc", 2);
var clip = _root.attachMovie(clipToDraw, "bigClip", 548684);
if (frame != undefined) {
trace("frame Stitch detected: " + frame);
clip.gotoAndStop(frame);
}
clip._alpha = 0;
var clipW = clip._width;
var clipH = clip._height;
var rows = Math.ceil(clipW / w);
var cols = Math.ceil(clipH / h);
container.bmpDataArray = new Array();
var col = 0;
while (col < cols) {
var row = 0;
while (row < rows) {
if ($transparent) {
var bmp = (new flash.display.BitmapData(w, h, true, 0));
} else {
var bmp = (new flash.display.BitmapData(w, h, false));
}
var xpos = (w * row);
var ypos = (h * col);
var graphics = [bmp, xpos, ypos];
container.bmpDataArray.push(graphics);
row++;
}
col++;
}
var k = 0;
var bmpDataArray = container.bmpDataArray;
for (var i in container.bmpDataArray) {
with (container.mc.createEmptyMovieClip("holder" + k, k)) {
var matrix = (new flash.geom.Matrix($speed, 0, 0, $speed, bmpDataArray[i][1] * -1, bmpDataArray[i][2] * -1));
bmpDataArray[i][0].draw(clip, matrix);
attachBitmap(bmpDataArray[i][0], 0);
_x = bmpDataArray[i][1] + $offsetx;
_y = bmpDataArray[i][2] + $offsety;
}
k++;
}
clip.removeMovieClip();
container.scrollRect = new flash.geom.Rectangle(0, 0, maskW, maskH);
}
function addBMP() {
}
function finishBMP() {
}
static var w = 550;
static var h = 425;
}
Symbol 840 MovieClip [__Packages.com.kaboose.games.PukeThePirate.SpriteManager] Frame 0
class com.kaboose.games.PukeThePirate.SpriteManager
{
var rootbuffer, front_depth, back_depth, stepsize;
function SpriteManager ($buffer) {
trace("Creating New SpriteManager: " + $buffer);
rootbuffer = $buffer;
front_depth = 1000;
back_depth = 1000;
stepsize = 100;
}
function createSprite($linkage) {
var _local2 = getNextDepth_Front();
var _local3 = rootbuffer.attachMovie($linkage, $linkage + _local2, _local2);
return(_local3);
}
function createEmptySprite($n) {
trace("crea te empty");
var _local3 = getNextDepth_Front();
var _local2 = rootbuffer.createEmptyMovieClip($n, _local3);
return(_local2);
}
static function destroyMC($mc) {
$mc.swapDepths(1048000);
$mc.removeMovieClip();
}
function destroyAllSprites() {
for (var _local2 in rootbuffer) {
if (typeof(rootbuffer[_local2]) == "movieclip") {
destroyMC(rootbuffer[_local2]);
}
}
front_depth = 1000;
}
function getNextDepth_Front() {
front_depth = front_depth + stepsize;
return(front_depth);
}
function getNextDepth_Back() {
back_depth = back_depth - stepsize;
return(back_depth);
}
function getBuffer() {
return(rootbuffer);
}
}
Symbol 841 MovieClip [__Packages.com.kaboose.games.worldengine.CollisionTile] Frame 0
class com.kaboose.games.worldengine.CollisionTile
{
var ID, CTYPE, pos, xw, yw, minx, maxx, miny, maxy;
function CollisionTile ($x, $y, $xw, $yw) {
ID = TID_EMPTY;
CTYPE = CTYPE_EMPTY;
pos = {};
pos.x = $x;
pos.y = $y;
xw = $xw / 2;
yw = $yw / 2;
minx = pos.x;
maxx = pos.x + xw;
miny = pos.y;
maxy = pos.y + yw;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
}
function Draw() {
}
function SetState($ID) {
if ($ID == TID_EMPTY) {
Clear();
} else {
ID = $ID;
UpdateType();
Draw();
}
}
function Clear() {
ID = TID_EMPTY;
UpdateType();
Draw();
}
function UpdateType() {
if (0 < ID) {
if (ID == CTYPE_FULL) {
CTYPE = CTYPE_FULL;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
}
} else {
CTYPE = CTYPE_EMPTY;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
}
}
var signx = 0;
var signy = 0;
var sx = 0;
var sy = 0;
static var TID_EMPTY = 0;
static var TID_FULL = 1;
static var CTYPE_EMPTY = 0;
static var CTYPE_FULL = 1;
static var CTYPE_45DEG = 2;
static var CTYPE_CONCAVE = 6;
static var CTYPE_CONVEX = 10;
static var CTYPE_22DEGs = 14;
static var CTYPE_22DEGb = 18;
static var CTYPE_67DEGs = 22;
static var CTYPE_67DEGb = 26;
static var CTYPE_HALF = 30;
}
Symbol 842 MovieClip [__Packages.com.kaboose.games.worldengine.Container] Frame 0
class com.kaboose.games.worldengine.Container extends com.kaboose.games.worldengine.CollisionTile
{
var contents, spawnSound, mc, pos;
function Container ($x, $y, $xw, $yw, $linkage, $contents) {
super($x, $y, $xw, $yw);
trace("new Container");
contents = $contents.split(", ");
spawnSound = new Sound();
spawnSound.attachSound(SND_SPAWN_REF);
}
function openContainer() {
super.SetState(0);
opened = true;
mc.gotoAndPlay("open");
var _local13 = 40;
var _local11 = 10;
var _local9 = contents.length;
var _local12 = [];
var _local10 = 0;
while (_local10 < _local9) {
_local10++;
}
for (_local10 in contents) {
for (var _local8 in com.kaboose.games.PukeThePirate.GamePickups.ITEM_LIST) {
if (com.kaboose.games.PukeThePirate.GamePickups.ITEM_LIST[_local8] == contents[_local10]) {
var _local6 = pos.x;
var _local4 = pos.y - 100;
var _local7 = com.kaboose.games.PukeThePirate.GamePickups.ATTRIBUTE_LIST[_local8];
var _local5 = new com.kaboose.games.PukeThePirate.GamePickups.CLASS_LIST[_local8](_local6, _local4, _local7);
spawnSound.start();
_global.game.World.pickups.push(_local5);
}
}
}
}
function setClip(clip) {
mc = clip;
}
var SND_SPAWN_REF = "sndSpawnPickup";
var opened = false;
}
Symbol 843 MovieClip [__Packages.com.kaboose.games.worldengine.BasePickup] Frame 0
class com.kaboose.games.worldengine.BasePickup
{
var colObj, pickupSound, SND_REF, mc, linkage, playerZone;
function BasePickup (x, y, r, bounce, type) {
colObj = new com.kaboose.games.worldengine.Sphere(x, y, r, bounce, this);
pickupSound = new Sound();
pickupSound.attachSound(SND_REF);
}
function applyItem(_object) {
playSound();
}
function playSound() {
trace("playPickupSound");
pickupSound.start();
}
function collideVsDynamicObject(_object, index) {
if (determinePlayerZone()) {
if (mc == undefined) {
createSprite();
}
var _local3 = false;
if (_object.colObj instanceof com.kaboose.games.worldengine.Box) {
var _local7 = _object.colObj.pos.x - colObj.pos.x;
var _local12 = _object.colObj.xw;
var _local11 = _object.colObj.yw;
var _local10 = (_local12 + colObj.r) - Math.abs(_local7);
if (0 < _local10) {
var _local6 = _object.colObj.pos.y - colObj.pos.y;
var _local9 = (_local11 + colObj.r) - Math.abs(_local6);
if (0 < _local9) {
_local3 = true;
}
}
} else {
var _local4 = Math.abs(_object.colObj.pos.x - colObj.pos.x);
var _local5 = Math.abs(_object.colObj.pos.y - colObj.pos.y);
var _local8 = (colObj.r + _object.colObj.r) - 2;
var _local13 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
if (_local13 < _local8) {
_local3 = true;
}
}
if (_local3) {
if (_object instanceof com.kaboose.games.PukeThePirate.PlayerObject) {
_object.pickupCollision(this);
destroy(index);
}
}
} else if (mc != undefined) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
mc = undefined;
}
}
function onGameLoop(dx, dy, index) {
if (active) {
updateClip(dx, dy);
collideVsDynamicObject(_global.game.PlayerObj, index);
} else if (mc != undefined) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
mc = undefined;
}
}
function updatePos(dx, dy) {
colObj.pos.x = colObj.pos.x + dx;
colObj.pos.y = colObj.pos.y + dy;
}
function createSprite() {
mc = _global.game.gfxItems.createSprite(linkage);
mc._x = colObj.pos.x + _global.game.World.worldMatrix.tx;
mc._y = colObj.pos.y + _global.game.World.worldMatrix.ty;
}
function destroySprite() {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
}
function determinePlayerZone() {
var _local4 = _global.game.World.getZone(this);
var _local3 = _global.game.World.getZone(_global.game.PlayerObj);
var _local5 = _local4.x - _local3.x;
var _local6 = _local4.y - _local3.y;
if (Math.abs(_local5) <= 1) {
playerZone = true;
} else {
playerZone = false;
}
return(playerZone);
}
function updateClip(dx, dy) {
mc._x = mc._x + dx;
mc._y = mc._y + dy;
}
function changeActive(act) {
active = act;
}
function changeOwner(newOwner) {
changeActive(false);
destroy();
}
function destroy(index) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
_global.game.pickups.splice(index, 1);
}
function takeObject() {
}
var airFriction = 0.5;
var groundFriction = 0.8;
var active = true;
}
Symbol 844 MovieClip [__Packages.com.kaboose.games.worldengine.DynamicCollisionObject] Frame 0
class com.kaboose.games.worldengine.DynamicCollisionObject
{
var pos, oldpos, px, py, slopeN, owner, bounce;
function DynamicCollisionObject () {
}
function verlet() {
var _local4 = _global.game.World.DRAG;
var _local8 = _global.game.World.GRAV;
var _local5 = pos;
var _local3 = oldpos;
var _local7 = _local3.x;
var _local6 = _local3.y;
_local3.x = (px = _local5.x);
_local3.y = (py = _local5.y);
_local5.x = _local5.x + ((_local4 * _local3.x) - (_local4 * _local7));
_local5.y = _local5.y + (((_local4 * _local3.y) - (_local4 * _local6)) + _local8);
}
function reportCollisionVsWorld(px, py, dx, dy, obj) {
slopeN = com.kaboose.math.MathFunctions.rad2deg(dx);
var _local5 = pos;
var _local6 = oldpos;
var _local9 = _local5.x - _local6.x;
var _local8 = _local5.y - _local6.y;
var _local7 = (_local9 * dx) + (_local8 * dy);
var _local16 = _local7 * dx;
var _local15 = _local7 * dy;
var _local19 = _local9 - _local16;
var _local18 = _local8 - _local15;
var _local11;
var _local14;
var _local13;
var _local17;
var _local12;
var _local10;
if (_local7 < 0) {
if (obj instanceof com.kaboose.games.worldengine.Mover) {
if (dy == -1) {
owner.onMover = true;
owner.mover = obj;
owner.anim = 1;
owner.lockAnimation = false;
owner.setAnimation();
}
}
if (obj instanceof com.kaboose.games.worldengine.DropTile) {
if (dy == -1) {
obj.onActivate();
}
}
if (obj instanceof com.kaboose.games.worldengine.TrapDoor) {
if (dy == -1) {
if (!obj.activated) {
obj.onActivate();
}
}
}
if (obj instanceof com.kaboose.games.worldengine.HazardTile) {
obj.performHazard();
}
if (obj instanceof com.kaboose.games.worldengine.Container) {
obj.openContainer();
}
_local17 = _global.game.World.FRICTION;
_local12 = _local19 * _local17;
_local10 = _local18 * _local17;
_local11 = 1 + bounce;
_local14 = _local16 * _local11;
_local13 = _local15 * _local11;
} else {
_local10 = 0;
_local12 = _local10;
_local13 = _local12;
_local14 = _local13;
}
_local5.x = _local5.x + px;
_local5.y = _local5.y + py;
if (owner === _global.game.World.movementReference) {
if (dy == -1) {
if (!owner.onGround) {
owner.landOnGround();
}
}
if (obj instanceof com.kaboose.games.worldengine.Stomper) {
if (owner.onGround && (dy == 1)) {
obj.playerCrush();
}
}
_global.game.World.updateScreenPos(px, py);
}
_local6.x = _local6.x + ((px + _local14) + _local12);
_local6.y = _local6.y + ((py + _local13) + _local10);
}
function getVelocityDelta() {
var _local3 = pos.x - oldpos.x;
var _local2 = pos.y - oldpos.y;
return({vx:_local3, vy:_local2});
}
var colV = 0;
var colH = 0;
}
Symbol 845 MovieClip [__Packages.com.kaboose.math.MathFunctions] Frame 0
class com.kaboose.math.MathFunctions
{
function MathFunctions () {
}
static function rad2deg(rad) {
return((rad * 180) / Math.PI);
}
static function deg2rad(deg) {
return((deg * Math.PI) / 180);
}
static function randomRange(min, max) {
return(Math.floor(Math.random() * ((max - min) + 1)) + min);
}
static function formatNumber($number) {
var _local1 = $number.toString();
var _local3 = 1;
if (_local1.indexOf(".") == -1) {
var _local2 = "";
_local1 = _local1.split("");
} else {
var _local2 = _local1.substr(_local1.indexOf("."), _local1.length);
_local1 = _local1.substr(0, _local1.indexOf(".")).split("");
}
for (var _local4 in _local1) {
var _local2 = _local1[_local4] + _local2;
if ((_local3++) == 3) {
_local3 = 1;
_local2 = (((isNaN(_local1[0]) && (_local4 > 1)) || ((!isNaN(_local1[0])) && (_local4 >= 1))) ? ("," + _local2) : (_local2));
}
}
return(_local2);
}
}
Symbol 846 MovieClip [__Packages.com.kaboose.games.worldengine.Mover] Frame 0
class com.kaboose.games.worldengine.Mover extends com.kaboose.games.worldengine.CollisionTile
{
var linkage, xspeed, yspeed, bounds, xw, pos, yw, mc, playerZone;
function Mover ($xspeed, $yspeed, $bounds, $x, $y, $xw, $yw, $linkage) {
super($x, $y, $xw, $yw);
linkage = $linkage;
xspeed = $xspeed;
yspeed = $yspeed;
bounds = new Object();
bounds.top = $bounds[0];
bounds.bottom = $bounds[2];
bounds.left = (pos.x - $bounds[3]) - xw;
bounds.right = (pos.x + $bounds[1]) + xw;
bounds.top = (pos.y - $bounds[0]) - yw;
bounds.bottom = (pos.y + $bounds[2]) - yw;
createSprite();
}
function checkInstance(instanceType) {
if (this instanceof instanceType) {
return(true);
}
}
function onGameLoop(dx, dy) {
if (determinePlayerZone()) {
updatePos(dx, dy);
if (mc == undefined) {
createSprite();
}
_global.game.PlayerObj.collideVsTile(this);
} else if (mc != undefined) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
mc = undefined;
}
}
function createSprite() {
mc = _global.game.gfxEnemies.createSprite(linkage);
mc._x = (pos.x - xw) + _global.game.World.worldMatrix.tx;
mc._y = (pos.y - yw) + _global.game.World.worldMatrix.ty;
}
function updatePos(dx, dy) {
if (xspeed != 0) {
pos.x = pos.x + (xspeed * xdir);
mc._x = mc._x + ((xspeed * xdir) + dx);
if ((pos.x + xw) > bounds.right) {
xdir = -1;
}
if ((pos.x - xw) < bounds.left) {
xdir = 1;
}
} else {
mc._x = mc._x + dx;
}
if (yspeed != 0) {
pos.y = pos.y + (yspeed * ydir);
mc._y = mc._y + ((yspeed * ydir) + dy);
if (pos.y > bounds.bottom) {
ydir = -1;
}
if (pos.y < bounds.top) {
ydir = 1;
}
} else {
mc._y = mc._y + dy;
}
}
function determinePlayerZone() {
var _local4 = _global.game.World.getZone(this);
var _local3 = _global.game.World.getZone(_global.game.PlayerObj);
var _local5 = _local4.x - _local3.x;
var _local6 = _local4.y - _local3.y;
playerZone = false;
if (Math.abs(_local5) <= 1) {
playerZone = true;
}
return(playerZone);
}
function updateClip(dx, dy) {
var _local3 = _global.game;
mc._x = pos.x + dx;
mc._y = pos.y + dy;
}
var xdir = 1;
var ydir = 1;
}
Symbol 847 MovieClip [__Packages.com.kaboose.games.worldengine.DropTile] Frame 0
class com.kaboose.games.worldengine.DropTile extends com.kaboose.games.worldengine.CollisionTile
{
var startPos, dropSpeed, dropDelay, dropY, shakeDelay, index, linkage, mc, activated, dropInt, shakeInt, pos, xw, yw;
function DropTile ($x, $y, $xw, $yw, $dropSpeed, $dropDelay, $dropDistance, $linkage, $index) {
super($x, $y, $xw, $yw);
if (startPos == undefined) {
startPos = {x:$x, y:$y};
}
dropSpeed = $dropSpeed;
dropDelay = $dropDelay;
dropY = $y + $dropDistance;
shakeDelay = $dropDelay - 0.5;
index = $index;
linkage = $linkage;
}
function setClip(clip) {
mc = clip;
}
function onGameLoop($index) {
updatePos($index);
_global.game.World.updateObject(index);
}
function playerCrush() {
_global.player.crush();
}
function onActivate() {
activated = true;
if (dropInt == undefined) {
trace("activating drop tile");
clearInterval(dropInt);
dropInt = setInterval(this, "startDrop", dropDelay * 1000);
}
if (shakeInt == undefined) {
clearInterval(shakeInt);
shakeInt = setInterval(this, "startShake", shakeDelay * 1000);
}
}
function updatePos($index) {
var _local2 = dropSpeed;
pos.y = pos.y + (_local2 * ydir);
mc._y = mc._y + (_local2 * ydir);
if (pos.y > dropY) {
stopDrop($index);
}
}
function startShake() {
trace("start shake");
clearInterval(shakeInt);
var _local3 = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Bounce.easeIn, mc._y - 3, mc._y + 5, 0.5, true);
var _local2 = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Bounce.easeIn, mc._x + 2, mc._x, 0.5, true);
}
function startDrop() {
trace("start drop");
clearInterval(dropInt);
_global.game.World.movingObjects.push(this);
}
function stopDrop($index) {
destroy($index);
}
function destroy($index) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
_global.game.World.movingObjects.splice($index, 1);
}
function restore() {
if (activated) {
clearInterval(dropInt);
clearInterval(shakeInt);
var _local4 = startPos.x;
var _local3 = startPos.y;
dropInt = undefined;
shakeInt = undefined;
pos.x = _local4;
pos.y = _local3;
_global.game.World.oX[index] = (_global.game.World.oTiles[index][2] = pos.x - xw);
_global.game.World.oY[index] = (_global.game.World.oTiles[index][3] = pos.y - yw);
_global.game.World.oX_oW[index] = pos.x + xw;
_global.game.World.oY_oH[index] = pos.y + yw;
activated = false;
}
}
var ydir = 1;
}
Symbol 848 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 849 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 850 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 851 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 852 MovieClip [__Packages.com.kaboose.games.worldengine.TrapDoor] Frame 0
class com.kaboose.games.worldengine.TrapDoor extends com.kaboose.games.worldengine.CollisionTile
{
var startPos, dropSpeed, dropDelay, dropY, shakeDelay, index, linkage, activated, dropInt, shakeInt, mc, SetState, pos, xw, yw;
function TrapDoor ($x, $y, $xw, $yw, $linkage, $index) {
super($x, $y, $xw, $yw);
startPos = {x:$x, y:$y};
dropSpeed = 0;
dropDelay = 1;
dropY = $y + 0;
shakeDelay = dropDelay - 0.5;
index = $index;
linkage = $linkage;
trace("trap index " + $index);
}
function onActivate() {
activated = true;
trace("activating trap");
if (dropInt == undefined) {
clearInterval(dropInt);
dropInt = setInterval(this, "startDrop", dropDelay * 1000);
}
if (shakeInt == undefined) {
clearInterval(shakeInt);
shakeInt = setInterval(this, "startShake", shakeDelay * 1000);
}
}
function startShake() {
trace("start trap shake");
clearInterval(shakeInt);
var _local3 = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Bounce.easeIn, mc._y - 3, mc._y + 5, 0.5, true);
var _local2 = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Bounce.easeIn, mc._x + 2, mc._x, 0.5, true);
}
function startDrop() {
mc.gotoAndPlay("open");
trace("trip trap!");
clearInterval(dropInt);
SetState(0);
}
function stopDrop($index) {
}
function setClip(clip) {
mc = clip;
if (activated) {
mc.gotoAndStop("opened");
}
}
function destroy($index) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
}
function restore() {
if (activated) {
clearInterval(dropInt);
clearInterval(shakeInt);
activated = false;
dropInt = undefined;
shakeInt = undefined;
pos = startPos;
_global.game.World.oX[index] = (_global.game.World.oTiles[index][2] = pos.x - xw);
_global.game.World.oY[index] = (_global.game.World.oTiles[index][3] = pos.y - yw);
_global.game.World.oX_oW[index] = pos.x + xw;
_global.game.World.oY_oH[index] = pos.y + yw;
}
}
var ydir = 1;
}
Symbol 853 MovieClip [__Packages.com.kaboose.games.worldengine.HazardTile] Frame 0
class com.kaboose.games.worldengine.HazardTile extends com.kaboose.games.worldengine.CollisionTile
{
var element;
function HazardTile ($x, $y, $xw, $yw, $linkage, $element) {
super($x, $y, $xw, $yw);
if (((_global.game.currentLevel < 2) || (_global.game.currentLevel == 4)) || (_global.game.currentLevel == 5)) {
element = "water";
} else if (_global.game.currentLevel > 5) {
element = "spike";
} else {
element = "lava";
}
}
function performHazard() {
_global.game.playerDeath(element);
var _local3 = _global.game.PlayerObj;
trace("hazard");
if (death) {
if (element == "water") {
_local3.anim = "dive";
} else if (element == "lava") {
_local3.anim = "burn";
} else if (element == "spike") {
_local3.anim = "death";
}
_local3.lockAnimation = false;
_local3.setAnimation();
}
}
var death = true;
}
Symbol 854 MovieClip [__Packages.com.kaboose.games.worldengine.Stomper] Frame 0
class com.kaboose.games.worldengine.Stomper extends com.kaboose.games.worldengine.CollisionTile
{
var attackSpeed, reloadSpeed, sndClip, stompSound, bounds, linkage, mc, xw, pos, yw, playerZone;
function Stomper ($attackSpeed, $reloadSpeed, $bounds, $x, $y, $xw, $yw, $linkage, $index) {
super($x, $y, $xw, $yw);
trace("new Stomper!");
attackSpeed = $attackSpeed;
reloadSpeed = $reloadSpeed;
sndClip = _global.game.gfxEnemies.createEmptySprite("turd" + $index);
stompSound = new Sound(sndClip);
stompSound.attachSound("sndStomperCrush");
bounds = new Object();
bounds.top = $bounds[0];
bounds.bottom = $bounds[1];
linkage = $linkage;
createSprite();
}
function playerCrush() {
_global.game.playerDeath();
}
function createSprite() {
mc = _global.game.gfxEnemies.createSprite(linkage);
mc._x = (pos.x - xw) + _global.game.World.worldMatrix.tx;
mc._y = (pos.y - yw) + _global.game.World.worldMatrix.ty;
}
function onGameLoop(dx, dy) {
updatePos(dx, dy);
if (determinePlayerZone()) {
if (mc == undefined) {
createSprite();
}
if (!_global.game.PlayerObj.stunned) {
_global.game.PlayerObj.collideVsTile(this);
}
} else if (mc != undefined) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
mc = undefined;
}
}
function updatePos(dx, dy) {
var _local3;
if (ydir == 1) {
_local3 = attackSpeed;
} else {
_local3 = reloadSpeed;
}
mc._x = mc._x + dx;
pos.y = pos.y + ((_local3 * ydir) + dy);
mc._y = mc._y + ((_local3 * ydir) + dy);
if (pos.y > bounds.bottom) {
var _local4 = sonicDistance();
var _local2 = _local4[0];
var _local5 = _local4[1];
if (_local2 < 1) {
_local2 = 0;
}
stompSound.setVolume(_local2);
stompSound.setPan(_local5);
stompSound.start();
ydir = -1;
}
if (pos.y < bounds.top) {
ydir = 1;
}
}
function updateClip() {
if (mc != undefined) {
var _local3 = _global.game;
var _local5 = _local3.World.movementReference.colObj.pos.x - pos.x;
var _local4 = _local3.World.movementReference.colObj.pos.y - pos.y;
mc._y = (_local3.World.movementReference.mc._y - _local4) - yw;
mc._x = (_local3.World.movementReference.mc._x - _local5) - xw;
}
}
function determinePlayerZone() {
var _local4 = _global.game.World.getZone(this);
var _local3 = _global.game.World.getZone(_global.game.PlayerObj);
var _local5 = _local4.x - _local3.x;
var _local6 = _local4.y - _local3.y;
playerZone = false;
if (Math.abs(_local5) <= 1) {
playerZone = true;
}
return(playerZone);
}
function sonicDistance() {
var _local3 = _global.game.PlayerObj.colObj.pos.x - pos.x;
var _local4 = _global.game.PlayerObj.colObj.pos.y - pos.y;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local5 = 100 - ((Math.abs(_local6) / SONIC_DISTANCE) * 100);
var _local7 = -((_local3 / SONIC_DISTANCE) * 100);
return([_local5, _local7]);
}
var xdir = 1;
var ydir = 1;
var SONIC_DISTANCE = 1200;
}
Symbol 855 MovieClip [__Packages.com.kaboose.games.worldengine.Sphere] Frame 0
class com.kaboose.games.worldengine.Sphere extends com.kaboose.games.worldengine.DynamicCollisionObject
{
var owner, name, pos, oldpos, r, bounce, reportCollisionVsWorld;
function Sphere ($posx, $posy, $r, $bounce, $owner) {
super();
owner = $owner;
name = "Sphere";
pos = {x:$posx, y:$posy};
oldpos = {x:$posx, y:$posy};
r = Math.abs($r);
bounce = $bounce;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_FULL] = sphereProjection_Full;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_45DEG] = sphereProjection_45Deg;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_CONCAVE] = sphereProjection_Concave;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_CONVEX] = sphereProjection_Convex;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_22DEGs] = sphereProjection_22DegS;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_22DEGb] = sphereProjection_22DegB;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_67DEGs] = sphereProjection_67DegS;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_67DEGb] = sphereProjection_67DegB;
projectSphere[com.kaboose.games.worldengine.CollisionTile.CTYPE_HALF] = sphereProjection_Half;
}
function collideVsWorldBounds() {
var _local5 = pos;
var _local4 = _global.game.World.XMIN - (_local5.x - r);
if (0 < _local4) {
reportCollisionVsWorld(_local4, 0, 1, 0, null);
} else {
_local4 = (_local5.x + r) - _global.game.World.XMAX;
if (0 < _local4) {
reportCollisionVsWorld(-_local4, 0, -1, 0, null);
}
}
var _local3 = _global.game.World.YMIN - (_local5.y - r);
if (0 < _local3) {
reportCollisionVsWorld(0, _local3, 0, 1, null);
} else {
_local3 = (_local5.y + r) - _global.game.World.YMAX;
if (0 < _local3) {
reportCollisionVsWorld(0, -_local3, 0, -1, null);
}
}
}
function collideVsTile(tile) {
var _local10 = pos;
var _local9 = r;
var _local14 = tile.pos.x;
var _local13 = tile.pos.y;
var _local6 = tile.xw;
var _local5 = tile.yw;
var _local4 = _local10.x - _local14;
var _local12 = (_local6 + _local9) - Math.abs(_local4);
if (0 < _local12) {
var _local3 = _local10.y - _local13;
var _local11 = (_local5 + _local9) - Math.abs(_local3);
if (0 < _local11) {
var _local7 = 0;
var _local8 = 0;
if (_local4 < (-_local6)) {
_local7 = -1;
} else if (_local6 < _local4) {
_local7 = 1;
}
if (_local3 < (-_local5)) {
_local8 = -1;
} else if (_local5 < _local3) {
_local8 = 1;
}
resolveCircleTile(_local12, _local11, _local7, _local8, tile);
}
} else if (owner.mover == tile) {
owner.onMover = false;
owner.mover = null;
}
}
function resolveCircleTile($x, $y, $oH, $oV, $t) {
if (0 < $t.ID) {
if (projectSphere[$t.CTYPE](this, $x, $y, $oH, $oV, $t) == "ground") {
_global.game.PlayerObj.colObj.colV = -1;
} else {
_global.game.PlayerObj.colObj.colV = 0;
}
}
}
static function sphereProjection_Full(obj, x, y, oH, oV, t) {
if (oH == 0) {
if (oV == 0) {
if (x < y) {
var _local4 = obj.pos.x - t.pos.x;
if (_local4 < 0) {
obj.reportCollisionVsWorld(-x, 0, -1, 0, t);
return(undefined);
}
obj.reportCollisionVsWorld(x, 0, 1, 0, t);
return(undefined);
}
var _local3 = obj.pos.y - t.pos.y;
if (_local3 < 0) {
obj.reportCollisionVsWorld(0, -y, 0, -1, t);
return(undefined);
}
obj.reportCollisionVsWorld(0, y, 0, 1, t);
return(undefined);
}
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
if (oV == -1) {
return("ground");
}
return(undefined);
}
if (oV == 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(undefined);
}
var _local12 = t.pos.x + (oH * t.xw);
var _local11 = t.pos.y + (oV * t.yw);
var _local4 = obj.pos.x - _local12;
var _local3 = obj.pos.y - _local11;
var _local6 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local7 = obj.r - _local6;
if (0 < _local7) {
if (_local6 == 0) {
_local4 = oH / Math.SQRT2;
_local3 = oV / Math.SQRT2;
} else {
_local4 = _local4 / _local6;
_local3 = _local3 / _local6;
}
obj.reportCollisionVsWorld(_local4 * _local7, _local3 * _local7, _local4, _local3, t);
return(undefined);
}
return(undefined);
}
static function sphereProjection_Half(obj, x, y, oH, oV, t) {
var _local7 = t.signx;
var _local13 = t.signy;
var _local17 = (oH * _local7) + (oV * _local13);
if (0 < _local17) {
} else if (oH == 0) {
if (oV == 0) {
var _local23 = obj.r;
var _local21 = (obj.pos.x - (_local7 * _local23)) - t.pos.x;
var _local20 = (obj.pos.y - (_local13 * _local23)) - t.pos.y;
var _local9 = _local7;
var _local8 = _local13;
var _local16 = (_local21 * _local9) + (_local20 * _local8);
if (_local16 < 0) {
_local9 = _local9 * (-_local16);
_local8 = _local8 * (-_local16);
var _local22 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = Math.sqrt((x * x) + (y * y));
if (_local15 < _local22) {
obj.reportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
obj.reportCollisionVsWorld(_local9, _local8, t.signx, t.signy);
}
return(true);
}
} else if (_local17 == 0) {
var _local23 = obj.r;
var _local6 = obj.pos.x - t.pos.x;
if ((_local6 * _local7) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local5 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = _local7 / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.reportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
}
} else if (oV == 0) {
if (_local17 == 0) {
var _local23 = obj.r;
var _local5 = obj.pos.y - t.pos.y;
if ((_local5 * _local13) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local6 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = _local7 / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.reportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
}
} else {
var _local19 = t.pos.x + (oH * t.xw);
var _local18 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local19;
var _local5 = obj.pos.y - _local18;
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.reportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
}
static function sphereProjection_45Deg(obj, x, y, oH, oV, t) {
var _local12 = t.signx;
var _local11 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = (obj.pos.x - (_local15 * obj.r)) - t.pos.x;
var _local3 = (obj.pos.y - (_local14 * obj.r)) - t.pos.y;
var _local21 = (_local4 * _local15) + (_local3 * _local14);
if (_local21 < 0) {
_local15 = _local15 * (-_local21);
_local14 = _local14 * (-_local21);
if (x < y) {
var _local17 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local17 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
var _local22 = Math.sqrt((_local15 * _local15) + (_local14 * _local14));
if (_local17 < _local22) {
obj.reportCollisionVsWorld(x, y, x / _local17, y / _local17, t);
} else {
obj.reportCollisionVsWorld(_local15, _local14, t.sx, t.sy, t);
}
}
} else if ((_local11 * oV) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local18 = (_local4 * (-_local14)) + (_local3 * _local15);
if (0 < ((_local18 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local16 = obj.r - _local13;
if (0 < _local16) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.reportCollisionVsWorld(_local4 * _local16, _local3 * _local16, _local4, _local3, t);
}
} else {
var _local21 = (_local4 * _local15) + (_local3 * _local14);
var _local16 = obj.r - Math.abs(_local21);
if (0 < _local16) {
obj.reportCollisionVsWorld(_local15 * _local16, _local14 * _local16, _local15, _local14, t);
}
}
}
} else if (oV == 0) {
if ((_local12 * oH) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local18 = (_local4 * (-_local14)) + (_local3 * _local15);
if (((_local18 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local16 = obj.r - _local13;
if (0 < _local16) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.reportCollisionVsWorld(_local4 * _local16, _local3 * _local16, _local4, _local3, t);
}
} else {
var _local21 = (_local4 * _local15) + (_local3 * _local14);
var _local16 = obj.r - Math.abs(_local21);
if (0 < _local16) {
obj.reportCollisionVsWorld(_local15 * _local16, _local14 * _local16, _local15, _local14, t);
}
}
}
} else if (0 < ((_local12 * oH) + (_local11 * oV))) {
} else {
var _local20 = t.pos.x + (oH * t.xw);
var _local19 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local20;
var _local6 = obj.pos.y - _local19;
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local16 = obj.r - _local13;
if (0 < _local16) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.reportCollisionVsWorld(_local7 * _local16, _local6 * _local16, _local7, _local6, t);
}
}
}
static function sphereProjection_Concave(obj, x, y, oH, oV, t) {
var _local13 = t.signx;
var _local12 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local8 = (t.pos.x + (_local13 * t.xw)) - obj.pos.x;
var _local7 = (t.pos.y + (_local12 * t.yw)) - obj.pos.y;
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local11 = Math.sqrt((_local8 * _local8) + (_local7 * _local7));
var _local14 = (_local11 + obj.r) - _local19;
if (0 < _local14) {
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local14) {
obj.reportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
_local8 = _local8 / _local11;
_local7 = _local7 / _local11;
obj.reportCollisionVsWorld(_local8 * _local14, _local7 * _local14, _local8, _local7, t);
}
}
} else if ((_local12 * oV) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local18 = t.pos.x - (_local13 * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local6 = 0;
_local5 = oV;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.reportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else if (oV == 0) {
if ((_local13 * oH) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y - (_local12 * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local6 = oH;
_local5 = 0;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.reportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else if (0 < ((_local13 * oH) + (_local12 * oV))) {
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.reportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
}
static function sphereProjection_Convex(obj, x, y, oH, oV, t) {
var _local7 = t.signx;
var _local6 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local14) {
obj.reportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.reportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
}
} else if ((_local6 * oV) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.reportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
}
} else if (oV == 0) {
if ((_local7 * oH) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.reportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
}
} else if (0 < ((_local7 * oH) + (_local6 * oV))) {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.reportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local4 = obj.pos.x - _local18;
var _local3 = obj.pos.y - _local17;
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local14 = obj.r - _local13;
if (0 < _local14) {
if (_local13 == 0) {
_local4 = oH / Math.SQRT2;
_local3 = oV / Math.SQRT2;
} else {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
}
obj.reportCollisionVsWorld(_local4 * _local14, _local3 * _local14, _local4, _local3, t);
}
}
}
static function sphereProjection_22DegS(obj, x, y, oH, oV, t) {
var _local12 = t.signx;
var _local11 = t.signy;
if (0 < (_local11 * oV)) {
} else if (oH == 0) {
if (oV == 0) {
var _local15 = t.sx;
var _local14 = t.sy;
var _local16 = obj.r;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - t.pos.y;
var _local19 = (_local4 * (-_local14)) + (_local3 * _local15);
if (0 < ((_local19 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = _local16 - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.reportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
_local4 = _local4 - (_local16 * _local15);
_local3 = _local3 - (_local16 * _local14);
var _local22 = (_local4 * _local15) + (_local3 * _local14);
if (_local22 < 0) {
_local15 = _local15 * (-_local22);
_local14 = _local14 * (-_local22);
var _local23 = Math.sqrt((_local15 * _local15) + (_local14 * _local14));
if (x < y) {
var _local18 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local18 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local18 < _local23) {
obj.reportCollisionVsWorld(x, y, x / _local18, y / _local18, t);
} else {
obj.reportCollisionVsWorld(_local15, _local14, t.sx, t.sy, t);
}
}
}
} else {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
}
} else if (oV == 0) {
if ((_local12 * oH) < 0) {
var _local21 = t.pos.x - (_local12 * t.xw);
var _local20 = t.pos.y;
var _local6 = obj.pos.x - _local21;
var _local5 = obj.pos.y - _local20;
if ((_local5 * _local11) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local13 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local13;
_local5 = _local5 / _local13;
}
obj.reportCollisionVsWorld(_local6 * _local17, _local5 * _local17, _local6, _local5, t);
}
}
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local15);
if (((_local19 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = obj.r - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.reportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
var _local22 = (_local4 * _local15) + (_local3 * _local14);
var _local17 = obj.r - Math.abs(_local22);
if (0 < _local17) {
obj.reportCollisionVsWorld(_local15 * _local17, _local14 * _local17, _local15, _local14, t);
}
}
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local21;
var _local5 = obj.pos.y - _local20;
var _local13 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local13;
_local5 = _local5 / _local13;
}
obj.reportCollisionVsWorld(_local6 * _local17, _local5 * _local17, _local6, _local5, t);
}
}
}
static function sphereProjection_22DegB(obj, x, y, oH, oV, t) {
var _local4 = t.signx;
var _local3 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local13 = t.sx;
var _local12 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x - (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y + (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
_local13 = _local13 * (-_local16);
_local12 = _local12 * (-_local16);
var _local24 = Math.sqrt((_local13 * _local13) + (_local12 * _local12));
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local24) {
obj.reportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
obj.reportCollisionVsWorld(_local13, _local12, t.sx, t.sy, t);
}
}
} else if ((_local3 * oV) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local13 = t.sx;
var _local12 = t.sy;
var _local23 = obj.pos.x - (t.pos.x - (_local4 * t.xw));
var _local22 = obj.pos.y - (t.pos.y + (_local3 * t.yw));
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (0 < ((_local19 * _local4) * _local3)) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.reportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.reportCollisionVsWorld(_local13 * _local14, _local12 * _local14, _local13, _local12, t);
}
}
}
} else if (oV == 0) {
if ((_local4 * oH) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local23 = obj.pos.x - (t.pos.x + (_local4 * t.xw));
var _local22 = obj.pos.y - t.pos.y;
if ((_local22 * _local3) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local13 = t.sx;
var _local12 = t.sy;
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (((_local19 * _local4) * _local3) < 0) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.reportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.reportCollisionVsWorld(_local13 * _local14, _local12 * _local14, t.sx, t.sy, t);
}
}
}
}
} else if (0 < ((_local4 * oH) + (_local3 * oV))) {
var _local18 = 2.23606797749979;
var _local13 = (_local4 * 1) / _local18;
var _local12 = (_local3 * 2) / _local18;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x - (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y + (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
obj.reportCollisionVsWorld((-_local13) * _local16, (-_local12) * _local16, t.sx, t.sy, t);
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local11;
_local6 = _local6 / _local11;
}
obj.reportCollisionVsWorld(_local7 * _local14, _local6 * _local14, _local7, _local6, t);
}
}
}
static function sphereProjection_67DegS(obj, x, y, oH, oV, t) {
var _local12 = t.signx;
var _local11 = t.signy;
if (0 < (_local12 * oH)) {
} else if (oH == 0) {
if (oV == 0) {
var _local16 = t.sx;
var _local14 = t.sy;
var _local15 = obj.r;
var _local4 = obj.pos.x - t.pos.x;
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local16);
if (((_local19 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = _local15 - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.reportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
_local4 = _local4 - (_local15 * _local16);
_local3 = _local3 - (_local15 * _local14);
var _local22 = (_local4 * _local16) + (_local3 * _local14);
if (_local22 < 0) {
_local16 = _local16 * (-_local22);
_local14 = _local14 * (-_local22);
var _local23 = Math.sqrt((_local16 * _local16) + (_local14 * _local14));
if (x < y) {
var _local18 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local18 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local18 < _local23) {
obj.reportCollisionVsWorld(x, y, x / _local18, y / _local18, t);
} else {
obj.reportCollisionVsWorld(_local16, _local14, t.sx, t.sy, t);
}
}
}
} else if ((_local11 * oV) < 0) {
var _local21 = t.pos.x;
var _local20 = t.pos.y - (_local11 * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
if ((_local7 * _local12) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.reportCollisionVsWorld(_local7 * _local17, _local6 * _local17, _local7, _local6, t);
}
}
} else {
var _local16 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local16);
if (0 < ((_local19 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = obj.r - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.reportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
var _local22 = (_local4 * _local16) + (_local3 * _local14);
var _local17 = obj.r - Math.abs(_local22);
if (0 < _local17) {
obj.reportCollisionVsWorld(_local16 * _local17, _local14 * _local17, t.sx, t.sy, t);
}
}
}
} else if (oV == 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.reportCollisionVsWorld(_local7 * _local17, _local6 * _local17, _local7, _local6, t);
}
}
}
static function sphereProjection_67DegB(obj, x, y, oH, oV, t) {
var _local4 = t.signx;
var _local3 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local13 = t.sx;
var _local12 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x + (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y - (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
_local13 = _local13 * (-_local16);
_local12 = _local12 * (-_local16);
var _local24 = Math.sqrt((_local13 * _local13) + (_local12 * _local12));
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local24) {
obj.reportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
obj.reportCollisionVsWorld(_local13, _local12, t.sx, t.sy, t);
}
}
} else if ((_local3 * oV) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local23 = obj.pos.x - t.pos.x;
var _local22 = obj.pos.y - (t.pos.y + (_local3 * t.yw));
if ((_local23 * _local4) < 0) {
obj.reportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local13 = t.sx;
var _local12 = t.sy;
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (0 < ((_local19 * _local4) * _local3)) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.reportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.reportCollisionVsWorld(_local13 * _local14, _local12 * _local14, _local13, _local12, t);
}
}
}
}
} else if (oV == 0) {
if ((_local4 * oH) < 0) {
obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local18 = 2.23606797749979;
var _local13 = (_local4 * 2) / _local18;
var _local12 = (_local3 * 1) / _local18;
var _local23 = obj.pos.x - (t.pos.x + (_local4 * t.xw));
var _local22 = obj.pos.y - (t.pos.y - (_local3 * t.yw));
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (((_local19 * _local4) * _local3) < 0) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.reportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.reportCollisionVsWorld(_local13 * _local14, _local12 * _local14, t.sx, t.sy, t);
}
}
}
} else if (0 < ((_local4 * oH) + (_local3 * oV))) {
var _local13 = t.sx;
var _local12 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x + (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y - (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
obj.reportCollisionVsWorld((-_local13) * _local16, (-_local12) * _local16, t.sx, t.sy, t);
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local11;
_local6 = _local6 / _local11;
}
obj.reportCollisionVsWorld(_local7 * _local14, _local6 * _local14, _local7, _local6, t);
}
}
}
static var OTYPE = 1;
var projectSphere = new Object();
var CTYPE_FULL = 1;
}
Symbol 856 MovieClip [__Packages.com.kaboose.games.worldengine.Box] Frame 0
class com.kaboose.games.worldengine.Box extends com.kaboose.games.worldengine.DynamicCollisionObject
{
var name, owner, pos, oldpos, xw, yw, bounce, reportCollisionVsWorld;
function Box ($posx, $posy, $xw, $yw, $bounce, $owner) {
super();
trace("Creating new BOX collision object");
name = "Box";
owner = $owner;
pos = {x:$posx, y:$posy};
oldpos = {x:$posx, y:$posy};
xw = $xw;
yw = $yw;
bounce = $bounce;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_FULL] = ProjAABB_Full;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_45DEG] = ProjAABB_45Deg;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_CONCAVE] = ProjAABB_Concave;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_CONVEX] = ProjAABB_Convex;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_22DEGs] = ProjAABB_22DegS;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_22DEGb] = ProjAABB_22DegB;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_67DEGs] = ProjAABB_67DegS;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_67DEGb] = ProjAABB_67DegB;
Proj_AABBTile[com.kaboose.games.worldengine.CollisionTile.CTYPE_HALF] = ProjAABB_Half;
}
function collideVsWorldBounds() {
var _local5 = pos;
var _local4 = _global.game.World.XMIN - (_local5.x - xw);
if (0 < _local4) {
reportCollisionVsWorld(_local4, 0, 1, 0, null);
} else {
_local4 = (_local5.x + xw) - _global.game.World.XMAX;
if (0 < _local4) {
reportCollisionVsWorld(-_local4, 0, -1, 0, null);
}
}
var _local3 = _global.game.World.YMIN - (_local5.y - yw);
if (0 < _local3) {
reportCollisionVsWorld(0, _local3, 0, 1, null);
} else {
_local3 = (_local5.y + yw) - _global.game.World.YMAX;
if (0 < _local3) {
reportCollisionVsWorld(0, -_local3, 0, -1, null);
}
}
}
function collideVsTile(tile) {
var _local9 = pos;
var _local4 = tile;
var _local8 = _local4.pos.x;
var _local7 = _local4.pos.y;
var _local11 = _local4.xw;
var _local10 = _local4.yw;
var _local6 = _local9.x - _local8;
var _local3 = (_local11 + xw) - Math.abs(_local6);
if (0 < _local3) {
var _local5 = pos.y - _local7;
var _local2 = (_local10 + yw) - Math.abs(_local5);
if (0 < _local2) {
if (_local3 < _local2) {
if (_local6 < 0) {
_local3 = _local3 * -1;
_local2 = 0;
} else {
_local2 = 0;
}
} else if (_local5 < 0) {
_local3 = 0;
_local2 = _local2 * -1;
} else {
_local3 = 0;
}
resolveBoxTile(_local3, _local2, this, _local4);
}
} else {
owner.onMover = false;
owner.mover = null;
}
}
function resolveBoxTile($x, $y, $box, $t) {
if (0 < $t.ID) {
Proj_AABBTile[$t.CTYPE]($x, $y, $box, $t);
}
}
function ProjAABB_Full(x, y, obj, t) {
var _local1 = Math.sqrt((x * x) + (y * y));
obj.reportCollisionVsWorld(x, y, x / _local1, y / _local1, t);
}
function ProjAABB_Half(x, y, obj, t) {
var _local3 = t.signx;
var _local2 = t.signy;
var _local10 = (obj.pos.x - (_local3 * obj.xw)) - t.pos.x;
var _local9 = (obj.pos.y - (_local2 * obj.yw)) - t.pos.y;
var _local6 = (_local10 * _local3) + (_local9 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local11 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local11) {
obj.reportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
} else {
obj.reportCollisionVsWorld(_local3, _local2, t.signx, t.signy, t);
}
}
}
function ProjAABB_Concave(x, y, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
var _local3 = (t.pos.x + (_local12 * t.xw)) - (obj.pos.x - (_local12 * obj.xw));
var _local2 = (t.pos.y + (_local11 * t.yw)) - (obj.pos.y - (_local11 * obj.yw));
var _local8 = t.xw * 2;
var _local13 = Math.sqrt((_local8 * _local8) + 0);
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local4 = _local6 - _local13;
if (0 < _local4) {
var _local7 = Math.sqrt((x * x) + (y * y));
if (_local7 < _local4) {
obj.reportCollisionVsWorld(x, y, x / _local7, y / _local7, t);
} else {
_local3 = _local3 / _local6;
_local2 = _local2 / _local6;
obj.reportCollisionVsWorld(_local3 * _local4, _local2 * _local4, _local3, _local2, t);
}
}
}
function ProjAABB_Convex(x, y, obj, t) {
var _local8 = t.signx;
var _local7 = t.signy;
var _local3 = (obj.pos.x - (_local8 * obj.xw)) - (t.pos.x - (_local8 * t.xw));
var _local2 = (obj.pos.y - (_local7 * obj.yw)) - (t.pos.y - (_local7 * t.yw));
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local9 = t.xw * 2;
var _local13 = Math.sqrt((_local9 * _local9) + 0);
var _local6 = _local13 - _local5;
if (((_local8 * _local3) < 0) || ((_local7 * _local2) < 0)) {
var _local10 = Math.sqrt((x * x) + (y * y));
obj.reportCollisionVsWorld(x, y, x / _local10, y / _local10, t);
} else if (0 < _local6) {
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
obj.reportCollisionVsWorld(_local3 * _local6, _local2 * _local6, _local3, _local2, t);
}
}
function ProjAABB_45Deg(x, y, obj, t) {
var _local13 = t.signx;
var _local12 = t.signy;
var _local10 = (obj.pos.x - (_local13 * obj.xw)) - t.pos.x;
var _local9 = (obj.pos.y - (_local12 * obj.yw)) - t.pos.y;
var _local3 = t.sx;
var _local2 = t.sy;
var _local6 = (_local10 * _local3) + (_local9 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local11 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local11) {
obj.reportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
} else {
obj.reportCollisionVsWorld(_local3, _local2, t.sx, t.sy);
}
}
}
function ProjAABB_22DegS(x, y, obj, t) {
var _local13 = t.signx;
var _local8 = t.signy;
var _local14 = obj.pos.y - (_local8 * obj.yw);
var _local3 = t.pos.y - _local14;
if (0 < (_local3 * _local8)) {
var _local16 = (obj.pos.x - (_local13 * obj.xw)) - (t.pos.x + (_local13 * t.xw));
var _local15 = (obj.pos.y - (_local8 * obj.yw)) - (t.pos.y - (_local8 * t.yw));
var _local5 = t.sx;
var _local4 = t.sy;
var _local9 = (_local16 * _local5) + (_local15 * _local4);
if (_local9 < 0) {
_local5 = _local5 * (-_local9);
_local4 = _local4 * (-_local9);
var _local10 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local7 = Math.sqrt((x * x) + (y * y));
var _local6 = Math.abs(_local3);
if (_local7 < _local10) {
if (_local6 < _local7) {
obj.reportCollisionVsWorld(0, _local3, 0, _local3 / _local6, t);
} else {
obj.reportCollisionVsWorld(x, y, x / _local7, y / _local7, t);
}
} else if (_local6 < _local10) {
obj.reportCollisionVsWorld(0, _local3, 0, _local3 / _local6, t);
} else {
obj.reportCollisionVsWorld(_local5, _local4, t.sx, t.sy, t);
}
}
}
}
function ProjAABB_22DegB(x, y, obj, t) {
var _local10 = t.signx;
var _local9 = t.signy;
var _local12 = (obj.pos.x - (_local10 * obj.xw)) - (t.pos.x - (_local10 * t.xw));
var _local11 = (obj.pos.y - (_local9 * obj.yw)) - (t.pos.y + (_local9 * t.yw));
var _local3 = t.sx;
var _local2 = t.sy;
var _local6 = (_local12 * _local3) + (_local11 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local13 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local13) {
obj.reportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
} else {
obj.reportCollisionVsWorld(_local3, _local2, t.sx, t.sy, t);
}
}
}
function ProjAABB_67DegS(x, y, obj, t) {
var _local8 = t.signx;
var _local13 = t.signy;
var _local14 = obj.pos.x - (_local8 * obj.xw);
var _local3 = t.pos.x - _local14;
if (0 < (_local3 * _local8)) {
var _local16 = (obj.pos.x - (_local8 * obj.xw)) - (t.pos.x - (_local8 * t.xw));
var _local15 = (obj.pos.y - (_local13 * obj.yw)) - (t.pos.y + (_local13 * t.yw));
var _local5 = t.sx;
var _local4 = t.sy;
var _local9 = (_local16 * _local5) + (_local15 * _local4);
if (_local9 < 0) {
_local5 = _local5 * (-_local9);
_local4 = _local4 * (-_local9);
var _local10 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local7 = Math.sqrt((x * x) + (y * y));
var _local6 = Math.abs(_local3);
if (_local7 < _local10) {
if (_local6 < _local7) {
obj.reportCollisionVsWorld(_local3, 0, _local3 / _local6, 0, t);
} else {
obj.reportCollisionVsWorld(x, y, x / _local7, y / _local7, t);
}
} else if (_local6 < _local10) {
obj.reportCollisionVsWorld(_local3, 0, _local3 / _local6, 0, t);
} else {
obj.reportCollisionVsWorld(_local5, _local4, t.sx, t.sy, t);
}
}
}
}
function ProjAABB_67DegB(x, y, obj, t) {
var _local10 = t.signx;
var _local9 = t.signy;
var _local12 = (obj.pos.x - (_local10 * obj.xw)) - (t.pos.x + (_local10 * t.xw));
var _local11 = (obj.pos.y - (_local9 * obj.yw)) - (t.pos.y - (_local9 * t.yw));
var _local3 = t.sx;
var _local2 = t.sy;
var _local6 = (_local12 * _local3) + (_local11 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local13 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local13) {
obj.reportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
} else {
obj.reportCollisionVsWorld(_local3, _local2, t.sx, t.sy, t);
}
}
}
static var OTYPE = 0;
static var Proj_AABBTile = new Object();
}
Symbol 857 MovieClip [__Packages.com.kaboose.games.worldengine.BaseCharacter] Frame 0
class com.kaboose.games.worldengine.BaseCharacter
{
var anim, mc, lastAnim, lockAnimation, animLockList, colObj, LIB_REF, zoneAwareness, zonePlayer, SONIC_DISTANCE, enemyKillSound;
function BaseCharacter () {
}
function setAnimation() {
if (mc._currentframe != anim) {
lastAnim = mc._currentframe;
if (!lockAnimation) {
for (var _local2 in animLockList) {
if (anim == animLockList[_local2]) {
lockAnimation = true;
break;
}
}
mc.gotoAndStop(anim);
}
}
}
function checkAnimLock() {
for (var _local2 in animLockList) {
if (anim == animLockList[_local2]) {
return(true);
}
}
}
function verlet() {
colObj.verlet();
}
function reportCollisionVsWorld(px, py, dx, dy, obj) {
colObj.reportCollisionVsWorld(px, py, dx, dy, obj);
}
function collideVsWorldBounds() {
colObj.collideVsWorldBounds();
}
function collideVsTile(tileRef) {
colObj.collideVsTile(tileRef);
}
function createSprite() {
mc = _global.game.gfxEnemies.createSprite(LIB_REF);
}
function destroySprite() {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
mc = undefined;
}
function checkActivityZone() {
var _local4 = _global.game.World.getZone(this);
var _local3 = _global.game.World.getZone(_global.game.PlayerObj);
var _local5 = _local4.x - _local3.x;
var _local6 = _local4.y - _local3.y;
if (Math.abs(_local5) <= zoneAwareness) {
zonePlayer = true;
active = true;
if (mc == undefined) {
createSprite();
}
} else {
zonePlayer = false;
active = false;
if (mc != undefined) {
destroySprite();
}
}
}
function sonicDistance() {
var _local3 = _global.game.PlayerObj.colObj.pos.x - colObj.pos.x;
var _local4 = _global.game.PlayerObj.colObj.pos.y - colObj.pos.y;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local5 = 100 - ((Math.abs(_local6) / SONIC_DISTANCE) * 100);
var _local7 = -((_local3 / SONIC_DISTANCE) * 100);
return([_local5, _local7]);
}
function collideVsPlayer(objRef) {
var _local2 = Math.abs(_global.game.PlayerObj.colObj.pos.x - objRef.colObj.pos.x);
var _local3 = Math.abs(_global.game.PlayerObj.colObj.pos.y - objRef.colObj.pos.y);
var _local5 = (objRef.colObj.r + _global.game.PlayerObj.colObj.r) - 2;
var _local6 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
if (_local6 < _local5) {
_global.game.PlayerObj.enemyCollision(objRef);
}
}
function getVelocityDelta() {
var _local3 = colObj.pos.x - colObj.oldPos.x;
var _local2 = colObj.pos.y - colObj.oldPos.y;
return({dx:_local3, dy:_local2});
}
function destroy() {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
if (enemyKillSound == undefined) {
enemyKillSound = new Sound();
enemyKillSound.attachSound(SND_ENEMY_KILL);
}
enemyKillSound.start();
mc = _global.game.gfxEnemies.createSprite(LIB_REF_DESTROY);
updateClip();
alive = false;
}
function explode() {
}
function updateClip() {
var _local3 = _global.game;
var _local5 = _local3.World.movementReference.colObj.pos.x - colObj.pos.x;
var _local4 = _local3.World.movementReference.colObj.pos.y - colObj.pos.y;
mc._y = _local3.World.movementReference.mc._y - _local4;
mc._x = _local3.World.movementReference.mc._x - _local5;
if (dx < 0) {
mc._xscale = 100;
} else if (dx > 0) {
mc._xscale = -100;
}
}
var LIB_REF_DESTROY = "destroyEnemy";
var SND_ENEMY_KILL = "sndEnemyDie";
var active = true;
var alive = true;
var invul = false;
var stunned = false;
var dx = 1;
var dy = 1;
}
Symbol 858 MovieClip [__Packages.com.kaboose.games.PukeThePirate.PlayerObject] Frame 0
class com.kaboose.games.PukeThePirate.PlayerObject extends com.kaboose.games.worldengine.BaseCharacter
{
var alive, r, colObj, jumpSound, stunSound, anim, lockAnimation, lastJump, playerKey, stunned, invul, mover, mc, invul_int, stun_int, flySoundPlaying, flySound, lastAnim, checkAnimLock;
function PlayerObject ($posx, $posy, $r, $bounce) {
super();
alive = true;
r = $r;
r = 33;
colObj = new com.kaboose.games.worldengine.Sphere($posx, $posy, r, 0, this);
jumpSound = new Sound();
jumpSound.attachSound("sndJump");
stunSound = new Sound();
stunSound.attachSound("sndPlayerStunned");
}
function shootProjectile() {
trace("shoot Projectile");
var _local4 = {x:Number, y:Number};
var _local3 = {x:Number, y:Number};
_local3.x = 2;
_local3.y = 0;
_local4.x = 1;
_local4.y = 0;
var _local5 = new com.kaboose.games.PukeThePirate.projectiles.CannonBall(colObj.pos.x, colObj.pos.y, _local4, _local3);
_global.game.World.projectiles.push(_local5);
}
function landOnGround() {
if (alive) {
trace("land ho");
if (anim == 21) {
lockAnimation = false;
}
onGround = true;
anim = 1;
}
}
function jump() {
if ((lastJump == undefined) || (jumpTimer < (getTimer() - lastJump))) {
if (onGround || (onMover)) {
lastJump = getTimer();
jumpSound.start();
return(true);
}
} else {
return(false);
}
}
function die(element) {
trace("DIE");
Key.removeListener(playerKey);
alive = false;
if (element == undefined) {
anim = 71;
lockAnimation = false;
setAnimation();
}
}
function hurt() {
stopFlySound();
if (!stunned) {
if (!invul) {
toggleStun();
stunSound.start();
}
}
}
function enemyCollision(enemyObj, $index) {
if (!stunned) {
var _local4 = 1;
var _local7 = -1;
if (enemyObj.colObj.pos.x > colObj.pos.x) {
_local4 = -1;
}
if (colObj.pos.y < (enemyObj.colObj.pos.y - colObj.r)) {
_local7 = -1;
trace("KILL ENEMY");
var _local6;
if (anim == 51) {
anim = 111;
_local6 = true;
} else {
anim = 111;
_local6 = false;
}
lockAnimation = false;
setAnimation();
_global.game.currentScore = _global.game.currentScore + enemyObj.pts;
_global.game.hud.update();
_global.game.enemiesKilled = _global.game.enemiesKilled + 1;
enemyObj.destroy($index, _local6);
} else if (!invul) {
var _local5 = new Sound();
_local5.attachSound("sndEnemyDie");
_local5.start();
hurt();
_global.game.playerLives = _global.game.playerLives - 1;
if (_global.game.playerLives == 0) {
_global.game.endGame();
anim = 71;
lockAnimation = false;
setAnimation();
}
_global.game.hud.update();
}
forceMove(_local4, _local7);
onGround = false;
onMover = false;
mover = null;
if (!invul) {
}
} else {
trace("cant hurt player is stunned");
}
}
function projectileCollision(projObj) {
if (!invul) {
var _local3 = new Sound();
_local3.attachSound("sndEnemyDie");
_local3.start();
hurt();
_global.game.playerLives = _global.game.playerLives - 1;
if (_global.game.playerLives == 0) {
_global.game.endGame();
anim = 71;
lockAnimation = false;
setAnimation();
}
_global.game.hud.update();
}
}
function pickupCollision(pickupObj) {
pickupObj.changeOwner(this);
pickupObj.applyItem();
_global.game.itemsCollected.push(pickupObj);
}
function forceMove(xdir, ydir) {
var _local4 = (maxSpeed / 5) * xdir;
var _local3 = (maxSpeed / 2.5) * ydir;
colObj.oldpos.x = colObj.pos.x;
colObj.oldpos.y = colObj.pos.y;
colObj.pos.x = colObj.pos.x + _local4;
colObj.pos.y = colObj.pos.y + _local3;
_global.game.World.updateScreenPos(_local4, _local3);
}
function invulOff() {
trace("turn off invul");
invul = false;
mc.invincibility.removeMovieClip();
clearInterval(invul_int);
}
function toggleStun() {
if (stunned) {
stunned = false;
clearInterval(stun_int);
lockAnimation = false;
setAnimation();
if (invul) {
mc.attachMovie("invincibility", "invincibility", mc.getNextHighestDepth());
mc.invincibility._x = mc.invincibility._x - colObj.r;
mc.invincibility._y = mc.invincibility._y - colObj.r;
}
} else {
stunned = true;
clearInterval(stun_int);
stun_int = setInterval(this, "toggleStun", stunTime);
clearInterval(invul_int);
invul_int = setInterval(this, "invulOff", invulTime + stunTime);
invul = true;
if (onGround) {
anim = 61;
lockAnimation = false;
setAnimation();
} else {
anim = 61;
lockAnimation = false;
setAnimation();
}
}
}
function loopFlySound() {
if (!flySoundPlaying) {
if (flySound == undefined) {
flySound = new Sound(mc);
flySound.attachSound("fartFly");
}
if (alive) {
if (!stunned) {
flySoundPlaying = true;
flySound.start(0, 999);
}
}
}
}
function stopFlySound() {
flySoundPlaying = false;
flySound.stop();
}
function setAnimation() {
if (anim != 41) {
stopFlySound();
}
if (mc._currentframe != anim) {
lastAnim = mc._currentframe;
if (!lockAnimation) {
if (checkAnimLock()) {
lockAnimation = true;
}
mc.gotoAndStop(anim);
}
}
}
var jumpTimer = 400;
var accelJump = 13;
var accel = 1.2;
var maxSpeed = 17;
var jumpingAirSpeed = 10;
var airFriction = 0.25;
var groundFriction = 0.8;
var flying = false;
var onGround = false;
var onMover = false;
var hitAngle = 0;
var active = true;
var gravity = 0.5;
var cGravity = 0;
var invulTime = 1500;
var stunTime = 2000;
var animLockList = [21, 81, 31, 61, 101, 111, 71];
}
Symbol 859 MovieClip [__Packages.com.kaboose.games.worldengine.BaseProjectile] Frame 0
class com.kaboose.games.worldengine.BaseProjectile extends com.kaboose.games.worldengine.Sphere
{
var r, dirX, dirY, accelX, accelY, startX, startY, pos, mc, startTime;
function BaseProjectile (x, y, dir, accel) {
super(x, y, r, 0, this);
dirX = dir.x;
dirY = dir.y;
accelX = accel.x;
accelY = accel.y;
startX = x;
startY = y;
}
function onGameLoop(index, dx, dy) {
updatePos(dx, dy);
collideVsDynamicObject(_global.game.PlayerObj, index);
if (checkExpire()) {
destroy(index);
}
}
function updatePos(dx, dy) {
trace("dx: " + dx);
pos.x = pos.x + (accelX * dirX);
pos.y = pos.y + (accelY * dirY);
mc._x = _global.game.PlayerObj.mc._x - (_global.game.PlayerObj.colObj.pos.x - pos.x);
mc._y = mc._y + ((accelY * dirY) + dy);
}
function updateClip() {
if (mc != undefined) {
var _local3 = _global.game;
var _local5 = _local3.World.movementReference.colObj.pos.x - pos.x;
var _local4 = _local3.World.movementReference.colObj.pos.y - pos.y;
mc._y = _local3.World.movementReference.mc._y - _local4;
mc._x = _local3.World.movementReference.mc._x - _local5;
}
}
function destroy(index) {
trace("destroy projectile");
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
_global.game.World.projectiles.splice(index, 1);
}
function checkExpire() {
var _local2;
((((getTimer() - startTime) / 1000) > expireTime) ? (_local2 = true) : (_local2 = false));
return(_local2);
}
function determinePlayerZone() {
var _local6 = _global.game.World.getZone(this);
var _local4 = _global.game.World.getZone(_global.game.PlayerObj);
var _local5 = Math.abs(_local6.x - _local4.x);
if (_local5 <= 1) {
var _local3 = true;
} else {
var _local3 = false;
}
return(_local3);
}
function collideVsDynamicObject(_object, $index) {
if (determinePlayerZone()) {
var _local5 = false;
var _local2 = Math.abs(_object.colObj.pos.x - pos.x);
var _local3 = Math.abs(_object.colObj.pos.y - pos.y);
var _local6 = r + _object.colObj.r;
var _local7 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
if (_local7 < _local6) {
_local5 = true;
}
if (_local5) {
_object.projectileCollision(this);
destroy($index);
}
}
}
var expireTime = 2;
}
Symbol 860 MovieClip [__Packages.com.kaboose.games.PukeThePirate.projectiles.CannonBall] Frame 0
class com.kaboose.games.PukeThePirate.projectiles.CannonBall extends com.kaboose.games.worldengine.BaseProjectile
{
var mc, startTime;
function CannonBall (x, y, dir, accel) {
super(x, y, dir, accel);
trace("new cannonball");
mc = _global.game.gfxEnemies.createSprite(LIB_REF);
mc.cacheAsBitmap = true;
super.updateClip();
startTime = getTimer();
}
var r = 16;
var bounce = 0.25;
var LIB_REF = "CannonBall";
var expireTime = 10;
}
Symbol 861 MovieClip [__Packages.com.kaboose.games.PukeThePirate.pickupitems.FrootLoop] Frame 0
class com.kaboose.games.PukeThePirate.pickupitems.FrootLoop extends com.kaboose.games.worldengine.BasePickup
{
var mc, colObj, airFriction;
function FrootLoop (x, y, attributes) {
super(x, y, attributes.radius, attributes.bounce);
trace("Creating New FrootLoop ");
}
function applyItem(_object) {
super.playSound();
_global.game.loopsCollected++;
_global.game.loopCycle++;
_global.game.currentScore = _global.game.currentScore + pts;
_global.game.hud.update();
if (_global.game.loopCycle == _global.game.loopCycleCount) {
trace("NEW LOOP CYCLE");
_global.game.loopCycle = 0;
_global.game.playerLives++;
_global.game.hud.update();
var _local3 = new Sound();
_local3.attachSound("sndExtraLife");
_local3.start();
}
}
function createSprite() {
mc = _global.game.gfxItems.createSprite(linkage);
mc._x = colObj.pos.x + _global.game.World.worldMatrix.tx;
mc._y = colObj.pos.y + _global.game.World.worldMatrix.ty;
mc.gotoAndStop(com.kaboose.math.MathFunctions.randomRange(1, 6));
}
function updatePos() {
xspeed = xspeed * airFriction;
yspeed = yspeed * airFriction;
colObj.pos.x = colObj.pos.x + xspeed;
colObj.pos.y = colObj.pos.y + yspeed;
}
var SND_REF = "sndFrootLoop";
var xspeed = 1;
var yspeed = 1;
static var pts = 25;
var linkage = "FrootLoop";
}
Symbol 862 MovieClip [__Packages.com.kaboose.games.PukeThePirate.pickupitems.ExtraLife] Frame 0
class com.kaboose.games.PukeThePirate.pickupitems.ExtraLife extends com.kaboose.games.worldengine.BasePickup
{
var playSound;
function ExtraLife (x, y, attributes) {
super(x, y, attributes.radius, attributes.bounce);
trace("Creating New ExtraLife");
}
function applyItem(_object) {
playSound();
trace("1up!");
_global.game.playerLives++;
_global.game.hud.update();
}
var linkage = "ExtraLife";
var SND_REF = "sndExtraLife";
}
Symbol 863 MovieClip [__Packages.com.kaboose.games.PukeThePirate.pickupitems.BonusPoints] Frame 0
class com.kaboose.games.PukeThePirate.pickupitems.BonusPoints extends com.kaboose.games.worldengine.BasePickup
{
var mc, colObj, playSound;
function BonusPoints (x, y, attributes) {
super(x, y, attributes.radius, attributes.bounce);
trace("Creating New BonusPoints");
}
function createSprite() {
mc = _global.game.gfxItems.createSprite(linkage);
mc._x = colObj.pos.x + _global.game.World.worldMatrix.tx;
mc._y = colObj.pos.y + _global.game.World.worldMatrix.ty;
mc.gotoAndStop(com.kaboose.math.MathFunctions.randomRange(1, 4));
}
function applyItem(_object) {
playSound();
_global.game.currentScore = _global.game.currentScore + pts;
_global.game.hud.update();
}
var linkage = "BonusPoints";
static var pts = 200;
var SND_REF = "sndBonusPoints";
}
Symbol 864 MovieClip [__Packages.com.kaboose.games.PukeThePirate.pickupitems.LevelKey] Frame 0
class com.kaboose.games.PukeThePirate.pickupitems.LevelKey extends com.kaboose.games.worldengine.BasePickup
{
var playSound;
function LevelKey (x, y, attributes) {
super(x, y, attributes.radius, attributes.bounce);
trace("Creating New LevelKey");
}
function applyItem(_object) {
playSound();
_global.game.endLevel();
}
var linkage = "LevelKey";
var SND_REF = "sndLevelKey";
}
Symbol 865 MovieClip [__Packages.com.kaboose.games.PukeThePirate.pickupitems.FlightPower] Frame 0
class com.kaboose.games.PukeThePirate.pickupitems.FlightPower extends com.kaboose.games.worldengine.BasePickup
{
var playSound;
function FlightPower (x, y, attributes) {
super(x, y, attributes.radius, attributes.bounce);
trace("Creating New FlightPower");
}
function applyItem(_object) {
playSound();
_global.game.flightPower = 100;
_global.game.currentScore = _global.game.currentScore + pts;
_global.game.hud.update();
}
var linkage = "FlightPower";
var SND_REF = "sndFlightPower";
var pts = 50;
}
Symbol 866 MovieClip [__Packages.com.kaboose.games.PukeThePirate.GamePickups] Frame 0
class com.kaboose.games.PukeThePirate.GamePickups
{
function GamePickups () {
}
static var ITEM_LIST = ["FrootLoop", "ExtraLife", "BonusPoints", "LevelKey", "FlightPower"];
static var CLASS_LIST = [com.kaboose.games.PukeThePirate.pickupitems.FrootLoop, com.kaboose.games.PukeThePirate.pickupitems.ExtraLife, com.kaboose.games.PukeThePirate.pickupitems.BonusPoints, com.kaboose.games.PukeThePirate.pickupitems.LevelKey, com.kaboose.games.PukeThePirate.pickupitems.FlightPower];
static var ATTRIBUTE_LIST = [{bounce:1, radius:16}, {bounce:0, radius:16}, {bounce:1, radius:16}, {bounce:1, radius:32}, {bounce:1, radius:16}];
}
Symbol 867 MovieClip [__Packages.com.kaboose.games.worldengine.MapObject] Frame 0
class com.kaboose.games.worldengine.MapObject extends MovieClip
{
var pos, LIB_REF, xw, yw, minx, maxx, miny, maxy, mc;
function MapObject ($x, $y, $xw, $yw, $libRef) {
super();
pos = {};
pos.x = $x;
pos.y = $y;
LIB_REF = $libRef;
xw = $xw / 2;
yw = $yw / 2;
minx = pos.x;
maxx = pos.x + xw;
miny = pos.y;
maxy = pos.y + yw;
}
function setClip(clip) {
trace("set clip: Container");
mc = clip;
trace(mc);
}
}
Symbol 868 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Cannon] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Cannon extends com.kaboose.games.worldengine.MapObject
{
var fireSound, muzzlePos, fireInterval;
function Cannon ($x, $y, $xw, $yw, $linkage) {
super($x, $y, $xw, $yw);
fireSound = new Sound();
fireSound.attachSound("sndCannonFire");
muzzlePos = {};
muzzlePos.x = $x - ($xw / 2);
muzzlePos.y = $y;
trace("new Cannon");
clearInterval(fireInterval);
fireInterval = setInterval(this, "fireProjectile", fireRate);
}
function fireProjectile() {
var _local5 = Math.abs(_global.game.World.getZone(this).x - _global.game.World.getZone(_global.game.PlayerObj).x);
if (_local5 <= 1) {
fireSound.start();
var _local4 = {x:Number, y:Number};
var _local3 = {x:Number, y:Number};
_local3.x = 5;
_local3.y = 0;
_local4.x = -1;
_local4.y = 0;
var _local6 = new com.kaboose.games.PukeThePirate.projectiles.CannonBall(muzzlePos.x, muzzlePos.y, _local4, _local3);
_global.game.World.projectiles.push(_local6);
}
}
var fireRate = 3000;
}
Symbol 869 MovieClip [__Packages.com.kaboose.games.worldengine.SpikeTrap] Frame 0
class com.kaboose.games.worldengine.SpikeTrap extends com.kaboose.games.worldengine.HazardTile
{
var stateInterval, mc, SetState;
function SpikeTrap ($x, $y, $xw, $yw, $linkage) {
super($x, $y, $xw, $yw, $linkage, "spike");
trace("NEW SPIKE TRAP");
clearInterval(stateInterval);
stateInterval = setInterval(this, "stateChange", onTime);
}
function setClip(clip) {
mc = clip;
if (active) {
mc.gotoAndStop("opened");
}
}
function stateChange() {
if (active) {
currentAnim = "closed";
active = false;
SetState(0);
clearInterval(stateInterval);
stateInterval = setInterval(this, "stateChange", offTime);
} else {
trace("Turning Trap ON!!!");
currentAnim = "open";
active = true;
SetState(1);
clearInterval(stateInterval);
stateInterval = setInterval(this, "stateChange", onTime);
}
mc.gotoAndStop(currentAnim);
}
function performHazard() {
if (!_global.game.PlayerObj.invul) {
var _local2 = new Sound();
_local2.attachSound("sndEnemyDie");
_local2.start();
_global.game.PlayerObj.hurt();
_global.game.playerLives = _global.game.playerLives - 1;
if (_global.game.playerLives == 0) {
_global.game.endGame();
}
_global.game.hud.update();
}
}
var active = true;
var onTime = 2500;
var offTime = 3500;
var death = true;
var currentAnim = "open";
}
Symbol 870 MovieClip [__Packages.com.kaboose.games.PukeThePirate.RenderLayers] Frame 0
class com.kaboose.games.PukeThePirate.RenderLayers
{
static var _instance;
function RenderLayers (targetMC) {
_instance = this;
var _local3 = pass.length;
var _local2 = 0;
while (_local2 < _local3) {
renderLayer[pass[_local2]] = targetMC.createEmptyMovieClip(pass[_local2], _local2);
_local2++;
}
}
function addAudioChild(name) {
ExternalResources.newClip(audio(), name);
}
function audio() {
return(_instance.renderLayer.BASE_AUDIO);
}
function worldBase() {
return(_instance.renderLayer.BASE_WORLD);
}
function menuBase() {
return(_instance.renderLayer.BASE_MENUS);
}
function itemsBase() {
return(renderLayer.BASE_ITEMS);
}
function enemiesBase() {
return(renderLayer.BASE_ENEMIES);
}
function playerBase() {
return(renderLayer.BASE_PLAYER);
}
function devBase() {
return(renderLayer.BASE_DEV);
}
var renderLayer = [];
var pass = ["BASE_BG", "BASE_WORLD", "BASE_ITEMS", "BASE_ENEMIES", "BASE_PLAYER", "BASE_MENUS", "BASE_AUDIO", "BASE_DEV"];
}
Symbol 871 MovieClip [__Packages.ExternalResources] Frame 0
class ExternalResources
{
function ExternalResources () {
}
static function registerSound(sndName) {
var _local2 = com.kaboose.games.PukeThePirate.RenderLayers._instance;
var _local1 = new Sound(newClip(_local2.audio, sndName));
_local1.attachSound(sndName);
sounds[sndName] = _local1;
}
static function getSound(sndName) {
return(sounds[sndName]);
}
static function newClip(scope, name) {
return(scope.createEmptyMovieClip(name, nextDepth(scope)));
}
static function nextDepth(mc) {
return(mc.getNextHighestDepth());
}
static var sounds = new Object();
}
Symbol 872 MovieClip [__Packages.com.kaboose.modules.Console] Frame 0
class com.kaboose.modules.Console
{
var commands, container, logTF, input;
function Console (scope, depth) {
if (scope == undefined) {
scope = _root;
depth = 1048575 /* 0x0FFFFF */;
}
if (depth == undefined) {
depth = 0;
}
commands = new com.kaboose.modules.Commands();
container = scope.createEmptyMovieClip("Console", depth);
container.onRollOver = function () {
};
container.useHandCursor = false;
Trace.subscribe(this);
MovieClip.addListener(this);
Key.addListener(this);
}
static function initialize(scope, depth) {
if (_instance == undefined) {
_instance = new com.kaboose.modules.Console(scope, depth);
}
}
static function setCommands(newCommands) {
Trace.out("Using Custom Commands.");
_instance.commands = newCommands;
}
function show() {
if (posH > 0) {
return(undefined);
}
Mouse.addListener(this);
Stage.addListener(this);
posH = 1;
container.createTextField("logTF", 1, 0, 0, width, height);
container.createTextField("input", 2, 0, height, width, inputHeight);
logTF = container.logTF;
input = container.input;
input.textColor = 10066329 /* 0x999999 */;
input.type = "input";
input.text = "";
logTF.html = true;
logTF.multiline = true;
logTF.wordWrap = true;
logTF.selectable = false;
logTF.textColor = 10066329 /* 0x999999 */;
logTF.htmlText = logHistory;
var wait = setInterval(function (c) {
c.keepFocus();
clearInterval(wait);
}, 16, this);
redraw();
}
function hide() {
posH = 0;
logHistory = logTF.htmlText;
input.removeTextField();
logTF.removeTextField();
Mouse.removeListener(this);
Stage.removeListener(this);
container.clear();
}
function redraw() {
var _local3 = height * posH;
var _local4 = _local3 - height;
var _local2 = _local3;
logTF._y = _local4;
input._y = _local2;
container.clear();
container.beginFill(3355443, 90);
com.kaboose.utils.VectorGFX.quad(container, 0, _local4, width, height);
container.beginFill(0, 100);
com.kaboose.utils.VectorGFX.quad(container, 0, _local2, width, inputHeight);
container.endFill();
}
function checkInput() {
var _local2 = input.text;
cmds.push(_local2);
input.text = "";
if ((_local2 == "") || (_local2 == ">")) {
return(undefined);
}
var _local4 = _local2.split(" ")[0];
var _local3 = _local4.slice(1, _local4.length);
var _local5 = _local2.slice(_local3.length + 2);
if (_local3 == "clear") {
logHistory = "";
logTF.htmlText = "";
updateLog(logHistory);
return(undefined);
}
commands.exec(_local3, _local5);
}
function onTraceOut(message, level) {
var _local2 = com.kaboose.utils.FormatText.toHTML(level.label, {color:level.labelColor});
_local2 = _local2 + (com.kaboose.utils.FormatText.toHTML(message, {color:level.messageColor}) + "<br>");
if (posH > 0) {
updateLog(_local2);
} else {
logHistory = logHistory + _local2;
}
}
function updateLog(txt) {
logTF.htmlText = logTF.htmlText + txt;
logTF.scroll = logTF.maxscroll;
}
function onMouseUp() {
keepFocus();
}
function keepFocus() {
Selection.setFocus(input);
Selection.setSelection(Selection.getEndIndex(), Selection.getEndIndex());
}
function onMouseWheel(delta) {
scrollPage(delta);
}
function scrollPage(delta) {
logTF.scroll = logTF.scroll - delta;
}
function onKeyDown() {
if (Key.getCode() == 38) {
var _local2 = cmds.length;
if (_local2 > 0) {
_local2--;
input.text = cmds[_local2];
}
}
if (Key.getCode() == 40) {
var _local2 = cmds.length;
if (_local2 < (cmds.length - 1)) {
_local2++;
input.text = cmds[_local2];
}
}
switch (Key.getAscii()) {
case 126 :
show();
break;
case 27 :
hide();
break;
case 13 :
checkInput();
}
switch (Key.getCode()) {
case 33 :
scrollPage(1);
break;
case 34 :
scrollPage(-1);
}
}
static var _instance = undefined;
var width = Stage.width;
var height = Stage.height * 0.75;
var posH = new Number();
var inputHeight = 20;
var logHistory = "";
var cmds = [];
}
Symbol 873 MovieClip [__Packages.com.kaboose.modules.Commands] Frame 0
class com.kaboose.modules.Commands
{
function Commands () {
}
function exec(cmd, args) {
var _local2 = this[cmd];
_local2(args);
}
function list(args) {
Trace.list(eval (args));
}
function help(args) {
Trace.out("Help Commands : ");
var _local1 = 0;
while (_local1 < cmdList.length) {
var _local2 = DebugLevel.WARN;
_local2.setPrefix = cmdList[_local1].cmd;
Trace.out(" - " + cmdList[_local1].desc, _local2);
_local1++;
}
}
function addCommands(arr) {
var _local2 = arr.length;
var _local1 = 0;
while (_local1 < _local2) {
cmdList.push(arr[_local1]);
_local1++;
}
}
static var cmdList = [{cmd:"list", desc:"Lists a variable/ array or object. non-recursive"}, {cmd:"exec", desc:"Executes custom commands."}, {cmd:"help", desc:"Outputs available commands."}];
}
Symbol 874 MovieClip [__Packages.com.kaboose.utils.VectorGFX] Frame 0
class com.kaboose.utils.VectorGFX
{
function VectorGFX () {
}
static function quad(mc, x, y, w, h) {
mc.moveTo(x, y);
mc.lineTo(x + w, y);
mc.lineTo(x + w, y + h);
mc.lineTo(x, y + h);
mc.lineTo(x, y);
}
static function line(mc, x, y, ex, ey) {
mc.moveTo(x, y);
mc.lineTo(ex, ey);
}
static function AABB(mc, xpos, ypos, w, h) {
var _local1 = {x:xpos - w, y:ypos - h};
var _local7 = {x:xpos + w, y:ypos - h};
var _local3 = {x:xpos + w, y:ypos + h};
var _local6 = {x:xpos - w, y:ypos + h};
mc.moveTo(_local1.x, _local1.y);
mc.lineTo(_local7.x, _local7.y);
mc.lineTo(_local3.x, _local3.y);
mc.lineTo(_local6.x, _local6.y);
mc.lineTo(_local1.x, _local1.y);
}
static function circle(mc, x, y, r) {
mc.moveTo(x + r, y);
mc.curveTo(r + x, (0.4142 * r) + y, (0.7071 * r) + x, (0.7071 * r) + y);
mc.curveTo((0.4142 * r) + x, r + y, x, r + y);
mc.curveTo((-0.4142 * r) + x, r + y, (-0.7071 * r) + x, (0.7071 * r) + y);
mc.curveTo((-r) + x, (0.4142 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.4142 * r) + y, (-0.7071 * r) + x, (-0.7071 * r) + y);
mc.curveTo((-0.4142 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.4142 * r) + x, (-r) + y, (0.7071 * r) + x, (-0.7071 * r) + y);
mc.curveTo(r + x, (-0.4142 * r) + y, r + x, y);
}
static function cross(mc, x, y, size) {
var _local1 = size || 4;
mc.moveTo(x - _local1, y);
mc.lineTo(x + _local1, y);
mc.moveTo(x, y - _local1);
mc.lineTo(x, y + _local1);
}
static function quadGraph(mc, size, tx, ty) {
var _local3 = size.x / tx;
var _local2 = size.y / ty;
quad(mc, 0, 0, size.x, size.y);
var _local1 = 0;
while (_local1 < ty) {
line(mc, 0, _local2 * _local1, size.x, _local2 * _local1);
_local1++;
}
_local1 = 0;
while (_local1 < tx) {
line(mc, _local3 * _local1, 0, _local3 * _local1, Stage.height);
_local1++;
}
}
}
Symbol 875 MovieClip [__Packages.com.kaboose.utils.FormatText] Frame 0
class com.kaboose.utils.FormatText
{
function FormatText () {
}
static function toHTML(txt, args) {
if (args == undefined) {
args = new Object();
}
if (args.font == undefined) {
args.font = "Arial";
}
if (args.size == undefined) {
args.size = 9;
}
if (args.color == undefined) {
args.color = "#FFFFFF";
}
return(((((((("<FONT FACE=\"" + args.font) + "\" SIZE=\"") + args.size) + "\" COLOR=\"") + args.color) + "\">") + txt) + "</FONT>");
}
static function splitNumber(number) {
var _local2 = number.toString();
var _local4 = Math.floor(_local2.length / 3);
var _local5 = _local2.length - (_local4 * 3);
var _local3 = _local2.substr(_local2.length - 3, 3);
var _local1 = 2;
while (_local1 <= _local4) {
_local3 = (_local2.substr(_local2.length - (_local1 * 3), 3) + ",") + _local3;
_local1++;
}
if (_local5 && (_local4)) {
_local3 = (_local2.substr(0, _local5) + ",") + _local3;
}
return(_local3);
}
}
Symbol 876 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 877 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.UIBase] Frame 0
class com.kaboose.games.PukeThePirate.ui.UIBase
{
var targetMC, mainGameBackground, btnOverSFX, btnDownSFX, uiTransition, bHiding, currentMenuMC, startX, startY, bDestroy, prevMenu, bDelayClosing;
function UIBase () {
targetMC = com.kaboose.games.PukeThePirate.RenderLayers._instance.menuBase();
mainGameBackground = com.kaboose.games.PukeThePirate.RenderLayers._instance.gameBase().mainBG;
attachRef(MENU_LIB_REF, targetMC.getNextHighestDepth());
btnOverSFX = new Sound();
btnOverSFX.attachSound(BTN_OVER_SND_LIB_REF);
btnDownSFX = new Sound();
btnDownSFX.attachSound(BTN_DOWN_SND_LIB_REF);
uiTransition = new mx.transitions.Tween(uiTransObj, "", easeStyle, 1, 0, uiTransitionTime, true);
uiTransition.onMotionChanged = delegate(this, onMotionChanged);
uiTransition.onMotionFinished = delegate(this, onMotionFinished);
uiTransition.stop();
}
function show() {
bHiding = false;
currentMenuMC._visible = true;
uiTransition.continueTo(0, uiTransitionTime);
}
function attachRef(libRef, depth) {
currentMenuMC = targetMC.attachMovie(libRef, libRef, depth);
currentMenuMC.cacheAsBitmap = true;
}
function onMotionChanged() {
var _local2 = uiTransition._pos;
currentMenuMC._x = endX + (startX * _local2);
currentMenuMC._y = endY + (startY * _local2);
}
function onMotionFinished() {
if (bDestroy) {
prevMenu.uiEnabled(true);
destroy();
}
if (bHiding) {
prevMenu.uiEnabled(true);
currentMenuMC._visible = false;
}
}
function setPrevMenu(obj) {
prevMenu = obj;
}
function delayClose(duration) {
if (bDelayClosing) {
return(undefined);
}
bDelayClosing = true;
var wait = setInterval(function (uiBase) {
clearInterval(wait);
uiBase.close();
}, duration, this);
}
function close() {
bDestroy = true;
hide();
}
function hide() {
bHiding = true;
uiTransition.continueTo(1, uiTransitionTime);
}
function onPrevMenu() {
uiEnabled(false);
delete prevMenu.nextMenu;
close();
}
function uiEnabled(bEnabled) {
var _local2 = currentMenuMC;
for (var _local3 in _local2) {
if (_local3.indexOf("btn") == 0) {
_local2[_local3].enabled = bEnabled;
}
}
}
function destroy() {
currentMenuMC.removeMovieClip();
}
function playOverSound() {
btnOverSFX.start();
}
function playDownSound() {
btnDownSFX.start();
}
var MENU_LIB_REF = "";
var uiTransObj = [];
var uiTransitionTime = 0.65;
var easeStyle = mx.transitions.easing.Strong.easeInOut;
var endX = 0;
var endY = 0;
var delegate = mx.utils.Delegate.create;
var BTN_OVER_SND_LIB_REF = "";
var BTN_DOWN_SND_LIB_REF = "";
}
Symbol 878 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.MainMenu] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.MainMenu extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC, nextMenu, uiEnabled, hide, bStartGame, uiTransition, mainGameBackground;
function MainMenu (axis, loc) {
super();
AdManager.getInstance().addEventListener("resumeGame", mx.utils.Delegate.create(this, onRemoveAd));
if (axis) {
this["start" + axis.toUpperCase()] = loc;
}
show();
if (_global.MainMenuMusic.position == 0) {
_global.MainMenuMusic.start(0, 99999);
}
_global.game.World.unloadLevel();
var classRef = this;
with (currentMenuMC) {
btnPlay.onRollOver = function () {
classRef.playOverSound();
};
btnPlay.onRelease = function () {
classRef.playDownSound();
classRef.onPlay();
};
btnHighScores.onRollOver = function () {
classRef.playOverSound();
};
btnHighScores.onPress = function () {
classRef.playDownSound();
classRef.onHighScores();
};
btnInstructions.onRollOver = function () {
classRef.playOverSound();
};
btnInstructions.onPress = function () {
classRef.playDownSound();
classRef.onInstructions();
};
btnTAF.onRollOver = function () {
classRef.playOverSound();
};
btnTAF.onPress = function () {
classRef.playDownSound();
classRef.onTAF();
};
}
}
function resumeGame() {
trace("wt");
}
function onPlay() {
onRemoveAd();
}
function onRemoveAd() {
trace("on remove ad");
nextMenu = new com.kaboose.games.PukeThePirate.ui.menus.LevelIntro();
uiEnabled(false);
super.destroy();
_root.addGamePlay();
}
function onHighScores() {
nextMenu = new com.kaboose.games.PukeThePirate.ui.menus.HighScoresMenu();
uiEnabled(false);
nextMenu.setPrevMenu(this);
hide();
}
function onInstructions() {
startX = -550;
nextMenu = new com.kaboose.games.PukeThePirate.ui.menus.InstructionsMenu();
nextMenu.setPrevMenu(this);
uiEnabled(false);
hide();
}
function onTAF() {
var _local1 = "";
getURL (_local1);
}
function onMotionChanged() {
super.onMotionChanged();
if (bStartGame) {
mainGameBackground.overlay._alpha = 100 + (100 * uiTransition._pos);
}
}
function destroy() {
if (bStartGame) {
startGame();
}
}
function startGame() {
new com.kaboose.games.PukeThePirate.GameManager();
currentMenuMC.removeMovieClip();
}
var MENU_LIB_REF = "MainMenu";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 0;
var startY = 0;
}
Symbol 879 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.LevelIntro] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.LevelIntro extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, key, currentMenuMC, uiEnabled, nextMenu, hide, bStartGame, bDestroy, uiTransition, uiTransitionTime, mainGameBackground, prevMenu;
function LevelIntro () {
super();
show();
var classRef = this;
key = new Object();
Key.addListener(key);
key.onKeyDown = function () {
Trace.out("key down : LEVEL INTRO");
if (Key.getCode() == 32) {
classRef.onPlay();
}
};
with (currentMenuMC) {
btnPlay.onPress = function () {
classRef.playDownSound();
classRef.onPlay();
};
}
}
function onPlay() {
Trace.out("levelIntro.onPlay()");
Key.removeListener(key);
uiEnabled(false);
nextMenu.setPrevMenu(this);
hide();
_global.MenuMusic.stop();
bStartGame = true;
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
function onMotionChanged() {
super.onMotionChanged();
if (bStartGame) {
mainGameBackground.overlay._alpha = 100 + (100 * uiTransition._pos);
}
}
function destroy() {
if (bStartGame) {
prevMenu.MainMenuMusic.stop();
if (_global.game == undefined) {
new com.kaboose.games.PukeThePirate.GameManager();
} else {
_global.game.loadLevel(_global.game.currentLevel);
}
com.kaboose.games.PukeThePirate.RenderLayers._instance.renderLayer.BASE_BG.mainBG.removeMovieClip();
currentMenuMC.removeMovieClip();
}
}
var MENU_LIB_REF = "LevelIntro";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 0;
var startY = 0;
}
Symbol 880 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.BaseLevel] Frame 0
class com.kaboose.games.PukeThePirate.levels.BaseLevel
{
function BaseLevel () {
}
}
Symbol 881 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level1_1] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level1_1 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level1_1 (worldRendererObj) {
super();
backgrounds = [["level1_1", 1, 0, 0, true], ["level1_1", 1, 3000, 0, true, 2], ["level1_1", 1, 6000, 0, true, 3]];
matte = "level1Matte";
cTiles = [];
movers = [];
hazards = [1000, 332.1, 100, 100, 1, "rd1_grndC_01", 2700, 331.1, 100.050354003906, 100, 1, "rd1_grndC_01", 2600, 331.1, 100.050354003906, 100, 1, "rd1_grndC_01", 1900, 331.1, 100.050354003906, 100, 1, "rd1_grndC_01", 1800, 331.1, 100.050354003906, 100, 1, "rd1_grndC_01", 1100, 331.15, 100.041198730469, 100.807189941406, 1, "rd1_grndC_01", 5100, 331.15, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 5000, 331.15, 99.9343872070313, 100.814819335938, 1, "rd1_grndC_01", 4500, 331.1, 99.9618530273438, 100.814819335938, 1, "rd1_grndC_01", 4400, 331.1, 99.9618530273438, 100.814819335938, 1, "rd1_grndC_01", 3300, 331.1, 99.9252319335938, 100.814819335938, 1, "rd1_grndC_01", 3200, 331.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 6300, 331.1, 100.172424316406, 100.01220703125, 1, "rd1_grndC_01", 6200, 331.1, 100.172424316406, 100.01220703125, 1, "rd1_grndC_01", 7500, 331.1, 99.951171875, 100.807189941406, 1, "rd1_grndC_01", 7400, 331.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 6900, 331.1, 100.025939941406, 100.819396972656, 1, "rd1_grndC_01", 6800, 331.1, 100.025939941406, 100.819396972656, 1, "rd1_grndC_01", 8100, 331.1, 99.9603271484375, 100.819396972656, 1, "rd1_grndC_01", 8000, 331.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01"];
spikeTraps = [];
mapObjects = [];
pickups = [2366, 212, "FrootLoop", 2293, 152, "FrootLoop", 2195, 152, "FrootLoop", 2116, 200, "FrootLoop", 1433, 163, "FrootLoop", 1354, 160, "FrootLoop", 1743, 163, "FrootLoop", 1657, 163, "FrootLoop", 1579, 163, "FrootLoop", 948, 200, "FrootLoop", 866, 200, "FrootLoop", 788, 200, "FrootLoop", 5905, 171, "FrootLoop", 5805, 171, "FrootLoop", 5708, 171, "FrootLoop", 5495, 163, "FrootLoop", 5416, 163, "FrootLoop", 5340, 163, "FrootLoop", 5138, 246, "FrootLoop", 5068, 245, "FrootLoop", 5138, 164, "FrootLoop", 5068, 163, "FrootLoop", 4465, 240, "FrootLoop", 4532, 239, "FrootLoop", 4532, 153, "FrootLoop", 4465, 154, "FrootLoop", 4722, 170, "FrootLoop", 3306, 175, "FrootLoop", 4134, 184, "FrootLoop", 4059, 168, "FrootLoop", 3977, 183, "FrootLoop", 3687, 183, "FrootLoop", 3607, 163, "FrootLoop", 3529, 186, "FrootLoop", 3097, 219, "FrootLoop", 3097, 144, "FrootLoop", 8816, 235, "LevelKey", 6295, 159, "FrootLoop", 6247, 214, "FrootLoop", 6343, 213, "FrootLoop", 6889, 149, "FrootLoop", 6841, 204, "FrootLoop", 6938, 203, "FrootLoop", 7132, 186, "FrootLoop", 7214, 166, "FrootLoop", 7302, 186, "FrootLoop", 7496, 231, "FrootLoop", 7496, 153, "FrootLoop", 7704, 186, "FrootLoop", 7792, 166, "FrootLoop", 7874, 186, "FrootLoop", 8096, 153, "FrootLoop", 8096, 231, "FrootLoop"];
cSlabs = [2800.7, 300, 199.397277832031, 100, 1, "CollisionSlab", 2000.1, 299.2, 599.899291992188, 100, 1, "CollisionSlab", 0, 299.9, 999.917602539063, 100, 1, "CollisionSlab", 1200.1, 300.05, 599.899291992188, 100, 1, "CollisionSlab", 5200, 299.7, 800.080871582031, 100, 1, "CollisionSlab", 4600, 300, 399.990844726563, 100, 1, "CollisionSlab", 3400, 300, 1000, 100, 1, "CollisionSlab", 3000, 300, 200, 100, 1, "CollisionSlab", 8200, 300, 800.080871582031, 100, 1, "CollisionSlab", 7600, 300, 399.990844726563, 100, 1, "CollisionSlab", 7000, 300, 399.8291015625, 100, 1, "CollisionSlab", 6400.6, 300, 399.394226074219, 100, 1, "CollisionSlab", 6000, 300, 199.397277832031, 100, 1, "CollisionSlab"];
containers = [577.4, 208.2, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 2177.4, 208.2, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 4770.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 8222.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "BonusPoints"];
stompers = [];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Lobster, 2309, 272, [250, 250, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 1497, 272, [250, 250, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 5905, 273, [700, 225, null, null], com.kaboose.games.PukeThePirate.enemies.Crab, 5411, 272, [100, 650, null, null], com.kaboose.games.PukeThePirate.enemies.Crab, 4167, 272, [750, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 3616, 268, [200, 525, null, null], com.kaboose.games.PukeThePirate.enemies.Crab, 6596, 273, [180, 180, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 7191, 274, [180, 180, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 7800, 275, [180, 180, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 8425, 277, [100, 400, null, null]];
dropTiles = [];
trapDoors = [];
}
static var playerSpawnX = 250;
static var playerSpawnY = 100;
static var music = "musicLevel1_1";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 882 MovieClip [__Packages.com.kaboose.games.worldengine.enemies.BaseEnemy] Frame 0
class com.kaboose.games.worldengine.enemies.BaseEnemy
{
var colObj, index, behaviour, proximityActivationDistance, awake, mc, onscreen, active, enemyKillSound;
function BaseEnemy (x, y, $index, attributes, omitBehaviour) {
colObj = new com.kaboose.games.worldengine.Sphere(x, y, r, bounce, this);
index = $index;
if (omitBehaviour != true) {
var _local3 = x - attributes[0];
var _local4 = x + attributes[1];
behaviour = new com.kaboose.games.worldengine.movementbehaviour.LateralPatrol(_local3, _local4, this, attributes[2]);
}
if ((attributes[3] != undefined) || (attributes[3] != null)) {
proximityActivationDistance = attributes[3];
} else {
awake = true;
}
}
function setClip(clip) {
mc = clip;
onscreen = true;
}
function onScreen() {
}
function offScreen() {
onscreen = false;
}
function onGameLoop(dynObjIndex) {
checkActive();
if (awake) {
if (active) {
behaviour.update();
_global.game.World.updateObject(index);
}
}
if (proximityActivationDistance == undefined) {
if (active) {
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
}
} else if (!awake) {
if (checkProximity(_global.game.PlayerObj)) {
awake = true;
}
} else {
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
if (!checkProximity(_global.game.PlayerObj)) {
awake = false;
}
}
}
function checkActive() {
var _local5 = _global.game.World.getZone(this);
var _local4 = _global.game.World.getZone(_global.game.PlayerObj);
var _local3 = Math.abs(_local5.x - _local4.x);
if (_local3 <= zoneAwareness) {
if (!active) {
active = true;
}
} else if (active) {
active = false;
}
}
function checkProximity(obj) {
var _local2 = Math.abs(obj.colObj.pos.x - colObj.pos.x);
var _local3 = Math.abs(obj.colObj.pos.y - colObj.pos.y);
var _local4 = proximityActivationDistance;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
if (_local5 < _local4) {
return(true);
}
return(false);
}
function changeActive(act) {
active = act;
}
function destroy($index, puke) {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(mc);
if (enemyKillSound == undefined) {
enemyKillSound = new Sound();
enemyKillSound.attachSound(SND_ENEMY_KILL);
}
if (puke) {
mc = _global.game.gfxEnemies.createSprite(LIB_REF_DESTROY);
} else {
mc = _global.game.gfxEnemies.createSprite(LIB_REF_DESTROY_BLUE);
}
var _local3 = _global.game;
var _local5 = _local3.World.movementReference.colObj.pos.x - colObj.pos.x;
var _local4 = _local3.World.movementReference.colObj.pos.y - colObj.pos.y;
mc._y = _local3.World.movementReference.mc._y - _local4;
mc._x = _local3.World.movementReference.mc._x - _local5;
trace("destroy: " + $index);
_global.game.World.dynamicObjects.splice($index, 1);
_global.game.World.oTiles[index] = null;
}
function collideVsDynamicObject(_object, $index) {
var _local3 = false;
if (_object.colObj instanceof com.kaboose.games.worldengine.Box) {
var _local7 = _object.colObj.pos.x - colObj.pos.x;
var _local12 = _object.colObj.xw;
var _local11 = _object.colObj.yw;
var _local10 = (_local12 + colObj.r) - Math.abs(_local7);
if (0 < _local10) {
var _local6 = _object.colObj.pos.y - colObj.pos.y;
var _local9 = (_local11 + colObj.r) - Math.abs(_local6);
if (0 < _local9) {
_local3 = true;
}
}
} else {
var _local4 = Math.abs(_object.colObj.pos.x - colObj.pos.x);
var _local5 = Math.abs(_object.colObj.pos.y - colObj.pos.y);
var _local8 = (colObj.r + _object.colObj.r) - 2;
var _local13 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
if (_local13 < _local8) {
_local3 = true;
}
}
if (_local3) {
if (_object instanceof com.kaboose.games.PukeThePirate.PlayerObject) {
trace("COLLISION");
_object.enemyCollision(this, $index);
}
}
}
static var LIB_REF = "enemy_crab";
static var r = 32;
static var bounce = 0;
var pts = 100;
var LIB_REF_DESTROY = "destroyEnemy";
var LIB_REF_DESTROY_BLUE = "destroyEnemyBlue";
var SND_ENEMY_KILL = "sndEnemyDie";
static var width = 64;
static var height = 64;
var zoneAwareness = 2;
var xspeed = 4;
var yspeed = 4;
var xdir = 1;
var ydir = 1;
var xw = 32;
var yw = 32;
}
Symbol 883 MovieClip [__Packages.com.kaboose.games.worldengine.movementbehaviour.LateralPatrol] Frame 0
class com.kaboose.games.worldengine.movementbehaviour.LateralPatrol
{
var boundsLeft, boundsRight, owner, patrolDelayDuration, paused, patrolDelayInt;
function LateralPatrol (bl, br, ownerRef, delayDuration) {
boundsLeft = bl;
boundsRight = br;
owner = ownerRef;
if (delayDuration != undefined) {
patrolDelayDuration = delayDuration;
}
}
function update() {
if (!paused) {
checkBounds();
}
}
function pausePatrol() {
clearInterval(patrolDelayInt);
patrolDelayInt = setInterval(this, "resumePatrol", owner.patrolDelayDuration * 1000);
paused = true;
}
function resumePatrol() {
clearInterval(patrolDelayInt);
paused = false;
}
function checkBounds() {
owner.mc._xscale = (100 * owner.xdir) * -1;
if (owner.colObj == undefined) {
if (owner.maxSpeed == undefined) {
var _local2 = owner.xdir * owner.xspeed;
} else {
var _local2 = Math.min(owner.maxSpeed * owner.dx, Math.max(owner.maxSpeed * owner.dx, owner.xspeed + owner.accelX));
}
owner.pos.x = owner.pos.x + _local2;
owner.mc._x = owner.mc._x + _local2;
if ((owner.pos.x + owner.xw) > boundsRight) {
owner.xdir = -1;
if ((patrolDelayDuration != undefined) || (patrolDelayDuration != null)) {
pausePatrol();
}
}
if (owner.pos.x < boundsLeft) {
owner.xdir = 1;
if ((patrolDelayDuration != undefined) || (patrolDelayDuration != null)) {
pausePatrol();
}
}
} else {
if (owner.maxSpeed == undefined) {
var _local2 = owner.xdir * owner.xspeed;
} else {
var _local2 = Math.min(owner.maxSpeed * owner.dx, Math.max(owner.maxSpeed * owner.dx, owner.xspeed + owner.accelX));
}
owner.colObj.pos.x = owner.colObj.pos.x + _local2;
owner.mc._x = owner.mc._x + _local2;
if ((owner.colObj.pos.x + owner.xw) > boundsRight) {
owner.xdir = -1;
if (owner.patrolDelayDuration != 0) {
}
pausePatrol();
}
if (owner.colObj.pos.x < boundsLeft) {
owner.xdir = 1;
if (owner.patrolDelayDuration != 0) {
}
pausePatrol();
}
}
}
}
Symbol 884 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Lobster] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Lobster extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
function Lobster (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new Lobster enemy");
}
static var LIB_REF = "enemy_lobster";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
}
Symbol 885 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Crab] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Crab extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
function Crab (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new Crab enemy");
}
static var LIB_REF = "enemy_crab";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
var xspeed = 5.5;
}
Symbol 886 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level1_2] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level1_2 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level1_2 (worldRendererObj) {
super();
backgrounds = [["level1_2", 1, 0, 0, true], ["level1_2", 1, 3000, 0, true, 2], ["level1_2", 1, 6000, 0, true, 3]];
matte = "level1Matte";
cTiles = [];
movers = [1633.2, 278.25, 103.75, 50, 1, "rd1_log", 4, 0, 0, 60, 0, 140, 1927.7, 278.25, 103.75, 50, 1, "rd1_log", 4, 0, 0, 150, 0, 70, 3099.9, 277.65, 103.75, 50, 1, "rd1_log", 4, 0, 0, 110, 0, 300, 3425.4, 277.65, 103.75, 50, 1, "rd1_log", 3, 0, 0, 150, 0, 110, 5750.4, 277.65, 103.75, 50, 1, "rd1_log", 4, 0, 0, 350, 0, 150, 6332.4, 277.65, 103.75, 50, 1, "rd1_log", 4, 0, 0, 200, 0, 125, 6704.4, 277.65, 103.75, 50, 1, "rd1_log", 4, 0, 0, 200, 0, 150];
hazards = [2900, 321.1, 99.9359130859375, 100.807189941406, 1, "rd1_grndC_01", 2801, 321.1, 99.9359130859375, 100.807189941406, 1, "rd1_grndC_01", 2101, 321.25, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 2001, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 1901, 321.1, 99.9359130859375, 100.807189941406, 1, "rd1_grndC_01", 1801, 321.1, 99.9359130859375, 100.807189941406, 1, "rd1_grndC_01", 1701, 321.1, 99.9664306640625, 100.807189941406, 1, "rd1_grndC_01", 1601, 321.1, 99.9664306640625, 100.807189941406, 1, "rd1_grndC_01", 1501, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 901, 321.5, 100, 100, 1, "rd1_grndC_01", 1001, 321.5, 100, 100, 1, "rd1_grndC_01", 5800, 321.1, 99.9496459960938, 100.807189941406, 1, "rd1_grndC_01", 5699.95, 321.5, 100, 100, 1, "rd1_grndC_01", 5900, 321.1, 99.9496459960938, 100.807189941406, 1, "rd1_grndC_01", 5600, 321.1, 100.050354003906, 100, 1, "rd1_grndC_01", 5100, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 5000, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 4500, 321.1, 99.9496459960938, 100.807189941406, 1, "rd1_grndC_01", 4400, 321.1, 99.951171875, 100.807189941406, 1, "rd1_grndC_01", 3300, 321.2, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 3400, 321.2, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 3100, 321.2, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 3000, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 3600, 321.2, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 3200, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 3500, 321.2, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 7500, 321.15, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 7400, 321.15, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 6300, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 6200, 321.1, 99.951171875, 100.807189941406, 1, "rd1_grndC_01", 6100, 321.1, 99.9725341796875, 100.816345214844, 1, "rd1_grndC_01", 6000, 321.1, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 6400, 321.2, 100, 100.799560546875, 1, "rd1_grndC_01", 6900, 321.2, 100.071716308594, 100.816345214844, 1, "rd1_grndC_01", 6800, 321.2, 100.050354003906, 100.807189941406, 1, "rd1_grndC_01", 6600, 321.15, 99.9496459960938, 100.816345214844, 1, "rd1_grndC_01", 6700, 321.2, 100.071716308594, 100.816345214844, 1, "rd1_grndC_01", 6500, 321.15, 99.9496459960938, 100.816345214844, 1, "rd1_grndC_01"];
spikeTraps = [];
mapObjects = [];
pickups = [2606, 110, "FrootLoop", 2736, 110, "FrootLoop", 2676, 152, "FrootLoop", 1694, 87, "FrootLoop", 1690, 170, "FrootLoop", 1729, 127, "FrootLoop", 1661, 127, "FrootLoop", 1984, 87, "FrootLoop", 1980, 170, "FrootLoop", 2019, 127, "FrootLoop", 1951, 127, "FrootLoop", 2282, 114, "FrootLoop", 2412, 114, "FrootLoop", 2352, 156, "FrootLoop", 1431, 136, "FrootLoop", 1429, 220, "FrootLoop", 1309, 135, "FrootLoop", 1186, 135, "FrootLoop", 1184, 219, "FrootLoop", 814, 154, "FrootLoop", 717, 152, "FrootLoop", 621, 154, "FrootLoop", 438, 152, "FrootLoop", 325, 154, "FrootLoop", 220, 154, "FrootLoop", 5804, 153, "FrootLoop", 5856, 103, "FrootLoop", 5752, 102, "FrootLoop", 5804, 46, "FrootLoop", 5546, 161, "FrootLoop", 5472, 161, "FrootLoop", 5303, 161, "FrootLoop", 5229, 161, "FrootLoop", 4964, 161, "FrootLoop", 4890, 161, "FrootLoop", 4721, 161, "FrootLoop", 4647, 161, "FrootLoop", 4089, 67, "FrootLoop", 4010, 67, "FrootLoop", 4323, 165, "FrootLoop", 4250, 165, "FrootLoop", 4176, 165, "FrootLoop", 3911, 165, "FrootLoop", 3837, 165, "FrootLoop", 3763, 165, "FrootLoop", 3472, 171, "FrootLoop", 3523, 122, "FrootLoop", 3419, 121, "FrootLoop", 3472, 64, "FrootLoop", 3156, 171, "FrootLoop", 3207, 122, "FrootLoop", 3103, 121, "FrootLoop", 3156, 64, "FrootLoop", 8857, 239, "LevelKey", 8556, 186, "FrootLoop", 7858, 184, "FrootLoop", 8199, 186, "FrootLoop", 8377, 158, "FrootLoop", 8420, 98, "FrootLoop", 8332, 99, "FrootLoop", 8049, 158, "FrootLoop", 8092, 98, "FrootLoop", 8004, 99, "FrootLoop", 7711, 158, "FrootLoop", 7754, 98, "FrootLoop", 7666, 99, "FrootLoop", 7315, 155, "FrootLoop", 7084, 155, "FrootLoop", 7359, 95, "FrootLoop", 7271, 96, "FrootLoop", 7126, 95, "FrootLoop", 7038, 96, "FrootLoop", 6608, 248, "FrootLoop", 6520, 248, "FrootLoop", 6782, 159, "FrootLoop", 6694, 159, "FrootLoop", 6428, 155, "FrootLoop", 6340, 155, "FrootLoop", 6897, 246, "FrootLoop", 6897, 164, "FrootLoop", 6897, 82, "FrootLoop", 6182, 246, "FrootLoop", 6182, 164, "FrootLoop", 6182, 82, "FrootLoop"];
cSlabs = [2201, 300, 600, 100, 1, "CollisionSlab", 1101, 300, 400, 100, 1, "CollisionSlab", 0, 300, 900.999450683594, 100, 1, "CollisionSlab", 5200, 300, 400, 100, 1, "CollisionSlab", 4600, 300, 400, 100, 1, "CollisionSlab", 3700, 300, 700.999450683594, 100, 1, "CollisionSlab", 7600, 300, 1400, 100, 1, "CollisionSlab", 7000, 300, 400, 100, 1, "CollisionSlab"];
containers = [1250.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 4190.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "FlightPower", 7138.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "ExtraLife"];
stompers = [];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Octopus, 1836, 175, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 2501, 273, [300, 300, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 840, 276, [250, 25, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 2900, 153, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 992, 175, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 5097, 143, [0, 375, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 3323, 136, [0, 375, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 5562, 273, [375, 0, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 4806, 273, [175, 175, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 4013, 275, [300, 325, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 4493, 136, [0, 375, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 6065, 143, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 6571, 143, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 7494, 149, [undefined, undefined, undefined], com.kaboose.games.PukeThePirate.enemies.Lobster, 8208, 276, [650, 650, null, null], com.kaboose.games.PukeThePirate.enemies.Lobster, 7870, 276, [200, 200, null, null]];
dropTiles = [];
trapDoors = [];
}
static var mapWidth = 9000;
static var mapHeight = 400;
static var playerSpawnX = 350;
static var playerSpawnY = 200;
static var music = "musicLevel1_1";
}
Symbol 887 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Octopus] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Octopus extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
var behaviour;
function Octopus (x, y, $index, attributes) {
super(x, y, $index, attributes, true);
var _local4 = y - attributes[0];
var _local6 = y + attributes[1];
behaviour = new com.kaboose.games.worldengine.movementbehaviour.VerticalPatrol(_local4, _local6, this, attributes[2]);
trace("new Octopus enemy");
}
static var LIB_REF = "enemy_octopus";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
}
Symbol 888 MovieClip [__Packages.com.kaboose.games.worldengine.movementbehaviour.VerticalPatrol] Frame 0
class com.kaboose.games.worldengine.movementbehaviour.VerticalPatrol
{
var boundsTop, boundsBottom, owner;
function VerticalPatrol (bt, bb, ownerRef) {
boundsTop = bt;
boundsBottom = bb;
owner = ownerRef;
}
function update() {
checkBounds();
}
function checkBounds() {
if (owner.colObj == undefined) {
if (owner.maxSpeed == undefined) {
var _local2 = owner.ydir * owner.yspeed;
} else {
var _local2 = Math.min(owner.maxSpeed * owner.dy, Math.max(owner.maxSpeed * owner.dy, owner.yspeed + owner.accely));
}
owner.pos.y = owner.pos.y + _local2;
owner.mc._y = owner.mc._y + _local2;
if (owner.pos.y > boundsBottom) {
owner.ydir = -1;
}
if (owner.pos.y < boundsTop) {
owner.ydir = 1;
}
} else {
if (owner.maxSpeed == undefined) {
var _local2 = owner.ydir * owner.yspeed;
} else {
var _local2 = Math.min(owner.maxSpeed * owner.dy, Math.max(owner.maxSpeed * owner.dy, owner.yspeed + owner.accely));
}
owner.colObj.pos.y = owner.colObj.pos.y + _local2;
owner.mc._y = owner.mc._y + _local2;
if (owner.colObj.pos.y > boundsBottom) {
owner.ydir = -1;
}
if (owner.colObj.pos.y <= boundsTop) {
owner.ydir = 1;
if (owner instanceof com.kaboose.games.PukeThePirate.enemies.Squid) {
owner.shootProjectile();
}
}
}
}
}
Symbol 889 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Squid] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Squid extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
var behaviour, muzzlePos;
function Squid (x, y, $index, attributes) {
super(x, y, $index, attributes, true);
var _local5 = y - attributes[0];
var _local6 = y + attributes[1];
behaviour = new com.kaboose.games.worldengine.movementbehaviour.VerticalPatrol(_local5, _local6, this, attributes[2]);
muzzlePos = {};
muzzlePos.x = x;
muzzlePos.y = y;
trace("new Squid enemy");
}
function shootProjectile() {
var _local4 = {x:Number, y:Number};
var _local3 = {x:Number, y:Number};
_local3.x = 4;
_local3.y = 0;
_local4.x = -1;
_local4.y = 0;
var _local5 = new com.kaboose.games.PukeThePirate.projectiles.InkBall(muzzlePos.x, muzzlePos.y, _local4, _local3);
_global.game.World.projectiles.push(_local5);
}
static var LIB_REF = "enemy_squid";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
}
Symbol 890 MovieClip [__Packages.com.kaboose.games.PukeThePirate.projectiles.InkBall] Frame 0
class com.kaboose.games.PukeThePirate.projectiles.InkBall extends com.kaboose.games.worldengine.BaseProjectile
{
var mc, startTime;
function InkBall (x, y, dir, accel) {
super(x, y, dir, accel);
trace("new InkBall");
mc = _global.game.gfxEnemies.createSprite(LIB_REF);
mc.cacheAsBitmap = true;
super.updateClip();
startTime = getTimer();
}
var r = 16;
var bounce = 0.25;
var LIB_REF = "InkBall";
}
Symbol 891 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level2_1] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level2_1 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level2_1 (worldRendererObj) {
super();
backgrounds = [["level2_1", 1, 0, 0, true], ["level2_1", 1, 3000, 0, true, 2], ["level2_1", 1, 6000, 0, true, 3]];
matte = "level2Matte";
cTiles = [];
movers = [2749.3, 302.8, 130.2, 52.1, 1, "rd2_plateau_01", 4, 0, 0, 150, 0, 150, 1746.95, 308.6, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 2045.15, 308.6, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 803.6, 291.45, 130.2, 52.1, 1, "rd2_plateau_01", 0, 3, 200, 0, 50, 0, 5798, 308.6, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 4738.6, 314.5, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 5000.65, 315.6, 130.2, 52.1, 1, "rd2_plateau_01", 3, 0, 0, 75, 0, 125, 4492.6, 315.6, 130.2, 52.1, 1, "rd2_plateau_01", 3, 0, 0, 150, 0, 75, 3140.4, 315.45, 130.2, 52.1, 1, "rd2_plateau_01", 0, 2, 200, 0, 50, 0, 6092.85, 318.6, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 6396.25, 318.6, 130.2, 52.1, 1, "rd2_plateau_01", 2, 0, 0, 75, 0, 175, 7094.25, 318.6, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 7397.65, 318.6, 130.2, 52.1, 1, "rd2_plateau_01", 0, 2, 200, 0, 0, 0, 8145.85, 318.6, 130.2, 52.1, 1, "rd2_plateau_01", 4, 0, 0, 125, 0, 125];
hazards = [2899.95, 341.4, 100, 100, 1, "rd2_grndB_01", 2799.95, 341.4, 100, 100, 1, "rd2_grndB_01", 2699.95, 341.4, 100, 100, 1, "rd2_grndB_01", 2599.95, 341.4, 100, 100, 1, "rd2_grndB_01", 2199.95, 341.4, 100, 100, 1, "rd2_grndB_01", 2099.95, 341.4, 100, 100, 1, "rd2_grndB_01", 1999.95, 341.4, 100, 100, 1, "rd2_grndB_01", 1899.95, 341.4, 100, 100, 1, "rd2_grndB_01", 1799.95, 341.4, 100, 100, 1, "rd2_grndB_01", 1699.95, 341.4, 100, 100, 1, "rd2_grndB_01", 1599.95, 341.4, 100, 100, 1, "rd2_grndB_01", 900.05, 340.8, 100.016784667969, 100, 1, "rd2_grndB_01", 800.05, 340.8, 100.016784667969, 100, 1, "rd2_grndB_01", 700, 340.8, 100.016784667969, 100, 1, "rd2_grndB_01", 5899.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5799.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5699.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5599.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5099.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4999.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4899.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4799.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4699.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4599.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4499.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4399.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3299.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3199.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3099.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 2999.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 8300.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 8200.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 8100.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 8000.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 7500, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 7400, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 7300, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 7200, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 7100, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 7000, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 6500, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 6400, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 6300, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 6200, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 6100, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 6000, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01"];
spikeTraps = [];
mapObjects = [];
pickups = [2845, 100, "FrootLoop", 2760, 100, "FrootLoop", 1532, 244, "FrootLoop", 1532, 168, "FrootLoop", 1532, 98, "FrootLoop", 1045, 246, "FrootLoop", 1045, 171, "FrootLoop", 1044, 100, "FrootLoop", 2131, 100, "FrootLoop", 2046, 100, "FrootLoop", 1836, 100, "FrootLoop", 1750, 100, "FrootLoop", 634, 163, "FrootLoop", 566, 100, "FrootLoop", 492, 164, "FrootLoop", 5403, 89, "FrootLoop", 5566, 166, "FrootLoop", 5502, 166, "FrootLoop", 5302, 161, "FrootLoop", 5238, 161, "FrootLoop", 4217, 192, "FrootLoop", 4152, 192, "FrootLoop", 3786, 192, "FrootLoop", 3721, 192, "FrootLoop", 3513, 191, "FrootLoop", 3448, 191, "FrootLoop", 4330, 113, "FrootLoop", 4266, 113, "FrootLoop", 4084, 113, "FrootLoop", 4020, 113, "FrootLoop", 3637, 106, "FrootLoop", 3573, 106, "FrootLoop", 5876, 79, "FrootLoop", 5812, 79, "FrootLoop", 4788, 148, "FrootLoop", 5077, 248, "FrootLoop", 5012, 248, "FrootLoop", 4816, 92, "FrootLoop", 4752, 92, "FrootLoop", 4576, 248, "FrootLoop", 4512, 248, "FrootLoop", 3214, 87, "FrootLoop", 3150, 87, "FrootLoop", 8864, 246, "LevelKey", 8589, 129, "FrootLoop", 8524, 129, "FrootLoop", 6792, 93, "FrootLoop", 6900, 221, "FrootLoop", 6696, 215, "FrootLoop", 8226, 106, "FrootLoop", 8162, 106, "FrootLoop", 8226, 191, "FrootLoop", 8162, 191, "FrootLoop", 8226, 266, "FrootLoop", 8162, 266, "FrootLoop", 7932, 173, "FrootLoop", 7659, 181, "FrootLoop", 7827, 106, "FrootLoop", 7762, 106, "FrootLoop", 7476, 128, "FrootLoop", 7412, 128, "FrootLoop", 7174, 128, "FrootLoop", 7109, 128, "FrootLoop", 7323, 286, "FrootLoop", 7259, 286, "FrootLoop", 6449, 210, "FrootLoop", 6137, 210, "FrootLoop", 6447, 148, "FrootLoop", 6477, 92, "FrootLoop", 6412, 92, "FrootLoop", 6137, 148, "FrootLoop", 6165, 92, "FrootLoop", 6101, 92, "FrootLoop"];
cSlabs = [2301, 302, 299.000549316406, 100, 1, "CollisionSlab", 1001, 302, 599.000549316406, 100, 1, "CollisionSlab", 0, 300, 700, 100, 1, "CollisionSlab", 3401, 302, 999.000549316406, 100, 1, "CollisionSlab", 5192, 300, 408.000183105469, 100, 1, "CollisionSlab", 8400, 300, 600, 100, 1, "CollisionSlab", 6600, 300, 400, 100, 1, "CollisionSlab", 7601, 302, 399.000549316406, 100, 1, "CollisionSlab"];
containers = [1130.3, 205.75, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 3844.7, 205.65, 116.7, 93.15, 1, "TreasureChest", "FlightPower", 5341.7, 205.75, 116.7, 93.15, 1, "TreasureChest", "ExtraLife", 8645.9, 206.2, 116.7, 93.15, 1, "TreasureChest", "BonusPoints"];
stompers = [];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Snake, 2456, 264, [125, 125, 2, null], com.kaboose.games.PukeThePirate.enemies.Spider, 2380, 142, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Bat, 1942, 139, [400, 400, undefined, null], com.kaboose.games.PukeThePirate.enemies.Spider, 1443, 133, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 1303, 237, [200, 25, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 1196, 133, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Snake, 577, 262, [150, 100, 2, null], com.kaboose.games.PukeThePirate.enemies.Snake, 5264, 262, [25, 325, 2, null], com.kaboose.games.PukeThePirate.enemies.Snake, 5543, 261, [325, 25, 2, null], com.kaboose.games.PukeThePirate.enemies.Spider, 5404, 164, [150, 115, null, null], com.kaboose.games.PukeThePirate.enemies.Bat, 4902, 145, [600, 250, undefined, null], com.kaboose.games.PukeThePirate.enemies.Snake, 3898, 262, [450, 450, 2, null], com.kaboose.games.PukeThePirate.enemies.Spider, 4302, 190, [150, 100, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 4183, 108, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 4057, 201, [150, 100, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 3763, 112, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 3608, 201, [150, 100, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 3492, 110, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 6893, 144, [100, 110, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 6693, 144, [100, 110, null, null], com.kaboose.games.PukeThePirate.enemies.Snake, 6792, 261, [185, 185, 2, null], com.kaboose.games.PukeThePirate.enemies.Bat, 7305, 138, [250, 250, undefined, null], com.kaboose.games.PukeThePirate.enemies.Spider, 7800, 260, [225, 0, null, null], com.kaboose.games.PukeThePirate.enemies.Snake, 7669, 261, [25, 300, 2, null], com.kaboose.games.PukeThePirate.enemies.Snake, 7933, 257, [300, 25, 2, null], com.kaboose.games.PukeThePirate.enemies.Snake, 8566, 259, [150, 325, 2, null]];
dropTiles = [];
trapDoors = [];
}
static var playerSpawnX = 250;
static var playerSpawnY = 200;
static var music = "musicLevel2";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 892 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Snake] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Snake extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
function Snake (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new Snake enemy");
}
static var LIB_REF = "enemy_snake";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
var patrolDelayDuration = 2;
}
Symbol 893 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Spider] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Spider extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
var behaviour;
function Spider (x, y, $index, attributes) {
super(x, y, $index, attributes, true);
var _local4 = y - attributes[0];
var _local6 = y + attributes[1];
behaviour = new com.kaboose.games.worldengine.movementbehaviour.VerticalPatrol(_local4, _local6, this, attributes[2]);
trace("new Spider enemy");
}
static var LIB_REF = "enemy_spider";
static var r = 18;
static var bounce = 0;
static var width = 64;
static var height = 64;
}
Symbol 894 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Bat] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Bat extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
function Bat (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new Bat enemy");
}
static var LIB_REF = "enemy_bat";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
}
Symbol 895 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level2_2] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level2_2 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level2_2 (worldRendererObj) {
super();
backgrounds = [["level2_2", 1, 0, 0, true], ["level2_2", 1, 3000, 0, true, 2], ["level2_2", 1, 6000, 0, true, 3]];
matte = "level2Matte";
cTiles = [];
movers = [2850.15, 309.55, 130.2, 52.1, 1, "rd2_plateau_01", 0, 5, 250, 0, 0, 0, 2616.5, 309.75, 130.2, 52.1, 1, "rd2_plateau_01", 2, 0, 0, 100, 0, 75, 697.35, 314.5, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 200, 0, 0, 0, 5810.55, 312, 130.2, 52.1, 1, "rd2_plateau_01", 0, 3, 200, 0, 0, 0, 3300, 309.75, 130.2, 52.1, 1, "rd2_plateau_01", 2.5, 0, 0, 50, 0, 100, 3059.3, 310.85, 130.2, 52.1, 1, "rd2_plateau_01", 0, 4, 210, 0, 0, 0, 8099.95, 315.95, 130.2, 52.1, 1, "rd2_plateau_01", 0, 2, 200, 0, 0, 0, 7621.6, 311.65, 130.2, 52.1, 1, "rd2_plateau_01", 0, 2, 225, 0, 0, 0, 7386.05, 312.15, 130.2, 52.1, 1, "rd2_plateau_01", 0, 2, 225, 0, 0, 0, 7027.8, 308.65, 130.2, 52.1, 1, "rd2_plateau_01", 2, 0, 0, 75, 0, 125, 6799.55, 308.65, 130.2, 52.1, 1, "rd2_plateau_01", 0, 2, 225, 0, 0, 0, 6579.6, 307.25, 130.2, 52.1, 1, "rd2_plateau_01", 3, 0, 0, 125, 0, 75];
hazards = [2101.75, 341.2, 100.001525878906, 100, 1, "rd2_grndB_01", 2001.75, 341.2, 100.001525878906, 100, 1, "rd2_grndB_01", 1901.75, 341.2, 100.001525878906, 100, 1, "rd2_grndB_01", 1801.75, 341.2, 100.001525878906, 100, 1, "rd2_grndB_01", 1701.75, 341.2, 100.001525878906, 100, 1, "rd2_grndB_01", 1601.75, 341.2, 100.018310546875, 100, 1, "rd2_grndB_01", 1501.75, 341.2, 100.018310546875, 100, 1, "rd2_grndB_01", 1401.7, 341.2, 100.018310546875, 100, 1, "rd2_grndB_01", 2899.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 2799.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 2699.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 2599.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 2499.95, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 899.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 799.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 699.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 599.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 499.9, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 4900, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4800, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4700, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4600, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4500, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4400, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4300, 341, 100.001525878906, 100, 1, "rd2_grndB_01", 4200.05, 341, 100.018310546875, 100, 1, "rd2_grndB_01", 4100.05, 341, 100.018310546875, 100, 1, "rd2_grndB_01", 4000, 341, 100.018310546875, 100, 1, "rd2_grndB_01", 3900.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3800.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3700.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5900.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5800.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 5700.05, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3400, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3300, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3200, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3100, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 3000, 340.8, 100.001525878906, 100, 1, "rd2_grndB_01", 8200.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 8100.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 8000.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7700.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7600.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7500.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7400.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7300.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7100.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 7000.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 6900.05, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 6800, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 6700, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 6600, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01", 6500, 340.8, 100.003051757813, 100, 1, "rd2_grndB_01"];
spikeTraps = [];
mapObjects = [];
pickups = [2905, 107, "FrootLoop", 2906, 232, "FrootLoop", 2905, 168, "FrootLoop", 2679, 107, "FrootLoop", 2680, 232, "FrootLoop", 2679, 168, "FrootLoop", 2441, 127, "FrootLoop", 2370, 127, "FrootLoop", 2100, 183, "FrootLoop", 1960, 112, "FrootLoop", 1809, 190, "FrootLoop", 1659, 110, "FrootLoop", 1509, 191, "FrootLoop", 790, 281, "FrootLoop", 722, 280, "FrootLoop", 907, 139, "FrootLoop", 949, 90, "FrootLoop", 880, 90, "FrootLoop", 593, 139, "FrootLoop", 634, 90, "FrootLoop", 566, 90, "FrootLoop", 3613, 113, "FrootLoop", 3613, 174, "FrootLoop", 5856, 157, "FrootLoop", 5857, 229, "FrootLoop", 5336, 199, "FrootLoop", 5509, 155, "FrootLoop", 5510, 227, "FrootLoop", 5165, 147, "FrootLoop", 5166, 219, "FrootLoop", 5363, 148, "FrootLoop", 5304, 148, "FrootLoop", 4914, 210, "FrootLoop", 4855, 210, "FrootLoop", 4785, 144, "FrootLoop", 4726, 144, "FrootLoop", 4639, 218, "FrootLoop", 4581, 218, "FrootLoop", 4494, 156, "FrootLoop", 4435, 156, "FrootLoop", 4338, 239, "FrootLoop", 4279, 238, "FrootLoop", 4180, 98, "FrootLoop", 4121, 98, "FrootLoop", 4016, 221, "FrootLoop", 3957, 221, "FrootLoop", 3832, 160, "FrootLoop", 3773, 160, "FrootLoop", 3349, 159, "FrootLoop", 3379, 108, "FrootLoop", 3320, 108, "FrootLoop", 3112, 159, "FrootLoop", 3143, 109, "FrootLoop", 3084, 109, "FrootLoop", 8883, 240, "LevelKey", 7914, 122, "FrootLoop", 7845, 120, "FrootLoop", 8152, 115, "FrootLoop", 8154, 179, "FrootLoop", 8154, 251, "FrootLoop", 7667, 115, "FrootLoop", 7669, 179, "FrootLoop", 7669, 251, "FrootLoop", 7434, 114, "FrootLoop", 7436, 177, "FrootLoop", 7436, 249, "FrootLoop", 6842, 114, "FrootLoop", 6843, 177, "FrootLoop", 6843, 249, "FrootLoop", 7071, 156, "FrootLoop", 7101, 106, "FrootLoop", 7043, 106, "FrootLoop", 6623, 149, "FrootLoop", 6654, 99, "FrootLoop", 6595, 98, "FrootLoop", 8672, 160, "FrootLoop", 8672, 104, "FrootLoop", 7187, 129, "FrootLoop", 7289, 129, "FrootLoop", 7237, 160, "FrootLoop", 7237, 104, "FrootLoop", 6191, 127, "FrootLoop", 6293, 127, "FrootLoop", 6241, 158, "FrootLoop", 6241, 101, "FrootLoop"];
cSlabs = [2202, 300, 297.999572753906, 100, 1, "CollisionSlab", 1001, 302, 399.000549316406, 100, 1, "CollisionSlab", 0, 300, 500, 100, 1, "CollisionSlab", 4992, 300, 707.992553710938, 100, 1, "CollisionSlab", 3501, 302, 199.098205566406, 100, 1, "CollisionSlab", 8301, 302, 698.933410644531, 100, 1, "CollisionSlab", 7800, 300, 199.098205566406, 100, 1, "CollisionSlab", 7201, 302, 99.0509033203125, 100, 1, "CollisionSlab", 6000, 300, 500.03662109375, 100, 1, "CollisionSlab"];
containers = [1054.7, 205.95, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 3552.2, 204.35, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 8325.8, 205.15, 116.7, 93.15, 1, "TreasureChest", "ExtraLife"];
stompers = [];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Spider, 1254, 181, [150, 115, null, null], com.kaboose.games.PukeThePirate.enemies.Bat, 2793, 165, [300, 300, undefined, null], com.kaboose.games.PukeThePirate.enemies.Snake, 2344, 263, [150, 150, 2, null], com.kaboose.games.PukeThePirate.enemies.Bat, 777, 136, [300, 300, undefined, null], com.kaboose.games.PukeThePirate.enemies.Spider, 1114, 118, [50, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Snake, 5573, 262, [675, 75, 3, null], com.kaboose.games.PukeThePirate.enemies.Bat, 4800, 95, [undefined, undefined, undefined], com.kaboose.games.PukeThePirate.enemies.Spider, 4375, 121, [150, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 5446, 144, [150, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 5232, 144, [150, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Snake, 5091, 263, [75, 625, 2, null], com.kaboose.games.PukeThePirate.enemies.Spider, 3228, 207, [undefined, undefined, undefined], com.kaboose.games.PukeThePirate.enemies.Bat, 3918, 86, [undefined, undefined, null], com.kaboose.games.PukeThePirate.enemies.Bat, 8449, 109, [700, 500, undefined, null], com.kaboose.games.PukeThePirate.enemies.Bat, 6896, 109, [400, 300, undefined, null], com.kaboose.games.PukeThePirate.enemies.Spider, 6111, 170, [150, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Spider, 6370, 169, [150, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Snake, 6246, 261, [250, 250, 2, null], com.kaboose.games.PukeThePirate.enemies.Snake, 7242, 259, [25, 25, 2, null], com.kaboose.games.PukeThePirate.enemies.Snake, 8672, 264, [325, 325, 2, null], com.kaboose.games.PukeThePirate.enemies.Spider, 7900, 181, [150, 150, null, null], com.kaboose.games.PukeThePirate.enemies.Bat, 7544, 118, [300, 300, undefined, null]];
dropTiles = [2036.45, 228, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 1759.95, 232.5, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 1910.05, 150.4, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 1610.05, 153.05, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 1457.45, 242, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 4835.05, 239.6, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 4705.7, 165.6, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 4558.8, 244.4, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 4411.8, 197, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 4252.8, 269.05, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 4100, 166.5, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 3931.4, 258.7, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01", 3753.95, 214.4, 130.2, 52.1, 16, 2, 400, 1, "rd2_plateau_01"];
trapDoors = [];
}
static var playerSpawnX = 250;
static var playerSpawnY = 200;
static var music = "musicLevel2";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 896 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level3_1] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level3_1 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level3_1 (worldRendererObj) {
super();
backgrounds = [["level3_1", 1, 0, 0, true], ["level3_1", 1, 3000, 0, true, 2], ["level3_1", 1, 6000, 0, true, 3]];
matte = "level3Matte";
cTiles = [];
movers = [1897.9, 96.05, 119.65, 68.7, 1, "rd3_table", 0, 3, 0, 0, 240, 0, 1693.9, 297.05, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 50, 0, 703.55, 302.45, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 4397.55, 303.25, 119.65, 68.7, 1, "rd3_table", 0, 3, 225, 0, 0, 0, 4796.55, 95.8, 119.65, 68.7, 1, "rd3_table", 0, 3, 0, 0, 260, 0, 5598.55, 85.8, 119.65, 68.7, 1, "rd3_table", 0, 3, 0, 0, 255, 0, 5882.1, 292, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 250, 0, 170, 5298.85, 298.5, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 180, 0, 100, 4602.3, 301.1, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 90, 0, 90];
hazards = [2900, 339.95, 100, 100, 1, "rd3_grndB_01", 2600, 339.95, 100, 100, 1, "rd3_grndB_01", 2500, 339.95, 100, 100, 1, "rd3_grndB_01", 2000, 339.95, 100, 100, 1, "rd3_grndB_01", 1900, 339.95, 100, 100, 1, "rd3_grndB_01", 1800, 339.95, 100, 100, 1, "rd3_grndB_01", 1700, 339.95, 100, 100, 1, "rd3_grndB_01", 1600, 339.95, 100, 100, 1, "rd3_grndB_01", 800, 339.95, 100, 100, 1, "rd3_grndB_01", 700, 339.95, 100, 100, 1, "rd3_grndB_01", 600, 339.95, 100, 100, 1, "rd3_grndB_01", 5900, 339.95, 100, 100, 1, "rd3_grndB_01", 5800, 339.95, 100, 100, 1, "rd3_grndB_01", 5700, 339.95, 100, 100, 1, "rd3_grndB_01", 5600, 339.95, 100, 100, 1, "rd3_grndB_01", 5500, 339.95, 100, 100, 1, "rd3_grndB_01", 5400, 339.95, 100, 100, 1, "rd3_grndB_01", 5300, 339.95, 100, 100, 1, "rd3_grndB_01", 5200, 339.95, 100, 100, 1, "rd3_grndB_01", 4900, 339.95, 100, 100, 1, "rd3_grndB_01", 4800, 339.95, 100, 100, 1, "rd3_grndB_01", 4700, 339.95, 100, 100, 1, "rd3_grndB_01", 4600, 339.95, 100, 100, 1, "rd3_grndB_01", 4500, 339.95, 100, 100, 1, "rd3_grndB_01", 4400, 339.95, 100, 100, 1, "rd3_grndB_01", 4300, 339.95, 100, 100, 1, "rd3_grndB_01", 3800, 339.95, 100, 100, 1, "rd3_grndB_01", 3700, 339.95, 100, 100, 1, "rd3_grndB_01", 3400, 339.95, 100, 100, 1, "rd3_grndB_01", 3300, 339.95, 100, 100, 1, "rd3_grndB_01", 3000, 339.95, 100, 100, 1, "rd3_grndB_01", 8400, 349.95, 100, 100, 1, "rd3_grndB_01", 8300, 349.95, 100, 100, 1, "rd3_grndB_01", 8000, 349.95, 100, 100, 1, "rd3_grndB_01", 7900, 349.95, 100, 100, 1, "rd3_grndB_01", 7300, 349.95, 100, 100, 1, "rd3_grndB_01", 7200, 349.95, 100, 100, 1, "rd3_grndB_01", 7000, 349.95, 100, 100, 1, "rd3_grndB_01", 6900, 349.95, 100, 100, 1, "rd3_grndB_01", 6700, 349.95, 100, 100, 1, "rd3_grndB_01", 6600, 349.95, 100, 100, 1, "rd3_grndB_01", 6100, 349.95, 100, 100, 1, "rd3_grndB_01", 6000, 349.95, 100, 100, 1, "rd3_grndB_01"];
spikeTraps = [];
mapObjects = [];
pickups = [2657, 266, "FrootLoop", 2596, 266, "FrootLoop", 2534, 266, "FrootLoop", 2731, 111, "FrootLoop", 1192, 111, "FrootLoop", 2286, 188, "FrootLoop", 2224, 188, "FrootLoop", 1320, 231, "FrootLoop", 1259, 231, "FrootLoop", 1026, 231, "FrootLoop", 965, 231, "FrootLoop", 1980, 58, "FrootLoop", 1919, 58, "FrootLoop", 1980, 262, "FrootLoop", 1919, 262, "FrootLoop", 1780, 58, "FrootLoop", 1719, 58, "FrootLoop", 1780, 262, "FrootLoop", 1719, 262, "FrootLoop", 786, 58, "FrootLoop", 726, 58, "FrootLoop", 786, 272, "FrootLoop", 726, 272, "FrootLoop", 551, 202, "FrootLoop", 490, 202, "FrootLoop", 322, 202, "FrootLoop", 252, 202, "FrootLoop", 5939, 300, "FrootLoop", 5344, 300, "FrootLoop", 5650, 49, "FrootLoop", 5934, 183, "FrootLoop", 5934, 126, "FrootLoop", 5934, 65, "FrootLoop", 5650, 300, "FrootLoop", 5649, 243, "FrootLoop", 5649, 182, "FrootLoop", 5345, 200, "FrootLoop", 5345, 143, "FrootLoop", 5345, 82, "FrootLoop", 5100, 200, "FrootLoop", 5099, 143, "FrootLoop", 5099, 82, "FrootLoop", 4541, 82, "FrootLoop", 4754, 82, "FrootLoop", 4850, 300, "FrootLoop", 4650, 300, "FrootLoop", 4450, 300, "FrootLoop", 4206, 183, "FrootLoop", 4007, 190, "FrootLoop", 4133, 121, "FrootLoop", 4065, 121, "FrootLoop", 3468, 271, "FrootLoop", 3398, 271, "FrootLoop", 3330, 271, "FrootLoop", 8816, 258, "FrootLoop", 8758, 258, "FrootLoop", 8705, 258, "FrootLoop", 8616, 183, "FrootLoop", 8643, 42, "FrootLoop", 8590, 42, "FrootLoop", 8228, 42, "FrootLoop", 8174, 42, "FrootLoop", 7689, 42, "FrootLoop", 7636, 42, "FrootLoop", 7357, 269, "FrootLoop", 7307, 269, "FrootLoop", 7253, 269, "FrootLoop", 7049, 269, "FrootLoop", 6999, 269, "FrootLoop", 6945, 269, "FrootLoop", 6880, 42, "FrootLoop", 6827, 42, "FrootLoop", 6756, 264, "FrootLoop", 6702, 264, "FrootLoop", 6645, 264, "FrootLoop", 6573, 194, "FrootLoop", 6504, 121, "FrootLoop", 6434, 198, "FrootLoop", 6364, 260, "FrootLoop", 6291, 111, "FrootLoop", 7182, 114, "FrootLoop", 8872, 249, "LevelKey"];
cSlabs = [2699.7, 299.9, 200.308227539063, 100, 1, "CollisionSlab", 2099.7, 299.9, 400.303649902344, 100, 1, "CollisionSlab", 899.7, 299.9, 700.439453125, 100, 1, "CollisionSlab", -0.3, 299.9, 600.201416015625, 100, 1, "CollisionSlab", 4999.7, 299.9, 200.299072265625, 100, 1, "CollisionSlab", 3899.7, 299.9, 400.291442871094, 100, 1, "CollisionSlab", 3499.7, 299.9, 196.269226074219, 100, 1, "CollisionSlab", 3103.7, 300.9, 196.269226074219, 100, 1, "CollisionSlab", 6799.7, 299.9, 99.3515014648438, 100, 1, "CollisionSlab", 7100.7, 297.4, 99.3515014648438, 100, 1, "CollisionSlab", 7399.7, 299.9, 500.260925292969, 100, 1, "CollisionSlab", 8099.7, 299.9, 200.30517578125, 100, 1, "CollisionSlab", 8499.7, 299.9, 500.201416015625, 100, 1, "CollisionSlab", 6196.95, 300, 403.044128417969, 100, 1, "CollisionSlab"];
containers = [1482.7, 206.9, 116.7, 93.15, 1, "TreasureChest", "FlightPower", 3549.1, 206, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 7410.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "ExtraLife"];
stompers = [];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Pirate, 1350, 252, [360, 135, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 2315, 255, [210, 210, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 5800, 187, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Squid, 3785, 194, [0, 300, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 6385, 255, [175, 200, null, null], com.kaboose.games.PukeThePirate.enemies.Squid, 8398, 122, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Squid, 7998, 122, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 8130, 254, [0, 175, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 7651, 254, [225, 225, null, null]];
dropTiles = [];
trapDoors = [2900, 300, 100, 37.45, 1, "rd3_trapDoorLeft", 2600, 300, 100, 37.45, 1, "rd3_trapDoorRight", 2500, 300, 100, 37.45, 1, "rd3_trapDoorLeft", 3000, 300, 100, 37.45, 1, "rd3_trapDoorRight", 3400, 301, 100, 37.45, 1, "rd3_trapDoorRight", 3300, 301, 100, 37.45, 1, "rd3_trapDoorLeft", 7300.05, 300, 100, 37.45, 1, "rd3_trapDoorRight", 7200.05, 300, 100, 37.45, 1, "rd3_trapDoorLeft", 7000, 300, 100, 37.45, 1, "rd3_trapDoorRight", 6900, 300, 100, 37.45, 1, "rd3_trapDoorLeft", 6701, 301, 100, 37.45, 1, "rd3_trapDoorRight", 6601, 301, 100, 37.45, 1, "rd3_trapDoorLeft"];
}
static var playerSpawnX = 250;
static var playerSpawnY = 200;
static var music = "musicLevel3_1";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 897 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Pirate] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Pirate extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
var mc, checkActive, awake, active, behaviour, index, proximityActivationDistance, collideVsDynamicObject, checkProximity, colObj;
function Pirate (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new Pirate enemy");
}
function setClip(clip) {
mc = clip;
mc.gotoAndStop(currentAnim);
}
function onGameLoop(dynObjIndex) {
checkActive();
if (awake) {
if (active) {
checkDistanceAnim(_global.game.PlayerObj);
behaviour.update();
_global.game.World.updateObject(index);
}
}
if (proximityActivationDistance == undefined) {
if (active) {
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
}
} else if (!awake) {
if (checkProximity(_global.game.PlayerObj)) {
awake = true;
}
} else {
trace("2");
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
if (!checkProximity(_global.game.PlayerObj)) {
awake = false;
}
}
}
function checkDistanceAnim(obj) {
var _local2 = Math.abs(obj.colObj.pos.x - colObj.pos.x);
var _local3 = Math.abs(obj.colObj.pos.y - colObj.pos.y);
var _local4 = attackDistance;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
if (_local5 < _local4) {
currentAnim = "attack";
} else {
currentAnim = "run";
}
mc.gotoAndStop(currentAnim);
}
static var LIB_REF = "enemy_Pirate";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
var currentAnim = "run";
var attackDistance = 125;
}
Symbol 898 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level3_2] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level3_2 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level3_2 (worldRendererObj) {
super();
backgrounds = [["level3_2", 1, 0, 0, true], ["level3_2", 1, 3000, 0, true, 2], ["level3_2", 1, 6000, 0, true, 3]];
matte = "level3Matte";
cTiles = [];
movers = [1196.55, 301.7, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 946, 302, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 140, 0, 140, 700.05, 304.5, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 4240.05, 298.9, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 3959.55, 299, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 5206.05, 303.5, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 50, 0, 50, 3098.3, 303.5, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 190, 0, 280, 4546.3, 293.5, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 100, 0, 140, 7002.55, 304.8, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 7597.55, 305.2, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 8496.55, 309.05, 119.65, 68.7, 1, "rd3_table", 0, 3, 180, 0, 40, 0, 7844, 304.8, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 100, 0, 100, 7296.3, 303.5, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 125, 0, 125, 6748.05, 307.5, 119.65, 68.7, 1, "rd3_table", 3, 0, 0, 115, 0, 115];
hazards = [2900, 339.95, 100, 100, 1, "rd3_grndB_01", 2800, 339.95, 100, 100, 1, "rd3_grndB_01", 2300, 339.95, 100, 100, 1, "rd3_grndB_01", 2200, 339.95, 100, 100, 1, "rd3_grndB_01", 1900, 339.95, 100, 100, 1, "rd3_grndB_01", 1800, 339.95, 100, 100, 1, "rd3_grndB_01", 1300, 339.95, 100, 100, 1, "rd3_grndB_01", 1200, 339.95, 100, 100, 1, "rd3_grndB_01", 1100, 339.95, 100, 100, 1, "rd3_grndB_01", 1000, 339.95, 100, 100, 1, "rd3_grndB_01", 900, 339.95, 100, 100, 1, "rd3_grndB_01", 800, 339.95, 100, 100, 1, "rd3_grndB_01", 700, 339.95, 100, 100, 1, "rd3_grndB_01", 600, 339.95, 100, 100, 1, "rd3_grndB_01", 400, 339.95, 100, 100, 1, "rd3_grndB_01", 300, 339.95, 100, 100, 1, "rd3_grndB_01", 5700, 339.95, 100, 100, 1, "rd3_grndB_01", 5600, 339.95, 100, 100, 1, "rd3_grndB_01", 5300, 339.95, 100, 100, 1, "rd3_grndB_01", 5200, 339.95, 100, 100, 1, "rd3_grndB_01", 5100, 339.95, 100, 100, 1, "rd3_grndB_01", 4700, 339.95, 100, 100, 1, "rd3_grndB_01", 4600, 339.95, 100, 100, 1, "rd3_grndB_01", 4500, 339.95, 100, 100, 1, "rd3_grndB_01", 4400, 339.95, 100, 100, 1, "rd3_grndB_01", 4300, 339.95, 100, 100, 1, "rd3_grndB_01", 4200, 339.95, 100, 100, 1, "rd3_grndB_01", 4100, 339.95, 100, 100, 1, "rd3_grndB_01", 4000, 339.95, 100, 100, 1, "rd3_grndB_01", 3900, 339.95, 100, 100, 1, "rd3_grndB_01", 3800, 339.95, 100, 100, 1, "rd3_grndB_01", 3300, 339.95, 100, 100, 1, "rd3_grndB_01", 3200, 339.95, 100, 100, 1, "rd3_grndB_01", 3100, 339.95, 100, 100, 1, "rd3_grndB_01", 3000, 339.95, 100, 100, 1, "rd3_grndB_01", 8600, 339.95, 100, 100, 1, "rd3_grndB_01", 8500, 339.95, 100, 100, 1, "rd3_grndB_01", 8400, 339.95, 100, 100, 1, "rd3_grndB_01", 8000, 339.95, 100, 100, 1, "rd3_grndB_01", 7900, 339.95, 100, 100, 1, "rd3_grndB_01", 7800, 339.95, 100, 100, 1, "rd3_grndB_01", 7700, 339.95, 100, 100, 1, "rd3_grndB_01", 7600, 339.95, 100, 100, 1, "rd3_grndB_01", 7500, 339.95, 100, 100, 1, "rd3_grndB_01", 7400, 339.95, 100, 100, 1, "rd3_grndB_01", 7300, 339.95, 100, 100, 1, "rd3_grndB_01", 7200, 339.95, 100, 100, 1, "rd3_grndB_01", 7100, 339.95, 100, 100, 1, "rd3_grndB_01", 7000, 339.95, 100, 100, 1, "rd3_grndB_01", 6900, 339.95, 100, 100, 1, "rd3_grndB_01", 6800, 339.95, 100, 100, 1, "rd3_grndB_01", 6700, 339.95, 100, 100, 1, "rd3_grndB_01", 6600, 339.95, 100, 100, 1, "rd3_grndB_01", 6100, 339.95, 100, 100, 1, "rd3_grndB_01", 6000, 339.95, 100, 100, 1, "rd3_grndB_01"];
spikeTraps = [];
mapObjects = [];
pickups = [1527, 200, "FrootLoop", 2100, 200, "FrootLoop", 2339, 56, "FrootLoop", 2277, 54, "FrootLoop", 1923, 56, "FrootLoop", 1862, 54, "FrootLoop", 748, 184, "FrootLoop", 1246, 184, "FrootLoop", 1279, 266, "FrootLoop", 1218, 264, "FrootLoop", 1279, 56, "FrootLoop", 1218, 54, "FrootLoop", 1027, 266, "FrootLoop", 965, 264, "FrootLoop", 1027, 56, "FrootLoop", 965, 54, "FrootLoop", 780, 269, "FrootLoop", 718, 268, "FrootLoop", 780, 59, "FrootLoop", 718, 58, "FrootLoop", 460, 266, "FrootLoop", 398, 266, "FrootLoop", 336, 264, "FrootLoop", 5742, 66, "FrootLoop", 5674, 66, "FrootLoop", 4949, 93, "FrootLoop", 4801, 248, "FrootLoop", 4713, 166, "FrootLoop", 3791, 223, "FrootLoop", 3889, 150, "FrootLoop", 4304, 197, "FrootLoop", 4623, 62, "FrootLoop", 4569, 62, "FrootLoop", 4322, 62, "FrootLoop", 4268, 62, "FrootLoop", 4037, 62, "FrootLoop", 3984, 62, "FrootLoop", 5284, 267, "FrootLoop", 5230, 267, "FrootLoop", 4623, 257, "FrootLoop", 4569, 257, "FrootLoop", 4322, 257, "FrootLoop", 4268, 257, "FrootLoop", 4037, 257, "FrootLoop", 3984, 257, "FrootLoop", 3180, 268, "FrootLoop", 3126, 268, "FrootLoop", 6139, 72, "FrootLoop", 6078, 71, "FrootLoop", 8579, 79, "FrootLoop", 8518, 77, "FrootLoop", 8582, 277, "FrootLoop", 8520, 275, "FrootLoop", 7930, 267, "FrootLoop", 7868, 265, "FrootLoop", 7680, 72, "FrootLoop", 7618, 71, "FrootLoop", 7383, 268, "FrootLoop", 7321, 267, "FrootLoop", 7086, 72, "FrootLoop", 7024, 71, "FrootLoop", 6834, 272, "FrootLoop", 6772, 271, "FrootLoop", 8870, 248, "LevelKey"];
cSlabs = [2399.7, 299, 400.311279296875, 100, 1, "CollisionSlab", 1999.7, 299.5, 200.25634765625, 100, 1, "CollisionSlab", 1399.7, 299, 400.315856933594, 100, 1, "CollisionSlab", 499.7, 300.5, 100.267028808594, 100, 1, "CollisionSlab", -0.3, 299.5, 300.201416015625, 100, 1, "CollisionSlab", 5799.7, 299, 200.241088867188, 100, 1, "CollisionSlab", 5399.7, 299.5, 200.241088867188, 100, 1, "CollisionSlab", 4799.7, 299, 300.434875488281, 100, 1, "CollisionSlab", 3399.7, 299.5, 400.311279296875, 100, 1, "CollisionSlab", 8699.7, 299.5, 300.233459472656, 100, 1, "CollisionSlab", 8099.7, 299, 300.233459472656, 100, 1, "CollisionSlab", 6199.7, 299.5, 400.311279296875, 100, 1, "CollisionSlab"];
containers = [2536.75, 206.05, 116.7, 93.15, 1, "TreasureChest", "FlightPower", 5838.2, 208.2, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 8270.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "ExtraLife"];
stompers = [];
cannons = [2015.6, 226.15, 147.75, 78.1, 1, "rd3_cannon", 1442.65, 226.25, 147.75, 78.1, 1, "rd3_cannon", 5452.05, 225.9, 147.75, 78.1, 1, "rd3_cannon", 3431.75, 224.05, 147.75, 78.1, 1, "rd3_cannon", 8099.5, 221.95, 147.75, 78.1, 1, "rd3_cannon"];
enemies = [com.kaboose.games.PukeThePirate.enemies.Squid, 2303, 143, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Squid, 1899, 144, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 2754, 258, [300, 0, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 2424, 258, [0, 300, null, null], com.kaboose.games.PukeThePirate.enemies.Octopus, 4169, 143, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Squid, 5704, 154, [0, 350, null, null], com.kaboose.games.PukeThePirate.enemies.Pirate, 6244, 257, [0, 275, null, null], com.kaboose.games.PukeThePirate.enemies.Squid, 6091, 151, [0, 350, null, null]];
dropTiles = [];
trapDoors = [400, 300, 100, 37.45, 1, "rd3_trapDoorRight", 300, 300, 100, 37.45, 1, "rd3_trapDoorLeft"];
}
static var playerSpawnX = 250;
static var playerSpawnY = 200;
static var music = "musicLevel3_2";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 899 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level4_1] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level4_1 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level4_1 (worldRendererObj) {
super();
backgrounds = [["level4_1", 1, 0, 0, true], ["level4_1", 1, 3000, 0, true, 2], ["level4_1", 1, 6000, 0, true, 3]];
matte = "level4Matte";
cTiles = [];
movers = [2002.9, 249.7, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 6, 135, 0, 75, 0, 1604.9, 249.7, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, 135, 0, 75, 0, 1796.9, 249.7, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 2, 140, 0, 75, 0, 2651.25, 248, 102.65, 51.35, 1, "rd4_stonePlatform", 4, 0, 0, 200, 0, 250, 896.5, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, 175, 0, 75, 0, 3000.05, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 4, 0, 0, 200, 0, 0, 7398.9, 80.7, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, -50, 0, 250, 0, 7198.55, 247, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 1, 125, 0, 75, 0, 7001.75, 79.15, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 2, -50, 0, 250, 0, 6794.55, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, 125, 0, 75, 0];
hazards = [2900, 350, 100, 100, 1, "rd4_grndB_01", 2800, 350, 100, 100, 1, "rd4_grndB_01", 2700, 350, 100, 100, 1, "rd4_grndB_01", 2600, 350, 100, 100, 1, "rd4_grndB_01", 2500, 350, 100, 100, 1, "rd4_grndB_01", 2400, 350, 100, 100, 1, "rd4_grndB_01", 2100, 350, 100, 100, 1, "rd4_grndB_01", 2000, 350, 100, 100, 1, "rd4_grndB_01", 1900, 350, 100, 100, 1, "rd4_grndB_01", 1800, 350, 100, 100, 1, "rd4_grndB_01", 1700, 350, 100, 100, 1, "rd4_grndB_01", 1600, 350, 100, 100, 1, "rd4_grndB_01", 1500, 350, 100, 100, 1, "rd4_grndB_01", 1000, 350, 100, 100, 1, "rd4_grndB_01", 900, 350, 100, 100, 1, "rd4_grndB_01", 800, 350, 100, 100, 1, "rd4_grndB_01", 4204.45, 393.8, 100, 100, 1, "rd4_grndB_01", 4104.45, 393.8, 100, 100, 1, "rd4_grndB_01", 4004.45, 393.8, 100, 100, 1, "rd4_grndB_01", 3904.45, 393.8, 100, 100, 1, "rd4_grndB_01", 3804.45, 393.8, 100, 100, 1, "rd4_grndB_01", 3704.45, 393.8, 100, 100, 1, "rd4_grndB_01", 5900.1, 393.8, 100, 100, 1, "rd4_grndB_01", 5800.1, 393.8, 100, 100, 1, "rd4_grndB_01", 5700.1, 393.8, 100, 100, 1, "rd4_grndB_01", 5600.1, 393.8, 100, 100, 1, "rd4_grndB_01", 5500.1, 393.8, 100, 100, 1, "rd4_grndB_01", 5400.1, 393.8, 100, 100, 1, "rd4_grndB_01", 5300.1, 393.8, 100, 100, 1, "rd4_grndB_01", 3200, 350, 100, 100, 1, "rd4_grndB_01", 3100, 350, 100, 100, 1, "rd4_grndB_01", 3000, 350, 100, 100, 1, "rd4_grndB_01", 7500, 350, 100, 100, 1, "rd4_grndB_01", 7400, 350, 100, 100, 1, "rd4_grndB_01", 7300, 350, 100, 100, 1, "rd4_grndB_01", 7200, 350, 100, 100, 1, "rd4_grndB_01", 7100, 350, 100, 100, 1, "rd4_grndB_01", 7000, 350, 100, 100, 1, "rd4_grndB_01", 6900, 350, 100, 100, 1, "rd4_grndB_01", 6800, 350, 100, 100, 1, "rd4_grndB_01", 6700, 350, 100, 100, 1, "rd4_grndB_01"];
spikeTraps = [2286.85, 218.75, 23.7, 83.45, 1, "rd4_aztec_spear", 3616.55, 219.45, 23.7, 83.45, 1, "rd4_aztec_spear", 3360.3, 219.6, 23.7, 83.45, 1, "rd4_aztec_spear", 7924.4, 219.6, 23.7, 83.45, 1, "rd4_aztec_spear"];
mapObjects = [];
pickups = [2242, 222, "FrootLoop", 2352, 222, "FrootLoop", 2298, 183, "FrootLoop", 2735, 183, "FrootLoop", 2662, 183, "FrootLoop", 2046, 149, "FrootLoop", 2044, 94, "FrootLoop", 2044, 37, "FrootLoop", 1848, 149, "FrootLoop", 1846, 94, "FrootLoop", 1846, 37, "FrootLoop", 1650, 149, "FrootLoop", 1648, 94, "FrootLoop", 1648, 37, "FrootLoop", 1325, 134, "FrootLoop", 1263, 133, "FrootLoop", 941, 155, "FrootLoop", 941, 101, "FrootLoop", 939, 47, "FrootLoop", 621, 183, "FrootLoop", 559, 181, "FrootLoop", 494, 183, "FrootLoop", 432, 181, "FrootLoop", 4172, 291, "FrootLoop", 4172, 234, "FrootLoop", 5872, 142, "FrootLoop", 5810, 142, "FrootLoop", 5671, 201, "FrootLoop", 5608, 201, "FrootLoop", 5473, 142, "FrootLoop", 5410, 142, "FrootLoop", 5254, 139, "FrootLoop", 4335, 218, "FrootLoop", 4848, 179, "FrootLoop", 4786, 179, "FrootLoop", 5020, 146, "FrootLoop", 4957, 146, "FrootLoop", 4662, 146, "FrootLoop", 4599, 146, "FrootLoop", 3993, 189, "FrootLoop", 3993, 132, "FrootLoop", 3806, 212, "FrootLoop", 3806, 154, "FrootLoop", 3207, 59, "FrootLoop", 3145, 59, "FrootLoop", 3500, 227, "FrootLoop", 3627, 185, "FrootLoop", 3625, 131, "FrootLoop", 3625, 74, "FrootLoop", 3372, 187, "FrootLoop", 3370, 133, "FrootLoop", 3370, 76, "FrootLoop", 7461, 146, "FrootLoop", 7249, 178, "FrootLoop", 8535, 201, "FrootLoop", 8867, 252, "LevelKey", 8341, 261, "FrootLoop", 8139, 202, "FrootLoop", 8534, 103, "FrootLoop", 8337, 146, "FrootLoop", 8135, 101, "FrootLoop", 7933, 148, "FrootLoop", 7828, 147, "FrootLoop", 7728, 147, "FrootLoop", 7052, 146, "FrootLoop", 6839, 178, "FrootLoop", 6551, 164, "FrootLoop", 6151, 164, "FrootLoop", 6355, 169, "FrootLoop", 6457, 169, "FrootLoop", 6252, 169, "FrootLoop"];
cSlabs = [2199.7, 299.95, 200.30517578125, 100, 1, "CollisionSlab", -0.3, 299.95, 800.325012207031, 100, 1, "CollisionSlab", 1099.7, 299.95, 400.299072265625, 100, 1, "CollisionSlab", 4294, 2, 1000.27923583984, 100, 1, "CollisionSlab", 4299.7, 299.95, 1000.27923583984, 100, 1, "CollisionSlab", 3299.7, 299.95, 404.316711425781, 100, 1, "CollisionSlab", 6100, -3, 499.986267089844, 100, 1, "CollisionSlab", 8699.7, 299.95, 300.343322753906, 100, 1, "CollisionSlab", 7600.7, 299.95, 399.392700195313, 100, 1, "CollisionSlab", 5999.7, 299.95, 700.294494628906, 100, 1, "CollisionSlab"];
containers = [1170.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "FlightPower", 4750.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "BonusPoints", 7634.55, 206.05, 116.7, 93.15, 1, "TreasureChest", "ExtraLife"];
stompers = [4358.55, 23.55, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -115.45, 162.55, 5078.55, 23.55, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -115.45, 162.55];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Idol, 1401, 255, [10, 150, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 4988, 253, [100, 50, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 4620, 254, [50, 100, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 6449, 254, [50, 200, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 6251, 254, [200, 50, 0, 150]];
dropTiles = [4130, 337, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 5800, 245.6, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 5602.15, 280.65, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 5400.1, 245.6, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 3950, 247, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 3769.05, 280.6, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 8498.1, 245.6, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 8297.15, 314.65, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 8100, 250, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01"];
trapDoors = [];
}
static var playerSpawnX = 250;
static var playerSpawnY = 200;
static var music = "musicLevel4_1";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 900 MovieClip [__Packages.com.kaboose.games.worldengine.enemies.ProximityChaser] Frame 0
class com.kaboose.games.worldengine.enemies.ProximityChaser extends com.kaboose.games.worldengine.enemies.BaseEnemy
{
var awake, active, behaviour, index, proximityActivationDistance, collideVsDynamicObject, checkProximity, colObj;
function ProximityChaser (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new ProxChaser enemy");
}
function onGameLoop(dynObjIndex) {
super.checkActive();
if (awake) {
if (active) {
behaviour.update();
_global.game.World.updateObject(index);
}
}
if (proximityActivationDistance == undefined) {
if (active) {
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
}
} else if (!awake) {
if (checkProximity(_global.game.PlayerObj)) {
trace("wake up");
awake = true;
}
} else {
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
if (!checkProximity(_global.game.PlayerObj)) {
trace("go to sleep");
awake = false;
}
}
}
function checkPlayerDirection() {
if (_global.game.PlayerObj.colObj.pos.x > colObj.pos.x) {
var _local3 = 1;
} else {
var _local3 = -1;
}
return(_local3);
}
static var LIB_REF = "enemy_lobster";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
}
Symbol 901 MovieClip [__Packages.com.kaboose.games.PukeThePirate.enemies.Idol] Frame 0
class com.kaboose.games.PukeThePirate.enemies.Idol extends com.kaboose.games.worldengine.enemies.ProximityChaser
{
var mc, checkActive, awake, active, behaviour, index, checkProximity, collideVsDynamicObject;
function Idol (x, y, $index, attributes) {
super(x, y, $index, attributes);
trace("new Idol enemy");
}
function setClip(clip) {
mc = clip;
mc.gotoAndStop(currentAnim);
}
function onGameLoop(dynObjIndex) {
checkActive();
if (awake) {
if (active) {
behaviour.update();
_global.game.World.updateObject(index);
}
}
if (!awake) {
if (checkProximity(_global.game.PlayerObj)) {
trace("wake up");
currentAnim = "walk";
mc.gotoAndStop(currentAnim);
awake = true;
}
} else {
collideVsDynamicObject(_global.game.PlayerObj, dynObjIndex);
if (!checkProximity(_global.game.PlayerObj)) {
trace("go to sleep");
awake = false;
currentAnim = "idle";
mc.gotoAndStop(currentAnim);
}
}
}
static var LIB_REF = "enemy_idol";
static var r = 32;
static var bounce = 0;
static var width = 64;
static var height = 64;
var currentAnim = "idle";
}
Symbol 902 MovieClip [__Packages.com.kaboose.games.PukeThePirate.levels.Level4_2] Frame 0
class com.kaboose.games.PukeThePirate.levels.Level4_2 extends com.kaboose.games.PukeThePirate.levels.BaseLevel
{
var backgrounds, matte, cTiles, movers, hazards, spikeTraps, mapObjects, pickups, cSlabs, containers, stompers, cannons, enemies, dropTiles, trapDoors;
function Level4_2 (worldRendererObj) {
super();
backgrounds = [["Level4_2", 1, 0, 0, true], ["Level4_2", 1, 3000, 0, true, 2], ["Level4_2", 1, 6000, 0, true, 3]];
matte = "level4Matte";
cTiles = [];
movers = [2896.5, 191.5, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 3, 75, 0, 150, 0, 1299.3, 251.5, 102.65, 51.35, 1, "rd4_stonePlatform", 3, 0, 0, 200, 0, 250, 943.3, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, 150, 0, 100, 0, 596.3, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 3, 0, 0, 250, 0, 200, 4801.35, 250.9, 102.7, 51.4, 1, "rd4_stonePlatform", 4, 0, 0, 200, 0, 200, 5596.75, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, 150, 0, 100, 0, 5396.8, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 3, 150, 0, 100, 0, 3396.25, 251.5, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 3, 175, 0, 100, 0, 3095.25, 190.5, 102.65, 51.35, 1, "rd4_stonePlatform", 3, 0, 0, 200, 0, 100, 8496.5, 249.95, 102.65, 51.35, 1, "rd4_stonePlatform", 4, 0, 0, 100, 0, 150, 8199.6, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 3, 175, 0, 75, 0, 7898.6, 249.35, 102.65, 51.35, 1, "rd4_stonePlatform", 2, 0, 0, 200, 0, 100, 7250.45, 250.6, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 5, 175, 0, 50, 0, 6934.65, 85.65, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 4, 0, 0, 250, 0, 6643.7, 250, 102.65, 51.35, 1, "rd4_stonePlatform", 0, 2, 175, 0, 50, 0];
hazards = [2499.75, 395.9, 100, 100, 1, "rd4_grndB_01", 2399.95, 395.95, 100, 100, 1, "rd4_grndB_01", 2299.95, 395.95, 100, 100, 1, "rd4_grndB_01", 2199.95, 395.95, 100, 100, 1, "rd4_grndB_01", 2099.95, 395.95, 100, 100, 1, "rd4_grndB_01", 2000.15, 396, 100, 100, 1, "rd4_grndB_01", 1900.15, 396, 100, 100, 1, "rd4_grndB_01", 2900, 350, 100, 100, 1, "rd4_grndB_01", 2800, 350, 100, 100, 1, "rd4_grndB_01", 1500, 350, 100, 100, 1, "rd4_grndB_01", 1400, 350, 100, 100, 1, "rd4_grndB_01", 1300, 350, 100, 100, 1, "rd4_grndB_01", 1200, 350, 100, 100, 1, "rd4_grndB_01", 1100, 350, 100, 100, 1, "rd4_grndB_01", 1000, 350, 100, 100, 1, "rd4_grndB_01", 900, 350, 100, 100, 1, "rd4_grndB_01", 800, 350, 100, 100, 1, "rd4_grndB_01", 700, 350, 100, 100, 1, "rd4_grndB_01", 600, 350, 100, 100, 1, "rd4_grndB_01", 500, 350, 100, 100, 1, "rd4_grndB_01", 400, 350, 100, 100, 1, "rd4_grndB_01", 5700, 350, 100, 100, 1, "rd4_grndB_01", 5600, 350, 100, 100, 1, "rd4_grndB_01", 5500, 350, 100, 100, 1, "rd4_grndB_01", 5400, 350, 100, 100, 1, "rd4_grndB_01", 5300, 350, 100, 100, 1, "rd4_grndB_01", 5000, 350, 100, 100, 1, "rd4_grndB_01", 4900, 350, 100, 100, 1, "rd4_grndB_01", 4800, 350, 100, 100, 1, "rd4_grndB_01", 4700, 350, 100, 100, 1, "rd4_grndB_01", 4600, 350, 100, 100, 1, "rd4_grndB_01", 4100, 350, 100, 100, 1, "rd4_grndB_01", 4000, 350, 100, 100, 1, "rd4_grndB_01", 3500, 350, 100, 100, 1, "rd4_grndB_01", 3400, 350, 100, 100, 1, "rd4_grndB_01", 3300, 350, 100, 100, 1, "rd4_grndB_01", 3200, 350, 100, 100, 1, "rd4_grndB_01", 3100, 350, 100, 100, 1, "rd4_grndB_01", 3000, 350, 100, 100, 1, "rd4_grndB_01", 8600, 350, 100, 100, 1, "rd4_grndB_01", 8500, 350, 100, 100, 1, "rd4_grndB_01", 8400, 350, 100, 100, 1, "rd4_grndB_01", 8300, 350, 100, 100, 1, "rd4_grndB_01", 8200, 350, 100, 100, 1, "rd4_grndB_01", 8100, 350, 100, 100, 1, "rd4_grndB_01", 8000, 350, 100, 100, 1, "rd4_grndB_01", 7900, 350, 100, 100, 1, "rd4_grndB_01", 7800, 350, 100, 100, 1, "rd4_grndB_01", 7400, 350, 100, 100, 1, "rd4_grndB_01", 7300, 350, 100, 100, 1, "rd4_grndB_01", 7200, 350, 100, 100, 1, "rd4_grndB_01", 7100, 350, 100, 100, 1, "rd4_grndB_01", 7000, 350, 100, 100, 1, "rd4_grndB_01", 6900, 350, 100, 100, 1, "rd4_grndB_01", 6800, 350, 100, 100, 1, "rd4_grndB_01", 6700, 350, 100, 100, 1, "rd4_grndB_01", 6600, 350, 100, 100, 1, "rd4_grndB_01", 6500, 350, 100, 100, 1, "rd4_grndB_01"];
spikeTraps = [2690.25, 218.15, 23.7, 83.45, 1, "rd4_aztec_spear", 5189.3, 215.8, 23.7, 83.45, 1, "rd4_aztec_spear"];
mapObjects = [];
pickups = [2270, 152, "FrootLoop", 2208, 152, "FrootLoop", 189, 228, "FrootLoop", 256, 229, "FrootLoop", 324, 229, "FrootLoop", 374, 161, "FrootLoop", 2974, 59, "FrootLoop", 2912, 59, "FrootLoop", 2702, 131, "FrootLoop", 2702, 186, "FrootLoop", 2463, 80, "FrootLoop", 2400, 80, "FrootLoop", 2081, 78, "FrootLoop", 2019, 78, "FrootLoop", 1772, 154, "FrootLoop", 1710, 154, "FrootLoop", 644, 168, "FrootLoop", 986, 168, "FrootLoop", 1356, 174, "FrootLoop", 1546, 68, "FrootLoop", 1484, 68, "FrootLoop", 1151, 66, "FrootLoop", 1088, 66, "FrootLoop", 845, 66, "FrootLoop", 782, 66, "FrootLoop", 510, 66, "FrootLoop", 447, 66, "FrootLoop", 4876, 80, "FrootLoop", 4814, 80, "FrootLoop", 5679, 68, "FrootLoop", 5616, 68, "FrootLoop", 5476, 68, "FrootLoop", 5414, 68, "FrootLoop", 5201, 141, "FrootLoop", 5201, 190, "FrootLoop", 5030, 223, "FrootLoop", 4968, 223, "FrootLoop", 4730, 223, "FrootLoop", 4667, 223, "FrootLoop", 3486, 68, "FrootLoop", 3423, 68, "FrootLoop", 4400, 183, "FrootLoop", 4340, 183, "FrootLoop", 4277, 183, "FrootLoop", 3940, 183, "FrootLoop", 3879, 183, "FrootLoop", 3816, 183, "FrootLoop", 4139, 114, "FrootLoop", 4076, 114, "FrootLoop", 4139, 300, "FrootLoop", 4076, 300, "FrootLoop", 8400, 195, "FrootLoop", 8122, 193, "FrootLoop", 8732, 219, "FrootLoop", 8652, 144, "FrootLoop", 8564, 78, "FrootLoop", 8508, 78, "FrootLoop", 8256, 78, "FrootLoop", 8201, 78, "FrootLoop", 7984, 68, "FrootLoop", 7928, 68, "FrootLoop", 6582, 194, "FrootLoop", 7410, 197, "FrootLoop", 7157, 197, "FrootLoop", 6839, 197, "FrootLoop", 7321, 53, "FrootLoop", 7266, 53, "FrootLoop", 7011, 54, "FrootLoop", 6955, 54, "FrootLoop", 6720, 53, "FrootLoop", 6664, 53, "FrootLoop", 7749, 181, "FrootLoop", 7548, 181, "FrootLoop", 6043, 193, "FrootLoop", 6041, 132, "FrootLoop", 6290, 193, "FrootLoop", 6287, 132, "FrootLoop", 8851, 239, "LevelKey"];
cSlabs = [2599.7, 299.6, 200.297546386719, 100, 1, "CollisionSlab", 1599.7, 299.6, 300.143432617188, 100, 1, "CollisionSlab", -0.3, 299.6, 400.311279296875, 100, 1, "CollisionSlab", 5800, -3, 200.3173828125, 100, 1, "CollisionSlab", 3600, -40, 999.978637695313, 100, 1, "CollisionSlab", 5800.7, 299.6, 200.3173828125, 100, 1, "CollisionSlab", 5099.7, 299.6, 200.3173828125, 100, 1, "CollisionSlab", 4198.7, 299.6, 400.311279296875, 100, 1, "CollisionSlab", 3599.7, 299.6, 400.311279296875, 100, 1, "CollisionSlab", 7500, -24, 300.230407714844, 100, 1, "CollisionSlab", 6000, 0, 500.341796875, 100, 1, "CollisionSlab", 8699.7, 299.6, 300.230407714844, 100, 1, "CollisionSlab", 7499.7, 299.6, 300.230407714844, 100, 1, "CollisionSlab", 5999.7, 299.6, 500.341796875, 100, 1, "CollisionSlab"];
containers = [];
stompers = [5828, 24.7, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -114.3, 163.7, 4440, 24.7, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -114.3, 163.7, 3609.1, 24.7, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -114.3, 163.7, 6344, 22.7, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -116.3, 161.7, 6078, 22.7, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -116.3, 161.7, 7572, 22.7, 153, 278, 1, "rd4_aztec_StonePillar", 8, 2, -116.3, 161.7];
cannons = [];
enemies = [com.kaboose.games.PukeThePirate.enemies.Idol, 1849, 253, [150, 0, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 1657, 254, [0, 150, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 4300, 251, [50, 100, 0, 150], com.kaboose.games.PukeThePirate.enemies.Idol, 3901, 251, [100, 50, 0, 150]];
dropTiles = [2401.15, 269.05, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 2200, 245, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01", 1999.15, 261.05, 90.05, 157.65, 16, 2, 400, 1, "rd4_pillar_01"];
trapDoors = [];
}
static var playerSpawnX = 250;
static var playerSpawnY = 200;
static var music = "musicLevel4_1";
static var mapWidth = 9000;
static var mapHeight = 400;
}
Symbol 903 MovieClip [__Packages.com.kaboose.games.PukeThePirate.GameManager] Frame 0
class com.kaboose.games.PukeThePirate.GameManager
{
var currentMusic, playerSpawnSound, currentLevel, playerLives, World, gfxItems, gfxEnemies, gfxPlayer, spacePressed, leftPressed, upPressed, downPressed, rightPressed, hud, levelTime, PlayerObj, respawnDelayInterval, levelTally;
function GameManager () {
_global.game = this;
currentMusic = new Sound();
playerSpawnSound = new Sound();
playerSpawnSound.attachSound(SPAWN_SND_REF);
currentLevel = defaultLevel;
playerLives = defaultLives;
var _local3 = com.kaboose.games.PukeThePirate.RenderLayers._instance.worldBase();
var _local4 = _local3.createEmptyMovieClip("worldMain", 1);
World = new com.kaboose.games.worldengine.WorldRenderer(_local3);
World.SetTileSize(WORLD_TILERAD);
World.SetPlayerScreenPosition(275, 266);
World.SetArea(550, 400);
World.SetWorldBounds(0, 4200, 0, 400);
World.SetGravity(0.6);
World.SetDrag(0.99);
World.SetFriction(0.1);
World.SetScroll("x", true);
World.SetScroll("Y", false);
gfxItems = new com.kaboose.games.PukeThePirate.SpriteManager(com.kaboose.games.PukeThePirate.RenderLayers._instance.itemsBase().createEmptyMovieClip("itembuffer", 1001));
gfxEnemies = new com.kaboose.games.PukeThePirate.SpriteManager(com.kaboose.games.PukeThePirate.RenderLayers._instance.enemiesBase().createEmptyMovieClip("enemybuffer", 1000));
gfxPlayer = new com.kaboose.games.PukeThePirate.SpriteManager(com.kaboose.games.PukeThePirate.RenderLayers._instance.playerBase().createEmptyMovieClip("playerbuffer", 1002));
spriteBuffers.push(gfxPlayer, gfxItems, gfxEnemies);
loadLevel(currentLevel);
}
function onKeyDown() {
if (Key.getCode() == 32) {
spacePressed = true;
}
if (Key.getCode() == 37) {
leftPressed = true;
}
if (Key.getCode() == 38) {
upPressed = true;
}
if (Key.getCode() == 40) {
downPressed = true;
}
if (Key.getCode() == 39) {
rightPressed = true;
}
}
function onKeyUp() {
if (Key.getCode() == 32) {
spacePressed = false;
}
if (Key.getCode() == 37) {
leftPressed = false;
}
if (Key.getCode() == 38) {
upPressed = false;
}
if (Key.getCode() == 40) {
downPressed = false;
}
if (Key.getCode() == 39) {
rightPressed = false;
}
}
function clearInput() {
spacePressed = false;
leftPressed = false;
upPressed = false;
downPressed = false;
rightPressed = false;
}
function initHUD() {
if (hud == undefined) {
delete hud;
hud = new com.kaboose.games.PukeThePirate.ui.huds.GameHud();
hud.subscribe(this);
} else {
hud.show();
hud.startTimer();
}
}
function initRender() {
var ref = this;
levelTime = getTimer();
Trace.out("level timer started");
clearInput();
Key.addListener(this);
_root.onEnterFrame = function () {
ref.gameLoop();
if (ref.PlayerObj.flying) {
ref.PlayerObj.loopFlySound();
} else if (ref.PlayerObj.flySoundPlaying) {
ref.PlayerObj.stopFlySound();
}
};
}
function killRenderLoop() {
Key.removeListener(this);
clearInput();
delete _root.onEnterFrame;
}
function loadLevel(level) {
initHUD();
currentLevel = level;
World.SetWorldBounds(0, levelClassList[level].mapWidth, 0, levelClassList[level].mapHeight);
World.SetPlayerSpawn(levelClassList[level].playerSpawnX, levelClassList[level].playerSpawnY);
addPlayer();
com.kaboose.games.worldengine.LevelLoader._instance.loadLevel(levelClassList[level], World);
currentMusic.stop();
currentMusic.attachSound(levelClassList[level].music);
currentMusic.start(0, 9999);
World.init();
initRender();
}
function playerDeath(element) {
trace("\n\n playerDeath \n\n");
PlayerObj.mc.invincibility.removeMovieClip();
PlayerObj.die(element);
if (!PlayerObj.stunned) {
if (!PlayerObj.invul) {
playerLives = playerLives - 1;
}
}
if (playerLives == 0) {
endGame();
} else {
clearInterval(respawnDelayInterval);
respawnDelayInterval = setInterval(this, "respawn", 2500);
}
hud.update();
}
function respawn() {
trace("Respawn");
clearInterval(respawnDelayInterval);
killRenderLoop();
World.resetDropTiles();
World.killProjectiles();
World.resetPosition();
World.resetPlayer();
World.setMovementReference(PlayerObj);
initRender();
playerSpawnSound.start();
}
function endGame(victory) {
trace("GAME OVER YOUNGBLOOD");
com.kaboose.games.PukeThePirate.RenderLayers._instance.renderLayer.BASE_BG.attachMovie("mainBG", "mainBG", 0);
killRenderLoop();
currentLevel = defaultLevel;
hud.killTimer();
hud.hide();
var _local3 = new Sound();
_local3.attachSound("sndWind");
_local3.start();
_global.getScores(currentScore, this);
if (victory) {
_global.game.World.unloadLevel();
hud.update();
resetGameData();
} else {
var n = setInterval(function () {
new com.kaboose.games.PukeThePirate.ui.menus.EndGameLoss(_global.game.currentScore);
_global.game.World.unloadLevel();
_global.game.resetGameData();
_global.game.hud.update();
clearInterval(n);
}, 2000, this);
}
}
function resetGameData() {
playerLives = defaultLives;
currentScore = 0;
itemsCollected = [];
enemiesKilled = 0;
loopsCollected = 0;
flightPower = 0;
loopCycle = 0;
}
function endLevel() {
levelTime = (getTimer() - levelTime) / 1000;
Trace.out("level timer calculated: " + levelTime);
trace("level complete");
hud.killTimer();
hud.hide();
killRenderLoop();
World.unloadLevel();
tallyLevelSummary();
if (currentLevel == (levelClassList.length - 1)) {
trace("game over you won");
new com.kaboose.games.PukeThePirate.ui.menus.LevelSummary(true);
} else {
currentLevel++;
new com.kaboose.games.PukeThePirate.ui.menus.LevelSummary();
}
}
function tallyLevelSummary() {
levelTally = {};
var _local2 = 0;
var _local3 = 0;
for (var _local5 in itemsCollected) {
if (itemsCollected[_local5] instanceof com.kaboose.games.PukeThePirate.pickupitems.BonusPoints) {
_local2++;
trace("bonus points found in tally");
}
if (itemsCollected[_local5] instanceof com.kaboose.games.PukeThePirate.pickupitems.FrootLoop) {
trace("dub count in tally");
_local3++;
}
}
trace(("you collected " + _local2) + " BonusPoint pickups");
levelTally.pickupCount = _local2;
levelTally.pickupValue = com.kaboose.games.PukeThePirate.pickupitems.BonusPoints.pts;
levelTally.pickupBonus = _local2 * com.kaboose.games.PukeThePirate.pickupitems.BonusPoints.pts;
Trace.out("Pickup Bonus: " + levelTally.pickupBonus);
Trace.out("pickupValue: " + com.kaboose.games.PukeThePirate.pickupitems.BonusPoints.pts);
Trace.out("pickupCount: " + _local2);
levelTally.timeCount = 0;
levelTally.timeValue = 0;
levelTally.timeBonus = 0;
levelTally.enemyCount = 0;
levelTally.enemyBonus = 0;
levelTally.enemyValue = 100;
var _local4 = levelTime;
if (_local4 < 31) {
levelTally.timeBonus = 1000;
} else if (_local4 < 61) {
levelTally.timeBonus = 500;
} else if (_local4 < 121) {
levelTally.timeBonus = 200;
} else if (_local4 < 181) {
levelTally.timeBonus = 100;
} else if (_local4 < 301) {
levelTally.timeBonus = 50;
} else {
levelTally.timeBonus = 0;
}
Trace.out("Base timeBonus: " + levelTally.timeBonus);
levelTally.timeBonus = levelTally.timeBonus * (currentLevel + 1);
Trace.out("- timeBonus * CurrentLevel: " + levelTally.timeBonus);
levelTally.dubCount = _local3;
levelTally.dubValue = com.kaboose.games.PukeThePirate.pickupitems.FrootLoop.pts;
levelTally.dubBonus = _local3 * com.kaboose.games.PukeThePirate.pickupitems.FrootLoop.pts;
levelTally.enemyCount = enemiesKilled;
levelTally.enemyValue = 100;
levelTally.enemyBonus = enemiesKilled * 100;
Trace.out("enemyCount: " + enemiesKilled);
Trace.out("enemyBonus: " + levelTally.enemyBonus);
levelTally.totalBonus = ((levelTally.pickupBonus + levelTally.timeBonus) + levelTally.dubBonus) + levelTally.enemyBonus;
currentScore = currentScore + levelTally.timeBonus;
hud.update();
levelTally.totalScore = currentScore;
itemsCollected = [];
enemiesKilled = 0;
}
function addPlayer() {
com.kaboose.games.PukeThePirate.SpriteManager.destroyMC(PlayerObj.mc);
delete PlayerObj;
PlayerObj = new com.kaboose.games.PukeThePirate.PlayerObject(World.playerSpawnX, World.playerSpawnY, null, null);
PlayerObj.mc = gfxPlayer.createSprite("player");
playerSpawnSound.start();
PlayerObj.mc._x = World.playerScreenX;
PlayerObj.mc._y = World.playerScreenY;
PlayerObj.stunned = false;
PlayerObj.alive = true;
World.setMovementReference(PlayerObj);
}
function flightPowerDecay() {
if (flightPower > 0) {
flightPower = flightPower - flightDecay;
hud.update();
}
}
function gameLoop() {
if ((!gamePaused) && (PlayerObj.alive)) {
World.movementReference.verlet();
var _local6 = 0;
var _local7 = 0;
if (!PlayerObj.stunned) {
if (leftPressed) {
_local6 = _local6 - World.movementReference.accel;
if (PlayerObj.onGround) {
PlayerObj.anim = 11;
}
} else if (rightPressed) {
_local6 = _local6 + World.movementReference.accel;
if (PlayerObj.onGround) {
PlayerObj.anim = 11;
}
} else {
_local6 = 0;
if (PlayerObj.onGround) {
PlayerObj.anim = 1;
} else if (PlayerObj.stunned) {
} else {
PlayerObj.flying = false;
PlayerObj.anim = 21;
}
}
if (upPressed) {
if (flightPower > 0) {
_local7 = _local7 - World.movementReference.accel;
PlayerObj.flying = true;
PlayerObj.lockAnimation = false;
PlayerObj.onGround = false;
PlayerObj.onMover = false;
PlayerObj.mover = null;
PlayerObj.anim = 41;
PlayerObj.setAnimation();
flightPowerDecay();
}
} else if (downPressed) {
if (!PlayerObj.onGround) {
if (PlayerObj.flying) {
flightPowerDecay();
_local7 = _local7 + World.movementReference.accel;
} else if (PlayerObj.mc._currentframe != 111) {
PlayerObj.lockAnimation = false;
PlayerObj.anim = 51;
PlayerObj.setAnimation();
}
}
} else if (PlayerObj.onGround) {
PlayerObj.flying = false;
}
if (spacePressed) {
if (World.movementReference.alive) {
if (PlayerObj.jump()) {
_local7 = _local7 - PlayerObj.accelJump;
PlayerObj.onGround = false;
PlayerObj.onMover = false;
PlayerObj.mover = null;
PlayerObj.anim = 21;
}
}
}
}
var _local4 = World.movementReference.colObj.pos;
var _local10 = World.movementReference.colObj.oldpos;
var _local11 = _local4.x - _local10.x;
var _local13 = _local4.y - _local10.y;
if (World.movementReference.onMover) {
if (World.movementReference.anim != 11) {
World.movementReference.anim = 1;
World.movementReference.lockAnimation = false;
World.movementReference.setAnimation();
}
var _local9 = World.movementReference.mover;
if (_local6 == 0) {
_local11 = _local9.xspeed * _local9.xdir;
}
if (_local7 == 0) {
_local13 = _local9.yspeed * _local9.ydir;
}
}
var _local8;
if (!PlayerObj.flying) {
if (!PlayerObj.onGround) {
_local8 = World.movementReference.jumpingAirSpeed;
} else {
_local8 = World.movementReference.maxSpeed;
}
} else {
_local8 = World.movementReference.maxSpeed;
}
var _local14 = Math.min(_local8, Math.max(-1 * _local8, _local11 + _local6));
var _local12 = Math.min(World.movementReference.maxSpeed, Math.max(-1 * World.movementReference.maxSpeed, _local13 + _local7));
if (int(_local12) != 0) {
PlayerObj.onGround = false;
PlayerObj.colObj.slopeN = undefined;
}
if (_local11 < 0) {
PlayerObj.mc._xscale = -100;
} else if (_local6 > 0) {
PlayerObj.mc._xscale = 100;
}
_local4.x = _local10.x + _local14;
_local4.y = _local10.y + _local12;
PlayerObj.setAnimation();
World.checkScrollLimit();
if (!World.scrollLeft) {
if (_local4.x < World.playerScreenX) {
PlayerObj.mc._x = _local4.x;
}
}
if (!World.scrollRight) {
if (_local4.x > (World.xPos + World.playerScreenX)) {
PlayerObj.mc._x = _local4.x - World.xPos;
}
}
World.updateScreenPos(_local14, _local12);
World.render();
World.movementReference.collideVsWorldBounds();
World.movementReference.setAnimation();
if (!World.scrollY) {
PlayerObj.mc._y = _local4.y;
}
if (!World.scrollX) {
PlayerObj.mc._x = _local4.x;
}
var _local5 = enemies.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = enemies[_local2];
if (_local3.alive) {
_local3.onGameLoop(_local2);
}
_local2++;
}
}
}
var enemies = [];
var SPAWN_SND_REF = "sndPlayerSpawn";
var gamePaused = false;
var levelClassList = [com.kaboose.games.PukeThePirate.levels.Level1_1, com.kaboose.games.PukeThePirate.levels.Level1_2, com.kaboose.games.PukeThePirate.levels.Level2_1, com.kaboose.games.PukeThePirate.levels.Level2_2, com.kaboose.games.PukeThePirate.levels.Level3_1, com.kaboose.games.PukeThePirate.levels.Level3_2, com.kaboose.games.PukeThePirate.levels.Level4_1, com.kaboose.games.PukeThePirate.levels.Level4_2];
var spriteBuffers = [];
var keyd = Key.isDown;
var kL = 37;
var kR = 39;
var kU = 38;
var kD = 40;
var kSP = 32;
var mAbs = Math.abs;
var mMax = Math.max;
var mMin = Math.min;
var WORLD_TILERAD = 50;
var currentScore = 0;
var itemsCollected = [];
var loopsCollected = 0;
var enemiesKilled = 0;
var loopCycle = 0;
var loopCycleCount = 50;
var defaultLives = 7;
var defaultLevel = 0;
var flightPower = 0;
var flightDecay = 1;
}
Symbol 904 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.HudBase] Frame 0
class com.kaboose.games.PukeThePirate.ui.HudBase extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var targetMC;
function HudBase () {
super();
targetMC = com.kaboose.games.PukeThePirate.RenderLayers._instance.LAYER.hudBase();
AsBroadcaster.initialize(gameEvents);
}
function subscribe(obj) {
gameEvents.addListener(obj);
}
function unsubscribe(obj) {
gameEvents.removeListener(obj);
}
function eventMessage(eventName) {
gameEvents.broadcastMessage(eventName);
}
var gameEvents = [];
var uiTransitionTime = 0.3;
}
Symbol 905 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.huds.GameHud] Frame 0
class com.kaboose.games.PukeThePirate.ui.huds.GameHud extends com.kaboose.games.PukeThePirate.ui.HudBase
{
static var _instance;
var show, currentMenuMC, timeInt;
function GameHud () {
super();
_instance = this;
show();
_instance.disableMeter();
_instance.update();
_instance.startTimer();
}
function startTimer() {
Trace.out("start timer");
_instance.time = 0;
clearInterval(_instance.timeInt);
_instance.timeInt = setInterval(_instance, "tick", 1000);
}
function tick() {
Trace.out("tick");
time = time + 1;
currentMenuMC.time = time;
}
function killTimer() {
time = 0;
clearInterval(timeInt);
}
function onMotionFinished() {
super.onMotionFinished();
}
function update() {
_instance.updateLoops();
_instance.updateLives();
_instance.updateScore();
_instance.updateFlightPower();
}
function updateLoops() {
currentMenuMC.loops = _global.game.loopsCollected;
}
function updateLives() {
if (_global.game.playerLives < currentMenuMC.lives) {
currentMenuMC.lifeLoss.gotoAndPlay(2);
}
currentMenuMC.lives = _global.game.playerLives;
}
function updateScore() {
currentMenuMC.score = formatNumber(_global.game.currentScore);
}
function updateFlightPower() {
if (_global.game.flightPower > 0) {
enableMeter();
currentMenuMC.flightPowerMeter.meter.bar._xscale = _global.game.flightPower;
} else {
disableMeter();
}
}
function enableMeter() {
currentMenuMC.flightPowerMeter._visible = true;
}
function disableMeter() {
currentMenuMC.flightPowerMeter._visible = false;
}
function formatNumber($number) {
var _local1 = $number.toString();
var _local3 = 1;
if (_local1.indexOf(".") == -1) {
var _local2 = "";
_local1 = _local1.split("");
} else {
var _local2 = _local1.substr(_local1.indexOf("."), _local1.length);
_local1 = _local1.substr(0, _local1.indexOf(".")).split("");
}
for (var _local4 in _local1) {
var _local2 = _local1[_local4] + _local2;
if ((_local3++) == 3) {
_local3 = 1;
_local2 = (((isNaN(_local1[0]) && (_local4 > 1)) || ((!isNaN(_local1[0])) && (_local4 >= 1))) ? ("," + _local2) : (_local2));
}
}
return(_local2);
}
var MENU_LIB_REF = "GameHud";
var time = 0;
}
Symbol 906 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.EndGameLoss] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.EndGameLoss extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC, nextMenu, uiEnabled, bDestroy, uiTransition, uiTransitionTime;
function EndGameLoss (score) {
super();
show();
var classRef = this;
with (currentMenuMC) {
btnNext.onRollOver = function () {
classRef.playOverSound();
};
btnNext.onPress = function () {
classRef.playDownSound();
classRef.onNext();
};
totalScore = com.kaboose.math.MathFunctions.formatNumber(score);
}
}
function onNext() {
_global.game.currentMusic.stop();
_global.MainMenuMusic.start(0, 9999);
nextMenu = new com.kaboose.games.PukeThePirate.ui.menus.MainMenu();
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
var MENU_LIB_REF = "EndGameLoss";
var BTN_OVER_SND_LIB_REF = "snd_btnMainOver";
var BTN_DOWN_SND_LIB_REF = "snd_btnMainDown";
var startX = 0;
var startY = -500;
}
Symbol 907 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.LevelSummary] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.LevelSummary extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, key, currentMenuMC, uiEnabled, bDestroy, uiTransition, uiTransitionTime;
function LevelSummary (victory) {
super();
com.kaboose.games.PukeThePirate.RenderLayers._instance.renderLayer.BASE_BG.attachMovie("mainBG", "mainBG", 0);
show();
var classRef = this;
key = new Object();
Key.addListener(key);
key.onKeyDown = function () {
trace("Key Down :: LevelSummary");
if (Key.getCode() == 32) {
if (classRef.victory) {
classRef.onEnd();
} else {
classRef.onPlay();
}
}
};
if (victory) {
with (currentMenuMC) {
btnPlay.onRollOver = function () {
classRef.playOverSound();
};
btnPlay.onPress = function () {
classRef.playDownSound();
classRef.onEnd();
};
var levelTally = _global.game.levelTally;
pickupCount = (levelTally.pickupCount + " x ") + levelTally.pickupValue;
pickupBonus = com.kaboose.math.MathFunctions.formatNumber(levelTally.pickupBonus);
timeBonus = com.kaboose.math.MathFunctions.formatNumber(levelTally.timeBonus);
totalBonus = com.kaboose.math.MathFunctions.formatNumber(levelTally.totalBonus);
currentScore = com.kaboose.math.MathFunctions.formatNumber(levelTally.totalScore);
dubCount = (levelTally.dubCount + " x ") + levelTally.dubValue;
dubBonus = levelTally.dubBonus;
enemyCount = (levelTally.enemyCount + " x ") + levelTally.enemyValue;
enemyBonus = levelTally.enemyBonus;
Trace.out("dubCount: " + levelTally.dubCount);
Trace.out("dubBonus: " + levelTally.dubBonus);
}
} else {
with (currentMenuMC) {
btnPlay.onRollOver = function () {
classRef.playOverSound();
};
btnPlay.onPress = function () {
classRef.playDownSound();
classRef.onPlay();
};
var levelTally = _global.game.levelTally;
pickupCount = (levelTally.pickupCount + " x ") + levelTally.pickupValue;
pickupBonus = com.kaboose.math.MathFunctions.formatNumber(levelTally.pickupBonus);
timeBonus = com.kaboose.math.MathFunctions.formatNumber(levelTally.timeBonus);
totalBonus = com.kaboose.math.MathFunctions.formatNumber(levelTally.totalBonus);
currentScore = com.kaboose.math.MathFunctions.formatNumber(levelTally.totalScore);
dubCount = (levelTally.dubCount + " x ") + levelTally.dubValue;
dubBonus = levelTally.dubBonus;
enemyCount = (levelTally.enemyCount + " x ") + levelTally.enemyValue;
enemyBonus = levelTally.enemyBonus;
Trace.out("dubCount: " + levelTally.dubCount);
Trace.out("dubBonus: " + levelTally.dubBonus);
}
}
}
function onPlay() {
Key.removeListener(key);
delete key;
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.LevelIntro();
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
function onEnd() {
Key.removeListener(key);
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.EndGameWin();
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
var MENU_LIB_REF = "LevelSummary";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 0;
var startY = -400;
}
Symbol 908 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.EndGameWin] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.EndGameWin extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC, nextMenu, uiEnabled, bDestroy, uiTransition, uiTransitionTime;
function EndGameWin () {
super();
show();
var classRef = this;
with (currentMenuMC) {
btnMainMenu.onRollOver = function () {
classRef.playOverSound();
};
btnMainMenu.onPress = function () {
classRef.playDownSound();
classRef.onNext();
};
totalScore = com.kaboose.math.MathFunctions.formatNumber(_global.game.currentScore);
}
}
function onNext() {
_global.game.currentMusic.stop();
_global.MainMenuMusic.start(0, 9999);
_global.game.endGame(true);
nextMenu = new com.kaboose.games.PukeThePirate.ui.menus.MainMenu();
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
var MENU_LIB_REF = "EndGameWin";
var BTN_OVER_SND_LIB_REF = "snd_btnMainOver";
var BTN_DOWN_SND_LIB_REF = "snd_btnMainDown";
var startX = 0;
var startY = -500;
}
Symbol 909 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.HighScoresMenu] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.HighScoresMenu extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC;
function HighScoresMenu () {
super();
show();
var classRef = this;
with (currentMenuMC) {
btnRegister._visible = _global.userLoggedIn;
btnRegister.onPress = function () {
classRef.playOverSound();
classRef.onRegister();
};
btnMainMenu.onPress = function () {
classRef.playDownSound();
classRef.prevMenu.show();
classRef.onPrevMenu();
};
}
}
function onRegister() {
}
var MENU_LIB_REF = "HighScoresMenu";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 0;
var startY = 0;
}
Symbol 910 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.InstructionsMenu] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.InstructionsMenu extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC, uiEnabled, bDestroy, uiTransition, uiTransitionTime;
function InstructionsMenu () {
super();
show();
var classRef = this;
with (currentMenuMC) {
btnMainMenu.onRollOver = function () {
classRef.playOverSound();
};
btnMainMenu.onPress = function () {
classRef.playDownSound();
classRef.onMainMenu();
};
btnInstructionsB.onRollOver = function () {
classRef.playOverSound();
};
btnInstructionsB.onPress = function () {
classRef.playDownSound();
classRef.onInstructionsB();
};
}
}
function onMainMenu() {
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.MainMenu();
_local2.startX = -550;
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
function onInstructionsB() {
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.InstructionsB();
_local2.startX = 550;
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
var MENU_LIB_REF = "InstructionsMenu";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 550;
var startY = 0;
}
Symbol 911 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.InstructionsB] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.InstructionsB extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC, uiEnabled, bDestroy, uiTransition, uiTransitionTime;
function InstructionsB () {
super();
show();
var classRef = this;
with (currentMenuMC) {
btnMainMenu.onRollOver = function () {
classRef.playOverSound();
};
btnMainMenu.onPress = function () {
classRef.playDownSound();
classRef.onInstructionsC();
};
btnInstructionsMenu.onRollOver = function () {
classRef.playOverSound();
};
btnInstructionsMenu.onPress = function () {
classRef.playDownSound();
classRef.onInstructionsMenu();
};
}
}
function onInstructionsC() {
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.InstructionsC();
_local2.startX = 550;
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
function onInstructionsMenu() {
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.InstructionsMenu();
_local2.startX = -550;
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
var MENU_LIB_REF = "InstructionsMenu2";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 550;
var startY = 0;
}
Symbol 912 MovieClip [__Packages.com.kaboose.games.PukeThePirate.ui.menus.InstructionsC] Frame 0
class com.kaboose.games.PukeThePirate.ui.menus.InstructionsC extends com.kaboose.games.PukeThePirate.ui.UIBase
{
var show, currentMenuMC, uiEnabled, bDestroy, uiTransition, uiTransitionTime;
function InstructionsC () {
super();
show();
var classRef = this;
with (currentMenuMC) {
btnMainMenu.onRollOver = function () {
classRef.playOverSound();
};
btnMainMenu.onPress = function () {
classRef.playDownSound();
classRef.onMainMenu();
};
btnInstructionsMenu.onRollOver = function () {
classRef.playOverSound();
};
btnInstructionsMenu.onPress = function () {
classRef.playDownSound();
classRef.InstructionsB();
};
}
}
function InstructionsB() {
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.InstructionsB();
_local2.startX = -550;
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
function onMainMenu() {
var _local2 = new com.kaboose.games.PukeThePirate.ui.menus.MainMenu("x", 550);
uiEnabled(false);
bDestroy = true;
uiTransition.continueTo(-1, uiTransitionTime);
}
var MENU_LIB_REF = "InstructionsMenu3";
var BTN_OVER_SND_LIB_REF = "click";
var BTN_DOWN_SND_LIB_REF = "click";
var startX = 550;
var startY = 0;
}
Symbol 913 MovieClip [__Packages.com.kaboose.utils.FrameStatistics] Frame 0
class com.kaboose.utils.FrameStatistics
{
var txtFormat, container, update;
function FrameStatistics (targetMC, depth) {
txtFormat = new TextFormat();
MovieClip.addListener(this);
container = targetMC.createEmptyMovieClip("FPSmeter", depth);
fill(container, 0, 0, 50, 20, [3159101, 16777215]);
txtFormat.font = "Verdana";
container.createTextField("fpsText", 1, 0, 0, 0, 0);
container.fpsText.autoSize = true;
container.fpsText.text = "fps:" + framesRendered;
container.fpsText.setTextFormat(txtFormat);
container.onPress = function () {
startDrag (this);
};
container.onRelease = function () {
stopDrag();
};
update = setInterval(function (fps) {
fps.container.fpsText.text = "fps:" + fps.framesRendered;
fps.container.fpsText.setTextFormat(fps.txtFormat);
fps.framesRendered = 0;
}, 1000, this);
}
function destroy() {
clearInterval(update);
MovieClip.removeListener(this);
container.fpsText.removeTextField();
container.removeMovieClip();
}
function onEnterFrame() {
framesRendered++;
}
function fill(targetMC, sx, sy, w, h, colors) {
var _local6 = "linear";
var _local3 = [100, 100];
var _local9 = [0, 255];
var _local2 = new flash.geom.Matrix();
_local2.createGradientBox(w, h, 1.57079633, 0, 0);
targetMC.beginGradientFill(_local6, colors, _local3, _local9, _local2);
targetMC.moveTo(sx, sy);
targetMC.lineTo(w, sy);
targetMC.lineTo(w, h);
targetMC.lineTo(sx, h);
targetMC.lineTo(sx, sy);
targetMC.endFill();
}
var framesRendered = 0;
}
Symbol 29 MovieClip [destroyEnemy] Frame 20
stop();
Symbol 32 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 119 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 7
stop();
Symbol 212 MovieClip Frame 6
stop();
Symbol 216 MovieClip Frame 10
stop();
Symbol 221 MovieClip Frame 8
stop();
Symbol 228 MovieClip Frame 17
stop();
Symbol 237 MovieClip Frame 2
stop();
Symbol 238 MovieClip Frame 18
stop();
_global.game.PlayerObj.lockAnimation = false;
Symbol 239 MovieClip Frame 28
_global.game.PlayerObj.lockAnimation = false;
_global.game.PlayerObj.currentAnim = 1;
Symbol 240 MovieClip Frame 10
stop();
Symbol 240 MovieClip Frame 20
stop();
Symbol 240 MovieClip Frame 30
stop();
Symbol 240 MovieClip Frame 40
stop();
Symbol 240 MovieClip Frame 50
stop();
Symbol 240 MovieClip Frame 60
stop();
Symbol 240 MovieClip Frame 70
stop();
Symbol 240 MovieClip Frame 80
stop();
Symbol 240 MovieClip Frame 90
stop();
Symbol 240 MovieClip Frame 100
stop();
Symbol 240 MovieClip Frame 110
stop();
Symbol 242 MovieClip [gfx_roadSign] Frame 1
var linkageName = "gfx_roadSign";
Symbol 244 MovieClip [rd1_grndA_02] Frame 1
var linkageName = "rd1_grndA_02";
Symbol 246 MovieClip [rd1_grndA_03] Frame 1
var linkageName = "rd1_grndA_03";
Symbol 249 MovieClip [rd1_jungleEnd] Frame 1
var linkageName = "rd1_jungleEnd";
Symbol 251 MovieClip [rd1_jungleBGA] Frame 1
var linkageName = "rd1_jungleBGA";
Symbol 253 MovieClip [rd1_jungleBGB] Frame 1
var linkageName = "rd1_jungleBGB";
Symbol 255 MovieClip [rd1_jungleBushA] Frame 1
var linkageName = "rd1_jungleBushA";
Symbol 256 MovieClip [rd1_jungleBushels] Frame 1
var linkageName = "rd1_jungleBushels";
Symbol 258 MovieClip [rd1_jungleSunRay] Frame 1
var linkageName = "rd1_jungleSunRay";
Symbol 260 MovieClip [rd1_jungleVines] Frame 1
var linkageName = "rd1_jungleVines";
Symbol 262 MovieClip [rd1_jungleLeaves] Frame 1
var linkageName = "rd1_jungleLeaves";
Symbol 264 MovieClip [rd1_grndA_05] Frame 1
var linkageName = "rd1_grndA_05";
Symbol 266 MovieClip [rd1_grndA_06] Frame 1
var linkageName = "rd1_grndA_06";
Symbol 268 MovieClip [rd1_grndA_04] Frame 1
var linkageName = "rd1_grndA_04";
Symbol 269 MovieClip [level1_1] Frame 1
stop();
var linkageName = "level1_1";
Symbol 278 MovieClip [rd2_caveCeiling] Frame 1
var linkageName = "rd2_caveCeiling";
Symbol 281 MovieClip [rd2_grndA_01] Frame 1
var linkageName = "rd2_grndA_01";
Symbol 284 MovieClip [rd2_grndA_03_leftEnd] Frame 1
var linkageName = "rd2_grndA_03_leftEnd";
Symbol 286 MovieClip [rd2_grndA_02_rightEnd] Frame 1
var linkageName = "rd2_grndA_02_rightEnd";
Symbol 289 MovieClip [level2_1] Frame 1
stop();
var linkageName = "level2_1";
Symbol 293 MovieClip [rd2_caveLavaFallWave] Frame 1
var linkageName = "rd2_caveLavaFallWave";
Symbol 294 MovieClip [rd2_lavaFall_01] Frame 1
var linkageName = "rd2_lavaFall_01";
Symbol 296 MovieClip [rd2_caveFallBoulderEnd] Frame 1
var linkageName = "rd2_caveFallBoulderEnd";
Symbol 301 MovieClip [rd2_grndA_04_island] Frame 1
var linkageName = "rd2_grndA_04_island";
Symbol 302 MovieClip [level2_2] Frame 1
stop();
var linkageName = "level2_2";
Symbol 307 MovieClip [rd1_grndB_01] Frame 1
var linkageName = "rd1_grndB_01";
Symbol 310 MovieClip [rd3_pirateShipBG] Frame 1
var linkageName = "rd3_pirateShipBG";
Symbol 315 MovieClip [rd3_shipBGPanel] Frame 1
var linkageName = "rd3_shipBGPanel";
Symbol 318 MovieClip [rd3_portHoleBolt] Frame 1
var linkageName = "rd3_portHoleBolt";
Symbol 319 MovieClip [rd3_portHole] Frame 1
var linkageName = "rd3_portHole";
Symbol 321 MovieClip [rd3_shipLight_01] Frame 1
var linkageName = "rd3_shipLight_01";
Symbol 323 MovieClip [rd3_grndA_01] Frame 1
var linkageName = "rd3_grndA_01";
Symbol 325 MovieClip [rd3_grndA_02-rightEnd] Frame 1
var linkageName = "rd3_grndA_02-rightEnd";
Symbol 327 MovieClip [rd3_grndA_03-leftEnd] Frame 1
var linkageName = "rd3_grndA_03-leftEnd";
Symbol 329 MovieClip [rd3_barrel] Frame 1
var linkageName = "rd3_barrel";
Symbol 331 MovieClip [rd3_cannonBall] Frame 1
var linkageName = "rd3_cannonBall";
Symbol 333 MovieClip [rd3_grndB_01] Frame 1
var linkageName = "rd3_grndB_01";
Symbol 335 MovieClip [rd3_grndA_02-island] Frame 1
var linkageName = "rd3_grndA_02-island";
Symbol 339 MovieClip [rd4_aztecTempleHieros] Frame 1
var linkageName = "rd4_aztecTempleHieros";
Symbol 341 MovieClip [rd4_aztecTembleWallBG] Frame 1
var linkageName = "rd4_aztecTembleWallBG";
Symbol 343 MovieClip [rd4_aztecBricks] Frame 1
var linkageName = "rd4_aztecBricks";
Symbol 345 MovieClip [rd4_aztecPillar] Frame 1
var linkageName = "rd4_aztecPillar";
Symbol 347 MovieClip [rd4_grndA_01] Frame 1
var linkageName = "rd4_grndA_01";
Symbol 367 MovieClip [ExtraLife] Frame 1
var linkageName = "b_life";
Symbol 369 MovieClip [rd3_cannonBase] Frame 1
var linkageName = "rd3_cannonBase";
Symbol 371 MovieClip [rd3_cannonBarrel] Frame 1
var linkageName = "rd3_cannonBarrel";
Symbol 372 MovieClip [rd3_cannon] Frame 1
var linkageName = "rd3_cannon";
Symbol 377 MovieClip [FlightPower] Frame 1
var linkageName = "b_pWing";
Symbol 387 MovieClip [CannonBall] Frame 1
var linkageName = "rd3_cannonBallAmmo";
Symbol 398 MovieClip [TreasureChest] Frame 1
stop();
var linkageName = "TreasureChest";
Symbol 398 MovieClip [TreasureChest] Frame 14
stop();
Symbol 415 MovieClip Frame 1
stop();
Symbol 448 MovieClip Frame 15
stop();
Symbol 494 MovieClip [HighScoresMenu] Frame 28
stop();
clearScores(this);
getScores(null, this);
Symbol 544 MovieClip Frame 5
stop();
Symbol 544 MovieClip Frame 49
gotoAndPlay ("loop");
Symbol 614 MovieClip Frame 8
this.Lmark1.gotoAndPlay("loop");
stop();
Symbol 614 MovieClip Frame 36
this.Lmark2.gotoAndPlay("loop");
stop();
Symbol 614 MovieClip Frame 90
this.Lmark3.gotoAndPlay("loop");
stop();
Symbol 614 MovieClip Frame 152
this.Lmark4.gotoAndPlay("loop");
stop();
Symbol 616 MovieClip [LevelIntro] Frame 30
stop();
var cur = _global.game.currentLevel;
if ((cur < 2) || (cur == undefined)) {
frame = "level1";
} else if (cur <= 2) {
frame = "level2";
} else if (cur <= 4) {
frame = "level3";
} else {
frame = "level4";
}
intro.gotoAndPlay(frame);
Symbol 646 MovieClip [LevelSummary] Frame 1
stop();
Symbol 646 MovieClip [LevelSummary] Frame 35
stop();
Symbol 664 MovieClip Frame 4
stop();
Symbol 670 MovieClip Frame 4
stop();
Symbol 674 MovieClip Frame 4
stop();
Symbol 678 MovieClip [MainMenu] Frame 1
stop();
Symbol 680 MovieClip [rd2_grndB_01] Frame 1
var linkageName = "rd2_grndB_01";
Symbol 682 MovieClip [rd2_plateau_01] Frame 1
var linkageName = "rd2_plateau_01";
Symbol 684 MovieClip [rd3_table] Frame 1
var linkageName = "rd3_table";
Symbol 686 MovieClip [rd3_doorHinge] Frame 1
var linkageName = "rd3_doorHinge";
Symbol 688 MovieClip [rd3_shipPlatform] Frame 1
var linkageName = "rd3_shipPlatform";
Symbol 689 MovieClip [rd3_trapDoorLeft] Frame 1
stop();
var linkageName = "rd3_trapDoorLeft";
Symbol 689 MovieClip [rd3_trapDoorLeft] Frame 17
stop();
Symbol 690 MovieClip [rd3_trapDoorRight] Frame 1
stop();
var linkageName = "rd3_trapDoorRight";
Symbol 690 MovieClip [rd3_trapDoorRight] Frame 17
stop();
Symbol 692 MovieClip [rd1_grndC_01] Frame 1
var linkageName = "rd1_grndC_01";
Symbol 694 MovieClip [rd1_log] Frame 1
var linkageName = "rd1_log";
Symbol 696 MovieClip [rd3_aztecSpear] Frame 1
var linkageName = "rd3_aztecSpear";
Symbol 698 MovieClip [rd3_aztecBush] Frame 1
var linkageName = "rd3_aztecBush";
Symbol 701 MovieClip Frame 9
stop();
Symbol 702 MovieClip [rd4_aztec_spear] Frame 1
stop();
var linkageName = "rd4_aztec_spear";
Symbol 702 MovieClip [rd4_aztec_spear] Frame 15
stop();
Symbol 704 MovieClip [rd4_aztec_StonePillar] Frame 1
var linkageName = "rd4_aztec_StonePillar";
Symbol 706 MovieClip [rd4_grndB_01] Frame 1
var linkageName = "rd4_grndB_01";
Symbol 708 MovieClip [rd4_pillar_01] Frame 1
var linkageName = "rd4_pillar_01";
Symbol 710 MovieClip [rd4_stonePlatform] Frame 1
var linkageName = "rd4_stonePlatform";
Symbol 715 MovieClip Frame 10
stop();
Symbol 726 MovieClip Frame 8
gotoAndPlay (3);
Symbol 745 MovieClip Frame 25
gotoAndPlay (2);
Symbol 751 MovieClip Frame 92
stop();
Symbol 758 MovieClip Frame 90
stop();
Symbol 762 MovieClip Frame 17
stop();
Symbol 788 MovieClip Frame 45
stop();
Symbol 795 MovieClip [player] Frame 10
stop();
Symbol 795 MovieClip [player] Frame 20
stop();
Symbol 795 MovieClip [player] Frame 30
stop();
Symbol 795 MovieClip [player] Frame 40
stop();
Symbol 795 MovieClip [player] Frame 50
stop();
Symbol 795 MovieClip [player] Frame 60
stop();
Symbol 795 MovieClip [player] Frame 70
stop();
Symbol 795 MovieClip [player] Frame 80
stop();
Symbol 795 MovieClip [player] Frame 90
stop();
Symbol 795 MovieClip [player] Frame 100
stop();
Symbol 795 MovieClip [player] Frame 110
stop();
Symbol 795 MovieClip [player] Frame 120
stop();
Instance of Symbol 52 MovieClip [enemy_bat] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 0;
speedY = 4;
}
Instance of Symbol 69 MovieClip [enemy_crab] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 4;
}
Instance of Symbol 99 MovieClip [enemy_lobster] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 0;
}
Instance of Symbol 398 MovieClip [TreasureChest] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
}
Instance of Symbol 682 MovieClip [rd2_plateau_01] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 0;
speedY = 0;
moverBounds = [];
moverBounds[0] = 0;
moverBounds[1] = 0;
moverBounds[2] = 0;
moverBounds[3] = 0;
}
Instance of Symbol 684 MovieClip [rd3_table] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 3;
speedY = 0;
moverBounds = [];
moverBounds[0] = 0;
moverBounds[1] = 150;
moverBounds[2] = 0;
moverBounds[3] = 150;
}
Instance of Symbol 694 MovieClip [rd1_log] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
moverBounds = [];
moverBounds[0] = 0;
moverBounds[1] = 0;
moverBounds[2] = 0;
moverBounds[3] = 0;
speedX = 4;
speedY = 0;
}
Instance of Symbol 708 MovieClip [rd4_pillar_01] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 0;
speedY = 3;
moverBounds = [];
moverBounds[0] = 150;
moverBounds[1] = 0;
moverBounds[2] = 150;
moverBounds[3] = 0;
}
Instance of Symbol 710 MovieClip [rd4_stonePlatform] in Symbol 804 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
speedX = 0;
speedY = 0;
moverBounds = [];
moverBounds[0] = 0;
moverBounds[1] = 0;
moverBounds[2] = 0;
moverBounds[3] = 0;
}
Symbol 830 MovieClip Frame 1
stop();