Section 1
//ag_intro_mc_306 (BRsFF_fla.ag_intro_mc_306)
package BRsFF_fla {
import flash.display.*;
public dynamic class ag_intro_mc_306 extends MovieClip {
public function ag_intro_mc_306(){
addFrameScript(195, frame196);
}
function frame196(){
stop();
}
}
}//package BRsFF_fla
Section 2
//AltometerLogo_494 (BRsFF_fla.AltometerLogo_494)
package BRsFF_fla {
import flash.display.*;
public dynamic class AltometerLogo_494 extends MovieClip {
public function AltometerLogo_494(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 3
//BlueRabbitJump_467 (BRsFF_fla.BlueRabbitJump_467)
package BRsFF_fla {
import flash.display.*;
public dynamic class BlueRabbitJump_467 extends MovieClip {
public function BlueRabbitJump_467(){
addFrameScript(42, frame43, 62, frame63);
}
function frame43(){
stop();
}
function frame63(){
stop();
}
}
}//package BRsFF_fla
Section 4
//ControlInfo_33 (BRsFF_fla.ControlInfo_33)
package BRsFF_fla {
import flash.display.*;
import flash.events.*;
public dynamic class ControlInfo_33 extends MovieClip {
public var left_btn:SimpleButton;
public var right_btn:SimpleButton;
public function ControlInfo_33(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function goto1(_arg1:Event):void{
this.gotoAndStop(1);
}
public function goto3(_arg1:Event):void{
this.gotoAndStop(3);
}
public function goto4(_arg1:Event):void{
this.gotoAndStop(4);
}
public function goto5(_arg1:Event):void{
this.gotoAndStop(5);
}
public function goto2(_arg1:Event):void{
this.gotoAndStop(2);
}
function frame3(){
this.left_btn.addEventListener(MouseEvent.CLICK, this.goto2);
this.right_btn.addEventListener(MouseEvent.CLICK, this.goto4);
}
function frame1(){
this.right_btn.addEventListener(MouseEvent.CLICK, this.goto2);
stop();
}
function frame4(){
this.left_btn.addEventListener(MouseEvent.CLICK, this.goto3);
this.right_btn.addEventListener(MouseEvent.CLICK, this.goto5);
}
function frame5(){
this.left_btn.addEventListener(MouseEvent.CLICK, this.goto4);
}
function frame2(){
this.left_btn.addEventListener(MouseEvent.CLICK, this.goto1);
this.right_btn.addEventListener(MouseEvent.CLICK, this.goto3);
}
}
}//package BRsFF_fla
Section 5
//DancingSealJump_455 (BRsFF_fla.DancingSealJump_455)
package BRsFF_fla {
import flash.display.*;
public dynamic class DancingSealJump_455 extends MovieClip {
public function DancingSealJump_455(){
addFrameScript(43, frame44, 62, frame63);
}
function frame44(){
stop();
}
function frame63(){
stop();
}
}
}//package BRsFF_fla
Section 6
//GameWater_483 (BRsFF_fla.GameWater_483)
package BRsFF_fla {
import flash.display.*;
public dynamic class GameWater_483 extends MovieClip {
public function GameWater_483(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 7
//LevelEffects_484 (BRsFF_fla.LevelEffects_484)
package BRsFF_fla {
import flash.display.*;
public dynamic class LevelEffects_484 extends MovieClip {
public function LevelEffects_484(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 8
//LevelFadout_498 (BRsFF_fla.LevelFadout_498)
package BRsFF_fla {
import flash.display.*;
import flash.events.*;
public dynamic class LevelFadout_498 extends MovieClip {
public function LevelFadout_498(){
addFrameScript(5, frame6, 43, frame44);
}
function frame6(){
this.stop();
}
function frame44(){
this.dispatchEvent(new Event("fadedOut"));
this.stop();
}
}
}//package BRsFF_fla
Section 9
//LogoCanvas_168 (BRsFF_fla.LogoCanvas_168)
package BRsFF_fla {
import flash.display.*;
public dynamic class LogoCanvas_168 extends MovieClip {
public var canvasColour_mc:MovieClip;
}
}//package BRsFF_fla
Section 10
//MenuSky_357 (BRsFF_fla.MenuSky_357)
package BRsFF_fla {
import flash.display.*;
public dynamic class MenuSky_357 extends MovieClip {
public function MenuSky_357(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 11
//ParachuteDeploy_45 (BRsFF_fla.ParachuteDeploy_45)
package BRsFF_fla {
import flash.display.*;
public dynamic class ParachuteDeploy_45 extends MovieClip {
public var parachute_mc:MovieClip;
public function ParachuteDeploy_45(){
addFrameScript(0, frame1, 33, frame34);
}
function frame1(){
this.stop();
}
function frame34(){
stop();
}
}
}//package BRsFF_fla
Section 12
//ParachutePop_47 (BRsFF_fla.ParachutePop_47)
package BRsFF_fla {
import flash.display.*;
public dynamic class ParachutePop_47 extends MovieClip {
public function ParachutePop_47(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package BRsFF_fla
Section 13
//Radar_495 (BRsFF_fla.Radar_495)
package BRsFF_fla {
import flash.display.*;
public dynamic class Radar_495 extends MovieClip {
public var blip_mc:MovieClip;
}
}//package BRsFF_fla
Section 14
//RedRabbitJump_459 (BRsFF_fla.RedRabbitJump_459)
package BRsFF_fla {
import flash.display.*;
public dynamic class RedRabbitJump_459 extends MovieClip {
public function RedRabbitJump_459(){
addFrameScript(43, frame44, 62, frame63);
}
function frame44(){
stop();
}
function frame63(){
stop();
}
}
}//package BRsFF_fla
Section 15
//ReindeerJump_445 (BRsFF_fla.ReindeerJump_445)
package BRsFF_fla {
import flash.display.*;
public dynamic class ReindeerJump_445 extends MovieClip {
public function ReindeerJump_445(){
addFrameScript(43, frame44, 62, frame63);
}
function frame44(){
stop();
}
function frame63(){
stop();
}
}
}//package BRsFF_fla
Section 16
//Symbol10fd_434 (BRsFF_fla.Symbol10fd_434)
package BRsFF_fla {
import flash.display.*;
import sfb.audio.*;
public dynamic class Symbol10fd_434 extends MovieClip {
public function Symbol10fd_434(){
addFrameScript(32, frame33, 129, frame130);
}
function frame33(){
SFXManager.getInstance().playSFX("lightning");
}
function frame130(){
SFXManager.getInstance().playSFX("lightning");
}
}
}//package BRsFF_fla
Section 17
//Symbol11_443 (BRsFF_fla.Symbol11_443)
package BRsFF_fla {
import flash.display.*;
import flash.events.*;
import code.*;
import sfb.application.*;
public dynamic class Symbol11_443 extends MovieClip {
public var dancingSeal_mc:MovieClip;
public var redRabbit_mc:MovieClip;
public var blueRabbit_mc:MovieClip;
public var reindeer_mc:MovieClip;
public function Symbol11_443(){
addFrameScript(65, frame66, 105, frame106);
}
function frame106(){
this.dispatchEvent(new Event("readyToJump", true));
stop();
}
function frame66(){
this.blueRabbit_mc.visible = false;
this.redRabbit_mc.visible = false;
this.dancingSeal_mc.visible = false;
this.reindeer_mc.visible = false;
switch (FreeFallApp(Game.game).character){
case 1:
this.blueRabbit_mc.visible = true;
break;
case 2:
this.redRabbit_mc.visible = true;
break;
case 3:
this.dancingSeal_mc.visible = true;
break;
case 4:
this.reindeer_mc.visible = true;
break;
};
}
}
}//package BRsFF_fla
Section 18
//Symbol134_147 (BRsFF_fla.Symbol134_147)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol134_147 extends MovieClip {
public var red_mc:SimpleButton;
public var yellow_mc:SimpleButton;
public var orange_mc:SimpleButton;
public var green_mc:SimpleButton;
public var white_mc:SimpleButton;
public var blue_mc:SimpleButton;
public var black_mc:SimpleButton;
public var pink_mc:SimpleButton;
public function Symbol134_147(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 19
//Symbol135_166 (BRsFF_fla.Symbol135_166)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol135_166 extends MovieClip {
public var large_mc:SimpleButton;
public var small_mc:SimpleButton;
public var mid_mc:SimpleButton;
public function Symbol135_166(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 20
//Symbol14copy_440 (BRsFF_fla.Symbol14copy_440)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol14copy_440 extends MovieClip {
public function Symbol14copy_440(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 21
//Symbol180_364 (BRsFF_fla.Symbol180_364)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol180_364 extends MovieClip {
public function Symbol180_364(){
addFrameScript(0, frame1, 15, frame16);
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 22
//Symbol206_384 (BRsFF_fla.Symbol206_384)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol206_384 extends MovieClip {
public function Symbol206_384(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 23
//Symbol213_372 (BRsFF_fla.Symbol213_372)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol213_372 extends MovieClip {
public var dancingSealSelect_btn:SimpleButton;
public function Symbol213_372(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 24
//Symbol214_378 (BRsFF_fla.Symbol214_378)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol214_378 extends MovieClip {
public var reindeerSelect_btn:SimpleButton;
public function Symbol214_378(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 25
//Symbol250_208 (BRsFF_fla.Symbol250_208)
package BRsFF_fla {
import flash.display.*;
import fl.motion.*;
import code.*;
public dynamic class Symbol250_208 extends MovieClip {
public var col:Color;
public function Symbol250_208(){
addFrameScript(0, frame1);
}
function frame1(){
col = new Color();
col.tintColor = FreeFallApp.app.logoBG;
col.tintMultiplier = 0.8;
this.transform.colorTransform = col;
}
}
}//package BRsFF_fla
Section 26
//Symbol251_207 (BRsFF_fla.Symbol251_207)
package BRsFF_fla {
import flash.display.*;
import fl.motion.*;
import code.*;
public dynamic class Symbol251_207 extends MovieClip {
public var col:Color;
public function Symbol251_207(){
addFrameScript(0, frame1);
}
function frame1(){
col = new Color();
col.tintColor = FreeFallApp.app.logoBG;
col.tintMultiplier = 0.8;
this.transform.colorTransform = col;
}
}
}//package BRsFF_fla
Section 27
//Symbol252_230 (BRsFF_fla.Symbol252_230)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol252_230 extends MovieClip {
public var char_mc:MovieClip;
}
}//package BRsFF_fla
Section 28
//Symbol253_231 (BRsFF_fla.Symbol253_231)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol253_231 extends MovieClip {
public function Symbol253_231(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 29
//Symbol275_305 (BRsFF_fla.Symbol275_305)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol275_305 extends MovieClip {
public function Symbol275_305(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 30
//Symbol276_276 (BRsFF_fla.Symbol276_276)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol276_276 extends MovieClip {
public function Symbol276_276(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 31
//Symbol276copy_512 (BRsFF_fla.Symbol276copy_512)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol276copy_512 extends MovieClip {
public function Symbol276copy_512(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 32
//Symbol281_500 (BRsFF_fla.Symbol281_500)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol281_500 extends MovieClip {
public var backToPlane_btn:SimpleButton;
public function Symbol281_500(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 33
//Symbol284_505 (BRsFF_fla.Symbol284_505)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol284_505 extends MovieClip {
public function Symbol284_505(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 34
//Symbol284copy_436 (BRsFF_fla.Symbol284copy_436)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol284copy_436 extends MovieClip {
public function Symbol284copy_436(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 35
//Symbol31_425 (BRsFF_fla.Symbol31_425)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol31_425 extends MovieClip {
public var clouds_mc:MovieClip;
}
}//package BRsFF_fla
Section 36
//Symbol33_426 (BRsFF_fla.Symbol33_426)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol33_426 extends MovieClip {
public function Symbol33_426(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 37
//Symbol351_46 (BRsFF_fla.Symbol351_46)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol351_46 extends MovieClip {
public var parachuteColour_mc:MovieClip;
public function Symbol351_46(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package BRsFF_fla
Section 38
//Symbol359_233 (BRsFF_fla.Symbol359_233)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol359_233 extends MovieClip {
public function Symbol359_233(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package BRsFF_fla
Section 39
//Symbol360_234 (BRsFF_fla.Symbol360_234)
package BRsFF_fla {
import flash.display.*;
import fl.motion.*;
import code.*;
public dynamic class Symbol360_234 extends MovieClip {
public var col:Color;
public function Symbol360_234(){
addFrameScript(0, frame1);
}
function frame1(){
col = new Color();
col.tintColor = FreeFallApp.app.logoBG;
col.tintMultiplier = 0.8;
this.transform.colorTransform = col;
}
}
}//package BRsFF_fla
Section 40
//Symbol362_235 (BRsFF_fla.Symbol362_235)
package BRsFF_fla {
import flash.display.*;
import fl.motion.*;
import code.*;
public dynamic class Symbol362_235 extends MovieClip {
public var col:Color;
public function Symbol362_235(){
addFrameScript(0, frame1);
}
function frame1(){
col = new Color();
col.tintColor = FreeFallApp.app.logoBG;
col.tintMultiplier = 0.8;
this.transform.colorTransform = col;
}
}
}//package BRsFF_fla
Section 41
//Symbol397_416 (BRsFF_fla.Symbol397_416)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol397_416 extends MovieClip {
public var thunderLevel_btn:SimpleButton;
public function Symbol397_416(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 42
//Symbol398_398 (BRsFF_fla.Symbol398_398)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol398_398 extends MovieClip {
public var snowLevel_btn:SimpleButton;
public function Symbol398_398(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 43
//Symbol399_410 (BRsFF_fla.Symbol399_410)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol399_410 extends MovieClip {
public var rainLevel_btn:SimpleButton;
public function Symbol399_410(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 44
//Symbol400_404 (BRsFF_fla.Symbol400_404)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol400_404 extends MovieClip {
public var sunLevel_btn:SimpleButton;
public function Symbol400_404(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 45
//Symbol421_77 (BRsFF_fla.Symbol421_77)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol421_77 extends MovieClip {
public function Symbol421_77(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package BRsFF_fla
Section 46
//Symbol451_10 (BRsFF_fla.Symbol451_10)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol451_10 extends MovieClip {
public var plane_mc:MovieClip;
public function Symbol451_10(){
addFrameScript(0, frame1);
}
function frame1(){
plane_mc.stop();
this.stop();
}
}
}//package BRsFF_fla
Section 47
//Symbol483_312 (BRsFF_fla.Symbol483_312)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol483_312 extends MovieClip {
public var clouds_mc:MovieClip;
}
}//package BRsFF_fla
Section 48
//Symbol484_313 (BRsFF_fla.Symbol484_313)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol484_313 extends MovieClip {
public function Symbol484_313(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 49
//Symbol487_310 (BRsFF_fla.Symbol487_310)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol487_310 extends MovieClip {
public function Symbol487_310(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 50
//Symbol500_513 (BRsFF_fla.Symbol500_513)
package BRsFF_fla {
import flash.display.*;
public dynamic class Symbol500_513 extends MovieClip {
public function Symbol500_513(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 51
//TeamLogo_31 (BRsFF_fla.TeamLogo_31)
package BRsFF_fla {
import flash.display.*;
import code.*;
import sfb.application.*;
public dynamic class TeamLogo_31 extends MovieClip {
public var default_mc:DefaultLogo;
public function TeamLogo_31(){
addFrameScript(0, frame1);
}
function frame1(){
this.addChild(new Bitmap(FreeFallApp(Game.game).logo, PixelSnapping.NEVER, true));
this.removeChild(default_mc);
}
}
}//package BRsFF_fla
Section 52
//TeamNameDisplay_342 (BRsFF_fla.TeamNameDisplay_342)
package BRsFF_fla {
import flash.display.*;
import code.*;
import flash.text.*;
public dynamic class TeamNameDisplay_342 extends MovieClip {
public var name_txt:TextField;
public function TeamNameDisplay_342(){
addFrameScript(0, frame1);
}
function frame1(){
name_txt.text = FreeFallApp.app.teamName;
}
}
}//package BRsFF_fla
Section 53
//Weather_428 (BRsFF_fla.Weather_428)
package BRsFF_fla {
import flash.display.*;
public dynamic class Weather_428 extends MovieClip {
public function Weather_428(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BRsFF_fla
Section 54
//Carrot (code.Carrot)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.audio.*;
import sfb.graphics.parallax.*;
import sfb.game.common.*;
public class Carrot extends Collectable {
private var goFrame:Number;
private var scene:ParaScene;
public var modelObject:ParaObject;
public var carrot_mc:MovieClip;
public function Carrot(_arg1:Vector3D=null){
addFrameScript(0, frame1, 5, frame6);
this.modelObject = new ParaObject(this, ((_arg1) || (new Vector3D())));
this.modelObject.onRender = this.onRenderModel;
}
override public function collect():void{
var _local1:Point;
var _local2:DisplayObject;
super.collect();
_local1 = new Point(this.x, this.y);
_local1 = this.parent.localToGlobal(_local1);
_local2 = this.stage.addChild(new Crunch());
_local2.x = _local1.x;
_local2.y = _local1.y;
SFXManager.getInstance().playSFX("crunch", 0, 1, (this.x / 275));
}
function frame6(){
if (this.goFrame){
this.carrot_mc.gotoAndPlay(this.goFrame);
};
}
function frame1(){
if (this.goFrame){
this.carrot_mc.gotoAndPlay(this.goFrame);
};
stop();
}
public function onRenderModel(_arg1:ParaScene):void{
var _local2:Vector;
_local2 = new Vector(this.x, this.y);
this.rotation = ((_local2.angle * 180) / Math.PI);
if (((this.carrot_mc) && (!((this.currentLabel == "collected"))))){
if (_local2.length > 70){
this.goFrame = this.carrot_mc.currentFrame;
if (this.currentLabel != "side"){
this.gotoAndStop("side");
};
} else {
this.goFrame = this.carrot_mc.currentFrame;
if (this.currentLabel != "top"){
this.gotoAndStop("top");
};
};
};
this.scene = _arg1;
}
}
}//package code
Section 55
//DrawLogo (code.DrawLogo)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import fl.motion.*;
import flash.text.*;
import sfb.application.*;
public class DrawLogo extends MovieClip {
public var brushSize_mc:MovieClip;
public var size:uint;
public var cancel_btn:SimpleButton;
public var done_btn:SimpleButton;
public var colours:Array;
public var baseColourSelect_mc:MovieClip;
public var teamName_txt:TextField;
public var clear_btn:SimpleButton;
public var default_btn:SimpleButton;
public var bgColour:uint;
public var brush:Sprite;
public var colourSelect_mc:MovieClip;
public var lastMouse:Vector;
public var stageRef:Stage;
public var colour:uint;
public var logo:BitmapData;
public var canvas_mc:MovieClip;
public function DrawLogo(){
var _local1:Bitmap;
super();
this.colours = [0xF2F2F2, 0x151515, 11600129, 156929, 1714611, 13534487, 16053259, 10892933];
this.colourSelect_mc.gotoAndStop(1);
this.brushSize_mc.gotoAndStop(1);
this.brush = new Sprite();
this.setBrushColour(this.colours[0]);
this.logo = FreeFallApp(Game.game).logo.clone();
this.setBaseColour(FreeFallApp(Game.game).logoBG);
this.teamName_txt.text = FreeFallApp(Game.game).teamName;
this.baseColourSelect_mc.gotoAndStop((this.colours.indexOf(this.bgColour) + 1));
_local1 = new Bitmap(this.logo);
this.canvas_mc.addChild(_local1);
this.canvas_mc.addEventListener(MouseEvent.MOUSE_DOWN, this.startDrawing);
this.colourSelect_mc.white_mc.addEventListener(MouseEvent.CLICK, this.selectWhite);
this.colourSelect_mc.black_mc.addEventListener(MouseEvent.CLICK, this.selectBlack);
this.colourSelect_mc.red_mc.addEventListener(MouseEvent.CLICK, this.selectRed);
this.colourSelect_mc.green_mc.addEventListener(MouseEvent.CLICK, this.selectGreen);
this.colourSelect_mc.blue_mc.addEventListener(MouseEvent.CLICK, this.selectBlue);
this.colourSelect_mc.orange_mc.addEventListener(MouseEvent.CLICK, this.selectOrange);
this.colourSelect_mc.yellow_mc.addEventListener(MouseEvent.CLICK, this.selectYellow);
this.colourSelect_mc.pink_mc.addEventListener(MouseEvent.CLICK, this.selectPink);
this.baseColourSelect_mc.white_mc.addEventListener(MouseEvent.CLICK, this.selectWhiteBG);
this.baseColourSelect_mc.black_mc.addEventListener(MouseEvent.CLICK, this.selectBlackBG);
this.baseColourSelect_mc.red_mc.addEventListener(MouseEvent.CLICK, this.selectRedBG);
this.baseColourSelect_mc.green_mc.addEventListener(MouseEvent.CLICK, this.selectGreenBG);
this.baseColourSelect_mc.blue_mc.addEventListener(MouseEvent.CLICK, this.selectBlueBG);
this.baseColourSelect_mc.orange_mc.addEventListener(MouseEvent.CLICK, this.selectOrangeBG);
this.baseColourSelect_mc.yellow_mc.addEventListener(MouseEvent.CLICK, this.selectYellowBG);
this.baseColourSelect_mc.pink_mc.addEventListener(MouseEvent.CLICK, this.selectPinkBG);
this.brushSize_mc.small_mc.addEventListener(MouseEvent.CLICK, this.selectSmall);
this.brushSize_mc.mid_mc.addEventListener(MouseEvent.CLICK, this.selectMid);
this.brushSize_mc.large_mc.addEventListener(MouseEvent.CLICK, this.selectLarge);
this.clear_btn.addEventListener(MouseEvent.CLICK, this.clear);
this.default_btn.addEventListener(MouseEvent.CLICK, this.defaultLogo);
this.done_btn.addEventListener(MouseEvent.CLICK, this.done);
this.cancel_btn.addEventListener(MouseEvent.CLICK, this.close);
}
public function selectRed(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[2]);
this.colourSelect_mc.gotoAndStop(3);
}
private function setBrushColour(_arg1:uint):void{
this.colour = _arg1;
this.brush.graphics.beginFill(this.colour);
this.brush.graphics.drawCircle(0, 0, 5);
this.brush.graphics.endFill();
}
public function selectGreenBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[3]);
this.baseColourSelect_mc.gotoAndStop(4);
}
public function selectRedBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[2]);
this.baseColourSelect_mc.gotoAndStop(3);
}
public function selectOrangeBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[5]);
this.baseColourSelect_mc.gotoAndStop(6);
}
private function setBaseColour(_arg1:uint):void{
var _local2:Color;
this.bgColour = _arg1;
_local2 = new Color();
_local2.tintColor = this.bgColour;
_local2.tintMultiplier = 1;
this.canvas_mc.canvasColour_mc.transform.colorTransform = _local2;
}
public function selectBlueBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[4]);
this.baseColourSelect_mc.gotoAndStop(5);
}
public function draw(_arg1:MouseEvent):void{
var _local2:Vector;
var _local3:Vector;
var _local4:uint;
var _local5:Matrix;
var _local6:Vector;
var _local7:uint;
var _local8:uint;
_local2 = new Vector(_arg1.stageX, _arg1.stageY);
_local3 = _local2.subtract(this.lastMouse);
_local4 = 4;
if (_local3.length > _local4){
_local6 = Vector.newFromPoint(this.canvas_mc.globalToLocal(this.lastMouse.toPoint())).add(_local3.normalised(_local4));
_local7 = 0;
_local8 = (_local3.length / _local4);
while (_local7 < _local8) {
_local5 = new Matrix();
_local5.translate(-2.5, -2.5);
switch (this.size){
case 1:
_local5.scale(1, 1);
break;
case 2:
_local5.scale(3, 3);
break;
case 3:
_local5.scale(5, 5);
break;
};
_local5.translate(_local6.x, _local6.y);
this.logo.draw(this.brush, _local5);
_local6 = _local6.add(_local3.normalised(_local4));
_local7++;
};
};
_local5 = new Matrix();
_local5.translate(-2.5, -2.5);
switch (this.size){
case 1:
_local5.scale(1, 1);
break;
case 2:
_local5.scale(3, 3);
break;
case 3:
_local5.scale(5, 5);
break;
};
_local5.translate(this.canvas_mc.mouseX, this.canvas_mc.mouseY);
this.logo.draw(this.brush, _local5);
this.lastMouse = new Vector(_arg1.stageX, _arg1.stageY);
}
public function selectPinkBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[7]);
this.baseColourSelect_mc.gotoAndStop(8);
}
public function startDrawing(_arg1:MouseEvent):void{
if (stage){
stage.addEventListener(MouseEvent.MOUSE_MOVE, this.draw);
stage.addEventListener(MouseEvent.MOUSE_UP, this.stopDrawing);
stageRef = stage;
this.lastMouse = new Vector(stage.mouseX, stage.mouseY);
};
}
public function selectSmall(_arg1:MouseEvent):void{
this.size = 1;
this.brushSize_mc.gotoAndStop(1);
}
public function selectOrange(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[5]);
this.colourSelect_mc.gotoAndStop(6);
}
public function selectBlack(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[1]);
this.colourSelect_mc.gotoAndStop(2);
}
public function done(_arg1:Event):void{
FreeFallApp(Game.game).logo.fillRect(FreeFallApp(Game.game).logo.rect, 0);
FreeFallApp(Game.game).logo.draw(this.logo);
FreeFallApp(Game.game).logoBG = bgColour;
FreeFallApp(Game.game).teamName = this.teamName_txt.text;
FreeFallApp.app.save.updateFromObject(FreeFallApp.app);
FreeFallApp.app.saveSystem.save(FreeFallApp.app.save.encode());
this.close();
}
public function selectPink(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[7]);
this.colourSelect_mc.gotoAndStop(8);
}
public function selectYellow(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[6]);
this.colourSelect_mc.gotoAndStop(7);
}
public function selectLarge(_arg1:MouseEvent):void{
this.size = 3;
this.brushSize_mc.gotoAndStop(3);
}
public function selectMid(_arg1:MouseEvent):void{
this.size = 2;
this.brushSize_mc.gotoAndStop(2);
}
public function selectGreen(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[3]);
this.colourSelect_mc.gotoAndStop(4);
}
public function clear(_arg1:Event):void{
this.logo.fillRect(this.logo.rect, 0);
}
public function defaultLogo(_arg1:Event):void{
this.logo.fillRect(this.logo.rect, 0);
this.logo.draw(new DefaultLogo());
}
public function selectBlue(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[4]);
this.colourSelect_mc.gotoAndStop(5);
}
public function selectWhite(_arg1:MouseEvent):void{
this.setBrushColour(this.colours[0]);
this.colourSelect_mc.gotoAndStop(1);
}
public function selectYellowBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[6]);
this.baseColourSelect_mc.gotoAndStop(7);
}
public function stopDrawing(_arg1:MouseEvent):void{
stageRef.removeEventListener(MouseEvent.MOUSE_MOVE, this.draw);
stageRef.removeEventListener(MouseEvent.MOUSE_UP, this.stopDrawing);
}
public function selectWhiteBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[0]);
this.baseColourSelect_mc.gotoAndStop(1);
}
public function selectBlackBG(_arg1:MouseEvent):void{
this.setBaseColour(this.colours[1]);
this.baseColourSelect_mc.gotoAndStop(2);
}
public function close(_arg1:Event=null):void{
if (this.parent){
this.parent.removeChild(this);
};
this.logo.dispose();
}
}
}//package code
Section 56
//Duck (code.Duck)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.audio.*;
import sfb.graphics.parallax.*;
import sfb.game.common.*;
public class Duck extends Enemy {
public var duck_mc:MovieClip;
private var goFrame:Number;
private var scene:ParaScene;
public var modelObject:ParaObject;
public function Duck(_arg1:Vector3D){
addFrameScript(0, frame1, 5, frame6);
this.modelObject = new ParaObject(this, ((_arg1) || (new Vector3D())));
this.modelObject.onRender = this.onRenderModel;
this.visible = false;
}
function frame6(){
if (this.goFrame){
this.duck_mc.gotoAndPlay(this.goFrame);
};
}
function frame1(){
if (this.goFrame){
this.duck_mc.gotoAndPlay(this.goFrame);
};
stop();
}
override public function hitMe():void{
var _local1:Point;
var _local2:DisplayObject;
super.hitMe();
_local1 = new Point(this.x, this.y);
_local1 = this.parent.localToGlobal(_local1);
_local2 = this.stage.addChild(new Quack());
_local2.x = _local1.x;
_local2.y = _local1.y;
SFXManager.getInstance().playSFX("quack", 0, 1, (this.x / 275));
}
public function onRenderModel(_arg1:ParaScene):void{
var _local2:Vector;
this.modelObject.position.z = (this.modelObject.position.z - 2);
_local2 = new Vector(this.x, this.y);
this.rotation = ((_local2.angle * 180) / Math.PI);
if (this.duck_mc){
if (_local2.length > 70){
this.goFrame = this.duck_mc.currentFrame;
if (this.currentLabel != "side"){
this.gotoAndStop("side");
};
} else {
this.goFrame = this.duck_mc.currentFrame;
if (this.currentLabel != "top"){
this.gotoAndStop("top");
};
};
};
this.scene = _arg1;
}
}
}//package code
Section 57
//FreeFallApp (code.FreeFallApp)
package code {
import flash.display.*;
import sfb.audio.*;
import flash.events.*;
import sfb.application.saves.*;
import sfb.game.systems.*;
import sfb.tools.*;
import sfb.application.preloader.*;
import flash.text.*;
import sfb.application.*;
public class FreeFallApp extends Game {
public var normalLevel_btn:SimpleButton;
public var level2Score:int;
public var newChars:Boolean;
public var backToPlane_mc:MovieClip;
public var sfbTitle_btn:SimpleButton;
public var fadeInOut_mc:MovieClip;
public var plane_mc:MovieClip;
public var teamName_txt:TextField;
public var ag_mc:MovieClip;
public var menuInfo_mc:MovieClip;
public var dancingSealSelect_mc:MovieClip;
public var agTitle_btn:SimpleButton;
public var weatherFall_mc:MovieClip;
public var agIntro_mc:MovieClip;
public var skyIntro_mc:MovieClip;
public var go_btn:SimpleButton;
public var teamName:String;
public var parachuteGame_mc:ParachuteGame;
public var mbrScores_btn:SimpleButton;
public var sunLevel_mc:MovieClip;
public var defaultInfo:uint;
public var levelUnlocked:uint;
public var ngEnd_mc:MovieClip;
public var levelInfo_mc:MovieClip;
public var level3Score:int;
public var sfbEnd_mc:MovieClip;
public var jump_btn:SimpleButton;
public var blueRabbitSelect_btn:SimpleButton;
public var carrotScore:int;
public var reindeerSelect_mc:MovieClip;
public var snowLevel_mc:MovieClip;
public var mbrTitle_btn:SimpleButton;
private var jumpClip:MovieClip;
public var redRabbitSelect_btn:SimpleButton;
public var weatherScore:int;
public var back_btn:SimpleButton;
public var pmgTitle_btn:SimpleButton;
public var character:uint;
public var characterUnlocked:uint;
public var playTitle_btn:SimpleButton;
public var fallChar_mc:MovieClip;
public var thunderLevel_mc:MovieClip;
public var fallBG_mc:MovieClip;
public var logoBG:uint;
public var level4Score:int;
public var score_txt:TextField;
public var teamLogo_btn:SimpleButton;
public var agEnd_mc:MovieClip;
public var preloaderBar_mc:MovieClip;
public var level1Score:int;
public var sfb_mc:MovieClip;
public var weatherParachute_mc:MovieClip;
public var duckScore:int;
private var sfxManager:SFXManager;
public var save:FreeFallGameSave;
public var darken1_mc:MovieClip;
public var level:uint;
public var arrow_mc:MovieClip;
public var levelName_mc:MovieClip;
public var pmgEnd_btn:SimpleButton;
public var cloudsBG_mc:MovieClip;
public var menuSky_mc:MovieClip;
public var cloudsFG_mc:MovieClip;
public var logo:BitmapData;
public var water_mc:MovieClip;
public var weather_mc:MovieClip;
public var door_mc:MovieClip;
private var musicManager:MusicManager;
public var bestScore_txt:TextField;
public var hud_mc:FreeFallHUD;
public var level5Score:int;
public var darken2_mc:MovieClip;
public var rainLevel_mc:MovieClip;
public var newLevel:Boolean;
public var agEnd_btn:SimpleButton;
public var effects_mc:MovieClip;
private var game:FreeFallGame;
public static var app:FreeFallApp;
public function FreeFallApp(){
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
super();
addFrameScript(0, frame1, 333, frame334, 334, frame335, 438, frame439, 494, frame495, 499, frame500, 569, frame570);
app = this;
this.stop();
this.preloader = new MovieClipPreloader(this.preloaderBar_mc);
this.preload();
this.linkToAG(this.ag_mc);
this.linkToSFB(this.sfb_mc);
ControlsManager.getInstance().init(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[6].numFrames);
this.addFrameScript(_local2, this.onLogos);
this.addFrameScript(_local3, this.onTitle);
this.addFrameScript(_local4, this.onMenu);
this.addFrameScript(_local5, this.onIntro);
this.addFrameScript(_local6, this.onGame);
this.addFrameScript(_local7, this.onPara);
this.addFrameScript(_local8, this.onFall);
}
public function gotoGame(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndStop(1, "Game");
}
private function infoCharacter(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(7);
}
public function onFall():void{
this.sfxManager.stopSFX("falling");
GameManager.getInstance().stop();
this.fallChar_mc.gotoAndStop(this.character);
this.fallBG_mc.gotoAndStop(this.level);
this.weatherFall_mc.gotoAndStop(this.level);
}
private function jump(_arg1:Event):void{
this.jumpClip = MovieClip(_arg1.target);
ControlsManager.getInstance().registerKeyPress("SPACE", this.onJump);
}
private function infoGo(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(13);
}
public function gotoFall(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndPlay(1, "Fall Water");
}
public function onPara():void{
this.stop();
this.sfxManager.stopSFX("falling");
this.parachuteGame_mc = new ParachuteGameClip();
this.parachuteGame_mc.x = 269.9;
this.parachuteGame_mc.y = -11.7;
this.addChildAt(this.parachuteGame_mc, 0);
this.weatherParachute_mc.gotoAndStop(this.level);
this.parachuteGame_mc.character_mc.player = this.character;
this.parachuteGame_mc.level = this.level;
}
override protected function preloadComplete(_arg1:Event):void{
this.gotoLogos();
}
public function onShowButtons():void{
this.linkToAG(this.pmgEnd_btn);
this.linkToAG(this.agEnd_btn);
this.linkToAG(this.agEnd_mc);
this.linkToSFB(this.sfbEnd_mc);
this.linkToNG(this.ngEnd_mc);
this.mbrScores_btn.addEventListener(MouseEvent.CLICK, this.openMoreBR);
}
function frame1(){
this.stop();
}
private function selectThunder(_arg1:MouseEvent):void{
this.level = 4;
this.characterSelect();
}
function frame500(){
this.onShowButtons();
stop();
}
private function startLevel():void{
this.back_btn.enabled = true;
this.back_btn.removeEventListener(MouseEvent.CLICK, this.onMenu);
this.back_btn.addEventListener(MouseEvent.CLICK, this.characterSelect);
this.menuSky_mc.mouseChildren = (this.menuSky_mc.mouseEnabled = true);
this.menuSky_mc.addEventListener(MouseEvent.CLICK, this.gotoIntro);
this.menuSky_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoGo);
this.menuSky_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
this.arrow_mc.addEventListener(MouseEvent.CLICK, this.gotoIntro);
this.arrow_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoGo);
this.arrow_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
this.blueRabbitSelect_btn.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter1);
this.redRabbitSelect_btn.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter2);
this.dancingSealSelect_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter3);
this.reindeerSelect_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter4);
this.blueRabbitSelect_btn.enabled = false;
this.redRabbitSelect_btn.enabled = false;
this.dancingSealSelect_mc.mouseEnabled = (this.dancingSealSelect_mc.mouseChildren = false);
this.reindeerSelect_mc.mouseEnabled = (this.reindeerSelect_mc.mouseChildren = false);
this.defaultInfo = 12;
this.infoDefault();
this.arrow_mc.visible = true;
}
private function selectRedRabbit(_arg1:MouseEvent):void{
this.character = 2;
this.startLevel();
}
private function selectSnow(_arg1:MouseEvent):void{
this.level = 3;
this.characterSelect();
}
private function selectReindeer(_arg1:MouseEvent):void{
this.character = 4;
this.startLevel();
}
public function gotoTitle(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndStop(1, "TitleScreen");
}
private function selectRain(_arg1:MouseEvent):void{
this.level = 2;
this.characterSelect();
}
public function onShowScores():void{
var _local1:int;
this.backToPlane_mc.backToPlane_btn.addEventListener(MouseEvent.CLICK, this.gotoMenu);
this.teamName_txt.text = this.teamName;
levelName_mc.gotoAndStop(this.level);
_local1 = int(((100 * ((this.carrotScore - (this.duckScore * 2)) - (this.weatherScore * 5))) * (1 - Math.abs((this.parachuteGame_mc.character_mc.x / 275)))));
this.score_txt.text = String(_local1);
switch (this.level){
case 1:
if (this.levelUnlocked == 1){
this.levelUnlocked = 2;
} else {
this.backToPlane_mc.gotoAndStop(2);
};
if (_local1 > this.level1Score){
this.level1Score = _local1;
};
this.bestScore_txt.text = String(this.level1Score);
break;
case 2:
if (this.levelUnlocked == 2){
this.levelUnlocked = 3;
this.characterUnlocked = 3;
} else {
this.backToPlane_mc.gotoAndStop(2);
};
if (_local1 > this.level2Score){
this.level2Score = _local1;
};
this.bestScore_txt.text = String(this.level2Score);
break;
case 3:
if (this.levelUnlocked == 3){
this.levelUnlocked = 4;
this.characterUnlocked = 4;
} else {
this.backToPlane_mc.gotoAndStop(2);
};
if (_local1 > this.level3Score){
this.level3Score = _local1;
};
this.bestScore_txt.text = String(this.level3Score);
break;
case 4:
if (this.levelUnlocked == 4){
this.levelUnlocked = 5;
} else {
this.backToPlane_mc.gotoAndStop(2);
};
if (_local1 > this.level4Score){
this.level4Score = _local1;
};
this.bestScore_txt.text = String(this.level4Score);
break;
case 5:
this.backToPlane_mc.gotoAndStop(2);
if (_local1 > this.level5Score){
this.level5Score = _local1;
};
this.bestScore_txt.text = String(this.level5Score);
break;
};
this.save.updateFromObject(this);
this.saveSystem.save(this.save.encode());
}
public function gotoLogos(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndPlay(1, "Logos");
}
public function onJump(_arg1:Event):void{
ControlsManager.getInstance().unregisterKeyPress("SPACE", this.onJump);
this.jumpClip.gotoAndPlay((this.jumpClip.currentFrame + 1));
this.jumpClip.blueRabbit_mc.gotoAndPlay((this.jumpClip.blueRabbit_mc.currentFrame + 1));
this.jumpClip.redRabbit_mc.gotoAndPlay((this.jumpClip.redRabbit_mc.currentFrame + 1));
this.jumpClip.dancingSeal_mc.gotoAndPlay((this.jumpClip.dancingSeal_mc.currentFrame + 1));
this.jumpClip.reindeer_mc.gotoAndPlay((this.jumpClip.reindeer_mc.currentFrame + 1));
this.gotoAndPlay((this.currentFrame + 1));
}
public function gotoIntro(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndStop(1, "Intro");
}
public function onGame():void{
var _local1:FreeFallPlayer;
this.sfxManager.stopSFX("outsidePlane");
this.stop();
water_mc.gotoAndStop(this.level);
effects_mc.gotoAndStop(this.level);
switch (this.character){
case 1:
_local1 = new BlueRabbitDiver();
_local1.moveMultiplier = 0.8;
break;
case 2:
_local1 = new RedRabbitDiver();
_local1.moveMultiplier = 0.8;
break;
case 3:
_local1 = new DancingSealDiver();
_local1.moveMultiplier = 0.9;
break;
case 4:
_local1 = new ReindeerDiver();
_local1.moveMultiplier = 1.1;
break;
};
_local1.hud = this.hud_mc;
if (this.level == 5){
effects_mc.blendMode = BlendMode.ADD;
_local1.isSun = true;
};
switch (this.level){
case 1:
this.game = new FreeFallGameNormal(_local1);
break;
case 2:
this.game = new FreeFallGameRain(_local1);
break;
case 3:
this.game = new FreeFallGameSnow(_local1);
break;
case 4:
this.game = new FreeFallGameThunder(_local1);
break;
case 5:
this.game = new FreeFallGameSun(_local1);
break;
};
_local1.addEventListener("deployingChute", this.game.onDeployChute);
this.addChildAt(this.game, 1);
GameManager.getInstance().startFrame(this.stage);
switch (this.level){
case 1:
this.musicManager.playMusic("level1");
break;
case 2:
this.musicManager.playMusic("level2");
break;
case 3:
this.musicManager.playMusic("level3");
break;
case 4:
this.musicManager.playMusic("level4");
break;
case 5:
this.musicManager.playMusic("level5");
break;
};
this.sfxManager.playSFX("falling", int.MAX_VALUE);
}
function frame439(){
stop();
}
private function selectNormal(_arg1:MouseEvent):void{
this.level = 1;
this.characterSelect();
}
private function selectDancingSeal(_arg1:MouseEvent):void{
this.character = 3;
this.startLevel();
}
private function drawTeamLogo(_arg1:MouseEvent):void{
this.addChild(new DrawLogo());
}
private function selectBlueRabbit(_arg1:MouseEvent):void{
this.character = 1;
this.startLevel();
}
function frame570(){
this.gotoMenu();
}
function frame334(){
stop();
}
public function gotoMenu(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndStop(1, "Menu");
}
function frame335(){
this.introAnimSetup();
}
private function infoLevel(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(1);
}
private function infoCharacter3(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(10);
}
private function infoCharacter4(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(11);
}
private function infoLevel1(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(2);
}
private function infoLevel5(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(6);
}
public function onLogos():void{
var _local1:MovieClip;
this.linkToAG(this.agIntro_mc);
this.musicManager = MusicManager.getInstance();
this.sfxManager = SFXManager.getInstance();
this.sfxManager.addSFX(CrunchSound, "crunch");
this.sfxManager.addSFX(QuackSound, "quack");
this.sfxManager.addSFX(WetSound, "wet");
this.sfxManager.addSFX(FreezeSound, "ice");
this.sfxManager.addSFX(ThunderSound, "thunder");
this.sfxManager.addSFX(BurnSound, "burn");
this.sfxManager.addSFX(LightningSound, "lightning");
this.sfxManager.addSFX(RainSound, "rain");
this.sfxManager.addSFX(FallSound, "falling");
this.sfxManager.addSFX(InsidePlaneSound, "insidePlane");
this.sfxManager.addSFX(OutsidePlaneSound, "outsidePlane");
this.sfxManager.addSFX(ParachuteSound, "openParachute");
this.musicManager.addMusic(Level1Music, "level1");
this.musicManager.addMusic(Level2Music, "level2");
this.musicManager.addMusic(Level3Music, "level3");
this.musicManager.addMusic(Level4Music, "level4");
this.musicManager.addMusic(Level5Music, "level5");
this.levelUnlocked = 1;
this.characterUnlocked = 2;
_local1 = new DefaultLogo();
this.logo = new BitmapData(_local1.width, _local1.height, true, 0);
this.logo.draw(_local1);
this.logoBG = 11600129;
this.teamName = "TEAM BR";
this.saveSystem = new SaveSystem("brsfreefall");
this.save = new FreeFallGameSave();
this.save.decode(this.saveSystem.load());
this.save.updateToObject(this);
this.saveSystem.save(this.save.encode());
}
private function infoCharacter1(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(8);
}
private function infoCharacter2(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(9);
}
private function infoLevel3(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(4);
}
private function characterSelect(_arg1:Event=null):void{
this.back_btn.enabled = true;
this.back_btn.addEventListener(MouseEvent.CLICK, this.onMenu);
this.back_btn.removeEventListener(MouseEvent.CLICK, this.characterSelect);
this.arrow_mc.visible = false;
this.menuSky_mc.gotoAndStop(this.level);
this.menuSky_mc.mouseChildren = (this.menuSky_mc.mouseEnabled = false);
this.menuSky_mc.removeEventListener(MouseEvent.CLICK, this.gotoIntro);
this.menuSky_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoGo);
this.menuSky_mc.removeEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
this.arrow_mc.removeEventListener(MouseEvent.CLICK, this.gotoIntro);
this.arrow_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoGo);
this.arrow_mc.removeEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
this.door_mc.gotoAndPlay(2);
this.normalLevel_btn.removeEventListener(MouseEvent.ROLL_OVER, this.infoLevel1);
this.rainLevel_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoLevel4);
this.snowLevel_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoLevel3);
this.thunderLevel_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoLevel2);
this.sunLevel_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoLevel5);
this.normalLevel_btn.enabled = false;
this.rainLevel_mc.mouseEnabled = (this.rainLevel_mc.mouseChildren = false);
this.snowLevel_mc.mouseEnabled = (this.snowLevel_mc.mouseChildren = false);
this.thunderLevel_mc.mouseEnabled = (this.thunderLevel_mc.mouseChildren = false);
this.sunLevel_mc.mouseEnabled = (this.sunLevel_mc.mouseChildren = false);
this.infoCharacter();
this.defaultInfo = 7;
switch (this.characterUnlocked){
case 4:
this.reindeerSelect_mc.gotoAndStop(2);
this.reindeerSelect_mc.mouseEnabled = (this.reindeerSelect_mc.mouseChildren = true);
this.reindeerSelect_mc.addEventListener(MouseEvent.CLICK, this.selectReindeer);
this.reindeerSelect_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoCharacter4);
this.reindeerSelect_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 3:
this.dancingSealSelect_mc.gotoAndStop(2);
this.dancingSealSelect_mc.mouseEnabled = (this.dancingSealSelect_mc.mouseChildren = true);
this.dancingSealSelect_mc.addEventListener(MouseEvent.CLICK, this.selectDancingSeal);
this.dancingSealSelect_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoCharacter3);
this.dancingSealSelect_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 2:
this.redRabbitSelect_btn.enabled = true;
this.redRabbitSelect_btn.addEventListener(MouseEvent.CLICK, this.selectRedRabbit);
this.redRabbitSelect_btn.addEventListener(MouseEvent.ROLL_OVER, this.infoCharacter2);
this.redRabbitSelect_btn.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 1:
this.blueRabbitSelect_btn.enabled = true;
this.blueRabbitSelect_btn.addEventListener(MouseEvent.CLICK, this.selectBlueRabbit);
this.blueRabbitSelect_btn.addEventListener(MouseEvent.ROLL_OVER, this.infoCharacter1);
this.blueRabbitSelect_btn.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
};
}
private function infoLevel2(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(3);
}
private function selectSun(_arg1:MouseEvent):void{
this.level = 5;
this.characterSelect();
}
public function onTitle():void{
this.stop();
this.linkToAG(this.pmgTitle_btn);
this.linkToAG(this.agTitle_btn);
this.linkToSFB(this.sfbTitle_btn);
this.mbrTitle_btn.addEventListener(MouseEvent.CLICK, this.openMoreBR);
this.playTitle_btn.addEventListener(MouseEvent.CLICK, this.gotoMenu);
}
function frame495(){
this.onShowScores();
}
private function playIntro(_arg1:MouseEvent){
this.gotoAndPlay(2, "Intro");
}
public function onIntro():void{
this.sfxManager.stopSFX("insidePlane");
this.sfxManager.playSFX("outsidePlane", int.MAX_VALUE);
if (this.level == 2){
this.sfxManager.playSFX("rain", int.MAX_VALUE, 0.6, 0, false, 100);
};
this.go_btn.addEventListener(MouseEvent.CLICK, this.playIntro);
this.cloudsFG_mc.clouds_mc.gotoAndStop(this.level);
this.cloudsBG_mc.clouds_mc.gotoAndStop(this.level);
this.skyIntro_mc.gotoAndStop(this.level);
this.weather_mc.gotoAndStop(this.level);
this.levelInfo_mc.gotoAndStop(this.level);
this.jump_btn.addEventListener(MouseEvent.CLICK, onJump);
this.qualityToMedium();
}
private function infoLevel4(_arg1:Event=null):void{
this.menuInfo_mc.gotoAndStop(5);
}
private function infoDefault(_arg1:Event=null):void{
if (this.menuInfo_mc){
this.menuInfo_mc.gotoAndStop(this.defaultInfo);
};
}
private function introAnimSetup():void{
this.plane_mc.addEventListener("readyToJump", this.jump);
}
public function gotoPara(_arg1:Event=null):void{
Cleanup.cleanDisplayList(this, true);
this.gotoAndStop(1, "Parachute");
}
public function onMenu(_arg1:Event=null):void{
this.stop();
ControlsManager.getInstance().clearKeyPresses();
ControlsManager.getInstance().clearDoublePresses();
this.sfxManager.stopAllSFX();
this.sfxManager.playSFX("insidePlane", int.MAX_VALUE);
this.musicManager.stopMusic();
if (this.door_mc.currentFrame > 1){
this.door_mc.gotoAndPlay(17);
};
this.back_btn.enabled = false;
this.back_btn.removeEventListener(MouseEvent.CLICK, this.onMenu);
this.back_btn.removeEventListener(MouseEvent.CLICK, this.characterSelect);
this.blueRabbitSelect_btn.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter1);
this.redRabbitSelect_btn.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter2);
this.dancingSealSelect_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter3);
this.reindeerSelect_mc.removeEventListener(MouseEvent.ROLL_OVER, this.infoCharacter4);
this.darken1_mc.mouseEnabled = false;
this.darken2_mc.mouseEnabled = false;
this.menuSky_mc.mouseChildren = (this.menuSky_mc.mouseEnabled = false);
this.blueRabbitSelect_btn.enabled = false;
this.redRabbitSelect_btn.enabled = false;
this.dancingSealSelect_mc.mouseEnabled = (this.dancingSealSelect_mc.mouseChildren = false);
this.reindeerSelect_mc.mouseEnabled = (this.reindeerSelect_mc.mouseChildren = false);
this.normalLevel_btn.enabled = false;
this.rainLevel_mc.mouseEnabled = (this.rainLevel_mc.mouseChildren = false);
this.snowLevel_mc.mouseEnabled = (this.snowLevel_mc.mouseChildren = false);
this.thunderLevel_mc.mouseEnabled = (this.thunderLevel_mc.mouseChildren = false);
this.sunLevel_mc.mouseEnabled = (this.sunLevel_mc.mouseChildren = false);
this.infoLevel();
this.defaultInfo = 1;
this.arrow_mc.visible = false;
this.teamLogo_btn.addEventListener(MouseEvent.CLICK, this.drawTeamLogo);
switch (this.levelUnlocked){
case 5:
this.sunLevel_mc.gotoAndStop(2);
this.sunLevel_mc.mouseEnabled = (this.sunLevel_mc.mouseChildren = true);
this.sunLevel_mc.addEventListener(MouseEvent.CLICK, this.selectSun);
this.sunLevel_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoLevel5);
this.sunLevel_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 4:
this.thunderLevel_mc.gotoAndStop(2);
this.thunderLevel_mc.mouseEnabled = (this.thunderLevel_mc.mouseChildren = true);
this.thunderLevel_mc.addEventListener(MouseEvent.CLICK, this.selectThunder);
this.thunderLevel_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoLevel4);
this.thunderLevel_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 3:
this.snowLevel_mc.gotoAndStop(2);
this.snowLevel_mc.mouseEnabled = (this.snowLevel_mc.mouseChildren = true);
this.snowLevel_mc.addEventListener(MouseEvent.CLICK, this.selectSnow);
this.snowLevel_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoLevel3);
this.snowLevel_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 2:
this.rainLevel_mc.gotoAndStop(2);
this.rainLevel_mc.mouseEnabled = (this.rainLevel_mc.mouseChildren = true);
this.rainLevel_mc.addEventListener(MouseEvent.CLICK, this.selectRain);
this.rainLevel_mc.addEventListener(MouseEvent.ROLL_OVER, this.infoLevel2);
this.rainLevel_mc.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
case 1:
this.normalLevel_btn.enabled = true;
this.normalLevel_btn.addEventListener(MouseEvent.CLICK, this.selectNormal);
this.normalLevel_btn.addEventListener(MouseEvent.ROLL_OVER, this.infoLevel1);
this.normalLevel_btn.addEventListener(MouseEvent.ROLL_OUT, this.infoDefault);
};
switch (this.characterUnlocked){
case 4:
this.reindeerSelect_mc.gotoAndStop(2);
case 3:
this.dancingSealSelect_mc.gotoAndStop(2);
};
}
public function openMoreBR(_arg1:Event):void{
this.addChild(new MoreBRS());
}
}
}//package code
Section 58
//FreeFallGame (code.FreeFallGame)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import sfb.game.systems.*;
import sfb.graphics.parallax.*;
import sfb.tools.*;
public class FreeFallGame extends MovieClip {
public var hud:FreeFallHUD;
protected var clouds1:ParaObject;
protected var clouds2:ParaObject;
protected var clouds3:ParaObject;
public var carrots:Array;
protected var island:ParaObject;
private var tickID:uint;
protected var scene:ParaScene;
public var ended:Boolean;
public var fallSpeed:Number;
public var deployed:Boolean;
protected var cam:Camera;
public var player:FreeFallPlayer;
public static var game:FreeFallGame;
public function FreeFallGame(_arg1:FreeFallPlayer=null){
game = this;
this.player = _arg1;
this.addChild(_arg1);
scene = new ParaScene(400);
if (clouds1){
scene.addObject(clouds1);
};
if (clouds2){
scene.addObject(clouds2);
};
if (clouds3){
scene.addObject(clouds3);
};
scene.addObject(island);
scene.addObject(_arg1.modelMass);
scene.addEventListener(ParaScene.FINISHED_RENDERING, _arg1.hitTest);
scene.hitMin = 75;
scene.hitMax = 125;
this.addChild(scene);
scene.realX = 275;
scene.realY = 200;
this.cam = new Camera(_arg1, scene, new Rectangle(265, 190, 20, 20), 1.2);
this.cam.startFollowing();
this.tickID = GameManager.getInstance().addTickFunction(act);
this.fallSpeed = 15;
}
public function onDeployChute(_arg1:Event):void{
this.deployed = true;
this.ended = true;
FreeFallApp(this.parent).fadeInOut_mc.gotoAndPlay("fadeOut");
FreeFallApp(this.parent).fadeInOut_mc.addEventListener("fadedOut", this.onFadedOut);
}
public function createWeather():void{
}
public function act():void{
var _local1:Duck;
if (ended){
this.fallSpeed = (this.fallSpeed * 0.95);
} else {
this.fallSpeed = this.player.modelMass.velocity.z;
};
scene.z = (scene.z + this.fallSpeed);
if (((((!(this.ended)) && ((scene.z < (player.fallHeight - 5000))))) && ((Math.random() < 0.05)))){
_local1 = new Duck(new Vector3D(this.player.modelMass.position.x, this.player.modelMass.position.y, (this.player.modelMass.position.z + 1000)));
scene.addObject(_local1.modelObject);
};
if (((((!(this.ended)) && ((scene.z < (player.fallHeight - 5000))))) && ((Math.random() < 0.04)))){
createWeather();
};
if (((!(this.ended)) && ((scene.z > (player.fallHeight - 2000))))){
this.ended = true;
FreeFallApp(this.parent).fadeInOut_mc.gotoAndPlay("fadeOut");
FreeFallApp(this.parent).fadeInOut_mc.addEventListener("fadedOut", this.onFadedOut);
};
}
public function onFadedOut(_arg1:Event):void{
this.cam.stopFollowing();
GameManager.getInstance().removeTickFunction(this.tickID);
this.player.endGame();
if (this.deployed){
FreeFallApp(this.parent).gotoPara();
} else {
FreeFallApp(this.parent).gotoFall();
};
if (this.parent){
this.parent.removeChild(this);
};
Cleanup.cleanDisplayList(this, true);
Cleanup.cleanArray(this.carrots);
this.scene.cleanup();
this.hud = null;
this.player = null;
this.scene = null;
this.cam = null;
this.clouds1 = null;
this.clouds2 = null;
this.clouds3 = null;
this.island = null;
}
}
}//package code
Section 59
//FreeFallGameNormal (code.FreeFallGameNormal)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.graphics.parallax.*;
import sfb.graphics.*;
public class FreeFallGameNormal extends FreeFallGame {
public function FreeFallGameNormal(_arg1:FreeFallPlayer=null){
var _local2:BitmapData;
var _local3:ScalingRepeatingTexture;
var _local4:ScalingRepeatingTexture;
var _local5:ScalingRepeatingTexture;
var _local6:MovieClip;
var _local7:MovieClip;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:Carrot;
_local2 = new BitmapData(550, 400, true);
_local2.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local2.colorTransform(_local2.rect, new ColorTransform(1, 1, 1, 0.8));
_local3 = new ScalingRepeatingTexture(_local2, new Rectangle(0, 0, 2000, 1600));
clouds1 = new ParaObject(_local3, new Vector3D(0, 0, 333));
_local2.dispose();
_local2 = new BitmapData(550, 400, true);
_local2.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local2.colorTransform(_local2.rect, new ColorTransform(1, 1, 1, 0.8));
_local4 = new ScalingRepeatingTexture(_local2, new Rectangle(0, 0, 2000, 1600));
clouds2 = new ParaObject(_local4, new Vector3D(0, 0, 666));
_local2.dispose();
_local2 = new BitmapData(550, 400, true);
_local2.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local2.colorTransform(_local2.rect, new ColorTransform(1, 1, 1, 0.8));
_local5 = new ScalingRepeatingTexture(_local2, new Rectangle(0, 0, 2000, 1600));
clouds3 = new ParaObject(_local5, new Vector3D(0, 0, 1000));
_local2.dispose();
clouds1.loopToDepth = (clouds2.loopToDepth = (clouds3.loopToDepth = 1000));
clouds1.fadeDistance = (clouds2.fadeDistance = (clouds3.fadeDistance = 100));
clouds1.drawDistance = (clouds2.drawDistance = (clouds3.drawDistance = 800));
clouds1.layer = (clouds2.layer = (clouds3.layer = true));
_local6 = new NormalIsland();
_local7 = new Continents();
new Continents().scaleX = (_local7.scaleY = 40);
_local6.addChild(_local7);
island = new ParaObject(_local6, new Vector3D(0, 0, 15000));
island.drawDistance = 15000;
_arg1.fallHeight = 15000;
_arg1.hud.maxHeight = uint((_arg1.fallHeight / 10));
_arg1.hud.deployStart = 400;
_arg1.hud.deployEnd = 200;
_arg1.carrotTarget = 50;
super(_arg1);
_local8 = [];
_local8 = _local8.concat(Paths3D.line(new Vector3D(200, -100, 500), new Vector3D(-200, -100, 1000), 10));
_local8 = _local8.concat(Paths3D.line(new Vector3D(-200, 100, 1050), new Vector3D(200, 100, 1550), 10));
_local8 = _local8.concat(Paths3D.arc(new Vector3D(0, 0, 1700), 50, (Math.PI * 4), 30, 0, new Vector3D(0, 0, 4800), 300));
_local8 = _local8.concat(Paths3D.arc(new Vector3D(0, 0, 5000), 200, (Math.PI * 2), 15, 0));
_local8 = _local8.concat(Paths3D.arc(new Vector3D(0, 0, 5500), 200, (Math.PI * 2), 15, 0));
_local8 = _local8.concat(Paths3D.arc(new Vector3D(0, 0, 6000), 200, (Math.PI * 2), 15, 0));
_local8 = _local8.concat(Paths3D.arc(new Vector3D(0, 0, 6500), 200, (Math.PI * 2), 15, 0));
_local8 = _local8.concat(Paths3D.line(new Vector3D(0, 0, 5000), new Vector3D(0, 0, 6500), 20));
_local8 = _local8.concat(Paths3D.line(new Vector3D(300, 300, 7500), new Vector3D(-300, -300, 8500), 10));
_local8 = _local8.concat(Paths3D.line(new Vector3D(300, -300, 9000), new Vector3D(-300, 300, 10000), 10));
this.carrots = [];
_local9 = 0;
_local10 = _local8.length;
while (_local9 < _local10) {
_local11 = new Carrot(_local8[_local9]);
this.carrots.push(_local11);
scene.addObject(_local11.modelObject);
_local9++;
};
}
}
}//package code
Section 60
//FreeFallGameRain (code.FreeFallGameRain)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.graphics.parallax.*;
import sfb.graphics.*;
public class FreeFallGameRain extends FreeFallGame {
public function FreeFallGameRain(_arg1:FreeFallPlayer=null){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:MovieClip;
var _local7:uint;
var _local8:uint;
var _local9:BitmapData;
var _local10:ScalingRepeatingTexture;
var _local11:ScalingRepeatingTexture;
var _local12:ScalingRepeatingTexture;
var _local13:MovieClip;
var _local14:MovieClip;
var _local15:uint;
var _local16:Array;
var _local17:Number;
var _local18:Number;
var _local19:Carrot;
_local2 = 0.6;
_local3 = 0.6;
_local4 = 0.6;
_local5 = 1.1;
_local6 = new Rain();
_local7 = 5000;
_local9 = new BitmapData(550, 400, true);
_local9.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local9.colorTransform(_local9.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = 0;
while (_local8 < _local7) {
_local9.draw(_local6, new Matrix(1, 0, 0, 1, (5 + (Math.random() * 540)), (5 + (Math.random() * 390))), null, BlendMode.LAYER);
_local8++;
};
_local10 = new ScalingRepeatingTexture(_local9, new Rectangle(0, 0, 2000, 1600));
clouds1 = new ParaObject(_local10, new Vector3D(0, 0, 333));
_local9.dispose();
_local9 = new BitmapData(550, 400, true);
_local9.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local9.colorTransform(_local9.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = 0;
while (_local8 < _local7) {
_local9.draw(_local6, new Matrix(1, 0, 0, 1, (Math.random() * 550), (Math.random() * 400)), null, BlendMode.LAYER);
_local8++;
};
_local11 = new ScalingRepeatingTexture(_local9, new Rectangle(0, 0, 2000, 1600));
clouds2 = new ParaObject(_local11, new Vector3D(0, 0, 666));
_local9.dispose();
_local9 = new BitmapData(550, 400, true);
_local9.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local9.colorTransform(_local9.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = 0;
while (_local8 < _local7) {
_local9.draw(_local6, new Matrix(1, 0, 0, 1, (Math.random() * 550), (Math.random() * 400)), null, BlendMode.LAYER);
_local8++;
};
_local12 = new ScalingRepeatingTexture(_local9, new Rectangle(0, 0, 2000, 1600));
clouds3 = new ParaObject(_local12, new Vector3D(0, 0, 1000));
_local9.dispose();
clouds1.loopToDepth = (clouds2.loopToDepth = (clouds3.loopToDepth = 1000));
clouds1.fadeDistance = (clouds2.fadeDistance = (clouds3.fadeDistance = 100));
clouds1.drawDistance = (clouds2.drawDistance = (clouds3.drawDistance = 800));
clouds1.layer = (clouds2.layer = (clouds3.layer = true));
_local13 = new RainIsland();
_local14 = new Continents();
new Continents().scaleX = (_local14.scaleY = 40);
_local13.addChild(_local14);
island = new ParaObject(_local13, new Vector3D(0, 0, 20000));
island.drawDistance = 20000;
_arg1.fallHeight = 20000;
_arg1.hud.maxHeight = uint((_arg1.fallHeight / 10));
_arg1.hud.deployStart = 400;
_arg1.hud.deployEnd = 200;
_arg1.carrotTarget = 50;
super(_arg1);
_local16 = [];
_local8 = 0;
while (_local8 < 30) {
_local17 = ((Math.random() * 600) - 300);
_local18 = ((Math.random() * 600) - 300);
_local16 = _local16.concat(Paths3D.line(new Vector3D(_local17, _local18, (500 + (_local8 * 500))), new Vector3D(_local17, _local18, ((500 + (_local8 * 500)) + 300)), 4));
_local8++;
};
this.carrots = [];
_local8 = 0;
_local15 = _local16.length;
while (_local8 < _local15) {
_local19 = new Carrot(_local16[_local8]);
this.carrots.push(_local19);
scene.addObject(_local19.modelObject);
_local8++;
};
}
override public function createWeather():void{
var _local1:RainCloud;
var _local2:ParaObject;
_local1 = new RainCloud();
_local1.gotoAndStop((Math.floor((Math.random() * 3)) + 1));
_local1.visible = false;
_local2 = new ParaObject(_local1, new Vector3D(((this.player.modelMass.position.x + (Math.random() * 500)) - 250), ((this.player.modelMass.position.y + (Math.random() * 500)) - 250), (this.player.modelMass.position.z + 1000)));
scene.addObject(_local2);
}
}
}//package code
Section 61
//FreeFallGameSave (code.FreeFallGameSave)
package code {
import flash.display.*;
import sfb.application.saves.*;
public class FreeFallGameSave extends GameSave {
public var level4Score:int;
public var characterUnlocked:uint;
public var teamName:String;
public var level2Score:int;
public var levelUnlocked:uint;
public var level5Score:int;
public var level3Score:int;
public var level1Score:int;
public var logo:BitmapData;
public var logoBG:uint;
public function FreeFallGameSave(){
vars = ["logoBG", "teamName", "levelUnlocked", "characterUnlocked", "level1Score", "level2Score", "level3Score", "level4Score", "level5Score"];
this.updateFromObject(FreeFallApp.app);
this.title = "Blue Rabbit's FreeFall";
this.description = "Skydiving adventures with Blue Rabbit and friends";
this.link = "http://www.armorgames.com";
this.colourBorder = 795977;
this.colourBackground = 5998312;
this.colourText = 0xFFFFFF;
this.image1.draw(new SaveImage1());
this.image1.draw(new SaveImage2());
}
override public function updateToObject(_arg1:Object):void{
super.updateToObject(_arg1);
if ((_arg1 is FreeFallApp)){
_arg1.logo = this.logo.clone();
};
}
override public function encode():EncodedGameSave{
var _local1:EncodedGameSave;
_local1 = super.encode();
_local1.data.logo = this.logo.getPixels(this.logo.rect);
return (_local1);
}
override public function updateFromObject(_arg1:Object):void{
super.updateFromObject(_arg1);
if ((_arg1 is FreeFallApp)){
this.logo = _arg1.logo.clone();
};
}
override public function decode(_arg1:EncodedGameSave):void{
super.decode(_arg1);
if (_arg1 != null){
_arg1.data.logo.position = 0;
this.logo.setPixels(this.logo.rect, _arg1.data.logo);
};
}
}
}//package code
Section 62
//FreeFallGameSnow (code.FreeFallGameSnow)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.graphics.parallax.*;
import sfb.graphics.*;
public class FreeFallGameSnow extends FreeFallGame {
public function FreeFallGameSnow(_arg1:FreeFallPlayer=null){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:MovieClip;
var _local7:uint;
var _local8:uint;
var _local9:BitmapData;
var _local10:ScalingRepeatingTexture;
var _local11:ScalingRepeatingTexture;
var _local12:ScalingRepeatingTexture;
var _local13:MovieClip;
var _local14:MovieClip;
var _local15:Array;
var _local16:uint;
var _local17:Carrot;
_local2 = 1.2;
_local3 = 1.2;
_local4 = 1.2;
_local5 = 1.1;
_local6 = new Snow();
_local7 = 100;
_local9 = new BitmapData(550, 400, true);
_local9.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local9.colorTransform(_local9.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = 0;
while (_local8 < _local7) {
_local9.draw(_local6, new Matrix(1, 0, 0, 1, (5 + (Math.random() * 540)), (5 + (Math.random() * 390))), null, BlendMode.LAYER);
_local8++;
};
_local10 = new ScalingRepeatingTexture(_local9, new Rectangle(0, 0, 2000, 1600));
clouds1 = new ParaObject(_local10, new Vector3D(0, 0, 333));
_local9.dispose();
_local9 = new BitmapData(550, 400, true);
_local9.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local9.colorTransform(_local9.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = 0;
while (_local8 < _local7) {
_local9.draw(_local6, new Matrix(1, 0, 0, 1, (Math.random() * 550), (Math.random() * 400)), null, BlendMode.LAYER);
_local8++;
};
_local11 = new ScalingRepeatingTexture(_local9, new Rectangle(0, 0, 2000, 1600));
clouds2 = new ParaObject(_local11, new Vector3D(0, 0, 666));
_local9.dispose();
_local9 = new BitmapData(550, 400, true);
_local9.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local9.colorTransform(_local9.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = 0;
while (_local8 < _local7) {
_local9.draw(_local6, new Matrix(1, 0, 0, 1, (Math.random() * 550), (Math.random() * 400)), null, BlendMode.LAYER);
_local8++;
};
_local12 = new ScalingRepeatingTexture(_local9, new Rectangle(0, 0, 2000, 1600));
clouds3 = new ParaObject(_local12, new Vector3D(0, 0, 1000));
_local9.dispose();
clouds1.loopToDepth = (clouds2.loopToDepth = (clouds3.loopToDepth = 1000));
clouds1.fadeDistance = (clouds2.fadeDistance = (clouds3.fadeDistance = 100));
clouds1.drawDistance = (clouds2.drawDistance = (clouds3.drawDistance = 800));
clouds1.layer = (clouds2.layer = (clouds3.layer = true));
_local13 = new SnowIsland();
_local14 = new Continents();
new Continents().scaleX = (_local14.scaleY = 40);
_local13.addChild(_local14);
island = new ParaObject(_local13, new Vector3D(0, 0, 25000));
island.drawDistance = 25000;
_arg1.fallHeight = 25000;
_arg1.hud.maxHeight = uint((_arg1.fallHeight / 10));
_arg1.hud.deployStart = 500;
_arg1.hud.deployEnd = 200;
_arg1.carrotTarget = 75;
super(_arg1);
_local15 = [];
_local15 = _local15.concat(Paths3D.arc(new Vector3D(0, 0, 500), 100, (Math.PI * 4), 25, 0, new Vector3D(-500, -500, 2500)));
_local15 = _local15.concat(Paths3D.arc(new Vector3D(-400, -400, 4000), 80, (Math.PI * 6), 25, 0, new Vector3D(-100, 100, 6000)));
_local15 = _local15.concat(Paths3D.arc(new Vector3D(0, 0, 7500), 20, (Math.PI * 6), 25, 0, new Vector3D(500, 100, 9000), 80));
_local15 = _local15.concat(Paths3D.arc(new Vector3D(400, 300, 9500), 100, (Math.PI * 6), 25, 0, new Vector3D(0, -100, 13000)));
_local15 = _local15.concat(Paths3D.arc(new Vector3D(300, 0, 15000), 100, (Math.PI * 6), 25, 0, new Vector3D(0, -600, 18000)));
_local15 = _local15.concat(Paths3D.arc(new Vector3D(300, 0, 15000), 100, (Math.PI * 6), 25, Math.PI, new Vector3D(0, -600, 18000)));
this.carrots = [];
_local8 = 0;
_local16 = _local15.length;
while (_local8 < _local16) {
_local17 = new Carrot(_local15[_local8]);
this.carrots.push(_local17);
scene.addObject(_local17.modelObject);
_local8++;
};
}
override public function createWeather():void{
var _local1:SnowFlake;
var _local2:ParaObject;
_local1 = new SnowFlake();
_local1.visible = false;
_local2 = new ParaObject(_local1, new Vector3D(((this.player.modelMass.position.x + (Math.random() * 500)) - 250), ((this.player.modelMass.position.y + (Math.random() * 500)) - 250), (this.player.modelMass.position.z + 1000)));
scene.addObject(_local2);
}
}
}//package code
Section 63
//FreeFallGameSun (code.FreeFallGameSun)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.graphics.parallax.*;
public class FreeFallGameSun extends FreeFallGame {
public function FreeFallGameSun(_arg1:FreeFallPlayer=null){
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:Array;
var _local5:Point;
var _local6:uint;
var _local7:uint;
var _local8:Carrot;
_local2 = new SunIsland();
_local3 = new Continents();
_local3.scaleX = (_local3.scaleY = 40);
_local2.addChild(_local3);
island = new ParaObject(_local2, new Vector3D(0, 0, 30000));
island.drawDistance = 30000;
_arg1.fallHeight = 30000;
_arg1.hud.maxHeight = uint((_arg1.fallHeight / 10));
_arg1.hud.deployStart = 500;
_arg1.hud.deployEnd = 300;
_arg1.carrotTarget = 100;
super(_arg1);
_local4 = [];
_local6 = 0;
while (_local6 < 32) {
_local5 = Point.polar(600, ((Math.random() * Math.PI) * 2));
_local4 = _local4.concat(Paths3D.line(new Vector3D(_local5.x, _local5.y, (500 + (_local6 * 700))), new Vector3D(_local5.x, _local5.y, ((500 + (_local6 * 700)) + 500)), 10));
_local6++;
};
this.carrots = [];
_local6 = 0;
_local7 = _local4.length;
while (_local6 < _local7) {
_local8 = new Carrot(_local4[_local6]);
this.carrots.push(_local8);
scene.addObject(_local8.modelObject);
_local6++;
};
}
}
}//package code
Section 64
//FreeFallGameThunder (code.FreeFallGameThunder)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.audio.*;
import flash.events.*;
import sfb.graphics.parallax.*;
import sfb.graphics.*;
public class FreeFallGameThunder extends FreeFallGame {
private var flashCT:ColorTransform;
private var blankCT:ColorTransform;
private var lightningCount:uint;
private var isLightning:Boolean;
private var flashing:DisplayObject;
public function FreeFallGameThunder(_arg1:FreeFallPlayer=null){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:BitmapData;
var _local7:ScalingRepeatingTexture;
var _local8:ScalingRepeatingTexture;
var _local9:ScalingRepeatingTexture;
var _local10:MovieClip;
var _local11:MovieClip;
var _local12:Array;
var _local13:uint;
var _local14:uint;
var _local15:Number;
var _local16:Array;
var _local17:Vector3D;
var _local18:uint;
var _local19:Vector3D;
var _local20:Carrot;
this.blankCT = new ColorTransform();
this.flashCT = new ColorTransform(3, 3, 3, 1, 50, 50, 50, 50);
_local2 = 0.3;
_local3 = 0.3;
_local4 = 0.3;
_local5 = 1;
_local6 = new BitmapData(550, 400, true);
_local6.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local6.colorTransform(_local6.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local7 = new ScalingRepeatingTexture(_local6, new Rectangle(0, 0, 2000, 1600));
clouds1 = new ParaObject(_local7, new Vector3D(0, 0, 333));
_local6.dispose();
_local6 = new BitmapData(550, 400, true);
_local6.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local6.colorTransform(_local6.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local8 = new ScalingRepeatingTexture(_local6, new Rectangle(0, 0, 2000, 1600));
clouds2 = new ParaObject(_local8, new Vector3D(0, 0, 666));
_local6.dispose();
_local6 = new BitmapData(550, 400, true);
_local6.perlinNoise(550, 400, 30, Math.floor((Math.random() * 30)), true, true, 8, true);
_local6.colorTransform(_local6.rect, new ColorTransform(_local2, _local3, _local4, _local5));
_local9 = new ScalingRepeatingTexture(_local6, new Rectangle(0, 0, 2000, 1600));
clouds3 = new ParaObject(_local9, new Vector3D(0, 0, 1000));
_local6.dispose();
clouds1.loopToDepth = (clouds2.loopToDepth = (clouds3.loopToDepth = 1000));
clouds1.fadeDistance = (clouds2.fadeDistance = (clouds3.fadeDistance = 100));
clouds1.drawDistance = (clouds2.drawDistance = (clouds3.drawDistance = 800));
clouds1.layer = (clouds2.layer = (clouds3.layer = true));
_local10 = new ThunderIsland();
_local11 = new Continents();
new Continents().scaleX = (_local11.scaleY = 40);
_local10.addChild(_local11);
island = new ParaObject(_local10, new Vector3D(0, 0, 30000));
island.drawDistance = 30000;
_arg1.fallHeight = 30000;
_arg1.hud.maxHeight = uint((_arg1.fallHeight / 10));
_arg1.hud.deployStart = 500;
_arg1.hud.deployEnd = 300;
_arg1.carrotTarget = 75;
super(_arg1);
_local12 = [];
_local15 = 500;
_local16 = [];
_local17 = new Vector3D(100, 100, _local15);
while (_local15 < 23000) {
_local18 = (Math.floor((Math.random() * 2)) + 1);
_local16 = [];
if (Math.random() < 0.1){
_local15 = (_local15 + 1000);
_local17.z = (_local17.z + 1000);
};
_local15 = (_local15 + 400);
_local13 = 0;
while (_local13 < _local18) {
_local19 = new Vector3D(((_local17.x + (Math.random() * 800)) - 400), ((_local17.y + (Math.random() * 800)) - 400), _local15);
if (_local19.length2D < 800){
_local16.push(_local19);
_local12 = _local12.concat(Paths3D.line(_local17, _local19, 6));
};
_local13++;
};
if (_local16.length > 0){
_local17 = _local16[Math.floor((Math.random() * _local16.length))];
} else {
_local17.z = _local15;
};
};
this.carrots = [];
_local13 = 0;
_local14 = _local12.length;
while (_local13 < _local14) {
_local20 = new Carrot(_local12[_local13]);
this.carrots.push(_local20);
scene.addObject(_local20.modelObject);
_local13++;
};
}
override public function createWeather():void{
var _local1:ThunderCloud;
_local1 = new ThunderCloud(new Vector3D(((this.player.modelMass.position.x + (Math.random() * 500)) - 250), ((this.player.modelMass.position.y + (Math.random() * 500)) - 250), (this.player.modelMass.position.z + 1000)));
scene.addObject(_local1.modelObject);
}
override public function act():void{
super.act();
if (((!(isLightning)) && ((Math.random() < 0.02)))){
this.isLightning = true;
lightningCount = 0;
this.flashing = this[("clouds" + (Math.floor((Math.random() * 3)) + 1))].target;
} else {
if (isLightning){
lightningCount++;
switch (lightningCount){
case 2:
this.flashing.transform.colorTransform = this.flashCT;
SFXManager.getInstance().playSFX("lightning", 0, 0.7, ((Math.random() * 2) - 1));
break;
case 5:
this.flashing.transform.colorTransform = this.flashCT;
break;
default:
this.flashing.transform.colorTransform = this.blankCT;
break;
};
if (lightningCount > 10){
this.isLightning = false;
};
};
};
}
override public function onFadedOut(_arg1:Event):void{
super.onFadedOut(_arg1);
this.flashing = null;
}
}
}//package code
Section 65
//FreeFallHUD (code.FreeFallHUD)
package code {
import sfb.maths.*;
import flash.display.*;
import flash.text.*;
public class FreeFallHUD extends MovieClip {
public var carrots_txt:TextField;
public var deployZone_mc:MovieClip;
public var height_txt:TextField;
public var messages_mc:MovieClip;
private var maxHeight_int:uint;
private var deployStart_int:uint;
public var radar_mc:MovieClip;
public var logo_mc:MovieClip;
private var deployEnd_int:uint;
public function FreeFallHUD(){
this.maxHeight_int = 2000;
this.deployStart_int = 500;
this.deployEnd_int = 300;
this.posZone();
}
public function posZone():void{
this.deployZone_mc.y = (80 + ((300 * (this.maxHeight_int - this.deployStart_int)) / this.maxHeight_int));
this.deployZone_mc.height = ((80 + ((300 * (this.maxHeight_int - this.deployEnd_int)) / this.maxHeight_int)) - this.deployZone_mc.y);
}
public function set maxHeight(_arg1:uint):void{
this.maxHeight_int = _arg1;
this.posZone();
}
public function get deployEnd():uint{
return (this.deployEnd_int);
}
public function set position(_arg1:Vector3D):void{
this.radar_mc.blip_mc.x = (_arg1.x / 35);
this.radar_mc.blip_mc.y = (_arg1.y / 35);
}
public function set deployStart(_arg1:uint):void{
this.deployStart_int = _arg1;
this.posZone();
}
public function set carrots(_arg1:String):void{
this.carrots_txt.text = String(_arg1);
}
public function get deployStart():uint{
return (this.deployStart_int);
}
public function set playerHeight(_arg1:uint):void{
this.height_txt.text = String(_arg1);
this.logo_mc.y = (80 + ((300 * (this.maxHeight_int - _arg1)) / this.maxHeight_int));
}
public function set deployEnd(_arg1:uint):void{
this.deployEnd_int = _arg1;
this.posZone();
}
}
}//package code
Section 66
//FreeFallPlayer (code.FreeFallPlayer)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.audio.*;
import flash.events.*;
import fl.motion.*;
import sfb.game.systems.*;
import sfb.graphics.parallax.*;
import sfb.game.graphics.*;
import sfb.tools.*;
import sfb.application.*;
public class FreeFallPlayer extends MovieClip {
private var weatherScore:int;
public var burnAmount:int;
private var controlsManager:ControlsManager;
public var carrotTarget:int;
public var hud:FreeFallHUD;
public var isKeyboard:Boolean;
public var iceCount:int;
public var carrotCount:int;
public var wetCount:int;
public var parachute_mc:MovieClip;
public var zapCount:int;
private var duckScore:int;
private var isDiving:Boolean;
private var tickID:uint;
public var burnCount:int;
public var moveMultiplier:Number;// = 1
public var fallHeight:uint;
private var isRolling:Boolean;
public var modelMass:ParaMass;
public var hit_mc:MovieClip;
public var isSun:Boolean;
private var carrotScore:int;
private var stateDisplay:IStateDisplayable;
private static var FALL_DOWN:String = "fallDown";
private static var ROLL_LEFT:String = "rollLeft";
private static var FALL_LEFT:String = "fallLeft";
private static var DIVING:String = "diving";
private static var FALL_RIGHT:String = "fallRight";
private static var FALL_CENTER:String = "fallCenter";
private static var ROLL_RIGHT:String = "rollRight";
private static var FALL_UP:String = "fallUp";
public function FreeFallPlayer(){
moveMultiplier = 1;
super();
this.carrotCount = 0;
this.modelMass = new ParaMass(this, new Vector3D(0, 0, 100), new Vector3D(0, 0, 15));
this.modelMass.fadeDistance = 0;
this.stateDisplay = new FrameStateDisplay(this);
this.stateDisplay.setState(FALL_CENTER);
this.stateDisplay.applyState();
controlsManager = ControlsManager.getInstance();
controlsManager.registerKey("LEFT", "LEFT");
controlsManager.registerKey("RIGHT", "RIGHT");
controlsManager.registerKey("UP", "UP");
controlsManager.registerKey("DOWN", "DOWN");
controlsManager.registerDoublePress("LEFT", this.doubleLeft);
controlsManager.registerDoublePress("RIGHT", this.doubleRight);
controlsManager.registerKeyPress("SPACE", this.deployChute);
this.tickID = GameManager.getInstance().addTickFunction(this.act);
this.isKeyboard = true;
this.addEventListener(Event.ADDED_TO_STAGE, this.addListeners);
}
private function clickRoll(_arg1:MouseEvent):void{
if ((((((this.burnCount <= 0)) && ((this.zapCount <= 0)))) && ((this.iceCount <= 0)))){
if (((!(this.isRolling)) && (!(this.isDiving)))){
if (this.parent.mouseX > 70){
this.isRolling = true;
modelMass.velocity.x = 60;
this.stateDisplay.setState(FALL_RIGHT);
this.stateDisplay.applyState();
this.stateDisplay.setState(ROLL_RIGHT);
} else {
if (this.parent.mouseX < -70){
this.isRolling = true;
modelMass.velocity.x = -60;
this.stateDisplay.setState(FALL_LEFT);
this.stateDisplay.applyState();
this.stateDisplay.setState(ROLL_LEFT);
} else {
this.deployChute();
};
};
};
};
}
public function zap():void{
this.weatherScore++;
this.zapCount = 50;
this.transform.colorTransform = new ColorTransform(0, 0, 0);
this.carrotCount = (this.carrotCount - 5);
if (this.carrotCount < 0){
this.carrotCount = 0;
};
SFXManager.getInstance().playSFX("thunder");
}
public function endGame():void{
GameManager.getInstance().removeTickFunction(this.tickID);
controlsManager.unregisterDoublePress("LEFT", this.doubleLeft);
controlsManager.unregisterDoublePress("RIGHT", this.doubleRight);
controlsManager.unregisterKeyPress("SPACE", this.deployChute);
this.stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.clickRoll);
this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.useMouse);
FreeFallApp.app.carrotScore = this.carrotScore;
FreeFallApp.app.duckScore = this.duckScore;
FreeFallApp.app.weatherScore = this.weatherScore;
Cleanup.cleanDisplayList(this, true);
modelMass.target = null;
modelMass = null;
stateDisplay.cleanup();
stateDisplay = null;
this.hud = null;
}
public function doubleLeft(_arg1:KeyboardEvent):void{
if (!this.isRolling){
this.isRolling = true;
modelMass.velocity.x = -60;
this.stateDisplay.setState(FALL_LEFT);
this.stateDisplay.applyState();
this.stateDisplay.setState(ROLL_LEFT);
};
}
public function act(){
var _local1:Object;
var _local2:Number;
var _local3:Color;
var _local4:DisplayObject;
_local1 = controlsManager.getKeys();
if (((((((_local1.LEFT) || (_local1.RIGHT))) || (_local1.UP))) || (_local1.DOWN))){
this.isKeyboard = true;
};
if (this.isKeyboard){
if (this.isRolling){
if (Math.abs(modelMass.velocity.x) < 5){
this.isRolling = false;
};
} else {
if (_local1.LEFT){
modelMass.velocity.x = (modelMass.velocity.x - (4 * moveMultiplier));
this.stateDisplay.setState(FALL_LEFT);
} else {
if (_local1.RIGHT){
modelMass.velocity.x = (modelMass.velocity.x + (4 * moveMultiplier));
this.stateDisplay.setState(FALL_RIGHT);
} else {
this.stateDisplay.setState(FALL_CENTER);
};
};
};
if (_local1.UP){
modelMass.velocity.y = (modelMass.velocity.y - (4 * moveMultiplier));
if (!this.isRolling){
this.stateDisplay.setState(FALL_UP);
};
} else {
if (_local1.DOWN){
modelMass.velocity.y = (modelMass.velocity.y + (4 * moveMultiplier));
if (!this.isRolling){
this.stateDisplay.setState(FALL_DOWN);
};
};
};
} else {
if (this.isRolling){
if (Math.abs(modelMass.velocity.x) < 5){
this.isRolling = false;
};
} else {
modelMass.velocity.x = ((moveMultiplier * this.parent.mouseX) / 10);
};
modelMass.velocity.y = ((moveMultiplier * this.parent.mouseY) / 10);
if (!this.isRolling){
if (modelMass.velocity.x > 4){
this.stateDisplay.setState(FALL_RIGHT);
} else {
if (modelMass.velocity.x < -4){
this.stateDisplay.setState(FALL_LEFT);
} else {
this.stateDisplay.setState(FALL_CENTER);
};
};
if (modelMass.velocity.y > 4){
this.stateDisplay.setState(FALL_DOWN);
} else {
if (modelMass.velocity.y < -4){
this.stateDisplay.setState(FALL_UP);
};
};
};
};
_local2 = modelMass.velocity.z;
modelMass.velocity.z = 0;
modelMass.velocity = modelMass.velocity.multiply(0.8);
if (wetCount > 0){
modelMass.velocity = modelMass.velocity.multiply(0.5);
};
if ((((((iceCount > 0)) || ((zapCount > 0)))) || ((burnCount > 0)))){
modelMass.velocity = new Vector3D();
this.stateDisplay.setState(FALL_CENTER);
};
if (isDiving){
modelMass.velocity = modelMass.velocity.multiply(0.3);
};
_local3 = new Color();
if (((isSun) && ((burnCount <= 0)))){
if (modelMass.velocity.length < 12){
this.burnAmount++;
_local3.tintColor = 0x990000;
_local3.tintMultiplier = (this.burnAmount / 80);
this.transform.colorTransform = _local3;
if (this.burnAmount > 40){
this.burnCount = 70;
burnAmount = 0;
_local3.tintColor = 0xFF0000;
_local3.tintMultiplier = 0.9;
this.transform.colorTransform = _local3;
SFXManager.getInstance().playSFX("burn", 0, 1.2);
};
} else {
this.burnAmount = 0;
this.transform.colorTransform = new ColorTransform();
};
};
modelMass.velocity.z = _local2;
if (isDiving){
this.stateDisplay.setState(DIVING);
modelMass.velocity.z = (modelMass.velocity.z * 0.95);
if (modelMass.velocity.z < 15){
modelMass.velocity.z = 15;
this.isDiving = false;
};
};
this.modelMass.render();
if (this.modelMass.position.length2D > 800){
this.modelMass.position = this.modelMass.position.normalised2D(800);
};
this.stateDisplay.applyState();
this.hud.position = this.modelMass.position;
this.hud.playerHeight = uint(((this.fallHeight - this.modelMass.position.z) / 10));
this.hud.carrots = ((this.carrotCount + "/") + this.carrotTarget);
if (wetCount > 0){
this.wetCount--;
if (wetCount == 0){
this.transform.colorTransform = new ColorTransform();
};
};
if (iceCount > 0){
this.iceCount--;
if (iceCount == 0){
while (this.numChildren > 3) {
this.removeChildAt(3);
};
};
};
if (zapCount > 0){
this.zapCount--;
if (zapCount == 0){
this.transform.colorTransform = new ColorTransform();
this.addChild(new CharacterDustClear());
};
};
if (burnCount > 0){
this.burnCount--;
if (burnCount == 0){
this.transform.colorTransform = new ColorTransform();
_local4 = this.addChild(new CharacterDustClear());
_local3 = new Color();
_local3.tintColor = 0xFFFFFF;
_local3.tintMultiplier = 1;
_local4.transform.colorTransform = _local3;
};
};
}
public function deployChute(_arg1:KeyboardEvent=null):void{
var _local2:uint;
var _local3:Color;
if (_arg1){
this.isKeyboard = true;
};
if (this.carrotCount >= this.carrotTarget){
_local2 = uint(((this.fallHeight - this.modelMass.position.z) / 10));
if ((((_local2 <= this.hud.deployStart)) && ((_local2 >= this.hud.deployEnd)))){
controlsManager.unregisterKeyPress("SPACE", this.deployChute);
this.dispatchEvent(new Event("deployingChute"));
SFXManager.getInstance().playSFX("openParachute", 0, 1.3);
this.parachute_mc.gotoAndPlay(2);
_local3 = new Color();
_local3.tintColor = FreeFallApp(Game.game).logoBG;
_local3.tintMultiplier = 0.8;
this.parachute_mc.parachute_mc.parachuteColour_mc.transform.colorTransform = _local3;
this.hud.logo_mc.gotoAndStop(2);
} else {
if (((((((((!(isDiving)) && (!(isRolling)))) && ((this.burnCount <= 0)))) && ((this.zapCount <= 0)))) && ((this.iceCount <= 0)))){
isDiving = true;
this.modelMass.velocity.z = 40;
};
};
} else {
if (((((((((!(isDiving)) && (!(isRolling)))) && ((this.burnCount <= 0)))) && ((this.zapCount <= 0)))) && ((this.iceCount <= 0)))){
isDiving = true;
this.modelMass.velocity.z = 40;
};
};
}
private function useMouse(_arg1:MouseEvent):void{
this.isKeyboard = false;
}
public function hitTest(_arg1:Event):void{
var _local2:ParaScene;
var _local3:Array;
var _local4:uint;
var _local5:uint;
var _local6:ParaObject;
var _local7:Point;
var _local8:Color;
_local2 = (_arg1.target as ParaScene);
if (_local2){
_local3 = _local2.hitable;
_local4 = 0;
_local5 = _local3.length;
while (_local4 < _local5) {
_local6 = _local3[_local4];
if (_local6.target.parent){
_local7 = new Point(_local6.target.x, _local6.target.y);
_local7 = _local6.target.parent.localToGlobal(_local7);
if (this.hit_mc.hitTestPoint(_local7.x, _local7.y, true)){
switch (true){
case (((_local6.target is Carrot)) && (!(Carrot(_local6.target).collected))):
Carrot(_local6.target).collect();
this.carrotScore++;
this.carrotCount++;
break;
case (((_local6.target is Duck)) && (!(Duck(_local6.target).hit))):
Duck(_local6.target).hitMe();
this.duckScore++;
this.carrotCount = (this.carrotCount - 2);
if (this.carrotCount < 0){
this.carrotCount = 0;
};
break;
case (((_local6.target is RainCloud)) && ((this.wetCount <= 0))):
this.weatherScore++;
this.wetCount = 50;
_local8 = new Color();
_local8.tintColor = 13158;
_local8.tintMultiplier = 0.8;
this.transform.colorTransform = _local8;
SFXManager.getInstance().playSFX("wet");
break;
case (((_local6.target is SnowFlake)) && ((this.iceCount <= 0))):
this.weatherScore++;
this.iceCount = 50;
this.addChild(new CharacterIce());
SFXManager.getInstance().playSFX("ice", 0, 1.3);
break;
};
};
};
_local4++;
};
};
}
public function doubleRight(_arg1:KeyboardEvent):void{
if (!this.isRolling){
this.isRolling = true;
modelMass.velocity.x = 60;
this.stateDisplay.setState(FALL_RIGHT);
this.stateDisplay.applyState();
this.stateDisplay.setState(ROLL_RIGHT);
};
}
private function addListeners(_arg1:Event):void{
this.stage.addEventListener(MouseEvent.MOUSE_DOWN, this.clickRoll);
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.useMouse);
this.removeEventListener(Event.ADDED_TO_STAGE, this.addListeners);
}
}
}//package code
Section 67
//ParachuteGame (code.ParachuteGame)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.game.systems.*;
public class ParachuteGame extends MovieClip {
private var camera:Camera;
public var background_mc:MovieClip;
public var character_mc:ParachutePlayer;
public var trees_mc:MovieClip;
public function ParachuteGame(){
trace(this.numChildren);
this.character_mc = new ParachutePlayerClip();
this.character_mc.x = -226.9;
this.character_mc.y = 237.2;
this.character_mc.modelMass.position = new Vector(-226.9, 237.2);
this.addChildAt(this.character_mc, 2);
this.camera = new Camera(character_mc, this, new Rectangle(-25, -200, 600, 440), 0.5);
this.camera.startFollowing();
}
public function set level(_arg1:uint):void{
this.trees_mc.gotoAndStop(_arg1);
this.background_mc.gotoAndStop(_arg1);
switch (_arg1){
case 2:
case 3:
case 4:
this.character_mc.isWind = true;
};
}
public function endGame():void{
this.camera.settleAndStop();
FreeFallApp(this.parent).play();
}
}
}//package code
Section 68
//ParachutePlayer (code.ParachutePlayer)
package code {
import sfb.maths.*;
import flash.display.*;
import sfb.maths.physics.*;
import flash.events.*;
import sfb.game.systems.*;
public class ParachutePlayer extends MovieClip {
private var wind:Number;// = 0.1
public var isKeyboard:Boolean;
public var isWind:Boolean;
public var swing_mc:MovieClip;
private var tickID:int;
private var player_int:uint;
private var stageRef:Stage;
private var speedLimit:SpeedLimit;
private var controls:ControlsManager;
public var modelMass:Mass;
public function ParachutePlayer(){
wind = 0.1;
super();
controls = ControlsManager.getInstance();
this.modelMass = new Mass(new Vector(this.x, this.y), new Vector(0, 3));
this.speedLimit = new SpeedLimit(5);
this.tickID = GameManager.getInstance().addTickFunction(this.act);
this.addEventListener(Event.ADDED_TO_STAGE, this.addListeners);
}
private function useMouse(_arg1:MouseEvent):void{
this.isKeyboard = false;
}
public function act():void{
var _local1:Object;
if (!this.stage){
if (this.stageRef){
this.stageRef.removeEventListener(MouseEvent.MOUSE_MOVE, this.useMouse);
};
GameManager.getInstance().removeTickFunction(this.tickID);
return;
};
_local1 = controls.getKeys();
if (((_local1.LEFT) || (_local1.RIGHT))){
isKeyboard = true;
};
if (isKeyboard){
if (_local1.LEFT){
this.modelMass.velocity.x = (this.modelMass.velocity.x - 0.3);
};
if (_local1.RIGHT){
this.modelMass.velocity.x = (this.modelMass.velocity.x + 0.3);
};
} else {
this.modelMass.velocity.x = (this.modelMass.velocity.x + (this.mouseX / 1000));
};
if (isWind){
wind = (0.05 + (Math.random() * 0.2));
this.modelMass.velocity.x = (this.modelMass.velocity.x - wind);
};
this.speedLimit.applyLimit(this.modelMass);
this.modelMass.velocity.y = 3;
this.modelMass.renderToDO(this);
if (this.x > 275){
this.x = 275;
this.modelMass.position.x = 275;
this.modelMass.velocity.x = 0;
} else {
if (this.x < -275){
this.x = -275;
this.modelMass.position.x = -275;
this.modelMass.velocity.x = 0;
};
};
if (this.y >= 723){
if (this.stageRef){
this.stageRef.removeEventListener(MouseEvent.MOUSE_MOVE, this.useMouse);
};
GameManager.getInstance().removeTickFunction(this.tickID);
ParachuteGame(this.parent).endGame();
this.gotoAndStop(1);
this.swing_mc.gotoAndStop(1);
switch (this.player_int){
case 1:
this.swing_mc.char_mc.gotoAndStop("brLand");
break;
case 2:
this.swing_mc.char_mc.gotoAndStop("rrLand");
break;
case 3:
this.swing_mc.char_mc.gotoAndStop("dsLand");
break;
case 4:
this.swing_mc.char_mc.gotoAndStop("rLand");
break;
};
};
}
private function addListeners(_arg1:Event):void{
this.stageRef = this.stage;
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.useMouse);
this.removeEventListener(Event.ADDED_TO_STAGE, this.addListeners);
}
public function set player(_arg1:uint):void{
this.player_int = _arg1;
switch (this.player_int){
case 1:
this.swing_mc.char_mc.gotoAndStop("br");
break;
case 2:
this.swing_mc.char_mc.gotoAndStop("rr");
break;
case 3:
this.swing_mc.char_mc.gotoAndStop("ds");
break;
case 4:
this.swing_mc.char_mc.gotoAndStop("r");
break;
};
}
}
}//package code
Section 69
//ThunderCloud (code.ThunderCloud)
package code {
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.graphics.parallax.*;
import sfb.graphics.effects.*;
public class ThunderCloud extends MovieClip {
private var scene:ParaScene;
public var modelObject:ParaObject;
public function ThunderCloud(_arg1:Vector3D){
addFrameScript(0, frame1);
this.modelObject = new ParaObject(this, ((_arg1) || (new Vector3D())));
this.modelObject.onRender = this.onRenderModel;
this.visible = false;
this.gotoAndStop((Math.floor((Math.random() * 3)) + 1));
}
function frame1(){
stop();
}
public function onRenderModel(_arg1:ParaScene):void{
var _local2:FreeFallPlayer;
var _local3:Vector3D;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
while (this.numChildren > 1) {
this.removeChildAt(1);
};
this.transform.colorTransform = new ColorTransform();
if (this.parent){
_local2 = FreeFallGame.game.player;
if (_local2.zapCount <= 0){
_local3 = this.modelObject.position.subtract(_local2.modelMass.position);
_local4 = new Point(_local3.x, _local3.y);
if ((((((_local4.length < 200)) && ((_local3.z < 10)))) && ((_local3.z > -10)))){
_local5 = this.parent.localToGlobal(new Point(this.x, this.y));
_local6 = _local2.parent.localToGlobal(new Point(_local2.x, _local2.y));
_local7 = _local6.subtract(_local5);
_local6.subtract(_local5).x = (_local7.x / this.scaleX);
_local7.y = (_local7.y / this.scaleY);
this.addChild(new LightningBolt(_local7, 4));
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 200, 200, 200);
_local2.zap();
};
};
};
}
}
}//package code
Section 70
//Color (fl.motion.Color)
package fl.motion {
import flash.geom.*;
import flash.display.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 71
//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 72
//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 73
//EncodedGameSave (sfb.application.saves.EncodedGameSave)
package sfb.application.saves {
import flash.utils.*;
public class EncodedGameSave {
public var colourBorder:uint;
public var colourBackground:uint;
public var data:Object;
public var image1:ByteArray;
public var image2:ByteArray;
public var title:String;
public var colourText:uint;
public var link:String;
public var description:String;
public function EncodedGameSave(){
this.data = {};
}
}
}//package sfb.application.saves
Section 74
//GameSave (sfb.application.saves.GameSave)
package sfb.application.saves {
import flash.geom.*;
import flash.display.*;
public class GameSave {
public var colourBorder:uint;
public var colourText:uint;
public var colourBackground:uint;
public var title:String;
public var image1:BitmapData;
public var link:String;
public var vars:Array;
public var description:String;
public var image2:BitmapData;
public static const imageSize:Rectangle = new Rectangle(0, 0, 80, 50);
public function GameSave(){
this.image1 = new BitmapData(GameSave.imageSize.width, GameSave.imageSize.height);
this.image2 = new BitmapData(GameSave.imageSize.width, GameSave.imageSize.height);
}
public function updateToObject(_arg1:Object):void{
var _local2:String;
for (_local2 in this.vars) {
_arg1[this.vars[_local2]] = this[this.vars[_local2]];
};
}
public function encode():EncodedGameSave{
var _local1:EncodedGameSave;
_local1 = new EncodedGameSave();
_local1.title = this.title;
_local1.description = this.description;
_local1.link = this.link;
_local1.colourBorder = this.colourBorder;
_local1.colourBackground = this.colourBackground;
_local1.colourText = this.colourText;
_local1.image1 = this.image1.getPixels(GameSave.imageSize);
_local1.image2 = this.image2.getPixels(GameSave.imageSize);
this.updateToObject(_local1.data);
return (_local1);
}
public function updateFromObject(_arg1:Object):void{
var _local2:String;
for (_local2 in this.vars) {
this[this.vars[_local2]] = _arg1[this.vars[_local2]];
};
}
public function decode(_arg1:EncodedGameSave):void{
if (_arg1 != null){
this.title = _arg1.title;
this.description = _arg1.description;
this.link = _arg1.link;
this.colourBorder = _arg1.colourBorder;
this.colourBackground = _arg1.colourBackground;
this.colourText = _arg1.colourText;
_arg1.image1.position = 0;
_arg1.image2.position = 0;
this.image1.setPixels(GameSave.imageSize, _arg1.image1);
this.image2.setPixels(GameSave.imageSize, _arg1.image2);
this.updateFromObject(_arg1.data);
};
}
}
}//package sfb.application.saves
Section 75
//SaveSystem (sfb.application.saves.SaveSystem)
package sfb.application.saves {
import flash.events.*;
import flash.net.*;
public class SaveSystem extends EventDispatcher {
private var sharedObject:SharedObject;
private var saveLocation:String;
private var gameName:String;
public function SaveSystem(_arg1:String){
this.saveLocation = "sfbsavegamesystem";
registerClassAlias("sfb.application.saves.EncodedGameSave", EncodedGameSave);
this.gameName = _arg1;
this.sharedObject = SharedObject.getLocal(this.saveLocation, "/");
if (!this.sharedObject.data[_arg1]){
this.sharedObject.data[_arg1] = {};
};
}
public function save(_arg1:EncodedGameSave):void{
var save = _arg1;
this.sharedObject.data[gameName].save = save;
try {
this.sharedObject.flush(5000);
} catch(e:Error) {
};
}
public function load():EncodedGameSave{
return ((this.sharedObject.data[gameName].save as EncodedGameSave));
}
}
}//package sfb.application.saves
Section 76
//Application (sfb.application.Application)
package sfb.application {
import flash.display.*;
import flash.events.*;
import sfb.application.saves.*;
import flash.utils.*;
import sfb.events.*;
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 77
//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 78
//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 79
//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, _arg6:uint=0):void{
if (((this.sfx_array[_arg1]) && (((!(_arg5)) || (!(this.sfxChannel_array[_arg1])))))){
this.sfxChannel_array[_arg1] = Sound(this.sfx_array[_arg1]).play(_arg6, _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 80
//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 81
//Collectable (sfb.game.common.Collectable)
package sfb.game.common {
import flash.display.*;
public class Collectable extends MovieClip {
public var collectSound:String;
public var collected:Boolean;
public static const COLLECT_COLLECTABLE:String = "collectCollectable";
public function Collectable(){
this.collectSound = Collectable.COLLECT_COLLECTABLE;
}
public function collect():void{
this.gotoAndStop("collect");
this.collected = true;
}
}
}//package sfb.game.common
Section 82
//Enemy (sfb.game.common.Enemy)
package sfb.game.common {
import flash.display.*;
public class Enemy extends MovieClip {
public var hitSound:String;
public var hit:Boolean;
public var hit_mc:MovieClip;
public static const HIT_SOUND:String = "hitEnemy";
public function Enemy(){
this.hitSound = Enemy.HIT_SOUND;
}
public function hitMe():void{
this.hit = true;
}
}
}//package sfb.game.common
Section 83
//FrameStateDisplay (sfb.game.graphics.FrameStateDisplay)
package sfb.game.graphics {
import flash.display.*;
import sfb.tools.*;
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 cleanup():void{
this.target = null;
Cleanup.cleanArray(frameLabels);
}
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 84
//IStateDisplayable (sfb.game.graphics.IStateDisplayable)
package sfb.game.graphics {
import flash.display.*;
public interface IStateDisplayable {
function applyState():void;
function cleanup():void;
function setTarget(_arg1:DisplayObject):void;
function setState(_arg1:String):void;
}
}//package sfb.game.graphics
Section 85
//Camera (sfb.game.systems.Camera)
package sfb.game.systems {
import flash.geom.*;
import flash.display.*;
public class Camera {
public var lowerLimits:Point;
public var container:DisplayObject;
public var target:DisplayObject;
public var upperLimits:Point;
public var boundBox:Rectangle;
private var isStoppedX:Boolean;
private var isStoppedY:Boolean;
private var tickID:uint;
public var elasticity:Number;
private var isStopping:Boolean;
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);
}
protected function adjustY(_arg1:Number, _arg2:int):void{
if (_arg1 > 0){
this.container.y = (this.container.y - ((_arg2 * _arg1) * (1 - elasticity)));
} else {
if (this.isStopping){
this.isStoppedY = true;
if (this.isStoppedX){
this.isStopping = false;
this.isStoppedX = false;
this.isStoppedY = false;
this.stopFollowing();
};
};
};
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 startFollowing():void{
this.stopFollowing();
this.tickID = GameManager.getInstance().addTickFunction(this.follow, 1);
}
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)));
} else {
if (this.isStopping){
this.isStoppedX = true;
if (this.isStoppedY){
this.isStopping = false;
this.isStoppedX = false;
this.isStoppedY = false;
this.stopFollowing();
};
};
};
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;
};
}
public function settleAndStop():void{
this.isStopping = true;
this.isStoppedX = false;
this.isStoppedY = false;
}
public function stopFollowing():void{
GameManager.getInstance().removeTickFunction(this.tickID);
}
public function follow():void{
var _local1:Point;
if (target.stage){
_local1 = new Point(target.x, target.y);
_local1 = target.parent.localToGlobal(_local1);
this.adjustX((this.boundBox.left - _local1.x), -1);
this.adjustX((_local1.x - this.boundBox.right), 1);
this.adjustY((this.boundBox.top - _local1.y), -1);
this.adjustY((_local1.y - this.boundBox.bottom), 1);
};
}
}
}//package sfb.game.systems
Section 86
//ControlsManager (sfb.game.systems.ControlsManager)
package sfb.game.systems {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public class ControlsManager extends EventDispatcher {
private var lastKeyLimit:uint;
private var regKeyPress:Array;
private var doublePressTime:Number;
private var keyDown:Array;
private var regKeys:Array;
private var lastKeys:Array;
private var lastPressTime:Number;
private var regDoublePress: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 = [];
this.regDoublePress = [];
this.lastKeys = [];
this.lastKeyLimit = 2;
this.doublePressTime = 200;
this.lastPressTime = getTimer();
}
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 function clearDoublePresses():void{
var _local1:int;
_local1 = 0;
while (_local1 < regDoublePress.length) {
this.regDoublePress[_local1].listener = null;
this.regDoublePress[_local1] = null;
_local1++;
};
this.regDoublePress = [];
}
public function registerDoublePress(_arg1:String, _arg2:Function):void{
var _local3:int;
_local3 = ((Keyboard[_arg1.toUpperCase()]) || (ControlsManager.KEY_CODES[_arg1.toUpperCase()]));
this.regDoublePress.push(new KeyPress(_local3, _arg2, false));
}
public function init(_arg1:Stage){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDownListener);
_arg1.addEventListener(KeyboardEvent.KEY_UP, this.keyUpListener);
}
public function unregisterDoublePress(_arg1:String, _arg2:Function):void{
var _local3:int;
var _local4:int;
_local3 = ((Keyboard[_arg1.toUpperCase()]) || (ControlsManager.KEY_CODES[_arg1.toUpperCase()]));
_local4 = 0;
while (_local4 < regDoublePress.length) {
if ((((this.regDoublePress[_local4].key == _local3)) && ((this.regDoublePress[_local4].listener == _arg2)))){
this.regDoublePress[_local4].listener = null;
this.regDoublePress.splice(_local4, 1);
_local4--;
};
_local4++;
};
}
public function unregisterKeyPress(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
var _local4:int;
var _local5:int;
_local4 = ((Keyboard[_arg1.toUpperCase()]) || (ControlsManager.KEY_CODES[_arg1.toUpperCase()]));
_local5 = 0;
while (_local5 < regKeyPress.length) {
if ((((this.regKeyPress[_local5].key == _local4)) && ((this.regKeyPress[_local5].listener == _arg2)))){
this.regKeyPress[_local5].listener = null;
this.regKeyPress.splice(_local5, 1);
_local5--;
};
_local5++;
};
}
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));
}
private function keyUpListener(_arg1:KeyboardEvent):void{
delete this.keyDown[_arg1.keyCode];
}
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 keyDownListener(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:Number;
_local4 = _arg1.keyCode;
_local5 = (getTimer() - this.lastPressTime);
this.lastPressTime = getTimer();
if (!this.keyDown[_arg1.keyCode]){
if (_local5 < this.doublePressTime){
_local2 = 0;
_local3 = this.regDoublePress.length;
while (_local2 < _local3) {
if ((((this.regDoublePress[_local2].key == _local4)) && ((this.lastKeys[(this.lastKeys.length - 1)] == _local4)))){
this.regDoublePress[_local2].listener(_arg1);
this.lastPressTime = 0;
};
_local2++;
};
};
this.lastKeys.push(_local4);
if (this.lastKeys.length > this.lastKeyLimit){
this.lastKeys.shift();
};
};
_local2 = 0;
_local3 = this.regKeyPress.length;
while (_local2 < _local3) {
if (this.regKeyPress[_local2].key == _local4){
if (((!(this.keyDown[_local4])) || (this.regKeyPress[_local2].holdRepeat))){
this.regKeyPress[_local2].listener(_arg1);
};
break;
};
_local2++;
};
this.keyDown[_local4] = true;
}
public function clearKeyPresses():void{
var _local1:int;
_local1 = 0;
while (_local1 < regKeyPress.length) {
this.regKeyPress[_local1].listener = null;
this.regKeyPress[_local1] = null;
_local1++;
};
this.regKeyPress = [];
}
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 87
//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 tickAccurateTimer:AccurateTimer;
private var tickTime:uint;
private var tickTimer:Timer;
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.tickAccurateTimer){
this.tickAccurateTimer.stop();
this.tickAccurateTimer.removeEventListener(TimerEvent.TIMER, this.timerTick);
this.tickAccurateTimer = null;
};
if (this.stage){
this.stage.removeEventListener(Event.ENTER_FRAME, this.frameTick);
this.stage = null;
};
}
public function unpause():void{
if (this.tickTimer){
this.tickTimer.start();
} else {
if (this.tickAccurateTimer){
this.tickAccurateTimer.start();
} else {
if (this.stage){
this.stage.addEventListener(Event.ENTER_FRAME, this.frameTick);
};
};
};
}
private function timerTick(_arg1:TimerEvent):void{
this.tickTime = getTimer();
this.callTickFunctions();
_arg1.updateAfterEvent();
}
public function startTimer(_arg1:uint=40):void{
trace("[GameManager].startTimer");
this.stop();
this.tickTimer = new Timer(_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{
trace("[GameManager].startFrame");
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 startAccurateTimer(_arg1:uint=40):void{
trace("[GameManager].startAccurateTimer");
this.stop();
this.tickAccurateTimer = new AccurateTimer(_arg1);
this.tickAccurateTimer.addEventListener(TimerEvent.TIMER, this.timerTick);
this.tickAccurateTimer.start();
}
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 pause():void{
if (this.tickTimer){
this.tickTimer.stop();
} else {
if (this.tickAccurateTimer){
this.tickAccurateTimer.stop();
} else {
if (this.stage){
this.stage.removeEventListener(Event.ENTER_FRAME, this.frameTick);
};
};
};
this.dispatchEvent(new Event(GameManager.PAUSE));
}
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 88
//LightningBolt (sfb.graphics.effects.LightningBolt)
package sfb.graphics.effects {
import flash.geom.*;
import flash.display.*;
public class LightningBolt extends Sprite {
private var currentForks_array:Array;
private var safetyCount:Number;
private var targetPoint:Point;
private var nextForks_array:Array;
private var T_MAX:Number;
public function LightningBolt(_arg1:Point, _arg2:Number=4){
var _local3:Number;
var _local4:*;
super();
this.T_MAX = _arg2;
this.safetyCount = 0;
this.currentForks_array = [];
this.nextForks_array = [];
this.targetPoint = _arg1;
_local3 = Math.atan2(_arg1.y, _arg1.x);
this.add(T_MAX, 0, 0, _local3);
while ((((this.nextForks_array.length >= 1)) && ((safetyCount++ < 200)))) {
this.currentForks_array = this.nextForks_array.concat([]);
for (_local4 in this.currentForks_array) {
this.spread(currentForks_array[_local4]);
};
};
this.currentForks_array = [];
this.nextForks_array = [];
}
private function spread(_arg1:Object):void{
var _local2:Number;
var _local3:Point;
var _local4:Number;
var _local5:Boolean;
var _local6:Number;
var _local7:Point;
var _local8:Number;
var _local9:Number;
_local2 = ((T_MAX - _arg1.t) + 1);
_local3 = new Point(_arg1.x, _arg1.y);
_local4 = Point.distance(_local3, targetPoint);
_local5 = (_local4 < 30);
if (_arg1.t == T_MAX){
_local7 = targetPoint.subtract(_local3);
_local8 = Math.atan2(_local7.y, _local7.x);
_local9 = (_local8 - _arg1.a);
if (_local9 > Math.PI){
_local9 = (_local9 - (2 * Math.PI));
};
if (_local9 <= -(Math.PI)){
_local9 = (_local9 + (2 * Math.PI));
};
_arg1.a = (_arg1.a + (((10 * _local9) / _local4) + ((Math.PI / 180) * (Math.floor(((Math.random() * _local2) * 15)) - (_local2 * 7.5)))));
} else {
_arg1.a = (_arg1.a + ((Math.PI / 180) * (Math.floor(((Math.random() * _local2) * 15)) - (_local2 * 7.5))));
};
this.graphics.lineStyle(_arg1.t, 0xFFFFFF, (30 + ((_arg1.t / T_MAX) * 70)));
this.graphics.moveTo(_arg1.x, _arg1.y);
_local6 = ((Math.floor((Math.random() * 2)) + _local2) + 2);
_arg1.x = (_arg1.x + (_local6 * Math.cos(_arg1.a)));
_arg1.y = (_arg1.y + (_local6 * Math.sin(_arg1.a)));
if (_local5){
if (_arg1.t == T_MAX){
_arg1.x = targetPoint.x;
_arg1.y = targetPoint.y;
safetyCount = 1000;
};
this.remove(_arg1);
};
this.graphics.lineTo(_arg1.x, _arg1.y);
if ((((_arg1.t > 1)) && ((Math.floor((Math.random() * ((_arg1.t)==T_MAX) ? 6 : (2.3 * _arg1.t))) == 1)))){
this.add(((_arg1.t - 1) - Math.floor((Math.random() * (_arg1.t - 1)))), _arg1.x, _arg1.y, _arg1.a);
};
if ((((_arg1.t < T_MAX)) && ((_arg1.c > (Math.floor((Math.random() * 22)) * _arg1.t))))){
_arg1.c = 0;
_arg1.t--;
if (_arg1.t == 0){
this.remove(_arg1);
};
} else {
_arg1.c++;
};
if ((((_arg1.t == T_MAX)) && ((_arg1.c == 10)))){
this.add(_arg1.t, _arg1.x, _arg1.y, _arg1.a);
_arg1.c = 440;
this.remove(_arg1);
};
}
private function remove(_arg1:Object):void{
var _local2:Number;
_local2 = 0;
while (_local2 < this.nextForks_array.length) {
if (this.nextForks_array[_local2] == _arg1){
delete this.nextForks_array[_local2];
this.nextForks_array.splice(_local2, 1);
_local2--;
};
_local2++;
};
}
private function add(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
this.nextForks_array.push({t:_arg1, x:_arg2, y:_arg3, a:_arg4, c:0});
}
}
}//package sfb.graphics.effects
Section 89
//ParaMass (sfb.graphics.parallax.ParaMass)
package sfb.graphics.parallax {
import sfb.maths.*;
import flash.display.*;
public class ParaMass extends ParaObject {
protected var velocity_v3d:Vector3D;
public var mass:Number;
public function ParaMass(_arg1:DisplayObject, _arg2:Vector3D=null, _arg3:Vector3D=null, _arg4:Number=1){
super(_arg1, _arg2);
this.velocity_v3d = (_arg3) ? _arg3.clone() : new Vector3D();
this.mass = _arg4;
}
public function set velocity(_arg1:Vector3D):void{
this.velocity_v3d.setFromVector3D(_arg1);
}
public function render():void{
this.position_v3d.moveBy(this.velocity_v3d);
}
public function get velocity():Vector3D{
return (this.velocity_v3d);
}
}
}//package sfb.graphics.parallax
Section 90
//ParaObject (sfb.graphics.parallax.ParaObject)
package sfb.graphics.parallax {
import sfb.maths.*;
import flash.display.*;
public class ParaObject {
public var layer:Boolean;
public var loopToDepth:Number;
public var fadeDistance:Number;
protected var position_v3d:Vector3D;
public var onRender:Function;
public var target:DisplayObject;
public var drawDistance:Number;
public function ParaObject(_arg1:DisplayObject, _arg2:Vector3D=null){
this.target = _arg1;
this.position_v3d = (_arg2) ? _arg2.clone() : new Vector3D();
this.drawDistance = 1000;
this.fadeDistance = 50;
this.loopToDepth = -1;
}
public function get depth():Number{
return (this.position_v3d.z);
}
public function toString():String{
return (("ParaObject - " + this.target));
}
public function get position():Vector3D{
return (this.position_v3d);
}
public function set position(_arg1:Vector3D):void{
this.position_v3d.setFromVector3D(_arg1);
}
}
}//package sfb.graphics.parallax
Section 91
//ParaScene (sfb.graphics.parallax.ParaScene)
package sfb.graphics.parallax {
import sfb.maths.*;
import flash.display.*;
import flash.events.*;
import sfb.tools.*;
public class ParaScene extends Sprite {
private var paraObjects:Array;
private var camera:Vector3D;
public var hitable:Array;
private var lastX:Number;
private var lastY:Number;
private var lastZ:Number;
private var cameraDepth:Number;
private var loopLength:uint;
public var hitMin:Number;
public var hitMax:Number;
private var loopCount:uint;
public static const FINISHED_RENDERING:String = "paraSceneFinishedRendering";
public function ParaScene(_arg1:Number=500){
this.cameraDepth = _arg1;
this.paraObjects = [];
this.camera = new Vector3D();
this.lastX = 0;
this.lastY = 0;
this.lastZ = 0;
this.hitMin = 0;
this.hitMax = 40;
this.hitable = [];
}
public function removeObject(_arg1:ParaObject, _arg2:Boolean=true):void{
var _local3:uint;
var _local4:uint;
_local3 = 0;
_local4 = this.paraObjects.length;
while (_local3 < _local4) {
if (this.paraObjects[_local3] == _arg1){
this.paraObjects.splice(_local3, 1);
this.loopCount--;
if (this.loopLength != 0){
this.loopLength--;
};
if (((_arg2) && (this.contains(_arg1.target)))){
this.removeChild(_arg1.target);
};
break;
};
_local3++;
};
}
public function set z(_arg1:Number):void{
lastZ = this.camera.z;
this.camera.z = _arg1;
if (lastZ != this.camera.z){
this.render();
};
}
public function set realX(_arg1:Number):void{
super.x = _arg1;
}
public function get cameraPosition():Vector3D{
return (this.camera.clone());
}
override public function get x():Number{
return (this.camera.x);
}
override public function get y():Number{
return (this.camera.y);
}
public function get realY():Number{
return (super.y);
}
public function render():void{
var _local1:ParaObject;
var _local2:DisplayObject;
var _local3:Vector3D;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local6 = [];
this.hitable = [];
loopCount = 0;
loopLength = this.paraObjects.length;
while (loopCount < loopLength) {
_local1 = this.paraObjects[loopCount];
if (_local1.target){
_local2 = _local1.target;
_local3 = _local1.position;
_local5 = (_local3.z - this.z);
if ((((_local5 < this.hitMax)) && ((_local5 > this.hitMin)))){
this.hitable.push(_local1);
};
if ((((_local5 < 0)) && ((_local1.loopToDepth > 0)))){
_local3.z = (_local3.z + _local1.loopToDepth);
_local5 = (_local5 + _local1.loopToDepth);
};
if ((((_local5 < _local1.drawDistance)) && ((_local5 > 0)))){
_local6.push(_local1);
if (_local5 < _local1.fadeDistance){
_local2.alpha = (_local5 / _local1.fadeDistance);
};
if (_local5 > (_local1.drawDistance - _local1.fadeDistance)){
_local2.alpha = ((_local1.drawDistance - _local5) / _local1.fadeDistance);
};
_local2.visible = true;
_local4 = getScaleRatio(_local3.z);
_local2.scaleX = (_local2.scaleY = _local4);
if (!_local1.layer){
_local2.x = ((_local3.x - this.camera.x) * _local4);
_local2.y = ((_local3.y - this.camera.y) * _local4);
} else {
_local2.x = (_local2.x + ((this.lastX - this.camera.x) * _local4));
_local2.y = (_local2.y + ((this.lastY - this.camera.y) * _local4));
};
if (Boolean(_local1.onRender)){
_local1.onRender(this);
};
} else {
_local2.visible = false;
if (_local5 < 0){
this.removeObject(_local1);
};
};
};
loopCount++;
};
_local6.sortOn("depth", (Array.NUMERIC | Array.DESCENDING));
loopCount = 0;
loopLength = _local6.length;
while (loopCount < loopLength) {
this.addChild(_local6[loopCount].target);
loopCount++;
};
this.dispatchEvent(new Event(FINISHED_RENDERING));
}
public function cleanup():void{
var _local1:*;
this.camera = null;
for (_local1 in paraObjects) {
ParaObject(paraObjects[_local1]).target = null;
};
Cleanup.cleanDisplayList(this, true);
Cleanup.cleanArray(this.hitable);
Cleanup.cleanArray(this.paraObjects);
}
public function get z():Number{
return (this.camera.z);
}
public function get realX():Number{
return (super.x);
}
public function addObject(_arg1:ParaObject):void{
this.paraObjects.push(_arg1);
this.addChild(_arg1.target);
_arg1.target.x = _arg1.position.x;
_arg1.target.y = _arg1.position.y;
}
public function getScaleRatio(_arg1:Number):Number{
return ((this.cameraDepth / (this.cameraDepth + (_arg1 - this.camera.z))));
}
override public function set x(_arg1:Number):void{
lastX = this.camera.x;
this.camera.x = _arg1;
if (lastX != this.camera.x){
this.render();
};
}
override public function set y(_arg1:Number):void{
lastY = this.camera.y;
this.camera.y = _arg1;
if (lastY != this.camera.y){
this.render();
};
}
public function set realY(_arg1:Number):void{
super.y = _arg1;
}
}
}//package sfb.graphics.parallax
Section 92
//ScalingRepeatingTexture (sfb.graphics.ScalingRepeatingTexture)
package sfb.graphics {
import flash.geom.*;
import flash.display.*;
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 93
//Mass (sfb.maths.physics.Mass)
package sfb.maths.physics {
import sfb.maths.*;
import flash.display.*;
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 94
//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 95
//Paths3D (sfb.maths.Paths3D)
package sfb.maths {
public class Paths3D {
public static function arc(_arg1:Vector3D, _arg2:Number, _arg3:Number, _arg4:uint=10, _arg5:Number=0, _arg6:Vector3D=null, _arg7:Number=-1):Array{
var _local8:Array;
var _local9:Array;
var _local10:Vector3D;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:uint;
var _local16:uint;
if (_arg6 == null){
_arg6 = _arg1.clone();
};
if (_arg7 == -1){
_arg7 = _arg2;
};
_local8 = line(_arg1, _arg6, _arg4);
_local9 = [];
_local11 = _arg2;
_local12 = _arg5;
_local13 = ((_arg7 - _arg2) / (_local8.length - 1));
_local14 = (_arg3 / (_local8.length - 1));
_local15 = 0;
_local16 = _local8.length;
while (_local15 < _local16) {
_local10 = _local8[_local15];
_local9.push(new Vector3D((_local10.x + (Math.sin(_local12) * _local11)), (_local10.y - (Math.cos(_local12) * _local11)), _local10.z));
_local11 = (_local11 + _local13);
_local12 = (_local12 + _local14);
_local15++;
};
return (_local9);
}
public static function line(_arg1:Vector3D, _arg2:Vector3D, _arg3:uint=10):Array{
var _local4:Array;
var _local5:Vector3D;
var _local6:uint;
_local4 = [];
_local4.push(_arg1.clone());
_local5 = _arg2.subtract(_arg1);
_local6 = 1;
while (_local6 <= (_arg3 - 1)) {
_local4.push(_arg1.add(_local5.multiply((_local6 / (_arg3 - 1)))));
_local6++;
};
return (_local4);
}
}
}//package sfb.maths
Section 96
//Vector (sfb.maths.Vector)
package sfb.maths {
import flash.geom.*;
import flash.display.*;
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 normal(_arg1:Boolean=true):Vector{
if (_arg1){
return (new Vector(-(this.point.y), this.point.x));
};
return (new Vector(this.point.y, -(this.point.x)));
}
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 newFromAngle(_arg1:Number, _arg2:Number=1):Vector{
return (Vector.newFromPoint(Point.polar(_arg2, (_arg1 - (Math.PI / 2)))));
}
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 97
//Vector3D (sfb.maths.Vector3D)
package sfb.maths {
public class Vector3D {
public var y:Number;// = 0
public var z:Number;// = 0
public var x:Number;// = 0
public function Vector3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
x = 0;
y = 0;
z = 0;
super();
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function divide(_arg1:Number):Vector3D{
return (new Vector3D((x / _arg1), (y / _arg1), (z / _arg1)));
}
public function normalised2D(_arg1:Number=1):Vector3D{
var _local2:Number;
var _local3:Vector3D;
if (length2D == 0){
return (new Vector3D());
};
_local2 = this.z;
_local3 = this.multiply((_arg1 / this.length2D));
_local3.z = _local2;
return (_local3);
}
public function multiply(_arg1:Number):Vector3D{
return (new Vector3D((x * _arg1), (y * _arg1), (z * _arg1)));
}
public function get length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function add(_arg1:Vector3D):Vector3D{
return (new Vector3D((x + _arg1.x), (y + _arg1.y), (z + _arg1.z)));
}
public function moveBy(_arg1:Vector3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function toString():String{
return (((((("Vector3D - x=" + x) + ", y=") + y) + ", z=") + z));
}
public function setFromVector3D(_arg1:Vector3D):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function equals(_arg1:Vector3D, _arg2:Number=0):Boolean{
return ((Vector3D.distance(this, _arg1) <= _arg2));
}
public function normalised(_arg1:Number=1):Vector3D{
if (length == 0){
return (new Vector3D());
};
return (this.multiply((_arg1 / this.length)));
}
public function get length2D():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function subtract(_arg1:Vector3D):Vector3D{
return (new Vector3D((x - _arg1.x), (y - _arg1.y), (z - _arg1.z)));
}
public function clone():Vector3D{
return (new Vector3D(x, y, z));
}
public static function interpolate(_arg1:Vector, _arg2:Vector, _arg3:Number):Vector{
return (_arg1.add(_arg2.subtract(_arg1).multiply(_arg3)));
}
public static function distance(_arg1:Vector3D, _arg2:Vector3D):Number{
return (_arg1.subtract(_arg2).length);
}
}
}//package sfb.maths
Section 98
//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 99
//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 traceCallStack():void{
try {
throw (new Error("Don't worry, just tracing the call stack!"));
} catch(e:Error) {
trace(e.getStackTrace());
};
}
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 100
//BlueRabbitDiver (BlueRabbitDiver)
package {
import code.*;
public dynamic class BlueRabbitDiver extends FreeFallPlayer {
public function BlueRabbitDiver(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 101
//BurnSound (BurnSound)
package {
import flash.media.*;
public dynamic class BurnSound extends Sound {
}
}//package
Section 102
//CharacterDustClear (CharacterDustClear)
package {
import flash.display.*;
public dynamic class CharacterDustClear extends MovieClip {
public function CharacterDustClear(){
addFrameScript(9, frame10);
}
function frame10(){
if (this.parent){
this.parent.removeChild(this);
};
stop();
}
}
}//package
Section 103
//CharacterIce (CharacterIce)
package {
import flash.display.*;
public dynamic class CharacterIce extends MovieClip {
}
}//package
Section 104
//Continents (Continents)
package {
import flash.display.*;
public dynamic class Continents extends MovieClip {
}
}//package
Section 105
//Crunch (Crunch)
package {
import flash.display.*;
public dynamic class Crunch extends MovieClip {
public function Crunch(){
addFrameScript(14, frame15);
}
function frame15(){
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package
Section 106
//CrunchSound (CrunchSound)
package {
import flash.media.*;
public dynamic class CrunchSound extends Sound {
}
}//package
Section 107
//DancingSealDiver (DancingSealDiver)
package {
import code.*;
public dynamic class DancingSealDiver extends FreeFallPlayer {
public function DancingSealDiver(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 108
//DefaultLogo (DefaultLogo)
package {
import flash.display.*;
public dynamic class DefaultLogo extends MovieClip {
}
}//package
Section 109
//FallSound (FallSound)
package {
import flash.media.*;
public dynamic class FallSound extends Sound {
}
}//package
Section 110
//FreezeSound (FreezeSound)
package {
import flash.media.*;
public dynamic class FreezeSound extends Sound {
}
}//package
Section 111
//InsidePlaneSound (InsidePlaneSound)
package {
import flash.media.*;
public dynamic class InsidePlaneSound extends Sound {
}
}//package
Section 112
//Level1Music (Level1Music)
package {
import flash.media.*;
public dynamic class Level1Music extends Sound {
}
}//package
Section 113
//Level2Music (Level2Music)
package {
import flash.media.*;
public dynamic class Level2Music extends Sound {
}
}//package
Section 114
//Level3Music (Level3Music)
package {
import flash.media.*;
public dynamic class Level3Music extends Sound {
}
}//package
Section 115
//Level4Music (Level4Music)
package {
import flash.media.*;
public dynamic class Level4Music extends Sound {
}
}//package
Section 116
//Level5Music (Level5Music)
package {
import flash.media.*;
public dynamic class Level5Music extends Sound {
}
}//package
Section 117
//LightningSound (LightningSound)
package {
import flash.media.*;
public dynamic class LightningSound extends Sound {
}
}//package
Section 118
//MoreBRS (MoreBRS)
package {
import flash.display.*;
import flash.events.*;
import code.*;
public dynamic class MoreBRS extends MovieClip {
public var back_btn:SimpleButton;
public var brrr2_btn:SimpleButton;
public var brcc_btn:SimpleButton;
public var brrr1_btn:SimpleButton;
public function MoreBRS(){
addFrameScript(0, frame1);
}
function frame1(){
FreeFallApp.app.linkTo(this.brcc_btn, "http://armorgames.com/play/195/blue-rabbits-climate-chaos");
FreeFallApp.app.linkTo(this.brrr1_btn, "http://armorgames.com/play/201/blue-rabbits-rocket-rush");
FreeFallApp.app.linkTo(this.brrr2_btn, "http://armorgames.com/play/1498/brs-reelin-roundup");
this.back_btn.addEventListener(MouseEvent.CLICK, this.closeMe);
}
public function closeMe(_arg1:Event):void{
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package
Section 119
//NormalIsland (NormalIsland)
package {
import flash.display.*;
public dynamic class NormalIsland extends MovieClip {
}
}//package
Section 120
//OutsidePlaneSound (OutsidePlaneSound)
package {
import flash.media.*;
public dynamic class OutsidePlaneSound extends Sound {
}
}//package
Section 121
//ParachuteGameClip (ParachuteGameClip)
package {
import code.*;
public dynamic class ParachuteGameClip extends ParachuteGame {
}
}//package
Section 122
//ParachutePlayerClip (ParachutePlayerClip)
package {
import code.*;
public dynamic class ParachutePlayerClip extends ParachutePlayer {
}
}//package
Section 123
//ParachuteSound (ParachuteSound)
package {
import flash.media.*;
public dynamic class ParachuteSound extends Sound {
}
}//package
Section 124
//Quack (Quack)
package {
import flash.display.*;
public dynamic class Quack extends MovieClip {
public function Quack(){
addFrameScript(14, frame15);
}
function frame15(){
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package
Section 125
//QuackSound (QuackSound)
package {
import flash.media.*;
public dynamic class QuackSound extends Sound {
}
}//package
Section 126
//Rain (Rain)
package {
import flash.display.*;
public dynamic class Rain extends MovieClip {
}
}//package
Section 127
//RainCloud (RainCloud)
package {
import flash.display.*;
public dynamic class RainCloud extends MovieClip {
public function RainCloud(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 128
//RainIsland (RainIsland)
package {
import flash.display.*;
public dynamic class RainIsland extends MovieClip {
}
}//package
Section 129
//RainSound (RainSound)
package {
import flash.media.*;
public dynamic class RainSound extends Sound {
}
}//package
Section 130
//RedRabbitDiver (RedRabbitDiver)
package {
import code.*;
public dynamic class RedRabbitDiver extends FreeFallPlayer {
public function RedRabbitDiver(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 131
//ReindeerDiver (ReindeerDiver)
package {
import code.*;
public dynamic class ReindeerDiver extends FreeFallPlayer {
public function ReindeerDiver(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 132
//SaveImage1 (SaveImage1)
package {
import flash.display.*;
public dynamic class SaveImage1 extends MovieClip {
}
}//package
Section 133
//SaveImage2 (SaveImage2)
package {
import flash.display.*;
public dynamic class SaveImage2 extends MovieClip {
}
}//package
Section 134
//Snow (Snow)
package {
import flash.display.*;
public dynamic class Snow extends MovieClip {
}
}//package
Section 135
//SnowFlake (SnowFlake)
package {
import flash.display.*;
public dynamic class SnowFlake extends MovieClip {
}
}//package
Section 136
//SnowIsland (SnowIsland)
package {
import flash.display.*;
public dynamic class SnowIsland extends MovieClip {
}
}//package
Section 137
//SunIsland (SunIsland)
package {
import flash.display.*;
public dynamic class SunIsland extends MovieClip {
}
}//package
Section 138
//ThunderIsland (ThunderIsland)
package {
import flash.display.*;
public dynamic class ThunderIsland extends MovieClip {
}
}//package
Section 139
//ThunderSound (ThunderSound)
package {
import flash.media.*;
public dynamic class ThunderSound extends Sound {
}
}//package
Section 140
//WetSound (WetSound)
package {
import flash.media.*;
public dynamic class WetSound extends Sound {
}
}//package