Section 1
//CoinCountHUD (code.CoinCountHUD)
package code {
import flash.display.*;
import flash.text.*;
public class CoinCountHUD extends MovieClip {
public var time_txt:TextField;
private var coins_int:int;
public var coins_txt:TextField;
public function CoinCountHUD(){
this.coins = 0;
}
public function set coins(_arg1:int):void{
this.coins_int = _arg1;
if (this.coins_int < 0){
this.coins_int = 0;
};
this.coins_txt.text = String(this.coins_int);
}
public function get coins():int{
return (this.coins_int);
}
}
}//package code
Section 2
//CrowsNestGame (code.CrowsNestGame)
package code {
import flash.display.*;
import flash.geom.*;
import sfb.game.systems.*;
import flash.events.*;
import sfb.tools.*;
import sfb.game.platformer.*;
import sfb.graphics.*;
import sfb.game.systems.timers.*;
import sfb.application.*;
public class CrowsNestGame extends MovieClip implements IPiratable {
public var hud:CoinCountHUD;
private var camera:Camera;
public var timer:TextTimer;
public var james_mc:PirateZebra;
private var tickID:uint;
public var net:ScalingRepeatingTexture;
public function CrowsNestGame(){
var _local1:BitmapData;
var _local2:Sprite;
var _local3:EnvironmentManager;
super();
this.addEventListener(Event.REMOVED_FROM_STAGE, this.cleanupListener);
_local1 = new BitmapData(293.9, 189.8, true, 0);
_local1.draw(new NetBlock());
this.net = new ScalingRepeatingTexture(_local1, null, 0x0100, 172, false, true);
_local2 = new Sprite();
_local2.addChild(net);
_local2.x = 275;
_local2.y = 200;
this.parent.addChildAt(_local2, this.parent.getChildIndex(this));
this.james_mc.currentGame = this;
this.james_mc.rigging = [_local2];
this.tickID = GameManager.getInstance().addTickFunction(this.act);
ControlsManager.getInstance().init(this.stage);
_local3 = EnvironmentManager.getInstance();
_local3.environment = new PlatformEnvironment();
this.camera = new Camera(this.james_mc, this, new Rectangle(225, 150, 100, 100), 0.9);
this.camera.startFollowing();
}
public function onGameFinished(_arg1:Event):void{
this.camera.stopFollowing();
this.james_mc.stopTick();
GameManager.getInstance().removeTickFunction(this.tickID);
Game.game.score = this.hud.coins;
PirateZebraApp(Game.game).gotoScores();
}
public function collect():void{
this.hud.coins++;
}
protected function cleanupListener(_arg1:Event):void{
this.camera.cleanup();
this.net.cleanup();
if (this.net.parent){
this.net.parent.removeChild(this.net);
};
this.net = null;
this.camera = null;
this.hud = null;
this.timer = null;
Cleanup.cleanDisplayList(this, true);
}
public function resetPosition():void{
}
public function act():void{
var _local1:Rectangle;
var _local2:DisplayObject;
var _local3:int;
var _local4:int;
var _local5:Coin;
var _local6:ParrotFlyOnce;
var _local7:Boolean;
var _local8:uint;
var _local9:uint;
if ((((james_mc.coins.length < 25)) && ((Math.random() > 0.93)))){
_local5 = new Coin();
this.addChild(_local5);
_local5.x = (((Math.random() * 550) - 275) + this.james_mc.x);
_local5.y = (((Math.random() * 400) - 200) + this.james_mc.y);
james_mc.coins.push(_local5);
};
if (Math.random() > 0.97){
_local6 = new ParrotFlyOnce();
this.addChild(_local6);
_local7 = Boolean(Math.round(Math.random()));
if (_local7){
_local6.x = (this.james_mc.x - 280);
_local6.y = ((this.james_mc.y + (Math.random() * 200)) - 100);
} else {
_local6.x = (this.james_mc.x + 280);
_local6.y = ((this.james_mc.y + (Math.random() * 200)) - 100);
_local6.scaleX = -1;
};
this.james_mc.enemies.push(_local6);
};
_local3 = 0;
_local4 = this.numChildren;
while (_local3 < _local4) {
_local2 = this.getChildAt(_local3);
_local1 = _local2.getBounds(this.parent);
if ((((((((_local1.left > 600)) || ((_local1.right < -50)))) || ((_local1.top < -50)))) || ((_local1.bottom > 450)))){
if ((_local2 is Coin)){
_local8 = 0;
_local9 = this.james_mc.coins.length;
while (_local8 < _local9) {
if (this.james_mc.coins[_local8] == _local2){
this.james_mc.coins.splice(_local8, 1);
break;
};
_local8++;
};
} else {
_local8 = 0;
_local9 = this.james_mc.coins.length;
while (_local8 < _local9) {
if (this.james_mc.enemies[_local8] == _local2){
this.james_mc.enemies.splice(_local8, 1);
break;
};
_local8++;
};
};
this.removeChild(_local2);
break;
};
_local3++;
};
}
public function hit():void{
this.hud.coins = (this.hud.coins - 5);
}
public function end():void{
}
override public function set y(_arg1:Number):void{
this.net.y = _arg1;
super.y = _arg1;
}
override public function set x(_arg1:Number):void{
this.net.x = _arg1;
super.x = _arg1;
}
}
}//package code
Section 3
//IPiratable (code.IPiratable)
package code {
public interface IPiratable {
function hit():void;
function resetPosition():void;
function collect():void;
function end():void;
}
}//package code
Section 4
//PirateZebra (code.PirateZebra)
package code {
import flash.display.*;
import flash.geom.*;
import sfb.maths.physics.*;
import sfb.maths.shapes.*;
import sfb.maths.*;
import sfb.audio.*;
import flash.events.*;
import flash.utils.*;
import sfb.tools.*;
import sfb.game.platformer.*;
public class PirateZebra extends PlatformPlayer {
public var coins:Array;
public var currentGame:IPiratable;
public var rigging:Array;
public var enemies:Array;
private var currentRigging:DisplayObject;
public var springBoards:Array;
public var ropes:Array;
private var canHit:Boolean;// = true
private var ropeJumpCount:int;
public static const ROPE_CLIMBING:String = "ropeClimbing";
public static const DOWN:String = "moveDown";
public static const CLIMBING_STILL:String = "climbingStill";
public static const UP:String = "moveUp";
public static const ROPE_JUMP_LEFT:String = "ropeJumpLeft";
public static const CLIMBING:String = "climbing";
public static const ROPE_JUMP_RIGHT:String = "ropeJumpRight";
public static const ROPE_STILL:String = "ropeStill";
public function PirateZebra(){
ropes = [];
rigging = [];
coins = [];
enemies = [];
springBoards = [];
canHit = true;
super();
this.hitShape = new MultiplePointShape([new Vector(this.x, ((this.y - this.height) - 10))], [new Vector((this.x - (this.width / 4)), this.y), new Vector((this.x + (this.width / 4)), this.y)], [new Vector((this.x - (this.width / 2)), (this.y - (this.height / 2)))], [new Vector((this.x + (this.width / 2)), (this.y - (this.height / 2)))]);
}
override protected function setMovement():void{
this.acceleration = 0.9;
this.jumpSpeed = -15;
this.speedLimit = new SpeedLimit(20);
}
public function setX(_arg1:Number):void{
this.modelMass.position.x = _arg1;
}
override protected function setControls():void{
this.controls.registerKey("LEFT", LEFT);
this.controls.registerKey("RIGHT", RIGHT);
this.controls.registerKey("UP", UP);
this.controls.registerKey("DOWN", DOWN);
this.controls.registerKey("UP", JUMP);
}
override protected function graphicalState():void{
var _local1:Number;
var _local2:Number;
_local1 = this.modelMass.velocity.x;
_local2 = this.modelMass.velocity.y;
if (_local1 > 0){
this.scaleX = this.initScaleX;
} else {
if (_local1 < 0){
this.scaleX = -(this.initScaleX);
};
};
switch (this.state){
case ON_GROUND:
if ((((_local1 > 1)) || ((_local1 < -1)))){
this.stateDisplay.setState(RUNNING);
} else {
this.stateDisplay.setState(STILL);
};
break;
case JUMPING:
this.stateDisplay.setState(JUMPING);
break;
case FALLING:
this.stateDisplay.setState(FALLING);
break;
case ROPE_CLIMBING:
if (_local2 < -1){
this.stateDisplay.setState(ROPE_CLIMBING);
} else {
this.stateDisplay.setState(ROPE_STILL);
};
break;
case ROPE_JUMP_LEFT:
this.stateDisplay.setState(ROPE_JUMP_LEFT);
this.scaleX = this.initScaleX;
break;
case ROPE_JUMP_RIGHT:
this.stateDisplay.setState(ROPE_JUMP_RIGHT);
this.scaleX = this.initScaleX;
break;
case CLIMBING:
if ((((((((_local1 > 1)) || ((_local1 < -1)))) || ((_local2 > 1)))) || ((_local2 < -1)))){
this.stateDisplay.setState(CLIMBING);
} else {
this.stateDisplay.setState(CLIMBING_STILL);
};
break;
};
this.stateDisplay.applyState();
}
override protected function adjustShape():void{
var _local1:Vector;
_local1 = new Vector((this.x - (this.initWidth / 4)), this.y);
this.hitShape.moveBy(_local1.subtract(MultiplePointShape(this.hitShape).getBottomVector(0)));
}
override protected function mainDecisions():void{
var _local1:Number;
var _local2:Point;
var _local3:Coin;
var _local4:uint;
var _local5:uint;
var _local6:MovieClip;
var _local7:Object;
var _local8:MovieClip;
var _local9:MovieClip;
var _local10:DisplayObject;
var _local11:Point;
var _local12:Point;
_local1 = ((20 * this.scaleX) / this.initScaleX);
if ((((this.state == ROPE_CLIMBING)) || ((this.state == CLIMBING)))){
_local1 = 0;
};
_local2 = this.modelMass.position.add(new Vector(_local1, -30)).toPoint();
_local2 = this.parent.localToGlobal(_local2);
_local4 = 0;
_local5 = this.coins.length;
while (_local4 < _local5) {
_local3 = (this.coins[_local4] as Coin);
if (_local3.hitTestPoint(_local2.x, _local2.y, true)){
currentGame.collect();
_local3.gotoAndPlay("stars");
this.coins.splice(_local4, 1);
SFXManager.getInstance().playSFX("coinCollect", 0, 0.7);
break;
};
_local4++;
};
_local2 = this.modelMass.position.add(new Vector(0, -10)).toPoint();
_local2 = this.parent.localToGlobal(_local2);
for each (_local6 in this.springBoards) {
if (_local6.hitTestPoint(_local2.x, _local2.y, true)){
_local6.plankClip_mc.gotoAndPlay(2);
this.gotoAndStop(1);
this.fallCount = 0;
this.state = JUMPING;
this.modelMass.velocity.y = (this.jumpSpeed * 10);
SFXManager.getInstance().playSFX("spring", 0, 0.8);
break;
};
};
if (this.canHit){
for each (_local8 in this.enemies) {
if (_local8.hit_mc){
if (_local8.hit_mc.hitTestPoint(_local2.x, _local2.y, true)){
if ((((_local8 is ParrotFly1)) || ((_local8 is ParrotFlyOnce)))){
SFXManager.getInstance().playSFX("parrot");
} else {
SFXManager.getInstance().playSFX("slap");
};
currentGame.hit();
_local9 = (this.parent.addChild(new CoinDrop()) as MovieClip);
_local9.x = this.x;
_local9.y = (this.y - 20);
SFXManager.getInstance().playSFX("coinLose");
this.canHit = false;
setTimeout(this.resetHit, 1000);
};
};
};
};
_local7 = this.controls.getKeys();
if (_local7[LEFT]){
this.modelMass.velocity.x = (this.modelMass.velocity.x - this.acceleration);
};
if (_local7[RIGHT]){
this.modelMass.velocity.x = (this.modelMass.velocity.x + this.acceleration);
};
if (((((_local7[UP]) || ((currentGame is CrowsNestGame)))) && ((((((this.state == ON_GROUND)) || ((this.state == JUMPING)))) || ((this.state == FALLING)))))){
for each (_local10 in this.ropes) {
if (this.hitTestObject(_local10)){
this.state = ROPE_CLIMBING;
this.modelMass.position.x = (this.x = _local10.x);
break;
};
};
_local11 = this.parent.localToGlobal(new Point(this.x, this.y));
for each (_local10 in this.rigging) {
if (_local10.hitTestPoint(_local11.x, _local11.y, true)){
this.currentRigging = (_local10 as DisplayObject);
this.state = CLIMBING;
break;
};
};
};
switch (this.state){
case ON_GROUND:
this.environment.applyTerrainFriction(this.modelMass);
if (_local7[JUMP]){
this.fallCount = 0;
this.state = JUMPING;
this.modelMass.velocity.y = this.jumpSpeed;
} else {
if (!this.hitTestResult){
this.fallCount++;
if (this.fallCount > this.fallLimit){
this.state = FALLING;
};
} else {
this.fallCount = 0;
};
};
break;
case JUMPING:
if (this.hitTestResult){
this.fallCount = 0;
this.state = ON_GROUND;
};
this.environment.applyAirResistance(this.modelMass);
break;
case ROPE_JUMP_LEFT:
case ROPE_JUMP_RIGHT:
this.ropeJumpCount++;
if (this.ropeJumpCount >= 8){
this.state = FALLING;
};
case FALLING:
if (this.hitTestResult){
this.fallCount = 0;
this.state = ON_GROUND;
};
this.environment.applyAirResistance(this.modelMass);
break;
case ROPE_CLIMBING:
this.modelMass.velocity.x = 0;
this.scaleX = this.initScaleX;
if (_local7[UP]){
this.modelMass.velocity.y = -3;
} else {
if (_local7[DOWN]){
this.modelMass.velocity.y = (this.modelMass.velocity.y + 0.1);
} else {
if (_local7[LEFT]){
this.state = ROPE_JUMP_LEFT;
this.ropeJumpCount = 0;
} else {
if (_local7[RIGHT]){
this.state = ROPE_JUMP_RIGHT;
this.ropeJumpCount = 0;
};
};
this.modelMass.velocity.y = 0;
};
};
break;
case CLIMBING:
this.modelMass.velocity.x = 0;
this.modelMass.velocity.y = 0;
if ((currentGame is CrowsNestGame)){
if (_local7[UP]){
this.modelMass.velocity.y = -8;
} else {
if (_local7[DOWN]){
this.modelMass.velocity.y = 8;
};
};
if (_local7[LEFT]){
this.modelMass.velocity.x = -8;
} else {
if (_local7[RIGHT]){
this.modelMass.velocity.x = 8;
};
};
this.modelMass.velocity = this.modelMass.velocity.normalised(8);
} else {
if (_local7[UP]){
this.modelMass.velocity.y = -4;
} else {
if (_local7[DOWN]){
this.modelMass.velocity.y = 4;
};
};
if (_local7[LEFT]){
this.modelMass.velocity.x = -4;
} else {
if (_local7[RIGHT]){
this.modelMass.velocity.x = 4;
};
};
this.modelMass.velocity = this.modelMass.velocity.normalised(4);
};
_local12 = this.parent.localToGlobal(new Point((this.x + this.modelMass.velocity.x), this.y));
if (!this.currentRigging.hitTestPoint(_local12.x, _local12.y, true)){
this.state = FALLING;
};
break;
};
if ((((this.y > 500)) && (!((currentGame is CrowsNestGame))))){
this.currentGame.resetPosition();
SFXManager.getInstance().playSFX("water", 0, 0.9, 0, true);
};
if ((((((((this.y > 355)) && ((this.x > 4920)))) && ((this.x < 5050)))) && (!((currentGame is CrowsNestGame))))){
this.visible = false;
this.stopTick();
this.currentGame.end();
};
}
public function setY(_arg1:Number):void{
this.modelMass.position.y = _arg1;
}
override protected function cleanupListener(_arg1:Event):void{
super.cleanupListener(_arg1);
this.currentRigging = null;
this.currentGame = null;
Cleanup.cleanArray(this.ropes);
Cleanup.cleanArray(this.rigging);
Cleanup.cleanArray(this.coins);
Cleanup.cleanArray(this.enemies);
Cleanup.cleanArray(this.springBoards);
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.modelMass.velocity = new Vector(0, 0);
this.modelMass.position = new Vector(_arg1, _arg2);
}
public function resetHit():void{
this.canHit = true;
}
public function stopTick():void{
this.game.removeTickFunction(this.tickID);
}
}
}//package code
Section 5
//PirateZebraApp (code.PirateZebraApp)
package code {
import flash.display.*;
import sfb.game.systems.*;
import sfb.audio.*;
import flash.events.*;
import flash.text.*;
import sfb.application.hiscores.*;
import sfb.application.preloader.*;
import sfb.game.systems.timers.*;
import sfb.application.*;
public class PirateZebraApp extends Game {
public var replay_btn:SimpleButton;
public var tentacleHUD_mc:CoinCountHUD;
public var tentacleTrapGame_mc:TentacleTrapGame;
public var superFlashBros_btn:SimpleButton;
public var mainMenu_btn:SimpleButton;
public var submitter_mc:HiscoreSubmit;
public var mainMenuCrows_btn:SimpleButton;
private var soundInit:Boolean;
public var playMoreScores_btn:SimpleButton;
public var play_btn:SimpleButton;
public var crowsTime_txt:TextField;
public var crowsNest_btn:SimpleButton;
public var hsd_mc:HiscoreDisplay;
public var mainHUD_mc:CoinCountHUD;
public var mainMenuTentacle_btn:SimpleButton;
public var mainGame_mc:PirateZebraGame;
public var crowsNestGame_mc:CrowsNestGame;
public var playMoreGames_btn:SimpleButton;
public var preloaderBar_mc:MovieClip;
public var armorGames_btn:SimpleButton;
public var gameName_mc:MovieClip;
public var playTentacle_btn:SimpleButton;
public var playCrows_btn:SimpleButton;
public var skip_btn:SimpleButton;
public var tentacleTime_txt:TextField;
public var crowsHUD_mc:CoinCountHUD;
public var allScores_btn:SimpleButton;
private var musicManager:MusicManager;
public var armorScores_btn:SimpleButton;
public var tentacleTrap_btn:SimpleButton;
public var time_txt:TextField;
public function PirateZebraApp(){
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
super();
addFrameScript(1, frame2);
this.stage.frameRate = 25;
this.preloader = new MovieClipPreloader(this.preloaderBar_mc);
this.preload();
GameManager.getInstance().startFrame(this.stage);
_local1 = 0;
_local2 = (_local1 + this.scenes[0].numFrames);
_local3 = (_local2 + this.scenes[1].numFrames);
_local4 = (_local3 + this.scenes[2].numFrames);
_local5 = (_local4 + this.scenes[3].numFrames);
_local6 = (_local5 + this.scenes[4].numFrames);
_local7 = (_local6 + this.scenes[5].numFrames);
_local8 = (_local7 + this.scenes[5].numFrames);
_local9 = (_local8 + this.scenes[5].numFrames);
this.addFrameScript(_local2, this.onMenu);
this.addFrameScript(_local3, this.onIntro);
this.addFrameScript(_local4, this.onMainGame);
this.addFrameScript(_local5, this.onCrowsNestMenu);
this.addFrameScript(_local6, this.onCrowsNest);
this.addFrameScript(_local7, this.onTentacleTrapMenu);
this.addFrameScript(_local8, this.onTentacleTrap);
this.addFrameScript(_local9, this.onScores);
this.score = 1;
this.flashkeys = ["dXVDS2FCSmI=", "QUlxSXNkY1U=", "cGNKRHdYUE8="];
this.SU0249s = ["MjYzMmolZSVhJW4lcw==", "MjYzNGolZSVhJW4lcw==", "MjYzM2olZSVhJW4lcw=="];
this.currentGame = 0;
this.qualityToMedium();
}
public function gotoCrowsNestMenu(_arg1:Event=null):void{
this.gotoAndStop(1, "Crows Nest Menu");
}
public function onCrowsNest():void{
this.crowsNestGame_mc.hud = this.crowsHUD_mc;
this.currentGame = 1;
this.crowsNestGame_mc.timer = new TextTimer(60000, this.crowsTime_txt);
this.crowsNestGame_mc.timer.addEventListener(TextTimer.TIME_UP, this.crowsNestGame_mc.onGameFinished);
this.crowsNestGame_mc.timer.countDown = true;
this.crowsNestGame_mc.timer.start();
this.musicManager.playMusic("main", int.MAX_VALUE, 0.5);
}
public function onMainGame():void{
this.stage.frameRate = 25;
this.stop();
this.mainGame_mc.hud = this.mainHUD_mc;
this.currentGame = 0;
this.musicManager.playMusic("main", int.MAX_VALUE, 0.5);
this.mainGame_mc.timer = new TextTimer(uint.MAX_VALUE, this.time_txt);
this.mainGame_mc.timer.start();
}
override protected function preloadComplete(_arg1:Event):void{
this.gotoMenu();
}
public function gotoTenatcleTrap(_arg1:Event=null):void{
this.gotoAndStop(1, "Tentacle Trap");
}
function frame2(){
stop();
}
public function gotoIntro(_arg1:Event=null):void{
this.gotoAndPlay(1, "Intro");
}
public function onScores():void{
if (((this.mainGame_mc) && (this.contains(this.mainGame_mc)))){
this.removeChild(this.mainGame_mc);
};
if (((this.tentacleTrapGame_mc) && (this.contains(this.tentacleTrapGame_mc)))){
this.removeChild(this.tentacleTrapGame_mc);
};
if (((this.crowsNestGame_mc) && (this.contains(this.crowsNestGame_mc)))){
this.removeChild(this.crowsNestGame_mc);
};
this.submitter_mc.score_txt.text = String(this.score);
this.gameName_mc.gotoAndStop((1 + this.currentGame));
this.musicManager.playMusic("menu", int.MAX_VALUE, 1, 0, 1000);
this.mainMenu_btn.addEventListener(MouseEvent.CLICK, this.gotoMenu);
this.linkToAG(this.playMoreScores_btn);
this.linkToAG(this.armorScores_btn);
switch (this.currentGame){
case 0:
this.replay_btn.addEventListener(MouseEvent.CLICK, this.gotoIntro);
this.linkTo(allScores_btn, "http://rankz.armorbot.com/piratezebra");
break;
case 1:
this.replay_btn.addEventListener(MouseEvent.CLICK, this.gotoCrowsNestMenu);
this.linkTo(allScores_btn, "http://rankz.armorbot.com/crowsnest");
break;
case 2:
this.replay_btn.addEventListener(MouseEvent.CLICK, this.gotoTenatcleTrapMenu);
this.linkTo(allScores_btn, "http://rankz.armorbot.com/tentacletrap");
break;
};
}
public function onCrowsNestMenu():void{
this.playCrows_btn.addEventListener(MouseEvent.CLICK, this.gotoCrowsNest);
this.mainMenuCrows_btn.addEventListener(MouseEvent.CLICK, this.gotoMenu);
}
public function gotoCrowsNest(_arg1:Event=null):void{
this.gotoAndStop(1, "Crows Nest");
}
public function gotoMenu(_arg1:Event=null):void{
this.gotoAndStop(1, "Menu");
}
public function gotoScores(_arg1:Event=null):void{
this.gotoAndStop(1, "Scores");
}
public function onTentacleTrap():void{
this.tentacleTrapGame_mc.hud = this.tentacleHUD_mc;
this.currentGame = 2;
this.tentacleTrapGame_mc.timer = new TextTimer(60000, this.tentacleTime_txt);
this.tentacleTrapGame_mc.timer.addEventListener(TextTimer.TIME_UP, this.tentacleTrapGame_mc.onGameFinished);
this.tentacleTrapGame_mc.timer.countDown = true;
this.tentacleTrapGame_mc.timer.start();
this.musicManager.playMusic("main", int.MAX_VALUE, 0.5);
}
public function onIntro():void{
this.stage.frameRate = 24;
this.skip_btn.addEventListener(MouseEvent.CLICK, this.gotoMainGame);
this.musicManager.stopMusic();
}
public function gotoMainGame(_arg1:Event=null):void{
this.gotoAndStop(1, "Main Game");
}
public function gotoTenatcleTrapMenu(_arg1:Event=null):void{
this.gotoAndStop(1, "Tentacle Trap Menu");
}
public function onMenu():void{
var _local1:SFXManager;
if (!this.soundInit){
this.musicManager = MusicManager.getInstance();
this.musicManager.addMusic(MainLoop, "main");
this.musicManager.addMusic(MenuLoop, "menu");
_local1 = SFXManager.getInstance();
_local1.addSFX(CoinCollectSFX, "coinCollect");
_local1.addSFX(CoinLoseSFX, "coinLose");
_local1.addSFX(FallinWaterSFX, "water");
_local1.addSFX(ParrotHitSFX, "parrot");
_local1.addSFX(SpringboardSFX, "spring");
_local1.addSFX(TentacleSlapSFX, "slap");
this.soundInit = true;
};
this.play_btn.addEventListener(MouseEvent.CLICK, this.gotoIntro);
this.crowsNest_btn.addEventListener(MouseEvent.CLICK, this.gotoCrowsNestMenu);
this.tentacleTrap_btn.addEventListener(MouseEvent.CLICK, this.gotoTenatcleTrapMenu);
this.linkToAG(this.playMoreGames_btn);
this.linkToAG(this.armorGames_btn);
this.linkToSFB(this.superFlashBros_btn);
this.musicManager.stopMusic();
}
public function onTentacleTrapMenu():void{
this.playTentacle_btn.addEventListener(MouseEvent.CLICK, this.gotoTenatcleTrap);
this.mainMenuTentacle_btn.addEventListener(MouseEvent.CLICK, this.gotoMenu);
}
}
}//package code
Section 6
//PirateZebraGame (code.PirateZebraGame)
package code {
import flash.display.*;
import flash.geom.*;
import sfb.game.systems.*;
import sfb.maths.shapes.*;
import sfb.maths.*;
import flash.events.*;
import flash.utils.*;
import sfb.tools.*;
import sfb.game.platformer.*;
import sfb.game.systems.timers.*;
import sfb.application.*;
public class PirateZebraGame extends MovieClip implements IPiratable {
public var springboard4_mc:MovieClip;
public var parrot1_mc:MovieClip;
public var boat_mc:MovieClip;
public var rope_mc:MovieClip;
public var parrot4_mc:MovieClip;
private var camera:Camera;
public var hud:CoinCountHUD;
public var rigging_mc:MovieClip;
public var springboard2_mc:MovieClip;
public var timer:TextTimer;
public var ground_mc:MovieClip;
public var tentacle2_mc:MovieClip;
public var james_mc:PirateZebra;
public var parrot5_mc:MovieClip;
public var springboard5_mc:MovieClip;
public var parrot2_mc:MovieClip;
public var springboard3_mc:MovieClip;
public var tentacle3_mc:MovieClip;
public var parrot3_mc:MovieClip;
public var parrot6_mc:MovieClip;
public var springboard1_mc:MovieClip;
public var tentacle1_mc:MovieClip;
public function PirateZebraGame(){
var _local1:EnvironmentManager;
var _local2:DisplayManager;
var _local3:uint;
var _local4:DisplayObject;
super();
this.addEventListener(Event.REMOVED_FROM_STAGE, this.cleanupListener);
this.james_mc.currentGame = this;
this.scaleX = (this.scaleY = 1);
this.james_mc.ropes = [this.rope_mc.rope1_mc, this.rope_mc.rope2_mc, this.rope_mc.rope3_mc, this.rope_mc.rope4_mc, this.rope_mc.rope5_mc, this.rope_mc.rope6_mc];
this.james_mc.rigging = [this.rigging_mc.rigging1_mc, this.rigging_mc.rigging2_mc, this.rigging_mc.rigging3_mc, this.rigging_mc.rigging4_mc];
this.james_mc.springBoards = [springboard1_mc, springboard2_mc, springboard3_mc, springboard4_mc, springboard5_mc];
this.james_mc.enemies = [tentacle1_mc, tentacle2_mc, tentacle3_mc, parrot1_mc, parrot2_mc, parrot3_mc, parrot4_mc, parrot5_mc, parrot6_mc];
ControlsManager.getInstance().init(this.stage);
_local1 = EnvironmentManager.getInstance();
_local1.environment = new PlatformEnvironment();
_local1.environment.friction = 0.16;
_local1.terrain = [new DisplayShape(this.ground_mc)];
this.ground_mc.visible = false;
this.rigging_mc.visible = false;
this.rope_mc.visible = false;
this.camera = new Camera(this.james_mc, this, new Rectangle(225, 150, 100, 100), 0.9);
this.camera.lowerLimits.y = 0;
this.camera.startFollowing();
_local2 = DisplayManager.getInstance();
_local2.interval = 10;
_local2.maxSpeed = new Vector(10, 10);
_local3 = 0;
while (_local3 < this.numChildren) {
_local4 = this.getChildAt(_local3);
if (((((((!((_local4 == this.james_mc))) && (!((_local4 == this.ground_mc))))) && (!((_local4 == this.rigging_mc))))) && (!((_local4 == this.rope_mc))))){
_local2.addSet([_local4], !((_local4 == boat_mc)));
if ((_local4 is Coin)){
this.james_mc.coins.push(_local4);
};
};
_local3++;
};
_local2.startRendering();
}
public function collect():void{
this.hud.coins++;
}
protected function cleanupListener(_arg1:Event):void{
this.camera.cleanup();
EnvironmentManager.getInstance().cleanup();
DisplayManager.getInstance().empty();
Cleanup.cleanDisplayList(this, true);
this.camera = null;
this.hud = null;
this.timer = null;
}
public function resetPosition():void{
if (this.james_mc.x < 600){
this.james_mc.setPosition(260, 200);
} else {
if (this.james_mc.x < 1400){
this.james_mc.setPosition(920, 200);
} else {
if (this.james_mc.x < 2400){
this.james_mc.setPosition(1920, 20);
} else {
if (this.james_mc.x < 3400){
this.james_mc.setPosition(2760, 200);
} else {
if (this.james_mc.x < 4400){
this.james_mc.setPosition(3600, 200);
} else {
this.james_mc.setPosition(4820, 200);
};
};
};
};
};
}
public function hit():void{
this.hud.coins = (this.hud.coins - 3);
}
public function end():void{
this.timer.pause();
this.camera.stopFollowing();
DisplayManager.getInstance().stopRendering();
Game.game.score = Math.round(((500 * this.hud.coins) - (this.timer.currentTime / 10)));
if (Game.game.score < 0){
Game.game.score = 0;
};
this.boat_mc.gotoAndStop(2);
setTimeout(PirateZebraApp(Game.game).gotoScores, 4000);
}
}
}//package code
Section 7
//TentacleTrapGame (code.TentacleTrapGame)
package code {
import flash.display.*;
import flash.geom.*;
import sfb.game.systems.*;
import sfb.maths.shapes.*;
import flash.events.*;
import sfb.tools.*;
import sfb.game.platformer.*;
import sfb.game.systems.timers.*;
import sfb.application.*;
public class TentacleTrapGame extends MovieClip implements IPiratable {
public var hud:CoinCountHUD;
private var camera:Camera;
public var timer:TextTimer;
public var james_mc:PirateZebra;
private var tickID:uint;
private var lastX:Number;
private var currentX:Number;
public function TentacleTrapGame(){
var _local1:EnvironmentManager;
var _local2:uint;
var _local3:DisplayObject;
super();
this.addEventListener(Event.REMOVED_FROM_STAGE, this.cleanupListener);
this.james_mc.currentGame = this;
this.currentX = 0;
this.lastX = 0;
this.tickID = GameManager.getInstance().addTickFunction(this.act);
ControlsManager.getInstance().init(this.stage);
_local1 = EnvironmentManager.getInstance();
_local1.environment = new PlatformEnvironment();
_local1.environment.friction = 0.08;
_local1.environment.airResistance = 0.06;
_local1.terrain = [new FlatShape(280)];
this.camera = new Camera(this.james_mc, this, new Rectangle(100, 150, 100, 100), 0.9);
this.camera.lowerLimits.y = 0;
this.camera.startFollowing();
_local2 = 0;
while (_local2 < 5) {
_local3 = this.addChildAt(new TentacleBlock(), 0);
_local3.x = (-330 + (270 * _local2));
_local3.y = 300;
this.james_mc.enemies.push(_local3);
_local2++;
};
}
public function onGameFinished(_arg1:Event):void{
this.camera.stopFollowing();
this.james_mc.stopTick();
GameManager.getInstance().removeTickFunction(this.tickID);
Game.game.score = this.hud.coins;
PirateZebraApp(Game.game).gotoScores();
}
public function collect():void{
this.hud.coins++;
}
protected function cleanupListener(_arg1:Event):void{
this.camera.cleanup();
EnvironmentManager.getInstance().cleanup();
this.camera = null;
this.hud = null;
this.timer = null;
Cleanup.cleanDisplayList(this, true);
}
public function resetPosition():void{
}
public function act():void{
var _local1:Number;
var _local2:DisplayObject;
var _local3:Rectangle;
var _local4:int;
var _local5:int;
var _local6:DisplayObject;
var _local7:uint;
var _local8:uint;
_local1 = (this.x - this.lastX);
this.lastX = this.x;
this.currentX = (this.currentX - _local1);
if ((((_local1 < -5)) && ((Math.random() > 0.8)))){
_local6 = this.addChild(new Coin());
_local6.x = (-(this.x) + 600);
_local6.y = (180 + (Math.random() * 80));
this.james_mc.coins.push(_local6);
};
if (this.currentX > 270){
this.currentX = (this.currentX - 270);
_local2 = this.addChildAt(new TentacleBlock(), 0);
_local2.x = ((-(this.x) - this.currentX) + 750);
_local2.y = 300;
this.james_mc.enemies.push(_local2);
} else {
if (this.currentX < -270){
this.currentX = (this.currentX + 270);
_local2 = this.addChildAt(new TentacleBlock(), 0);
_local2.x = -(((this.x + this.currentX) + 330));
_local2.y = 300;
this.james_mc.enemies.push(_local2);
};
};
_local4 = 0;
_local5 = this.numChildren;
while (_local4 < _local5) {
_local2 = this.getChildAt(_local4);
_local3 = _local2.getBounds(this.parent);
if ((((_local3.left > 700)) || ((_local3.right < -330)))){
_local7 = 0;
_local8 = this.james_mc.enemies.length;
while (_local7 < _local8) {
if (this.james_mc.enemies[_local7] == _local2){
this.james_mc.enemies.splice(_local7, 1);
};
_local7++;
};
this.removeChild(_local2);
break;
};
_local4++;
};
}
public function hit():void{
this.hud.coins = (this.hud.coins - 6);
}
public function end():void{
}
}
}//package code
Section 8
//BoatRowBoat_208 (PirateZebra_fla.BoatRowBoat_208)
package PirateZebra_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class BoatRowBoat_208 extends MovieClip {
public function BoatRowBoat_208(){
addFrameScript(0, frame1);
}
function frame1(){
this.marked = true;
stop();
}
}
}//package PirateZebra_fla
Section 9
//GoClip_246 (PirateZebra_fla.GoClip_246)
package PirateZebra_fla {
import flash.display.*;
public dynamic class GoClip_246 extends MovieClip {
public function GoClip_246(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package PirateZebra_fla
Section 10
//PreloaderBar_4 (PirateZebra_fla.PreloaderBar_4)
package PirateZebra_fla {
import flash.display.*;
public dynamic class PreloaderBar_4 extends MovieClip {
public function PreloaderBar_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PirateZebra_fla
Section 11
//SoundsExporter_29 (PirateZebra_fla.SoundsExporter_29)
package PirateZebra_fla {
import flash.display.*;
public dynamic class SoundsExporter_29 extends MovieClip {
public function SoundsExporter_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PirateZebra_fla
Section 12
//Symbol164_25 (PirateZebra_fla.Symbol164_25)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol164_25 extends MovieClip {
public var flap_mc:MovieClip;
}
}//package PirateZebra_fla
Section 13
//Symbol165_24 (PirateZebra_fla.Symbol165_24)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol165_24 extends MovieClip {
public var turn_mc:MovieClip;
}
}//package PirateZebra_fla
Section 14
//Symbol242_157 (PirateZebra_fla.Symbol242_157)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol242_157 extends MovieClip {
public function Symbol242_157(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
this.stop();
}
function frame2(){
this.play();
}
}
}//package PirateZebra_fla
Section 15
//Symbol249_200 (PirateZebra_fla.Symbol249_200)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol249_200 extends MovieClip {
public var rigging1_mc:MovieClip;
public var rigging4_mc:MovieClip;
public var rigging2_mc:MovieClip;
public var rigging3_mc:MovieClip;
}
}//package PirateZebra_fla
Section 16
//Symbol252_205 (PirateZebra_fla.Symbol252_205)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol252_205 extends MovieClip {
public var rope3_mc:MovieClip;
public var rope6_mc:MovieClip;
public var rope1_mc:MovieClip;
public var rope4_mc:MovieClip;
public var rope2_mc:MovieClip;
public var rope5_mc:MovieClip;
}
}//package PirateZebra_fla
Section 17
//Symbol315_227 (PirateZebra_fla.Symbol315_227)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol315_227 extends MovieClip {
public function Symbol315_227(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package PirateZebra_fla
Section 18
//Symbol316_228 (PirateZebra_fla.Symbol316_228)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol316_228 extends MovieClip {
public function Symbol316_228(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PirateZebra_fla
Section 19
//Symbol325_258 (PirateZebra_fla.Symbol325_258)
package PirateZebra_fla {
import flash.display.*;
public dynamic class Symbol325_258 extends MovieClip {
public function Symbol325_258(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PirateZebra_fla
Section 20
//Hiscore (sfb.application.hiscores.Hiscore)
package sfb.application.hiscores {
public class Hiscore {
public var score:Number;
public var name:String;
public function Hiscore(_arg1:String, _arg2:Number){
this.name = _arg1;
this.score = _arg2;
}
}
}//package sfb.application.hiscores
Section 21
//HiscoreDisplay (sfb.application.hiscores.HiscoreDisplay)
package sfb.application.hiscores {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import sfb.application.*;
public class HiscoreDisplay extends MovieClip {
public var score1_txt:TextField;
public var score3_txt:TextField;
public var score5_txt:TextField;
private var hiscoreRequest:URLRequest;
public var score7_txt:TextField;
public var score9_txt:TextField;
public var name0_txt:TextField;
public var name2_txt:TextField;
public var name8_txt:TextField;
public var name6_txt:TextField;
private var hiscores:Array;
private var hiscoreData:URLVariables;
public var score2_txt:TextField;
public var score6_txt:TextField;
public var score8_txt:TextField;
public var score4_txt:TextField;
public var name4_txt:TextField;
public var score0_txt:TextField;
private var hiscoreLoader:URLLoader;
public var name1_txt:TextField;
public var name3_txt:TextField;
public var name5_txt:TextField;
public var name7_txt:TextField;
public var name9_txt:TextField;
public function HiscoreDisplay(){
this.hiscores = [];
this.hiscoreRequest = new URLRequest("http://rankz.armorbot.com/get/top10.php");
this.hiscoreRequest.method = URLRequestMethod.POST;
this.hiscoreLoader = new URLLoader();
this.hiscoreLoader.addEventListener(Event.COMPLETE, this.onLoadHiscores);
this.hiscoreLoader.addEventListener(IOErrorEvent.IO_ERROR, this.errorListener);
this.loadHiscores();
}
public function errorListener(_arg1:Event):void{
this.gotoAndStop("error");
}
public function loadHiscores():void{
this.gotoAndStop("loading");
this.hiscoreRequest.data = new URLVariables();
this.hiscoreRequest.data.SU0249 = Game.game.SU0249;
this.hiscoreRequest.data.flashkey = Game.game.flashkey;
this.hiscoreLoader.load(this.hiscoreRequest);
}
private function writeHiscores():void{
var _local1:uint;
var _local2:uint;
var _local3:Array;
var _local4:Array;
this.hiscores = [];
_local3 = this.hiscoreData.top10.split("<u/*/u>");
_local1 = 0;
_local2 = _local3.length;
while (_local1 < _local2) {
_local4 = _local3[_local1].split("</*/>");
this.hiscores[_local1] = new Hiscore(_local4[0], _local4[1]);
_local1++;
};
_local1 = 0;
_local2 = this.hiscores.length;
while (_local1 < _local2) {
if (((this[(("name" + _local1) + "_txt")]) && (this[(("score" + _local1) + "_txt")]))){
this[(("name" + _local1) + "_txt")].text = this.hiscores[_local1].name;
this[(("score" + _local1) + "_txt")].text = this.hiscores[_local1].score;
} else {
break;
};
_local1++;
};
}
private function onLoadHiscores(_arg1:Event):void{
this.hiscoreData = new URLVariables(this.hiscoreLoader.data);
if (String(this.hiscoreData["success"]) == "true"){
this.gotoAndStop("hiscores");
setTimeout(this.writeHiscores, 100);
} else {
this.gotoAndStop("error");
};
}
}
}//package sfb.application.hiscores
Section 22
//HiscoreSubmit (sfb.application.hiscores.HiscoreSubmit)
package sfb.application.hiscores {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import sfb.application.*;
public class HiscoreSubmit extends MovieClip {
public var hiscore:Hiscore;
public var score_txt:TextField;
private var submitRequest:URLRequest;
private var submitLoader:URLLoader;
public var hiscoreDisplay:HiscoreDisplay;
public var submit_btn:SimpleButton;
public var name_txt:TextField;
public function HiscoreSubmit(){
this.score_txt.text = String(Game.game.score);
this.name_txt.text = "YOUR NAME";
this.submit_btn.addEventListener(MouseEvent.CLICK, this.submitScore);
this.submitRequest = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
this.submitRequest.method = URLRequestMethod.POST;
this.submitLoader = new URLLoader();
this.submitLoader.dataFormat = URLLoaderDataFormat.TEXT;
this.submitLoader.addEventListener(Event.COMPLETE, this.onSubmitScore);
this.hiscoreDisplay = (this.parent["hsd_mc"] as HiscoreDisplay);
if (this.hiscoreDisplay){
this.submitLoader.addEventListener(IOErrorEvent.IO_ERROR, this.hiscoreDisplay.errorListener);
} else {
this.submitLoader.addEventListener(IOErrorEvent.IO_ERROR, this.errorListener);
};
}
public function errorListener(_arg1:Event):void{
}
private function submitScore(_arg1:Event):void{
var _local2:Number;
var _local3:String;
this.name_txt.type = TextFieldType.DYNAMIC;
this.name_txt.selectable = false;
if (this.contains(this.submit_btn)){
this.removeChild(this.submit_btn);
};
this.hiscore = new Hiscore(this.name_txt.text, Number(this.score_txt.text));
this.submitRequest.data = new URLVariables();
this.submitRequest.data.SU0249 = Game.game.SU0249;
this.submitRequest.data.flashkey = Game.game.flashkey;
this.submitRequest.data.bmFtZTE = this.hiscore.name;
_local2 = this.hiscore.score;
_local3 = (_local2 + "Z");
this.submitRequest.data.c2NvcmUx = _local3.split("0").join("U");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split("").join("A");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split("AU").join("Y");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split("A1").join("B");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split(".").join("N");
this.submitLoader.load(this.submitRequest);
}
private function onSubmitScore(_arg1:Event):void{
if (this.hiscoreDisplay){
this.hiscoreDisplay.loadHiscores();
};
}
}
}//package sfb.application.hiscores
Section 23
//MovieClipPreloader (sfb.application.preloader.MovieClipPreloader)
package sfb.application.preloader {
import flash.display.*;
import flash.events.*;
public class MovieClipPreloader extends Preloader {
protected var target:MovieClip;
protected var totalFrames:uint;
public function MovieClipPreloader(_arg1:MovieClip){
super(_arg1.root.loaderInfo);
this.target = _arg1;
this.target.gotoAndStop(1);
this.totalFrames = this.target.totalFrames;
}
override protected function checkProgress(_arg1:Event):void{
var _local2:uint;
_local2 = Math.ceil((this.progress * this.totalFrames));
this.target.gotoAndStop(_local2);
if (this.progress >= 1){
this.dispatchEvent(new Event(Event.COMPLETE));
};
}
}
}//package sfb.application.preloader
Section 24
//Preloader (sfb.application.preloader.Preloader)
package sfb.application.preloader {
import flash.display.*;
import flash.events.*;
public class Preloader extends EventDispatcher {
protected var loaderInfo:LoaderInfo;
public function Preloader(_arg1:LoaderInfo){
this.loaderInfo = _arg1;
}
public function start():void{
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, this.checkProgress);
}
protected function checkProgress(_arg1:Event):void{
if (this.progress >= 1){
this.dispatchEvent(new Event(Event.COMPLETE));
};
}
public function get progress():Number{
return ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal));
}
}
}//package sfb.application.preloader
Section 25
//SaveSystem (sfb.application.saves.SaveSystem)
package sfb.application.saves {
import flash.events.*;
public class SaveSystem extends EventDispatcher {
}
}//package sfb.application.saves
Section 26
//Application (sfb.application.Application)
package sfb.application {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import sfb.events.*;
import sfb.application.saves.*;
import sfb.application.preloader.*;
import flash.net.*;
import flash.ui.*;
public class Application extends MovieClip {
protected var sfbLink:ContextMenuItem;
protected var lowQuality:ContextMenuItem;
public var saveSystem:SaveSystem;
protected var pmgLink:ContextMenuItem;
public var rightClickMenu:ContextMenu;
protected var agLink:ContextMenuItem;
public var preloader:Preloader;
protected var links:Dictionary;
protected var mediumQuality:ContextMenuItem;
protected var qualityIndicator:String;// = " <<<"
protected var highQuality:ContextMenuItem;
public static var application:Application;
public function Application(){
qualityIndicator = " <<<";
super();
this.stop();
Application.application = this;
this.createRightClickMenu();
this.links = new Dictionary(true);
}
public function linkToAB(_arg1:InteractiveObject):void{
_arg1.addEventListener(MouseEvent.CLICK, this.browseToAB);
}
protected function preload():void{
if (this.preloader){
this.preloader.addEventListener(Event.COMPLETE, this.preloadComplete);
this.preloader.start();
};
}
public function qualityToLow(_arg1:Event=null):void{
this.stage.quality = StageQuality.LOW;
this.highQuality.caption = this.removeQualityIndicator(this.highQuality.caption);
this.mediumQuality.caption = this.removeQualityIndicator(this.mediumQuality.caption);
this.lowQuality.caption = this.removeQualityIndicator(this.lowQuality.caption);
this.lowQuality.caption = (this.lowQuality.caption + this.qualityIndicator);
this.dispatchEvent(new ApplicationEvent(ApplicationEvent.QUALITY_CHANGE));
}
public function linkTo(_arg1:InteractiveObject, _arg2:String):void{
this.links[_arg1] = _arg2;
_arg1.addEventListener(MouseEvent.CLICK, this.browseToLink);
}
public function browseToNG(_arg1:Event=null):void{
navigateToURL(new URLRequest("http://www.newgrounds.com/"), "_blank");
}
public function linkToSFB(_arg1:InteractiveObject):void{
_arg1.addEventListener(MouseEvent.CLICK, this.browseToSFB);
}
public function browseToLink(_arg1:Event=null):void{
navigateToURL(new URLRequest(this.links[_arg1.target]), "_blank");
}
protected function preloadComplete(_arg1:Event):void{
}
protected function removeQualityIndicator(_arg1:String):String{
if (_arg1.substr((_arg1.length - this.qualityIndicator.length)) == this.qualityIndicator){
return (_arg1.substring(0, (_arg1.length - this.qualityIndicator.length)));
};
return (_arg1);
}
public function linkToAG(_arg1:InteractiveObject):void{
_arg1.addEventListener(MouseEvent.CLICK, this.browseToAG);
}
public function browseToSFB(_arg1:Event=null):void{
navigateToURL(new URLRequest("http://www.superflashbros.net/"), "_blank");
}
public function browseToAB(_arg1:Event=null):void{
navigateToURL(new URLRequest("http://www.armorblog.com/"), "_blank");
}
public function browseToAG(_arg1:Event=null):void{
navigateToURL(new URLRequest("http://www.armorgames.com/"), "_blank");
}
public function linkToNG(_arg1:InteractiveObject):void{
_arg1.addEventListener(MouseEvent.CLICK, this.browseToNG);
}
protected function createRightClickMenu():void{
this.rightClickMenu = new ContextMenu();
this.rightClickMenu.hideBuiltInItems();
this.highQuality = new ContextMenuItem("Quality: High");
this.highQuality.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.qualityToHigh);
this.mediumQuality = new ContextMenuItem("Quality: Medium");
this.mediumQuality.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.qualityToMedium);
this.lowQuality = new ContextMenuItem("Quality: Low");
this.lowQuality.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.qualityToLow);
this.sfbLink = new ContextMenuItem("SuperFlashBros.net", true);
this.sfbLink.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.browseToSFB);
this.agLink = new ContextMenuItem("ArmorGames.com");
this.agLink.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.browseToAG);
this.pmgLink = new ContextMenuItem("Play More Games!");
this.pmgLink.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.browseToAG);
this.rightClickMenu.customItems.push(this.highQuality);
this.rightClickMenu.customItems.push(this.mediumQuality);
this.rightClickMenu.customItems.push(this.lowQuality);
this.rightClickMenu.customItems.push(this.sfbLink);
this.rightClickMenu.customItems.push(this.agLink);
this.rightClickMenu.customItems.push(this.pmgLink);
this.contextMenu = rightClickMenu;
this.qualityToHigh();
}
public function qualityToHigh(_arg1:Event=null):void{
this.stage.quality = StageQuality.HIGH;
this.highQuality.caption = this.removeQualityIndicator(this.highQuality.caption);
this.mediumQuality.caption = this.removeQualityIndicator(this.mediumQuality.caption);
this.lowQuality.caption = this.removeQualityIndicator(this.lowQuality.caption);
this.highQuality.caption = (this.highQuality.caption + this.qualityIndicator);
this.dispatchEvent(new ApplicationEvent(ApplicationEvent.QUALITY_CHANGE));
}
public function qualityToMedium(_arg1:Event=null):void{
this.stage.quality = StageQuality.MEDIUM;
this.highQuality.caption = this.removeQualityIndicator(this.highQuality.caption);
this.mediumQuality.caption = this.removeQualityIndicator(this.mediumQuality.caption);
this.lowQuality.caption = this.removeQualityIndicator(this.lowQuality.caption);
this.mediumQuality.caption = (this.mediumQuality.caption + this.qualityIndicator);
this.dispatchEvent(new ApplicationEvent(ApplicationEvent.QUALITY_CHANGE));
}
}
}//package sfb.application
Section 27
//Game (sfb.application.Game)
package sfb.application {
public class Game extends Application {
protected var flashkeys:Array;
public var currentGame:uint;
protected var SU0249s:Array;
public var score:Number;
public static var game:Game;
public function Game(){
Game.game = this;
}
public function get SU0249():String{
return (this.SU0249s[this.currentGame]);
}
public function get flashkey():String{
return (this.flashkeys[this.currentGame]);
}
}
}//package sfb.application
Section 28
//MusicManager (sfb.audio.MusicManager)
package sfb.audio {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class MusicManager {
private var setVolume:Number;
private var musicChannel:SoundChannel;
private var isMuted:Boolean;
private var oldMusicChannel:SoundChannel;
private var fadeTimer:Timer;
private var volSpeed:Number;
private var oldVolSpeed:Number;
private var music_array:Array;
private static var INSTANCE:MusicManager;
public function MusicManager(){
this.music_array = [];
this.fadeTimer = new Timer(20);
this.fadeTimer.addEventListener(TimerEvent.TIMER, this.fadeInOut);
this.setVolume = 1;
}
public function stopMusic():void{
this.fadeTimer.stop();
if (this.oldMusicChannel){
this.oldMusicChannel.stop();
this.oldMusicChannel = null;
};
if (this.musicChannel){
this.musicChannel.stop();
this.musicChannel = null;
};
}
public function addMusic(_arg1:Class, _arg2:String):void{
this.music_array[_arg2] = new (_arg1);
}
private function fadeInOut(_arg1:TimerEvent):void{
var _local2:SoundTransform;
var _local3:SoundTransform;
if (this.oldMusicChannel){
_local2 = this.oldMusicChannel.soundTransform;
_local2.volume = (_local2.volume - oldVolSpeed);
this.oldMusicChannel.soundTransform = _local2;
if (_local2.volume < 0.05){
this.oldMusicChannel.stop();
};
};
if (this.musicChannel){
_local3 = this.musicChannel.soundTransform;
_local3.volume = (_local3.volume + volSpeed);
this.musicChannel.soundTransform = _local3;
};
}
public function playMusic(_arg1:String, _arg2:int=40000000, _arg3:Number=1, _arg4:Number=0, _arg5:int=0):void{
var _local6:Number;
if (this.music_array[_arg1]){
this.setVolume = _arg3;
_local6 = _arg3;
if (this.oldMusicChannel){
this.oldMusicChannel.stop();
};
if (_arg5 != 0){
if (this.musicChannel){
this.oldMusicChannel = this.musicChannel;
this.oldVolSpeed = (this.oldMusicChannel.soundTransform.volume / (_arg5 / 20));
};
this.volSpeed = (_arg3 / (_arg5 / 20));
_local6 = 0;
this.fadeTimer.repeatCount = Math.round((_arg5 / 20));
this.fadeTimer.reset();
this.fadeTimer.start();
} else {
if (this.musicChannel){
this.musicChannel.stop();
};
};
this.musicChannel = Sound(this.music_array[_arg1]).play(0, _arg2, new SoundTransform(_local6, _arg4));
};
}
public function mute():void{
var _local1:SoundTransform;
var _local2:SoundTransform;
this.fadeTimer.stop();
this.isMuted = true;
if (this.oldMusicChannel){
_local1 = this.oldMusicChannel.soundTransform;
_local1.volume = 0;
this.oldMusicChannel.soundTransform = _local1;
};
if (this.musicChannel){
_local2 = this.musicChannel.soundTransform;
_local2.volume = 0;
this.musicChannel.soundTransform = _local2;
};
}
public function get muted():Boolean{
return (this.isMuted);
}
public function unmute():void{
var _local1:SoundTransform;
this.isMuted = false;
if (this.musicChannel){
_local1 = this.musicChannel.soundTransform;
_local1.volume = this.setVolume;
this.musicChannel.soundTransform = _local1;
};
}
public static function getInstance():MusicManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (MusicManager);
return (INSTANCE);
}
}
}//package sfb.audio
Section 29
//SFXManager (sfb.audio.SFXManager)
package sfb.audio {
import flash.events.*;
import flash.media.*;
public class SFXManager {
private var sfxChannel_array:Array;
private var sfx_array:Array;
private static var INSTANCE:SFXManager;
public function SFXManager(){
this.sfx_array = [];
this.sfxChannel_array = [];
}
public function stopSFX(_arg1:String):void{
if (this.sfxChannel_array[_arg1]){
SoundChannel(this.sfxChannel_array[_arg1]).stop();
this.sfxChannel_array[_arg1] = null;
};
}
public function addSFX(_arg1:Class, _arg2:String):void{
this.sfx_array[_arg2] = new (_arg1);
}
public function stopAllSFX():void{
var _local1:String;
for (_local1 in this.sfxChannel_array) {
if (this.sfxChannel_array[_local1]){
this.stopSFX(_local1);
};
};
}
private function completeListener(_arg1:Event):void{
var _local2:String;
for (_local2 in this.sfxChannel_array) {
if (this.sfxChannel_array[_local2] == _arg1.target){
this.stopSFX(_local2);
};
};
}
public function playSFX(_arg1:String, _arg2:int=0, _arg3:Number=1, _arg4:Number=0, _arg5:Boolean=false):void{
if (((this.sfx_array[_arg1]) && (((!(_arg5)) || (!(this.sfxChannel_array[_arg1])))))){
this.sfxChannel_array[_arg1] = Sound(this.sfx_array[_arg1]).play(0, _arg2, new SoundTransform(_arg3, _arg4));
this.sfxChannel_array[_arg1].addEventListener(Event.SOUND_COMPLETE, this.completeListener);
};
}
public function isSFXPlaying(_arg1:String):Boolean{
if (this.sfxChannel_array[_arg1]){
return (true);
};
return (false);
}
public static function getInstance():SFXManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (SFXManager);
return (INSTANCE);
}
}
}//package sfb.audio
Section 30
//ApplicationEvent (sfb.events.ApplicationEvent)
package sfb.events {
import flash.events.*;
public class ApplicationEvent extends Event {
public static const QUALITY_CHANGE:String = "appQualityChange";
public function ApplicationEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package sfb.events
Section 31
//Environment (sfb.game.common.Environment)
package sfb.game.common {
import sfb.maths.physics.*;
import sfb.maths.shapes.*;
import sfb.maths.*;
import sfb.maths.physics.forces.*;
public class Environment {
protected var airResistanceForce:FluidResistanceForce;
protected var frictionForce:FluidResistanceForce;
public var terrain:Array;
protected var gravityForce:VectorForce;
public function Environment(){
this.gravityForce = new VectorForce(new Mass(), new Vector(0, 1));
this.frictionForce = new FluidResistanceForce(new Mass(), 0.1);
this.airResistanceForce = new FluidResistanceForce(new Mass(), 0.1);
}
public function applyGravity(_arg1:Mass):void{
}
public function applyAirResistance(_arg1:Mass):void{
}
public function set airResistance(_arg1:Number):void{
this.airResistanceForce.resistanceRatio = _arg1;
}
public function set friction(_arg1:Number):void{
this.frictionForce.resistanceRatio = _arg1;
}
public function hitTestTerrain(_arg1:IShapeable, _arg2:Mass):Boolean{
return (false);
}
public function applyTerrainFriction(_arg1:Mass):void{
}
public function set gravity(_arg1:Number):void{
this.gravityForce.force = this.gravityForce.force.normalised(_arg1);
}
}
}//package sfb.game.common
Section 32
//Resource (sfb.game.common.Resource)
package sfb.game.common {
import flash.events.*;
public class Resource extends EventDispatcher {
protected var maximum_int:int;// = 100
protected var value_int:int;// = 50
protected var minimum_int:int;// = 0
public static const INCREASE:String = "resourceIncrease";
public static const RUN_OUT:String = "resourceRunOut";
public static const FULL_UP:String = "resourceFullUp";
public static const DECREASE:String = "resourceDecrease";
public function Resource(_arg1:int=100, _arg2:int=0, _arg3:int=0){
value_int = 50;
maximum_int = 100;
minimum_int = 0;
super();
this.maximum_int = _arg1;
this.minimum_int = _arg2;
this.value = _arg3;
}
protected function onIncrease():void{
this.dispatchEvent(new Event(Resource.INCREASE));
}
protected function onFullUp():void{
this.dispatchEvent(new Event(Resource.FULL_UP));
}
public function set maximum(_arg1:int):void{
if (_arg1 > this.minimum_int){
this.maximum_int = _arg1;
this.value = this.value_int;
};
}
protected function onRunOut():void{
this.dispatchEvent(new Event(Resource.RUN_OUT));
}
public function set minimum(_arg1:int):void{
if (_arg1 < this.maximum_int){
this.minimum_int = _arg1;
this.value = this.value_int;
};
}
public function get minimum():int{
return (this.minimum_int);
}
public function set value(_arg1:int):void{
var _local2:int;
var _local3:int;
_local2 = this.value_int;
_local3 = (this.value_int - _local2);
if (_arg1 <= this.minimum_int){
this.value_int = this.minimum_int;
this.onDecrease();
this.onRunOut();
} else {
if (_arg1 >= this.maximum_int){
this.value_int = this.maximum_int;
this.onIncrease();
this.onFullUp();
} else {
this.value_int = _arg1;
if (_local3 > 0){
this.onIncrease();
} else {
if (_local3 < 0){
this.onDecrease();
};
};
};
};
}
protected function onDecrease():void{
this.dispatchEvent(new Event(Resource.DECREASE));
}
public function get maximum():int{
return (this.maximum_int);
}
public function get value():int{
return (this.value_int);
}
}
}//package sfb.game.common
Section 33
//FrameStateDisplay (sfb.game.graphics.FrameStateDisplay)
package sfb.game.graphics {
import flash.display.*;
public class FrameStateDisplay implements IStateDisplayable {
private var frameLabels:Array;
private var target:MovieClip;
private var state:String;
public function FrameStateDisplay(_arg1:MovieClip){
this.setTarget(_arg1);
}
public function applyState():void{
if (this.target.currentLabel != this.state){
if (this.frameLabels.indexOf(this.state) != -1){
this.target.gotoAndStop(this.state);
};
};
}
public function setTarget(_arg1:DisplayObject):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
this.target = (_arg1 as MovieClip);
this.frameLabels = [];
_local2 = this.target.currentLabels;
_local3 = 0;
_local4 = _local2.length;
while (_local3 < _local4) {
this.frameLabels[_local3] = FrameLabel(_local2[_local3]).name;
_local3++;
};
}
public function setState(_arg1:String):void{
this.state = _arg1;
}
}
}//package sfb.game.graphics
Section 34
//IStateDisplayable (sfb.game.graphics.IStateDisplayable)
package sfb.game.graphics {
import flash.display.*;
public interface IStateDisplayable {
function applyState():void;
function setTarget(_arg1:DisplayObject):void;
function setState(_arg1:String):void;
}
}//package sfb.game.graphics
Section 35
//PlatformEnvironment (sfb.game.platformer.PlatformEnvironment)
package sfb.game.platformer {
import sfb.maths.physics.*;
import sfb.maths.shapes.*;
import sfb.maths.*;
import sfb.game.common.*;
public class PlatformEnvironment extends Environment {
override public function applyGravity(_arg1:Mass):void{
this.gravityForce.mass = _arg1;
this.gravityForce.applyForce();
}
override public function applyAirResistance(_arg1:Mass):void{
this.airResistanceForce.mass = _arg1;
this.airResistanceForce.applyForce();
}
override public function hitTestTerrain(_arg1:IShapeable, _arg2:Mass):Boolean{
var _local3:Boolean;
var _local4:uint;
var _local5:uint;
var _local6:Vector;
if (this.terrain){
_local3 = false;
_local4 = 0;
_local5 = this.terrain.length;
while (_local4 < _local5) {
if (_arg1.shapeIntersects(this.terrain[_local4])){
_local6 = _arg1.pushOutOfShape(this.terrain[_local4], 0.1, Vector.UP);
_arg2.position.moveBy(_local6);
if (_local6.x != 0){
_arg2.velocity.x = 0;
};
if (_local6.y != 0){
_arg2.velocity.y = 0;
};
_local3 = (_local6.y < 0);
};
_local4++;
};
return (_local3);
};
return (false);
}
override public function applyTerrainFriction(_arg1:Mass):void{
this.frictionForce.mass = _arg1;
this.frictionForce.applyForce();
}
}
}//package sfb.game.platformer
Section 36
//PlatformPlayer (sfb.game.platformer.PlatformPlayer)
package sfb.game.platformer {
import flash.display.*;
import sfb.game.systems.*;
import sfb.maths.physics.*;
import sfb.maths.shapes.*;
import sfb.maths.*;
import flash.events.*;
import sfb.game.common.*;
import sfb.game.graphics.*;
public class PlatformPlayer extends MovieClip {
protected var environment:EnvironmentManager;
protected var fallLimit:int;
protected var fallCount:int;
protected var health:Resource;
protected var tickID:uint;
protected var acceleration:Number;
protected var state:String;
protected var initWidth:Number;
protected var hitTestResult:Boolean;
protected var isEnabled:Boolean;
protected var jumpSpeed:Number;
protected var speedLimit:SpeedLimit;
protected var controls:ControlsManager;
public var modelMass:Mass;
protected var hitShape:IShapeable;
protected var initScaleX:Number;
protected var stateDisplay:IStateDisplayable;
protected var game:GameManager;
public static const RIGHT:String = "moveRight";
public static const LEFT:String = "moveLeft";
public static const STILL:String = "still";
public static const FALLING:String = "falling";
public static const JUMP:String = "jump";
public static const JUMPING:String = "jumping";
public static const ON_GROUND:String = "onGround";
public static const RUNNING:String = "running";
public function PlatformPlayer(){
this.addEventListener(Event.REMOVED_FROM_STAGE, this.cleanupListener);
this.initScaleX = this.scaleX;
this.initWidth = this.width;
this.controls = ControlsManager.getInstance();
this.setControls();
this.environment = EnvironmentManager.getInstance();
this.game = GameManager.getInstance();
this.tickID = this.game.addTickFunction(this.act);
this.health = new Resource();
this.modelMass = new Mass();
this.modelMass.position.setFromDO(this);
this.hitShape = new MultiplePointShape([new Vector(this.x, (this.y - this.height))], [new Vector((this.x - (this.width / 3)), this.y), new Vector((this.x + (this.width / 3)), this.y)], [new Vector((this.x - (this.width / 2)), (this.y - (this.height / 2)))], [new Vector((this.x + (this.width / 2)), (this.y - (this.height / 2)))]);
this.stateDisplay = new FrameStateDisplay(this);
this.setMovement();
this.hitTestResult = false;
this.fallCount = 0;
this.fallLimit = 3;
this.state = FALLING;
this.isEnabled = true;
}
protected function setMovement():void{
this.acceleration = 0.5;
this.jumpSpeed = -8;
this.speedLimit = new SpeedLimit(8);
}
protected function setControls():void{
this.controls.registerKey("LEFT", LEFT);
this.controls.registerKey("RIGHT", RIGHT);
this.controls.registerKey("UP", JUMP);
}
protected function graphicalState():void{
switch (this.state){
case ON_GROUND:
if (this.modelMass.velocity.length > 1){
this.stateDisplay.setState(RUNNING);
} else {
this.stateDisplay.setState(STILL);
};
break;
case JUMPING:
this.stateDisplay.setState(JUMPING);
break;
case FALLING:
this.stateDisplay.setState(FALLING);
break;
};
this.stateDisplay.applyState();
if (this.modelMass.velocity.x > 0){
this.scaleX = this.initScaleX;
} else {
if (this.modelMass.velocity.x < 0){
this.scaleX = -(this.initScaleX);
};
};
}
protected function adjustShape():void{
var _local1:Vector;
_local1 = new Vector((this.x - (this.initWidth / 3)), this.y);
this.hitShape.moveBy(_local1.subtract(MultiplePointShape(this.hitShape).getBottomVector(0)));
}
protected function mainDecisions():void{
var _local1:Object;
_local1 = this.controls.getKeys();
if (_local1[LEFT]){
this.modelMass.velocity.x = (this.modelMass.velocity.x - this.acceleration);
};
if (_local1[RIGHT]){
this.modelMass.velocity.x = (this.modelMass.velocity.x + this.acceleration);
};
switch (this.state){
case ON_GROUND:
this.environment.applyTerrainFriction(this.modelMass);
if (_local1[JUMP]){
this.fallCount = 0;
this.state = JUMPING;
this.modelMass.velocity.y = this.jumpSpeed;
} else {
if (!this.hitTestResult){
this.fallCount++;
if (this.fallCount > this.fallLimit){
this.state = FALLING;
};
} else {
this.fallCount = 0;
};
};
break;
case JUMPING:
if (this.hitTestResult){
this.fallCount = 0;
this.state = ON_GROUND;
};
this.environment.applyAirResistance(this.modelMass);
break;
case FALLING:
if (this.hitTestResult){
this.fallCount = 0;
this.state = ON_GROUND;
};
this.environment.applyAirResistance(this.modelMass);
break;
};
}
protected function cleanupListener(_arg1:Event):void{
this.controls = null;
this.environment = null;
this.game = null;
this.health = null;
this.modelMass = null;
this.hitShape = null;
this.stateDisplay = null;
}
public function act():void{
var _local1:Vector;
if (this.isEnabled){
this.environment.applyGravity(this.modelMass);
this.mainDecisions();
this.graphicalState();
this.speedLimit.applyLimit(this.modelMass);
this.modelMass.position = this.modelMass.position.add(this.modelMass.velocity);
_local1 = new Vector(this.x, this.y);
_local1 = this.modelMass.position.subtract(_local1);
this.x = this.modelMass.position.x;
this.y = this.modelMass.position.y;
this.hitShape.moveBy(_local1);
this.hitTestResult = this.environment.hitTestTerrain(this.hitShape, this.modelMass);
this.x = this.modelMass.position.x;
this.y = this.modelMass.position.y;
this.adjustShape();
};
}
}
}//package sfb.game.platformer
Section 37
//AbstractTimer (sfb.game.systems.timers.AbstractTimer)
package sfb.game.systems.timers {
import flash.display.*;
import sfb.game.systems.*;
import flash.events.*;
import flash.utils.*;
public class AbstractTimer extends MovieClip {
protected var maxTime_int:uint;
protected var currentTime_int:int;
protected var lastTime_int:uint;
protected var tickID:uint;
protected var flashTime_int:uint;
public static const TIME_UP:String = "displayTimerTimeUp";
public function AbstractTimer(_arg1:uint){
this.maxTime_int = _arg1;
this.currentTime_int = 0;
this.flashTime_int = 0;
this.lastTime_int = getTimer();
}
public function get remainingTime():uint{
return ((this.maxTime_int - this.currentTime_int));
}
public function count():void{
var _local1:uint;
_local1 = getTimer();
this.currentTime_int = (this.currentTime_int + (_local1 - lastTime_int));
this.lastTime_int = _local1;
if (this.currentTime_int >= this.maxTime_int){
this.currentTime_int = this.maxTime_int;
this.pause();
this.dispatchEvent(new Event(TIME_UP));
};
}
public function start():void{
if (this.tickID == 0){
this.tickID = GameManager.getInstance().addTickFunction(this.count);
};
}
public function reset():void{
this.pause();
this.currentTime_int = 0;
}
public function get currentTime():uint{
return (this.currentTime_int);
}
public function pause():void{
GameManager.getInstance().removeTickFunction(this.tickID);
this.tickID = 0;
}
}
}//package sfb.game.systems.timers
Section 38
//TextTimer (sfb.game.systems.timers.TextTimer)
package sfb.game.systems.timers {
import flash.text.*;
import sfb.tools.*;
public class TextTimer extends AbstractTimer {
public var countDown:Boolean;
public var textField:TextField;
public static const TIME_UP:String = "displayTimerTimeUp";
public function TextTimer(_arg1:uint, _arg2:TextField=null){
super(_arg1);
this.textField = ((_arg2) || (new TextField()));
if (this.textField.parent){
this.textField.parent.addChildAt(this, this.textField.parent.getChildIndex(this.textField));
this.x = this.textField.x;
this.y = this.textField.y;
this.textField.x = (this.textField.y = 0);
};
this.addChild(this.textField);
}
override public function count():void{
super.count();
if (this.countDown){
this.textField.text = TimeConversion.milliToMinsSecs((this.maxTime_int - this.currentTime));
} else {
this.textField.text = TimeConversion.milliToMinsSecs(this.currentTime);
};
}
}
}//package sfb.game.systems.timers
Section 39
//Camera (sfb.game.systems.Camera)
package sfb.game.systems {
import flash.display.*;
import flash.geom.*;
public class Camera {
public var elasticity:Number;
public var container:DisplayObject;
public var boundBox:Rectangle;
public var target:DisplayObject;
private var tickID:uint;
public var lowerLimits:Point;
public var upperLimits:Point;
public function Camera(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Rectangle=null, _arg4:Number=0){
this.target = _arg1;
this.container = _arg2;
this.boundBox = ((_arg3) || (new Rectangle(275, 200, 1, 1)));
this.elasticity = _arg4;
this.lowerLimits = new Point(Number.NaN, Number.NaN);
this.upperLimits = new Point(Number.NaN, Number.NaN);
}
public function cleanup():void{
this.target = null;
this.container = null;
}
protected function adjustX(_arg1:Number, _arg2:int):void{
if (_arg1 > 0){
this.container.x = (this.container.x - ((_arg2 * _arg1) * (1 - elasticity)));
};
if (((!(isNaN(this.lowerLimits.x))) && ((this.container.x < this.lowerLimits.x)))){
this.container.x = this.lowerLimits.x;
};
if (((!(isNaN(this.upperLimits.x))) && ((this.container.x > this.upperLimits.x)))){
this.container.x = this.upperLimits.x;
};
}
protected function adjustY(_arg1:Number, _arg2:int):void{
if (_arg1 > 0){
this.container.y = (this.container.y - ((_arg2 * _arg1) * (1 - elasticity)));
};
if (((!(isNaN(this.lowerLimits.y))) && ((this.container.y < this.lowerLimits.y)))){
this.container.y = this.lowerLimits.y;
};
if (((!(isNaN(this.upperLimits.y))) && ((this.container.y > this.upperLimits.y)))){
this.container.y = this.upperLimits.y;
};
}
public function stopFollowing():void{
GameManager.getInstance().removeTickFunction(this.tickID);
}
public function startFollowing():void{
this.stopFollowing();
this.tickID = GameManager.getInstance().addTickFunction(this.follow, 1);
}
public function follow():void{
var _local1:Rectangle;
if (target.stage){
_local1 = target.getBounds(target.stage);
this.adjustX((this.boundBox.left - _local1.left), -1);
this.adjustX((_local1.right - this.boundBox.right), 1);
this.adjustY((this.boundBox.top - _local1.top), -1);
this.adjustY((_local1.bottom - this.boundBox.bottom), 1);
};
}
}
}//package sfb.game.systems
Section 40
//ControlsManager (sfb.game.systems.ControlsManager)
package sfb.game.systems {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class ControlsManager extends EventDispatcher {
private var regKeyPress:Array;
private var keyDown:Array;
private var regKeys:Array;
private static const KEY_CODES:Object = {Q:81, W:87, E:69, R:82, T:84, Y:89, U:85, I:73, O:79, P:80, A:65, S:83, D:68, F:70, G:71, H:72, J:74, K:75, L:76, Z:90, X:88, C:67, V:86, B:66, N:78, M:77};
public static const DEFAULT_USER:String = "defaultUser";
private static var INSTANCE:ControlsManager;
public function ControlsManager(){
this.keyDown = [];
this.regKeys = [];
this.regKeyPress = [];
}
public function init(_arg1:Stage){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDownListener);
_arg1.addEventListener(KeyboardEvent.KEY_UP, this.keyUpListener);
}
public function registerKeyPress(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
var _local4:int;
_local4 = ((Keyboard[_arg1.toUpperCase()]) || (ControlsManager.KEY_CODES[_arg1.toUpperCase()]));
this.regKeyPress.push(new KeyPress(_local4, _arg2, _arg3));
}
public function getKeys(_arg1:String="defaultUser"):Object{
var _local2:Object;
var _local3:String;
if (this.regKeys[_arg1]){
_local2 = {};
for (_local3 in this.regKeys[_arg1]) {
_local2[_local3] = Boolean(this.keyDown[this.regKeys[_arg1][_local3]]);
};
return (_local2);
//unresolved jump
};
return (null);
}
private function keyUpListener(_arg1:KeyboardEvent):void{
delete this.keyDown[_arg1.keyCode];
}
private function keyDownListener(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:uint;
_local2 = 0;
_local3 = this.regKeyPress.length;
while (_local2 < _local3) {
if (_arg1.keyCode == this.regKeyPress[_local2].key){
if (((!(this.keyDown[_arg1.keyCode])) || (this.regKeyPress[_local2].holdRepeat))){
this.regKeyPress[_local2].listener(_arg1);
};
break;
};
_local2++;
};
this.keyDown[_arg1.keyCode] = true;
}
public function registerKey(_arg1:String, _arg2:String, _arg3:String="defaultUser"):void{
var _local4:int;
if (!this.regKeys[_arg3]){
this.regKeys[_arg3] = [];
};
_local4 = ((Keyboard[_arg1.toUpperCase()]) || (ControlsManager.KEY_CODES[_arg1.toUpperCase()]));
this.regKeys[_arg3][_arg2] = _local4;
}
public static function getInstance():ControlsManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (ControlsManager);
return (INSTANCE);
}
}
}//package sfb.game.systems
class KeyPress {
public var listener:Function;
public var holdRepeat:Boolean;
public var key:int;
private function KeyPress(_arg1:int, _arg2:Function, _arg3:Boolean){
this.key = _arg1;
this.listener = _arg2;
this.holdRepeat = _arg3;
}
}
Section 41
//DisplayManager (sfb.game.systems.DisplayManager)
package sfb.game.systems {
import flash.display.*;
import flash.geom.*;
import sfb.maths.*;
import sfb.tools.*;
public class DisplayManager {
private var displayList:Array;
private var stageArea_rec:Rectangle;
private var intervalCount:uint;
private var maxSpeed_vec:Vector;
private var workingArea_rec:Rectangle;
private var interval_int:uint;
private var tickID:uint;
private var stage:Stage;
private static var INSTANCE:DisplayManager;
public function DisplayManager(){
this.displayList = [];
this.maxSpeed_vec = new Vector();
this.stageArea_rec = new Rectangle();
this.workingArea_rec = new Rectangle();
this.interval_int = 1;
this.intervalCount = 0;
}
public function set maxSpeed(_arg1:Vector):void{
this.maxSpeed_vec = _arg1;
this.workingArea_rec = this.stageArea_rec.clone();
this.workingArea_rec.inflatePoint(maxSpeed_vec.multiply(interval_int).toPoint());
}
public function addSet(_arg1:Array, _arg2:Boolean=false):void{
this.displayList.push(new DisplayObjectSet(_arg1, _arg2));
if (!this.stage){
this.stage = _arg1[0].stage;
this.stageArea = new Rectangle(0, 0, this.stage.stageWidth, this.stage.stageHeight);
};
}
public function empty():void{
Cleanup.cleanArray(this.displayList);
this.interval_int = 1;
this.intervalCount = 0;
}
public function set interval(_arg1:uint):void{
this.interval_int = _arg1;
this.intervalCount = 0;
this.workingArea_rec = this.stageArea_rec.clone();
this.workingArea_rec.inflatePoint(maxSpeed_vec.multiply(interval_int).toPoint());
}
public function render():void{
var _local1:Rectangle;
var _local2:Boolean;
var _local3:DisplayObject;
var _local4:DisplayObjectSet;
for each (_local4 in this.displayList) {
_local1 = new Rectangle();
for each (_local3 in _local4.displayObjects) {
_local1 = _local1.union(_local3.getBounds(this.stage));
};
_local2 = _local1.intersects(this.workingArea_rec);
for each (_local3 in _local4.displayObjects) {
_local3.visible = _local2;
if (((_local4.isStopPlay) && ((_local3 is MovieClip)))){
if (_local2){
MovieClip(_local3).play();
} else {
MovieClip(_local3).stop();
};
};
};
};
}
public function startRendering():void{
this.stopRendering();
this.tickID = GameManager.getInstance().addTickFunction(this.render, 1);
}
public function set stageArea(_arg1:Rectangle):void{
this.stageArea_rec = _arg1;
this.workingArea_rec = this.stageArea_rec.clone();
this.workingArea_rec.inflatePoint(maxSpeed_vec.multiply(interval_int).toPoint());
}
public function stopRendering():void{
GameManager.getInstance().removeTickFunction(this.tickID);
}
public static function getInstance():DisplayManager{
if (INSTANCE){
return (INSTANCE);
};
return ((INSTANCE = new (DisplayManager)));
}
}
}//package sfb.game.systems
class DisplayObjectSet {
public var isStopPlay:Boolean;
public var displayObjects:Array;
private function DisplayObjectSet(_arg1:Array, _arg2:Boolean){
this.displayObjects = _arg1;
this.isStopPlay = _arg2;
}
}
Section 42
//EnvironmentManager (sfb.game.systems.EnvironmentManager)
package sfb.game.systems {
import sfb.maths.physics.*;
import sfb.maths.shapes.*;
import sfb.game.common.*;
import sfb.tools.*;
public class EnvironmentManager {
public var environment:Environment;
private static var INSTANCE:EnvironmentManager;
public function applyGravity(_arg1:Mass):void{
this.environment.applyGravity(_arg1);
}
public function cleanup():void{
Cleanup.cleanArray(this.environment.terrain);
}
public function applyTerrainFriction(_arg1:Mass):void{
this.environment.applyTerrainFriction(_arg1);
}
public function set terrain(_arg1:Array):void{
this.environment.terrain = _arg1;
}
public function set airResistance(_arg1:Number):void{
this.environment.airResistance = _arg1;
}
public function hitTestTerrain(_arg1:IShapeable, _arg2:Mass):Boolean{
return (this.environment.hitTestTerrain(_arg1, _arg2));
}
public function set friction(_arg1:Number):void{
this.environment.friction = _arg1;
}
public function applyAirResistance(_arg1:Mass):void{
this.environment.applyAirResistance(_arg1);
}
public function set gravity(_arg1:Number):void{
this.environment.gravity = _arg1;
}
public static function getInstance():EnvironmentManager{
if (INSTANCE){
return (INSTANCE);
};
return ((INSTANCE = new (EnvironmentManager)));
}
}
}//package sfb.game.systems
Section 43
//GameManager (sfb.game.systems.GameManager)
package sfb.game.systems {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import sfb.tools.*;
public class GameManager extends EventDispatcher {
private var stage:Stage;
private var tickTime:uint;
private var tickTimer:AccurateTimer;
private var tickFunctionsNum:uint;
private var tickFunctionsCount:uint;
private var tickFunctions:Array;
public static const END:String = "endGame";
public static const PAUSE:String = "pauseGame";
public static const UNPAUSE:String = "unpauseGame";
private static var INSTANCE:GameManager;
public function GameManager(){
this.tickFunctions = [];
this.tickFunctionsNum = 0;
this.tickFunctionsCount = 0;
}
public function stop():void{
if (this.tickTimer){
this.tickTimer.stop();
this.tickTimer.removeEventListener(TimerEvent.TIMER, this.timerTick);
this.tickTimer = null;
};
if (this.stage){
this.stage.removeEventListener(Event.ENTER_FRAME, this.frameTick);
this.stage = null;
};
}
private function timerTick(_arg1:TimerEvent):void{
this.tickTime = getTimer();
this.callTickFunctions();
_arg1.updateAfterEvent();
}
public function startTimer(_arg1:uint=40):void{
this.stop();
this.tickTimer = new AccurateTimer(_arg1);
this.tickTimer.addEventListener(TimerEvent.TIMER, this.timerTick);
this.tickTimer.start();
}
public function addTickFunction(_arg1:Function, _arg2:int=0):uint{
var _local3:uint;
var _local4:uint;
this.tickFunctionsNum++;
_local3 = this.tickFunctions.push(new TickFunction(_arg1, _arg2));
_local4 = this.tickFunctions[(_local3 - 1)].id;
this.tickFunctions.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
return (_local4);
}
private function callTickFunctions():void{
this.tickFunctionsCount = 0;
while (this.tickFunctionsCount < this.tickFunctionsNum) {
this.tickFunctions[this.tickFunctionsCount].tickFunction();
this.tickFunctionsCount++;
};
}
public function set delay(_arg1:uint):void{
if (this.tickTimer){
this.tickTimer.delay = _arg1;
};
}
private function frameTick(_arg1:Event):void{
this.tickTime = getTimer();
this.callTickFunctions();
}
public function startFrame(_arg1:Stage):void{
this.stop();
this.stage = _arg1;
this.stage.addEventListener(Event.ENTER_FRAME, this.frameTick);
}
override public function toString():String{
return (("[GameManager] - " + this.tickFunctions.toString()));
}
public function endGame():void{
this.dispatchEvent(new Event(GameManager.END));
}
public function pause():void{
if (this.tickTimer){
this.tickTimer.stop();
} else {
if (this.stage){
this.stage.removeEventListener(Event.ENTER_FRAME, this.frameTick);
};
};
this.dispatchEvent(new Event(GameManager.PAUSE));
}
public function removeTickFunction(_arg1:uint):void{
var _local2:uint;
_local2 = 0;
while (_local2 < tickFunctionsNum) {
if (this.tickFunctions[_local2].id == _arg1){
this.tickFunctions.splice(_local2, 1);
this.tickFunctionsNum = (this.tickFunctionsNum - 1);
this.tickFunctionsCount = (this.tickFunctionsCount - 1);
return;
};
_local2++;
};
}
public function unpause():void{
if (this.tickTimer){
this.tickTimer.start();
} else {
if (this.stage){
this.stage.addEventListener(Event.ENTER_FRAME, this.frameTick);
};
};
}
public static function getInstance():GameManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (GameManager);
return (INSTANCE);
}
}
}//package sfb.game.systems
class TickFunction {
public var priority:int;
public var tickFunction:Function;
public var id:uint;
private static var idCount:uint = 1;
private function TickFunction(_arg1:Function, _arg2:int=0){
this.tickFunction = _arg1;
this.priority = _arg2;
this.id = idCount++;
}
public function toString():String{
return (((("TickFunction, priority " + this.priority) + ", ID ") + this.id));
}
}
Section 44
//ScalingRepeatingTexture (sfb.graphics.ScalingRepeatingTexture)
package sfb.graphics {
import flash.display.*;
import flash.geom.*;
public class ScalingRepeatingTexture extends Sprite {
protected var currentY:Number;
protected var repeatY:Number;
protected var repeatX:Number;
protected var textureBmp:Bitmap;
protected var screenRect:Rectangle;
protected var flipH:Boolean;
protected var numH:int;
protected var flipV:Boolean;
protected var numV:int;
protected var currentX:Number;
public function ScalingRepeatingTexture(_arg1, _arg2:Rectangle=null, _arg3:Number=undefined, _arg4:Number=undefined, _arg5:Boolean=false, _arg6:Boolean=false){
var _local7:DisplayObject;
var _local8:BitmapData;
var _local9:BitmapData;
var _local10:uint;
var _local11:uint;
var _local12:Matrix;
super();
if ((_arg1 is DisplayObject)){
_local7 = (_arg1 as DisplayObject);
};
if ((_arg1 is BitmapData)){
_local8 = (_arg1 as BitmapData);
};
this.screenRect = ((_arg2) || (new Rectangle(0, 0, 550, 400)));
this.repeatX = ((_arg3) || ((_local7) ? _local7.width : _local8.width));
this.repeatY = ((_arg4) || ((_local7) ? _local7.height : _local8.height));
this.flipH = _arg5;
this.flipV = _arg6;
this.currentX = 0;
this.currentY = 0;
this.numH = (Math.ceil((this.screenRect.width / this.repeatX)) + 1);
this.numV = (Math.ceil((this.screenRect.height / this.repeatY)) + 1);
if (this.flipH){
this.numH = ((Math.ceil((this.numH / 2)) + 1) * 2);
};
if (this.flipV){
this.numV = ((Math.ceil((this.numV / 2)) + 1) * 2);
};
_local9 = new BitmapData((this.numH * this.repeatX), (this.numV * this.repeatY), true, 0);
this.textureBmp = new Bitmap(_local9);
this.addChild(this.textureBmp);
_local10 = 0;
while (_local10 < numH) {
_local11 = 0;
while (_local11 < numV) {
_local12 = new Matrix();
_local12.translate((_local10 * this.repeatX), (_local11 * this.repeatY));
if (((this.flipH) && (((_local10 % 2) == 0)))){
_local12.scale(-1, 1);
_local12.tx = (_local12.tx - this.repeatX);
};
if (((this.flipV) && (((_local11 % 2) == 0)))){
_local12.scale(1, -1);
_local12.ty = (_local12.ty - this.repeatY);
};
_local12.tx = Math.abs(_local12.tx);
_local12.ty = Math.abs(_local12.ty);
_local9.draw(((_local7) || (_local8)), _local12);
_local11++;
};
_local10++;
};
if (this.flipH){
this.repeatX = (this.repeatX * 2);
};
if (this.flipV){
this.repeatY = (this.repeatY * 2);
};
}
override public function get x():Number{
return (this.currentX);
}
override public function get y():Number{
return (this.currentY);
}
public function cleanup():void{
this.textureBmp.bitmapData.dispose();
if (this.textureBmp.parent){
this.textureBmp.parent.removeChild(this.textureBmp);
};
}
override public function set x(_arg1:Number):void{
textureBmp.x = (textureBmp.x + ((_arg1 - this.currentX) / this.scaleX));
this.currentX = _arg1;
while (this.textureBmp.x > (-(this.screenRect.width) / 2)) {
this.textureBmp.x = (this.textureBmp.x - this.repeatX);
};
while (this.textureBmp.x < (-(this.repeatX) - (this.screenRect.width / 2))) {
this.textureBmp.x = (this.textureBmp.x + this.repeatX);
};
}
override public function set y(_arg1:Number):void{
textureBmp.y = (textureBmp.y + ((_arg1 - this.currentY) / this.scaleY));
this.currentY = _arg1;
while (this.textureBmp.y > (-(this.screenRect.height) / 2)) {
this.textureBmp.y = (this.textureBmp.y - this.repeatY);
};
while (this.textureBmp.y < (-(this.repeatY) - (this.screenRect.height / 2))) {
this.textureBmp.y = (this.textureBmp.y + this.repeatY);
};
}
}
}//package sfb.graphics
Section 45
//FluidResistanceForce (sfb.maths.physics.forces.FluidResistanceForce)
package sfb.maths.physics.forces {
import sfb.maths.physics.*;
import sfb.maths.*;
public class FluidResistanceForce implements IForcable {
public var resistanceRatio:Number;
public var mass:Mass;
protected var isEnabled:Boolean;
public function FluidResistanceForce(_arg1:Mass, _arg2:Number=0.05){
this.mass = _arg1;
this.resistanceRatio = _arg2;
this.isEnabled = true;
}
public function get enabled():Boolean{
return (this.isEnabled);
}
public function set enabled(_arg1:Boolean):void{
this.isEnabled = _arg1;
}
public function applyForce():void{
var _local1:Vector;
if (this.isEnabled){
_local1 = this.mass.velocity.multiply(-(this.resistanceRatio));
this.mass.velocity = this.mass.velocity.add(_local1);
};
}
}
}//package sfb.maths.physics.forces
Section 46
//IForcable (sfb.maths.physics.forces.IForcable)
package sfb.maths.physics.forces {
public interface IForcable {
function get enabled():Boolean;
function set enabled(_arg1:Boolean):void;
function applyForce():void;
}
}//package sfb.maths.physics.forces
Section 47
//VectorForce (sfb.maths.physics.forces.VectorForce)
package sfb.maths.physics.forces {
import sfb.maths.physics.*;
import sfb.maths.*;
public class VectorForce implements IForcable {
public var force:Vector;
public var mass:Mass;
protected var isEnabled:Boolean;
public function VectorForce(_arg1:Mass, _arg2:Vector, _arg3:Number=1){
this.mass = _arg1;
this.force = _arg2.normalised(_arg3);
this.isEnabled = true;
}
public function get enabled():Boolean{
return (this.isEnabled);
}
public function set enabled(_arg1:Boolean):void{
this.isEnabled = _arg1;
}
public function applyForce():void{
if (this.isEnabled){
this.mass.velocity = this.mass.velocity.add(this.force);
};
}
}
}//package sfb.maths.physics.forces
Section 48
//Mass (sfb.maths.physics.Mass)
package sfb.maths.physics {
import flash.display.*;
import sfb.maths.*;
public class Mass {
private var velocity_vtr:Vector;
public var mass:Number;
private var centerOfMass_vtr:Vector;
public var elasticity:Number;
public var friction:Number;
private var position_vtr:Vector;
public function Mass(_arg1:Vector=null, _arg2:Vector=null, _arg3:Number=1, _arg4:Number=1, _arg5:Number=1, _arg6:Vector=null){
this.position_vtr = ((_arg1) || (new Vector()));
this.velocity_vtr = ((_arg2) || (new Vector()));
this.mass = _arg3;
this.elasticity = _arg4;
this.friction = _arg5;
this.centerOfMass_vtr = ((_arg6) || (new Vector()));
}
public function set centerOfMass(_arg1:Vector):void{
this.centerOfMass_vtr.setFromVector(_arg1);
}
public function renderToDO(_arg1:DisplayObject):void{
this.render();
this.position_vtr.setToDO(_arg1);
}
public function get position():Vector{
return (this.position_vtr);
}
public function set position(_arg1:Vector):void{
this.position_vtr.setFromVector(_arg1);
}
public function set velocity(_arg1:Vector):void{
this.velocity_vtr.setFromVector(_arg1);
}
public function render():void{
this.position_vtr.moveBy(this.velocity_vtr);
}
public function get centerOfMass():Vector{
return (this.centerOfMass_vtr);
}
public function get velocity():Vector{
return (this.velocity_vtr);
}
}
}//package sfb.maths.physics
Section 49
//SpeedLimit (sfb.maths.physics.SpeedLimit)
package sfb.maths.physics {
public class SpeedLimit {
public var maximum:Number;
public var minimum:Number;
public function SpeedLimit(_arg1:Number, _arg2:Number=0){
this.maximum = _arg1;
this.minimum = _arg2;
}
public function applyLimit(_arg1:Mass):void{
if (_arg1.velocity.length > this.maximum){
_arg1.velocity = _arg1.velocity.normalised(this.maximum);
};
if (_arg1.velocity.length < this.minimum){
_arg1.velocity = _arg1.velocity.normalised(this.minimum);
};
}
}
}//package sfb.maths.physics
Section 50
//DisplayShape (sfb.maths.shapes.DisplayShape)
package sfb.maths.shapes {
import flash.display.*;
import flash.geom.*;
import sfb.maths.*;
public class DisplayShape implements IShapeable {
public var displayObject:DisplayObject;
public function DisplayShape(_arg1:DisplayObject){
this.displayObject = _arg1;
}
public function moveBy(_arg1:Vector):void{
this.displayObject.x = (this.displayObject.x + _arg1.x);
this.displayObject.y = (this.displayObject.y + _arg1.y);
}
public function shapeIntersection(_arg1:IShapeable):Rectangle{
return (new Rectangle());
}
public function pushShapeOut(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
return (new Vector());
}
public function shapeIntersects(_arg1:IShapeable):Boolean{
switch (true){
case (_arg1 is RectangleShape):
if (this.displayObject.parent){
return (this.displayObject.getBounds(this.displayObject.parent).intersects(RectangleShape(_arg1).rectangle));
};
return (false);
case (_arg1 is DisplayShape):
return (this.displayObject.hitTestObject(DisplayShape(_arg1).displayObject));
default:
return (false);
};
}
public function pushVectorOut(_arg1:Vector, _arg2:Number=1, _arg3:Vector=null):Vector{
var _local4:Vector;
var _local5:Vector;
if (this.vectorInside(_arg1)){
if (_arg3){
_local4 = _arg3.normalised(_arg2);
} else {
_local4 = _arg1.subtract(Vector.newFromDisplayObject(this.displayObject)).normalised(_arg2);
};
_local5 = _arg1.clone();
while (this.vectorInside(_local5)) {
_local5 = _local5.add(_local4);
};
return (_local5);
//unresolved jump
};
return (_arg1);
}
public function pushOutOfShape(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
return (new Vector());
}
public function vectorInside(_arg1:Vector):Boolean{
var _local2:Point;
_local2 = this.displayObject.parent.localToGlobal(_arg1.toPoint());
return (this.displayObject.hitTestPoint(_local2.x, _local2.y, true));
}
}
}//package sfb.maths.shapes
Section 51
//FlatShape (sfb.maths.shapes.FlatShape)
package sfb.maths.shapes {
import flash.geom.*;
import sfb.maths.*;
public class FlatShape implements IShapeable {
public var y:Number;
public function FlatShape(_arg1:Number){
this.y = _arg1;
}
public function shapeIntersection(_arg1:IShapeable):Rectangle{
return (new Rectangle());
}
public function pushShapeOut(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
return (new Vector());
}
public function moveBy(_arg1:Vector):void{
y = (y + _arg1.y);
}
public function shapeIntersects(_arg1:IShapeable):Boolean{
return (false);
}
public function pushVectorOut(_arg1:Vector, _arg2:Number=1, _arg3:Vector=null):Vector{
return (new Vector(_arg1.x, this.y));
}
public function pushOutOfShape(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
return (new Vector());
}
public function vectorInside(_arg1:Vector):Boolean{
return ((_arg1.y > this.y));
}
}
}//package sfb.maths.shapes
Section 52
//IShapeable (sfb.maths.shapes.IShapeable)
package sfb.maths.shapes {
import flash.geom.*;
import sfb.maths.*;
public interface IShapeable {
function pushVectorOut(_arg1:Vector, _arg2:Number=1, _arg3:Vector=null):Vector;
function shapeIntersects(_arg1:IShapeable):Boolean;
function moveBy(_arg1:Vector):void;
function shapeIntersection(_arg1:IShapeable):Rectangle;
function pushOutOfShape(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector;
function pushShapeOut(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector;
function vectorInside(_arg1:Vector):Boolean;
}
}//package sfb.maths.shapes
Section 53
//MultiplePointShape (sfb.maths.shapes.MultiplePointShape)
package sfb.maths.shapes {
import flash.geom.*;
import sfb.maths.*;
public class MultiplePointShape implements IShapeable {
private var leftVectors:Array;
private var rightVectors:Array;
private var bottomVectors:Array;
private var topVectors:Array;
public function MultiplePointShape(_arg1:Array=null, _arg2:Array=null, _arg3:Array=null, _arg4:Array=null){
this.bottomVectors = ((_arg2) || ([]));
this.topVectors = ((_arg1) || ([]));
this.leftVectors = ((_arg3) || ([]));
this.rightVectors = ((_arg4) || ([]));
}
public function getTopVector(_arg1:uint):Vector{
return (this.topVectors[_arg1]);
}
public function getBottomVector(_arg1:uint):Vector{
return (this.bottomVectors[_arg1]);
}
public function getRightVector(_arg1:uint):Vector{
return (this.rightVectors[_arg1]);
}
public function pushVectorOut(_arg1:Vector, _arg2:Number=1, _arg3:Vector=null):Vector{
throw (new Error("[MultiplePointShape].pushVectorOut not implemented"));
}
public function pushOutOfShape(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
var _local4:uint;
var _local5:uint;
var _local6:Vector;
var _local7:Vector;
var _local8:Vector;
var _local9:Vector;
var _local10:Vector;
_local6 = Vector.UP.normalised(_arg2);
_local7 = Vector.DOWN.normalised(_arg2);
_local8 = Vector.LEFT.normalised(_arg2);
_local9 = Vector.RIGHT.normalised(_arg2);
_local10 = new Vector();
_local4 = 0;
_local5 = this.topVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.topVectors[_local4])) {
this.moveBy(_local7);
_local10.moveBy(_local7);
};
_local4++;
};
_local4 = 0;
_local5 = this.bottomVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.bottomVectors[_local4])) {
this.moveBy(_local6);
_local10.moveBy(_local6);
};
_local4++;
};
_local4 = 0;
_local5 = this.leftVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.leftVectors[_local4])) {
this.moveBy(_local9);
_local10.moveBy(_local9);
};
_local4++;
};
_local4 = 0;
_local5 = this.rightVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.rightVectors[_local4])) {
this.moveBy(_local8);
_local10.moveBy(_local8);
};
_local4++;
};
return (_local10);
}
public function moveBy(_arg1:Vector):void{
var _local2:String;
for (_local2 in this.topVectors) {
this.topVectors[_local2].moveBy(_arg1);
};
for (_local2 in this.bottomVectors) {
this.bottomVectors[_local2].moveBy(_arg1);
};
for (_local2 in this.leftVectors) {
this.leftVectors[_local2].moveBy(_arg1);
};
for (_local2 in this.rightVectors) {
this.rightVectors[_local2].moveBy(_arg1);
};
}
public function shapeIntersection(_arg1:IShapeable):Rectangle{
throw (new Error("[FourPointShape].pushVectorOut not implemented"));
}
public function getLeftVector(_arg1:uint):Vector{
return (this.leftVectors[_arg1]);
}
public function vectorInside(_arg1:Vector):Boolean{
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:uint;
var _local7:uint;
_local2 = true;
_local3 = true;
_local4 = true;
_local5 = true;
_local6 = 0;
_local7 = this.bottomVectors.length;
while (_local6 < _local7) {
_local2 = ((_local2) && ((this.bottomVectors[_local6].y >= _arg1.y)));
_local6++;
};
_local6 = 0;
_local7 = this.topVectors.length;
while (_local6 < _local7) {
_local3 = ((_local3) && ((this.topVectors[_local6].y <= _arg1.y)));
_local6++;
};
_local6 = 0;
_local7 = this.leftVectors.length;
while (_local6 < _local7) {
_local4 = ((_local4) && ((this.leftVectors[_local6].x <= _arg1.x)));
_local6++;
};
_local6 = 0;
_local7 = this.rightVectors.length;
while (_local6 < _local7) {
_local5 = ((_local5) && ((this.rightVectors[_local6].x >= _arg1.x)));
_local6++;
};
return (((((((_local2) && (_local3))) && (_local4))) && (_local5)));
}
public function pushShapeOut(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
var _local4:uint;
var _local5:uint;
var _local6:Vector;
var _local7:Vector;
var _local8:Vector;
var _local9:Vector;
var _local10:Vector;
_local6 = Vector.UP.normalised(_arg2);
_local7 = Vector.DOWN.normalised(_arg2);
_local8 = Vector.LEFT.normalised(_arg2);
_local9 = Vector.RIGHT.normalised(_arg2);
_local10 = new Vector();
_local4 = 0;
_local5 = this.topVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.topVectors[_local4])) {
_arg1.moveBy(_local6);
_local10.moveBy(_local6);
};
_local4++;
};
_local4 = 0;
_local5 = this.bottomVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.bottomVectors[_local4])) {
_arg1.moveBy(_local7);
_local10.moveBy(_local7);
};
_local4++;
};
_local4 = 0;
_local5 = this.leftVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.leftVectors[_local4])) {
_arg1.moveBy(_local8);
_local10.moveBy(_local8);
};
_local4++;
};
_local4 = 0;
_local5 = this.rightVectors.length;
while (_local4 < _local5) {
while (_arg1.vectorInside(this.rightVectors[_local4])) {
_arg1.moveBy(_local9);
_local10.moveBy(_local9);
};
_local4++;
};
return (_local10);
}
public function shapeIntersects(_arg1:IShapeable):Boolean{
var _local2:Boolean;
var _local3:String;
_local2 = false;
for (_local3 in this.topVectors) {
_local2 = ((_local2) || (_arg1.vectorInside(this.topVectors[_local3])));
};
for (_local3 in this.bottomVectors) {
_local2 = ((_local2) || (_arg1.vectorInside(this.bottomVectors[_local3])));
};
for (_local3 in this.leftVectors) {
_local2 = ((_local2) || (_arg1.vectorInside(this.leftVectors[_local3])));
};
for (_local3 in this.rightVectors) {
_local2 = ((_local2) || (_arg1.vectorInside(this.rightVectors[_local3])));
};
return (_local2);
}
}
}//package sfb.maths.shapes
Section 54
//RectangleShape (sfb.maths.shapes.RectangleShape)
package sfb.maths.shapes {
import flash.geom.*;
import sfb.maths.*;
public class RectangleShape implements IShapeable {
public var minRadius:Number;
public var center:Vector;
public var maxRadius:Number;
public var rectangle:Rectangle;
public function RectangleShape(_arg1:Rectangle, _arg2:Boolean=false){
this.rectangle = _arg1;
if (!_arg2){
this.calculate();
};
}
public function moveBy(_arg1:Vector):void{
this.rectangle.offsetPoint(_arg1.toPoint());
}
public function pushVectorOut(_arg1:Vector, _arg2:Number=1, _arg3:Vector=null):Vector{
if (_arg3){
if (_arg3.x == 0){
return (((_arg3.y)>=0) ? new Vector(_arg1.x, this.rectangle.bottom) : new Vector(_arg1.x, this.rectangle.top));
} else {
if (_arg3.y == 0){
return (((_arg3.x)>=0) ? new Vector(this.rectangle.right, _arg1.y) : new Vector(this.rectangle.left, _arg1.y));
} else {
throw (new Error("[RectangleShape].pushVectorOut - no method written for non-axis directional push"));
};
};
} else {
};
return (!NULL!);
}
public function shapeIntersection(_arg1:IShapeable):Rectangle{
if ((_arg1 is RectangleShape)){
return (this.rectangle.intersection(RectangleShape(_arg1).rectangle));
};
return (new Rectangle());
}
public function pushOutOfShape(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
return (new Vector());
}
public function calculate():void{
this.center = Vector.newFromPoint(this.rectangle.topLeft.add(new Point((this.rectangle.width / 2), (this.rectangle.height / 2))));
this.minRadius = (Math.min(this.rectangle.width, this.rectangle.height) / 2);
this.maxRadius = this.center.subtract(Vector.newFromPoint(this.rectangle.topLeft)).length;
}
public function pushShapeOut(_arg1:IShapeable, _arg2:Number=1, _arg3:Vector=null):Vector{
var _local4:Rectangle;
_local4 = this.shapeIntersection(_arg1);
if (!_arg3){
if (_local4.left == this.rectangle.left){
if (_local4.top == this.rectangle.top){
return (((_local4.width)<_local4.height) ? new Vector(-(_local4.width), 0) : new Vector(0, -(_local4.height)));
} else {
if (_local4.bottom == this.rectangle.bottom){
return (((_local4.width)<_local4.height) ? new Vector(-(_local4.width), 0) : new Vector(0, _local4.height));
} else {
return (new Vector(-(_local4.width), 0));
};
};
} else {
if (_local4.right == this.rectangle.right){
if (_local4.top == this.rectangle.top){
return (((_local4.width)<_local4.height) ? new Vector(_local4.width, 0) : new Vector(0, -(_local4.height)));
} else {
if (_local4.bottom == this.rectangle.bottom){
return (((_local4.width)<_local4.height) ? new Vector(_local4.width, 0) : new Vector(0, _local4.height));
} else {
return (new Vector(_local4.width, 0));
};
};
} else {
if (_local4.top == this.rectangle.top){
return (new Vector(0, -(_local4.height)));
};
if (_local4.bottom == this.rectangle.bottom){
return (new Vector(0, _local4.height));
};
return (new Vector());
};
};
//unresolved jump
};
return (MathsTools.vectorAcrossRectangle(_arg3, _local4));
}
public function vectorInside(_arg1:Vector):Boolean{
return (this.rectangle.containsPoint(_arg1.toPoint()));
}
public function shapeIntersects(_arg1:IShapeable):Boolean{
switch (true){
case (_arg1 is RectangleShape):
return (this.rectangle.intersects(RectangleShape(_arg1).rectangle));
default:
return (false);
};
}
}
}//package sfb.maths.shapes
Section 55
//MathsTools (sfb.maths.MathsTools)
package sfb.maths {
import flash.geom.*;
public class MathsTools {
public static function closestVectorOnRectangle(_arg1:Vector, _arg2:Rectangle):Vector{
var _local3:Vector;
var _local4:Vector;
var _local5:Vector;
var _local6:Vector;
var _local7:Vector;
var _local8:Vector;
var _local9:Vector;
var _local10:Vector;
_local3 = new Vector(_arg2.left, _arg2.top);
_local4 = new Vector(_arg2.right, _arg2.top);
_local5 = new Vector(_arg2.left, _arg2.bottom);
_local6 = new Vector(_arg2.right, _arg2.bottom);
_local7 = closestVectorOnLine(_local3, _local4, _arg1, true);
_local8 = closestVectorOnLine(_local3, _local5, _arg1, true);
_local9 = closestVectorOnLine(_local4, _local6, _arg1, true);
_local10 = closestVectorOnLine(_local5, _local6, _arg1, true);
return (Vector.nearest(_arg1, [_local7, _local8, _local9, _local10]));
}
public static function vectorAcrossRectangle(_arg1:Vector, _arg2:Rectangle, _arg3:Boolean=false):Vector{
var _local4:Number;
var _local5:Vector;
var _local6:Rectangle;
var _local7:Vector;
var _local8:Vector;
_local4 = _arg1.angle;
_local5 = _arg1.normalised();
_local6 = _arg2.clone();
_local6.x = 0;
_local6.y = 0;
_local7 = new Vector((_local6.width / 2), (_local6.height / 2));
if (!_arg3){
_local8 = _local7.add(_local5.multiply(((_local5.x * _local6.width) / 2)));
if ((((_local8.y < 0)) || ((_local8.y > _local6.height)))){
_local5 = _local5.multiply((_local5.y * _local6.height));
} else {
_local5 = _local5.multiply((_local5.x * _local6.width));
};
return (_local5);
//unresolved jump
};
return (new Vector());
}
public static function closestVectorOnLine(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Boolean):Vector{
var _local5:Vector;
var _local6:Vector;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _arg3.subtract(_arg1);
_local6 = _arg2.subtract(_arg1);
_local7 = _arg2.subtract(_arg1).dotProduct(_local6);
_local8 = _local5.dotProduct(_local6);
_local9 = (_local8 / _local7);
if (_arg4){
if (_local9 < 0){
_local9 = 0;
} else {
if (_local9 > 1){
_local9 = 1;
};
};
};
return (_arg1.add(_local6.multiply(_local9)));
}
}
}//package sfb.maths
Section 56
//Vector (sfb.maths.Vector)
package sfb.maths {
import flash.display.*;
import flash.geom.*;
public class Vector {
private var point:Point;
public static const DOWN:Vector = new Vector(0, 1);
;
public static const LEFT:Vector = new Vector(-1, 0);
;
public static const UP:Vector = new Vector(0, -1);
;
public static const RIGHT:Vector = new Vector(1, 0);
;
public function Vector(_arg1:Number=0, _arg2:Number=0){
this.point = new Point(_arg1, _arg2);
}
public function get y():Number{
return (this.point.y);
}
public function setFromPoint(_arg1:Point):void{
this.point.x = _arg1.x;
this.point.y = _arg1.y;
}
public function setToDO(_arg1:DisplayObject):void{
_arg1.x = this.point.x;
_arg1.y = this.point.y;
}
public function get angle():Number{
return (new Vector().angleTo(this));
}
public function subtract(_arg1:Vector):Vector{
return (new Vector((this.point.x - _arg1.x), (this.point.y - _arg1.y)));
}
public function toPoint():Point{
return (this.point.clone());
}
public function setFromVector(_arg1:Vector):void{
this.point.x = _arg1.x;
this.point.y = _arg1.y;
}
public function moveBy(_arg1:Vector):void{
this.point.x = (this.point.x + _arg1.x);
this.point.y = (this.point.y + _arg1.y);
}
public function clone():Vector{
return (new Vector(this.point.x, this.point.y));
}
public function add(_arg1:Vector):Vector{
return (new Vector((this.point.x + _arg1.x), (this.point.y + _arg1.y)));
}
public function multiply(_arg1:Number):Vector{
return (new Vector((this.point.x * _arg1), (this.point.y * _arg1)));
}
public function get length():Number{
return (this.point.length);
}
public function toString():String{
return (((("Vector - x=" + this.x) + ", y=") + this.y));
}
public function dotProduct(_arg1:Vector):Number{
return (((this.point.x * _arg1.x) + (this.point.y * _arg1.y)));
}
public function angleTo(_arg1:Vector):Number{
var _local2:Vector;
_local2 = _arg1.subtract(this);
return (Math.atan2(_local2.x, -(_local2.y)));
}
public function set x(_arg1:Number):void{
this.point.x = _arg1;
}
public function set y(_arg1:Number):void{
this.point.y = _arg1;
}
public function roundToNearest(_arg1:Number=0.01):void{
this.point.x = (Math.round((this.point.x / _arg1)) * _arg1);
this.point.y = (Math.round((this.point.y / _arg1)) * _arg1);
}
public function normalised(_arg1:Number=1):Vector{
var _local2:Point;
_local2 = this.toPoint();
_local2.normalize(_arg1);
return (Vector.newFromPoint(_local2));
}
public function get x():Number{
return (this.point.x);
}
public function divide(_arg1:Number):Vector{
return (new Vector((this.point.x / _arg1), (this.point.y / _arg1)));
}
public function reflect(_arg1:Vector):Vector{
return (this.add(_arg1.multiply((2 * this.length))));
}
public function setFromDO(_arg1:DisplayObject):void{
this.point.x = _arg1.x;
this.point.y = _arg1.y;
}
public function equals(_arg1:Vector, _arg2:Number=0):Boolean{
return ((Vector.distance(this, _arg1) <= _arg2));
}
public static function interpolate(_arg1:Vector, _arg2:Vector, _arg3:Number):Vector{
return (Vector.newFromPoint(Point.interpolate(_arg1.toPoint(), _arg2.toPoint(), (1 - _arg3))));
}
public static function newFromPoint(_arg1:Point):Vector{
return (new Vector(_arg1.x, _arg1.y));
}
public static function distance(_arg1:Vector, _arg2:Vector):Number{
return (Point.distance(_arg1.toPoint(), _arg2.toPoint()));
}
public static function newFromDisplayObject(_arg1:DisplayObject):Vector{
return (new Vector(_arg1.x, _arg1.y));
}
public static function nearest(_arg1:Vector, _arg2:Array):Vector{
var _local3:Number;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:Vector;
_local3 = Number.POSITIVE_INFINITY;
_local4 = 0;
_local5 = 0;
_local6 = _arg2.length;
while (_local5 < _local6) {
_local7 = _arg1.subtract(_arg2[_local5]);
if (_local7.length < _local3){
_local3 = _local7.length;
_local4 = _local5;
};
_local5++;
};
return (_arg2[_local4]);
}
}
}//package sfb.maths
Section 57
//AccurateTimer (sfb.tools.AccurateTimer)
package sfb.tools {
import flash.events.*;
import flash.utils.*;
public class AccurateTimer extends EventDispatcher {
private var timer:Timer;
private var time:uint;
private var delay_int:uint;
public function AccurateTimer(_arg1:uint, _arg2:uint=0){
this.timer = new Timer(_arg1, _arg2);
this.timer.addEventListener(TimerEvent.TIMER, this.timerListener);
this.timer.addEventListener(TimerEvent.TIMER_COMPLETE, this.timerCompleteListener);
this.delay_int = _arg1;
}
public function stop():void{
this.timer.stop();
}
public function get delay():uint{
return (this.delay);
}
public function get currentCount():int{
return (this.timer.currentCount);
}
public function set delay(_arg1:uint):void{
this.timer.delay = _arg1;
this.delay_int = _arg1;
}
private function timerListener(_arg1:TimerEvent):void{
var _local2:int;
var _local3:int;
_local2 = (this.delay_int - (getTimer() - this.time));
_local3 = (this.delay_int + _local2);
if (_local3 < 1){
_local3 = 1;
};
this.timer.delay = _local3;
this.time = (getTimer() + _local2);
this.dispatchEvent(_arg1);
}
public function start():void{
this.timer.start();
this.time = getTimer();
}
public function reset():void{
this.timer.reset();
}
public function set repeatCount(_arg1:int):void{
this.timer.repeatCount = _arg1;
}
private function timerCompleteListener(_arg1:TimerEvent):void{
this.dispatchEvent(_arg1);
}
public function get repeatCount():int{
return (this.timer.repeatCount);
}
public function get running():Boolean{
return (this.timer.running);
}
}
}//package sfb.tools
Section 58
//Cleanup (sfb.tools.Cleanup)
package sfb.tools {
import flash.display.*;
public class Cleanup {
public static function cleanArray(_arg1:Array):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
_local2 = 0;
_local3 = _arg1.length;
while (_local2 < _local3) {
_arg1[0] = null;
_arg1.splice(0, 1);
_local2++;
};
};
}
public static function cleanDisplayList(_arg1:DisplayObjectContainer, _arg2:Boolean=false):void{
var _local3:uint;
var _local4:uint;
var _local5:DisplayObject;
if (_arg1){
_local3 = 0;
_local4 = _arg1.numChildren;
while (_local3 < _local4) {
_local5 = _arg1.getChildAt(0);
if ((_local5 is MovieClip)){
MovieClip(_local5).stop();
};
if (((_local5) && (_arg1.contains(_local5)))){
_arg1.removeChild(_local5);
};
if (((_arg2) && ((_local5 is DisplayObjectContainer)))){
Cleanup.cleanDisplayList(DisplayObjectContainer(_local5), true);
};
_local3++;
};
};
}
}
}//package sfb.tools
Section 59
//TimeConversion (sfb.tools.TimeConversion)
package sfb.tools {
public class TimeConversion {
public static function milliToMinsSecs(_arg1:uint, _arg2:int=2, _arg3:uint=3):String{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:Number;
var _local8:uint;
var _local9:uint;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:Number;
var _local14:uint;
_local4 = (_arg1 / 1000);
_local5 = Math.floor(_local4);
_local6 = (_arg1 - (1000 * _local5));
_local7 = (_local5 / 60);
_local8 = Math.floor(_local7);
_local9 = (_local5 - (60 * _local8));
_local10 = String(_local8);
while (_local10.length < _arg3) {
_local10 = ("0" + _local10);
};
_local11 = String(_local9);
while (_local11.length < 2) {
_local11 = ("0" + _local11);
};
_local12 = ((_local10 + ":") + _local11);
if (_arg2 > 0){
_local12 = (_local12 + ".");
_local13 = Math.pow(10, _arg2);
_local14 = ((1000 * Math.round(((_local6 * _local13) / 1000))) / _local13);
_local12 = (_local12 + String(_local14).substr(0, _arg2));
};
return (_local12);
}
}
}//package sfb.tools
Section 60
//Coin (Coin)
package {
import flash.display.*;
public dynamic class Coin extends MovieClip {
public function Coin(){
addFrameScript(32, frame33, 49, frame50);
}
function frame33(){
gotoAndStop(1);
}
function frame50(){
if (this.parent){
this.parent.removeChild(this);
};
this.stop();
}
}
}//package
Section 61
//CoinCollectSFX (CoinCollectSFX)
package {
import flash.media.*;
public dynamic class CoinCollectSFX extends Sound {
}
}//package
Section 62
//CoinDrop (CoinDrop)
package {
import flash.display.*;
public dynamic class CoinDrop extends MovieClip {
public function CoinDrop(){
addFrameScript(14, frame15);
}
function frame15(){
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package
Section 63
//CoinHUD (CoinHUD)
package {
import code.*;
public dynamic class CoinHUD extends CoinCountHUD {
}
}//package
Section 64
//CoinLoseSFX (CoinLoseSFX)
package {
import flash.media.*;
public dynamic class CoinLoseSFX extends Sound {
}
}//package
Section 65
//FallinWaterSFX (FallinWaterSFX)
package {
import flash.media.*;
public dynamic class FallinWaterSFX extends Sound {
}
}//package
Section 66
//MainLoop (MainLoop)
package {
import flash.media.*;
public dynamic class MainLoop extends Sound {
}
}//package
Section 67
//MenuLoop (MenuLoop)
package {
import flash.media.*;
public dynamic class MenuLoop extends Sound {
}
}//package
Section 68
//NetBlock (NetBlock)
package {
import flash.display.*;
public dynamic class NetBlock extends MovieClip {
}
}//package
Section 69
//ParrotFly1 (ParrotFly1)
package {
import flash.display.*;
public dynamic class ParrotFly1 extends MovieClip {
public var hit_mc:MovieClip;
}
}//package
Section 70
//ParrotFlyOnce (ParrotFlyOnce)
package {
import flash.display.*;
public dynamic class ParrotFlyOnce extends MovieClip {
public var hit_mc:MovieClip;
public function ParrotFlyOnce(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 71
//ParrotHitSFX (ParrotHitSFX)
package {
import flash.media.*;
public dynamic class ParrotHitSFX extends Sound {
}
}//package
Section 72
//PirateJames (PirateJames)
package {
import code.*;
public dynamic class PirateJames extends PirateZebra {
}
}//package
Section 73
//SpringBoard (SpringBoard)
package {
import flash.display.*;
public dynamic class SpringBoard extends MovieClip {
public var plankClip_mc:MovieClip;
}
}//package
Section 74
//SpringboardSFX (SpringboardSFX)
package {
import flash.media.*;
public dynamic class SpringboardSFX extends Sound {
}
}//package
Section 75
//TentacleBlock (TentacleBlock)
package {
import flash.display.*;
public dynamic class TentacleBlock extends MovieClip {
public var hit_mc:MovieClip;
}
}//package
Section 76
//TentacleSlapSFX (TentacleSlapSFX)
package {
import flash.media.*;
public dynamic class TentacleSlapSFX extends Sound {
}
}//package
Section 77
//TentacleTrapGameClip (TentacleTrapGameClip)
package {
import code.*;
public dynamic class TentacleTrapGameClip extends TentacleTrapGame {
}
}//package