Section 1
//FishingLine (code.FishingLine)
package code {
import sfb.maths.*;
import flash.display.*;
import sfb.maths.physics.*;
import sfb.game.systems.*;
import sfb.maths.physics.forces.*;
public class FishingLine extends Sprite {
private var startString:FixedStringForce;
private var startPoint:Vector;
private var endPoint:Vector;
private var tickID:uint;
private var strings:Array;
private var masses:Array;
private var segs:uint;// = 30
private var endString:FixedStringForce;
public function FishingLine(_arg1:Vector){
var _local2:uint;
masses = [];
strings = [];
segs = 30;
super();
this.startPoint = _arg1;
this.endPoint = _arg1.clone();
_local2 = 0;
while (_local2 < (this.segs - 1)) {
this.masses[_local2] = new Mass(new Vector((100 + (((_local2 + 1) * 200) / this.segs)), 100));
if (_local2 > 0){
this.strings.push(new SpringForce(this.masses[(_local2 - 1)], this.masses[_local2], 1));
};
_local2++;
};
this.startString = new FixedStringForce(startPoint, masses[0], 1);
this.endString = new FixedStringForce(endPoint, masses[(segs - 2)], 1);
this.tickID = GameManager.getInstance().addTickFunction(this.render);
}
public function setEndPoint(_arg1:Number, _arg2:Number):void{
this.endPoint.x = _arg1;
this.endPoint.y = _arg2;
}
public function setStartPoint(_arg1:Number, _arg2:Number):void{
this.startPoint.x = _arg1;
this.startPoint.y = _arg2;
}
public function start():void{
this.tickID = GameManager.getInstance().addTickFunction(this.render);
}
public function render():void{
this.act();
this.act();
this.act();
}
private function act():void{
var _local1:*;
var _local2:Vector;
var _local3:*;
startString.applyForce();
for (_local1 in strings) {
strings[_local1].applyForce();
};
endString.applyForce();
this.graphics.clear();
this.graphics.lineStyle(1, 0xFFFFFF);
this.graphics.moveTo(startPoint.x, startPoint.y);
_local2 = new Vector(0, 0.08);
for (_local3 in masses) {
masses[_local3].velocity = masses[_local3].velocity.add(_local2);
masses[_local3].velocity = masses[_local3].velocity.add(masses[_local3].velocity.multiply(-0.05));
masses[_local3].render();
this.graphics.lineTo(masses[_local3].position.x, masses[_local3].position.y);
};
this.graphics.lineTo(endPoint.x, endPoint.y);
}
public function pause():void{
GameManager.getInstance().removeTickFunction(this.tickID);
}
}
}//package code
Section 2
//Reel (code.Reel)
package code {
import sfb.audio.*;
import flash.events.*;
import sfb.maths.*;
import flash.display.*;
import sfb.game.systems.*;
public class Reel extends MovieClip {
private var lineLength:Number;
private var oldAngle:Number;
public var reelHandle_mc:MovieClip;
private var bestLineSpeed:Number;
private var angleSpeed:Number;
public var reelTension_mc:MovieClip;
private var lineReeledIn:Number;
private var tickID:uint;
private var sfxManager:SFXManager;
public var reelSpindle_mc:MovieClip;
private var lineTension:Number;
public static var REELED_IN:String = "reeledIn";
public static var FAIL:String = "failReel";
public function Reel(){
this.reelHandle_mc.addEventListener(MouseEvent.MOUSE_DOWN, this.startGrip);
this.sfxManager = SFXManager.getInstance();
this.sfxManager.addSFX(ReelSound, "reel");
this.reelTension_mc.stop();
this.reset();
}
public function updateTension():void{
if (this.angleSpeed > this.bestLineSpeed){
this.lineTension = (this.lineTension + 1.8);
} else {
if (this.angleSpeed < this.bestLineSpeed){
this.lineTension = (this.lineTension - 1.8);
};
};
this.reelTension_mc.gotoAndStop((Math.floor(((this.reelTension_mc.totalFrames * this.lineTension) / 100)) + 1));
if ((((this.lineTension < 0)) || ((this.lineTension > 100)))){
this.stopGrip();
this.dispatchEvent(new Event(FAIL));
};
}
public function reset():void{
this.lineLength = 3000;
this.lineReeledIn = 0;
this.bestLineSpeed = 8;
this.lineTension = 50;
this.reelTension_mc.gotoAndStop((Math.floor(((this.reelTension_mc.totalFrames * this.lineTension) / 100)) + 1));
}
private function stopGrip(_arg1:Event=null):void{
if (this.stage){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.rotateToGrip);
};
GameManager.getInstance().removeTickFunction(this.tickID);
this.sfxManager.stopSFX("reel");
}
private function rotateToGrip(_arg1:MouseEvent=null):void{
var _local2:Vector;
var _local3:Number;
var _local4:Number;
_local2 = new Vector(this.mouseX, this.mouseY);
this.reelSpindle_mc.rotation = (180 + ((_local2.angle * 180) / Math.PI));
_local3 = this.reelSpindle_mc.rotation;
while (_local3 < this.oldAngle) {
_local3 = (_local3 + 360);
};
_local4 = (_local3 - this.oldAngle);
this.angleSpeed = _local4;
if ((((_local4 > 180)) && ((_local4 < 340)))){
this.stopGrip();
this.sfxManager.stopSFX("reel");
} else {
if ((((_local4 > 10)) && ((_local4 < 180)))){
this.sfxManager.playSFX("reel", uint.MAX_VALUE, 1, 0, true);
this.lineReeledIn = (this.lineReeledIn + _local4);
if (this.lineReeledIn >= this.lineLength){
this.lineReeledIn = 0;
this.stopGrip();
this.dispatchEvent(new Event(Reel.REELED_IN));
};
};
};
this.oldAngle = this.reelSpindle_mc.rotation;
_local2.normalised(60).setToDO(this.reelHandle_mc);
_arg1.updateAfterEvent();
}
private function startGrip(_arg1:Event=null):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, this.rotateToGrip);
this.stage.addEventListener(MouseEvent.MOUSE_UP, this.stopGrip);
this.tickID = GameManager.getInstance().addTickFunction(this.updateTension);
}
}
}//package code
Section 3
//ReelinRoundupApp (code.ReelinRoundupApp)
package code {
import sfb.audio.*;
import flash.events.*;
import flash.display.*;
import sfb.game.systems.*;
import sfb.application.preloader.*;
import sfb.application.*;
public class ReelinRoundupApp extends Game {
public var moreGames_btn:SimpleButton;
public var playAgain_mc:SimpleButton;
public var continue_mc:SimpleButton;
public var ag_mc:MovieClip;
public var scores_mc:SimpleButton;
public var submitter_mc:MovieClip;
public var play_btn:SimpleButton;
public var hsd_mc:MovieClip;
public var game_mc:MovieClip;
public var armorBlog_mc:SimpleButton;
public var menuBackground_mc:MovieClip;
public var preloaderBar_mc:MovieClip;
public var armorGames_btn:SimpleButton;
public var sfb_mc:MovieClip;
private var sfxManager:SFXManager;
private var musicManager:MusicManager;
public var playMoreScores_mc:SimpleButton;
public var flashBros_btn:SimpleButton;
public var armorScores_mc:SimpleButton;
public function ReelinRoundupApp(){
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
super();
this.preloader = new MovieClipPreloader(this.preloaderBar_mc);
this.preload();
GameManager.getInstance().startTimer();
_local1 = this.scenes[0].numFrames;
_local2 = this.scenes[1].numFrames;
_local3 = this.scenes[2].numFrames;
_local4 = this.scenes[3].numFrames;
this.addFrameScript(_local1, this.onMenu);
this.addFrameScript((_local1 + _local2), this.onHowTo);
this.addFrameScript(((_local1 + _local2) + _local3), this.onGame);
this.addFrameScript((((_local1 + _local2) + _local3) + _local4), this.onScores);
this.score = 0;
this.flashkeys = ["eW9ESnhhUVg="];
this.SU0249s = ["MjU0MGolZSVhJW4lcw=="];
this.currentGame = 0;
this.musicManager = MusicManager.getInstance();
this.sfxManager = SFXManager.getInstance();
this.qualityToMedium();
}
public function gotoGame(_arg1:Event=null):void{
this.gotoAndStop(1, "Game");
}
public function onHowTo():void{
this.musicManager.playMusic("menu", int.MAX_VALUE, 1, 0, 1000);
this.continue_mc.addEventListener(MouseEvent.CLICK, this.gotoGame);
}
override protected function preloadComplete(_arg1:Event):void{
this.gotoMenu();
}
public function onGame():void{
this.sfxManager.playSFX("water", int.MAX_VALUE, 0.7);
this.musicManager.playMusic("main", int.MAX_VALUE, 1, 0, 1000);
}
public function onScores():void{
this.sfxManager.stopSFX("water");
this.musicManager.playMusic("menu", int.MAX_VALUE, 1, 0, 1000);
this.linkToAG(this.armorScores_mc);
this.linkToAG(this.playMoreScores_mc);
this.linkToAB(this.armorBlog_mc);
this.playAgain_mc.addEventListener(MouseEvent.CLICK, this.gotoHowTo);
this.linkToURL(this.scores_mc, "http://rankz.armorbot.com/reelinroundup/");
}
public function gotoHowTo(_arg1:Event=null):void{
this.gotoAndStop(1, "How to Play");
}
public function gotoMenu(_arg1:Event=null):void{
this.gotoAndStop(1, "Menu");
}
public function gotoScores(_arg1:Event=null):void{
this.gotoAndStop(1, "Score");
}
public function onMenu():void{
this.musicManager.addMusic(MenuLoop, "menu");
this.musicManager.addMusic(MainLoop, "main");
this.sfxManager.addSFX(WaterLoop, "water");
this.play_btn.addEventListener(MouseEvent.CLICK, this.gotoHowTo);
this.linkToAG(this.moreGames_btn);
this.linkToAG(this.armorGames_btn);
this.linkToSFB(this.flashBros_btn);
}
}
}//package code
Section 4
//ReelinRoundupGame (code.ReelinRoundupGame)
package code {
import sfb.audio.*;
import flash.events.*;
import sfb.maths.*;
import flash.geom.*;
import flash.display.*;
import sfb.game.systems.*;
import sfb.application.*;
import flash.filters.*;
public class ReelinRoundupGame extends MovieClip {
public var fishCaught:uint;
public var line:FishingLine;
public var cutscene_mc:MovieClip;
public var timePie:TimePie;
private var tickID:uint;
public var tapshape_mc:TapShape;
public var blue_mc:MovieClip;
private var musicManager:MusicManager;
public var reel_mc:Reel;
public function ReelinRoundupGame(){
this.musicManager = MusicManager.getInstance();
if (this.contains(this.cutscene_mc)){
this.removeChild(this.cutscene_mc);
};
this.cutscene_mc.br_mc.gotoAndStop(1);
this.cutscene_mc.br_mc.addFrameScript((this.cutscene_mc.br_mc.totalFrames - 1), this.onCutscene);
if (this.contains(this.reel_mc)){
this.removeChild(this.reel_mc);
};
this.reel_mc.addEventListener(Reel.REELED_IN, this.reeledInListener);
this.reel_mc.addEventListener(Reel.FAIL, this.failListener);
this.tapshape_mc.isEnabled = true;
this.tapshape_mc.addEventListener(TapShape.FIND, this.findListener);
this.fishCaught = 0;
this.line = new FishingLine(new Vector(315, 163));
this.addChild(this.line);
this.tickID = GameManager.getInstance().addTickFunction(this.moveReel);
this.timePie = new TimePie(150000, 30);
this.timePie.x = 560;
this.timePie.y = 460;
this.timePie.filters = [new DropShadowFilter(3, 45, 0, 0.5)];
this.timePie.addEventListener(TimePie.TIME_UP, this.endGame);
this.addChild(this.timePie);
}
public function reeledInListener(_arg1:Event):void{
this.addChild(this.cutscene_mc);
this.cutscene_mc.br_mc.play();
this.cutscene_mc.br_mc.fish_mc.gotoAndStop((Math.floor((Math.random() * 4)) + 1));
this.fishCaught++;
this.line.pause();
this.timePie.pause();
}
public function moveRod():void{
var _local1:Point;
if (this.blue_mc.reelIn_mc){
_local1 = new Point(this.blue_mc.reelIn_mc.follow_mc.x, this.blue_mc.reelIn_mc.follow_mc.y);
_local1 = this.blue_mc.reelIn_mc.localToGlobal(_local1);
_local1 = this.globalToLocal(_local1);
this.line.setStartPoint(_local1.x, _local1.y);
};
}
private function endGame(_arg1:Event):void{
Game.game.score = this.fishCaught;
ReelinRoundupApp(this.parent).gotoScores();
}
public function onCutscene():void{
this.line.setStartPoint(315, 163);
if (this.contains(this.cutscene_mc)){
this.removeChild(this.cutscene_mc);
};
this.cutscene_mc.br_mc.gotoAndStop(1);
this.tapshape_mc.isEnabled = true;
this.tapshape_mc.newPoint();
if (this.contains(this.reel_mc)){
this.removeChild(this.reel_mc);
};
GameManager.getInstance().removeTickFunction(this.tickID);
this.tickID = GameManager.getInstance().addTickFunction(this.moveReel);
this.line.start();
this.timePie.start();
blue_mc.gotoAndStop(1);
}
public function moveReel():void{
this.line.setEndPoint(this.mouseX, this.mouseY);
}
public function findListener(_arg1:Event):void{
this.addChild(this.reel_mc);
this.tapshape_mc.isEnabled = false;
this.reel_mc.reset();
blue_mc.gotoAndStop(2);
GameManager.getInstance().removeTickFunction(this.tickID);
this.tickID = GameManager.getInstance().addTickFunction(this.moveRod);
}
public function failListener(_arg1:Event):void{
this.addChild(this.cutscene_mc);
this.cutscene_mc.br_mc.play();
this.cutscene_mc.br_mc.fish_mc.gotoAndStop(5);
this.line.pause();
this.timePie.pause();
}
}
}//package code
Section 5
//TapIndicator (code.TapIndicator)
package code {
import flash.display.*;
public class TapIndicator extends MovieClip {
public function TapIndicator(_arg1:Number):void{
this.gotoAndStop((1 + Math.floor((_arg1 * this.totalFrames))));
}
}
}//package code
Section 6
//TapShape (code.TapShape)
package code {
import sfb.audio.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class TapShape extends MovieClip {
private var sfxManager:SFXManager;
private var pointToFind:Point;
public var isEnabled:Boolean;
public static const FIND:String = "tapShapeFind";
public function TapShape(){
this.addEventListener(MouseEvent.MOUSE_DOWN, this.indicateTap);
this.isEnabled = false;
this.newPoint();
this.sfxManager = SFXManager.getInstance();
this.sfxManager.addSFX(Splash1, "splash1");
this.sfxManager.addSFX(Splash2, "splash2");
this.sfxManager.addSFX(Splash3, "splash3");
this.sfxManager.addSFX(Splash4, "splash4");
}
private function indicateTap(_arg1:Event):void{
var _local2:Point;
var _local3:Point;
var _local4:Number;
var _local5:Number;
var _local6:TapIndicator;
if (this.isEnabled){
_local2 = new Point(this.mouseX, this.mouseY);
_local3 = pointToFind.subtract(_local2);
_local4 = (_local3.length / (this.width / 2));
_local5 = (1 - _local4);
if (_local5 < 0){
_local5 = 0;
};
_local6 = new TapIndicator(_local5);
_local6.x = this.mouseX;
_local6.y = this.mouseY;
this.addChild(_local6);
if (_local5 < 0.97){
this.sfxManager.playSFX("splash1", 0, ((1.5 * _local5) * _local5));
} else {
this.sfxManager.playSFX("splash4");
this.dispatchEvent(new Event(TapShape.FIND));
};
};
}
public function newPoint():void{
var _local1:Boolean;
var _local2:Point;
_local1 = false;
while (!(_local1)) {
this.pointToFind = new Point(Math.floor((Math.random() * this.width)), Math.floor((Math.random() * this.height)));
_local2 = this.localToGlobal(this.pointToFind);
_local1 = this.hitTestPoint(_local2.x, _local2.y, true);
};
}
}
}//package code
Section 7
//BLUERABBIT_108 (ReelinRoundup_fla.BLUERABBIT_108)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class BLUERABBIT_108 extends MovieClip {
public var fish:MovieClip;
public var reelIn_mc:MovieClip;
public function BLUERABBIT_108(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ReelinRoundup_fla
Section 8
//Cutscene_60 (ReelinRoundup_fla.Cutscene_60)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class Cutscene_60 extends MovieClip {
public var br_mc:MovieClip;
}
}//package ReelinRoundup_fla
Section 9
//FISH_71 (ReelinRoundup_fla.FISH_71)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class FISH_71 extends MovieClip {
public function FISH_71(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ReelinRoundup_fla
Section 10
//MusicExport_35 (ReelinRoundup_fla.MusicExport_35)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class MusicExport_35 extends MovieClip {
public function MusicExport_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ReelinRoundup_fla
Section 11
//PreloaderBar_7 (ReelinRoundup_fla.PreloaderBar_7)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class PreloaderBar_7 extends MovieClip {
public function PreloaderBar_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ReelinRoundup_fla
Section 12
//Symbol114_54 (ReelinRoundup_fla.Symbol114_54)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class Symbol114_54 extends MovieClip {
public var reelHandle_mc:MovieClip;
public var reelSpindle_mc:MovieClip;
}
}//package ReelinRoundup_fla
Section 13
//Symbol96_65 (ReelinRoundup_fla.Symbol96_65)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class Symbol96_65 extends MovieClip {
public var fish_mc:MovieClip;
}
}//package ReelinRoundup_fla
Section 14
//Symbol97_116 (ReelinRoundup_fla.Symbol97_116)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class Symbol97_116 extends MovieClip {
public var follow_mc:MovieClip;
public function Symbol97_116(){
addFrameScript(13, frame14);
}
function frame14(){
gotoAndPlay(10);
}
}
}//package ReelinRoundup_fla
Section 15
//TapBlip_134 (ReelinRoundup_fla.TapBlip_134)
package ReelinRoundup_fla {
import flash.display.*;
public dynamic class TapBlip_134 extends MovieClip {
public function TapBlip_134(){
addFrameScript(10, frame11);
}
function frame11(){
this.parent.parent.removeChild(this.parent);
this.stop();
}
}
}//package ReelinRoundup_fla
Section 16
//Hiscore (sfb.application.hiscores.Hiscore)
package sfb.application.hiscores {
public class Hiscore {
public var score:Number;
public var name:String;
public function Hiscore(_arg1:String, _arg2:Number){
this.name = _arg1;
this.score = _arg2;
}
}
}//package sfb.application.hiscores
Section 17
//HiscoreDisplay (sfb.application.hiscores.HiscoreDisplay)
package sfb.application.hiscores {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import sfb.application.*;
public class HiscoreDisplay extends MovieClip {
public var score1_txt:TextField;
public var score3_txt:TextField;
public var score5_txt:TextField;
private var hiscoreRequest:URLRequest;
public var score7_txt:TextField;
public var score9_txt:TextField;
public var name0_txt:TextField;
public var name2_txt:TextField;
public var name8_txt:TextField;
public var name6_txt:TextField;
private var hiscores:Array;
private var hiscoreData:URLVariables;
public var score2_txt:TextField;
public var score6_txt:TextField;
public var score8_txt:TextField;
public var score4_txt:TextField;
public var name4_txt:TextField;
public var score0_txt:TextField;
private var hiscoreLoader:URLLoader;
public var name1_txt:TextField;
public var name3_txt:TextField;
public var name5_txt:TextField;
public var name7_txt:TextField;
public var name9_txt:TextField;
public function HiscoreDisplay(){
this.hiscores = [];
this.hiscoreRequest = new URLRequest("http://rankz.armorbot.com/get/top10.php");
this.hiscoreRequest.method = URLRequestMethod.POST;
this.hiscoreLoader = new URLLoader();
this.hiscoreLoader.addEventListener(Event.COMPLETE, this.onLoadHiscores);
this.loadHiscores();
}
public function loadHiscores():void{
this.gotoAndStop("loading");
this.hiscoreRequest.data = new URLVariables();
this.hiscoreRequest.data.SU0249 = Game.game.SU0249;
this.hiscoreRequest.data.flashkey = Game.game.flashkey;
this.hiscoreLoader.load(this.hiscoreRequest);
}
private function writeHiscores():void{
var _local1:uint;
var _local2:uint;
var _local3:Array;
var _local4:Array;
this.hiscores = [];
_local3 = this.hiscoreData.top10.split("<u/*/u>");
_local1 = 0;
_local2 = _local3.length;
while (_local1 < _local2) {
_local4 = _local3[_local1].split("</*/>");
this.hiscores[_local1] = new Hiscore(_local4[0], _local4[1]);
_local1++;
};
_local1 = 0;
_local2 = this.hiscores.length;
while (_local1 < _local2) {
if (((this[(("name" + _local1) + "_txt")]) && (this[(("score" + _local1) + "_txt")]))){
this[(("name" + _local1) + "_txt")].text = this.hiscores[_local1].name;
this[(("score" + _local1) + "_txt")].text = this.hiscores[_local1].score;
} else {
break;
};
_local1++;
};
}
private function onLoadHiscores(_arg1:Event):void{
this.hiscoreData = new URLVariables(this.hiscoreLoader.data);
if (String(this.hiscoreData["success"]) == "true"){
this.gotoAndStop("hiscores");
setTimeout(this.writeHiscores, 100);
} else {
this.gotoAndStop("error");
};
}
}
}//package sfb.application.hiscores
Section 18
//HiscoreSubmit (sfb.application.hiscores.HiscoreSubmit)
package sfb.application.hiscores {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import sfb.application.*;
public class HiscoreSubmit extends MovieClip {
public var hiscore:Hiscore;
public var score_txt:TextField;
private var submitRequest:URLRequest;
private var submitLoader:URLLoader;
public var hiscoreDisplay:HiscoreDisplay;
public var submit_btn:SimpleButton;
public var name_txt:TextField;
public function HiscoreSubmit(){
this.score_txt.text = String(Game.game.score);
this.name_txt.text = "YOUR NAME";
this.submit_btn.addEventListener(MouseEvent.CLICK, this.submitScore);
this.submitRequest = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
this.submitRequest.method = URLRequestMethod.POST;
this.submitLoader = new URLLoader();
this.submitLoader.dataFormat = URLLoaderDataFormat.TEXT;
this.submitLoader.addEventListener(Event.COMPLETE, this.onSubmitScore);
}
private function submitScore(_arg1:Event):void{
var _local2:Number;
var _local3:String;
this.name_txt.type = TextFieldType.DYNAMIC;
this.name_txt.selectable = false;
if (this.contains(this.submit_btn)){
this.removeChild(this.submit_btn);
};
this.hiscore = new Hiscore(this.name_txt.text, Number(this.score_txt.text));
this.submitRequest.data = new URLVariables();
this.submitRequest.data.SU0249 = Game.game.SU0249;
this.submitRequest.data.flashkey = Game.game.flashkey;
this.submitRequest.data.bmFtZTE = this.hiscore.name;
_local2 = this.hiscore.score;
_local3 = (_local2 + "Z");
this.submitRequest.data.c2NvcmUx = _local3.split("0").join("U");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split("").join("A");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split("AU").join("Y");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split("A1").join("B");
this.submitRequest.data.c2NvcmUx = this.submitRequest.data.c2NvcmUx.split(".").join("N");
this.submitLoader.load(this.submitRequest);
}
private function onSubmitScore(_arg1:Event):void{
this.hiscoreDisplay = (this.parent["hsd_mc"] as HiscoreDisplay);
if (this.hiscoreDisplay){
trace("loading");
this.hiscoreDisplay.loadHiscores();
};
}
}
}//package sfb.application.hiscores
Section 19
//MovieClipPreloader (sfb.application.preloader.MovieClipPreloader)
package sfb.application.preloader {
import flash.events.*;
import flash.display.*;
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 20
//Preloader (sfb.application.preloader.Preloader)
package sfb.application.preloader {
import flash.events.*;
import flash.display.*;
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 21
//SaveSystem (sfb.application.saves.SaveSystem)
package sfb.application.saves {
import flash.events.*;
public class SaveSystem extends EventDispatcher {
}
}//package sfb.application.saves
Section 22
//Application (sfb.application.Application)
package sfb.application {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import sfb.events.*;
import sfb.application.preloader.*;
import sfb.application.saves.*;
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 linkLookup:Dictionary;
protected var pmgLink:ContextMenuItem;
public var rightClickMenu:ContextMenu;
protected var agLink:ContextMenuItem;
public var preloader:Preloader;
protected var mediumQuality:ContextMenuItem;
protected var qualityIndicator:String;// = " <<<"
protected var highQuality:ContextMenuItem;
public static var application:Application;
public function Application(){
qualityIndicator = " <<<";
super();
this.stop();
this.linkLookup = new Dictionary(true);
Application.application = this;
this.createRightClickMenu();
}
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 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 linkToURL(_arg1:InteractiveObject, _arg2:String){
this.linkLookup[_arg1] = _arg2;
_arg1.addEventListener(MouseEvent.CLICK, this.browseToURL);
}
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 browseToURL(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:String;
_local2 = (_arg1.target as InteractiveObject);
if (_local2){
_local3 = (this.linkLookup[_local2] as String);
if (_local3){
navigateToURL(new URLRequest(_local3), "_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 23
//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 24
//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 (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 {
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 25
//SFXManager (sfb.audio.SFXManager)
package sfb.audio {
import flash.events.*;
import flash.media.*;
public class SFXManager {
private var sfxChannel_array:Array;
private var sfx_array:Array;
private static var INSTANCE:SFXManager;
public function SFXManager(){
this.sfx_array = [];
this.sfxChannel_array = [];
}
public function stopSFX(_arg1:String):void{
if (this.sfxChannel_array[_arg1]){
SoundChannel(this.sfxChannel_array[_arg1]).stop();
this.sfxChannel_array[_arg1] = null;
};
}
public function addSFX(_arg1:Class, _arg2:String):void{
this.sfx_array[_arg2] = new (_arg1);
}
public function stopAllSFX():void{
var _local1:String;
for (_local1 in this.sfxChannel_array) {
if (this.sfxChannel_array[_local1]){
this.stopSFX(_local1);
};
};
}
private function completeListener(_arg1:Event):void{
var _local2:String;
for (_local2 in this.sfxChannel_array) {
if (this.sfxChannel_array[_local2] == _arg1.target){
this.stopSFX(_local2);
};
};
}
public function playSFX(_arg1:String, _arg2:int=0, _arg3:Number=1, _arg4:Number=0, _arg5:Boolean=false):void{
if (((this.sfx_array[_arg1]) && (((!(_arg5)) || (!(this.sfxChannel_array[_arg1])))))){
this.sfxChannel_array[_arg1] = Sound(this.sfx_array[_arg1]).play(0, _arg2, new SoundTransform(_arg3, _arg4));
this.sfxChannel_array[_arg1].addEventListener(Event.SOUND_COMPLETE, this.completeListener);
};
}
public function isSFXPlaying(_arg1:String):Boolean{
if (this.sfxChannel_array[_arg1]){
return (true);
};
return (false);
}
public static function getInstance():SFXManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (SFXManager);
return (INSTANCE);
}
}
}//package sfb.audio
Section 26
//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 27
//GameManager (sfb.game.systems.GameManager)
package sfb.game.systems {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import sfb.tools.*;
public class GameManager extends EventDispatcher {
private var stage:Stage;
private var tickTime:uint;
private var tickTimer:AccurateTimer;
private var tickFunctionsNum:uint;
private var tickFunctionsCount:uint;
private var tickFunctions:Array;
public static const END:String = "endGame";
public static const PAUSE:String = "pauseGame";
public static const UNPAUSE:String = "unpauseGame";
private static var INSTANCE:GameManager;
public function GameManager(){
this.tickFunctions = [];
this.tickFunctionsNum = 0;
this.tickFunctionsCount = 0;
}
public function stop():void{
if (this.tickTimer){
this.tickTimer.stop();
this.tickTimer.removeEventListener(TimerEvent.TIMER, this.timerTick);
this.tickTimer = null;
};
if (this.stage){
this.stage.removeEventListener(Event.ENTER_FRAME, this.frameTick);
this.stage = null;
};
}
private function timerTick(_arg1:TimerEvent):void{
this.tickTime = getTimer();
this.callTickFunctions();
_arg1.updateAfterEvent();
}
public function startTimer(_arg1:uint=40):void{
this.stop();
this.tickTimer = new AccurateTimer(_arg1);
this.tickTimer.addEventListener(TimerEvent.TIMER, this.timerTick);
this.tickTimer.start();
}
public function addTickFunction(_arg1:Function, _arg2:int=0):uint{
var _local3:uint;
var _local4:uint;
this.tickFunctionsNum++;
_local3 = this.tickFunctions.push(new TickFunction(_arg1, _arg2));
_local4 = this.tickFunctions[(_local3 - 1)].id;
this.tickFunctions.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
return (_local4);
}
private function callTickFunctions():void{
this.tickFunctionsCount = 0;
while (this.tickFunctionsCount < this.tickFunctionsNum) {
this.tickFunctions[this.tickFunctionsCount].tickFunction();
this.tickFunctionsCount++;
};
}
public function set delay(_arg1:uint):void{
if (this.tickTimer){
this.tickTimer.delay = _arg1;
};
}
private function frameTick(_arg1:Event):void{
this.tickTime = getTimer();
this.callTickFunctions();
}
public function startFrame(_arg1:Stage):void{
this.stop();
this.stage = _arg1;
this.stage.addEventListener(Event.ENTER_FRAME, this.frameTick);
}
public function endGame():void{
this.dispatchEvent(new Event(GameManager.END));
}
public function pause():void{
if (this.tickTimer){
this.tickTimer.stop();
} else {
if (this.stage){
this.stage.removeEventListener(Event.ENTER_FRAME, this.frameTick);
};
};
this.dispatchEvent(new Event(GameManager.PAUSE));
}
public function removeTickFunction(_arg1:uint):void{
var _local2:uint;
_local2 = 0;
while (_local2 < tickFunctionsNum) {
if (this.tickFunctions[_local2].id == _arg1){
this.tickFunctions.splice(_local2, 1);
this.tickFunctionsNum = (this.tickFunctionsNum - 1);
this.tickFunctionsCount = (this.tickFunctionsCount - 1);
return;
};
_local2++;
};
}
public function unpause():void{
if (this.tickTimer){
this.tickTimer.start();
} else {
if (this.stage){
this.stage.addEventListener(Event.ENTER_FRAME, this.frameTick);
};
};
}
public static function getInstance():GameManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (GameManager);
return (INSTANCE);
}
}
}//package sfb.game.systems
class TickFunction {
public var priority:int;
public var tickFunction:Function;
public var id:uint;
private static var idCount:uint = 1;
private function TickFunction(_arg1:Function, _arg2:int=0){
this.tickFunction = _arg1;
this.priority = _arg2;
this.id = idCount++;
}
public function toString():String{
return (((("TickFunction, priority " + this.priority) + ", ID ") + this.id));
}
}
Section 28
//TimePie (sfb.game.systems.TimePie)
package sfb.game.systems {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class TimePie extends Sprite {
private var countUp:Boolean;
private var outlineColours_array:Array;
private var raduis:Number;
private var colours_array:Array;
private var maxTime:uint;
private var tickID:uint;
private var lastTime:uint;
private var innerRadius:Number;
private var flashTime:uint;
private var currentTime:int;
public static const TIME_UP:String = "timePieUp";
public function TimePie(_arg1:uint, _arg2:Number=40, _arg3:Boolean=false){
this.currentTime = 0;
this.maxTime = _arg1;
this.raduis = _arg2;
this.countUp = _arg3;
this.lastTime = getTimer();
this.colours_array = [1351456, 6527779, 10851878, 12210965, 0xD40200];
this.outlineColours_array = [679955, 4348949, 6510358, 7093519, 0x7F0000];
this.tickID = GameManager.getInstance().addTickFunction(this.count);
}
public function count():void{
var _local1:uint;
_local1 = getTimer();
this.currentTime = (this.currentTime + (_local1 - lastTime));
this.lastTime = _local1;
if (this.currentTime >= this.maxTime){
this.currentTime = this.maxTime;
this.drawPie();
GameManager.getInstance().removeTickFunction(this.tickID);
this.dispatchEvent(new Event(TIME_UP));
} else {
this.drawPie();
};
}
public function start():void{
this.tickID = GameManager.getInstance().addTickFunction(this.count);
}
private function drawPie():void{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:Number;
var _local5:Number;
var _local6:Point;
this.graphics.clear();
_local1 = (currentTime / maxTime);
_local2 = this.colours_array[Math.floor((this.colours_array.length * _local1))];
_local3 = this.outlineColours_array[Math.floor((this.outlineColours_array.length * _local1))];
this.graphics.lineStyle(3, _local3, 1, false, "normal", CapsStyle.SQUARE);
this.graphics.beginFill(_local2);
this.graphics.moveTo(0, 0);
_local4 = ((Math.PI * 2) * _local1);
if (!countUp){
_local4 = ((Math.PI * 2) - _local4);
};
_local5 = 0;
while (_local5 < _local4) {
_local6 = Point.polar(this.raduis, (_local5 - (Math.PI / 2)));
this.graphics.lineTo(_local6.x, _local6.y);
_local5 = (_local5 + 0.01);
};
this.graphics.lineTo(0, 0);
this.graphics.endFill();
}
public function pause():void{
GameManager.getInstance().removeTickFunction(this.tickID);
}
}
}//package sfb.game.systems
Section 29
//FixedStringForce (sfb.maths.physics.forces.FixedStringForce)
package sfb.maths.physics.forces {
import sfb.maths.*;
import sfb.maths.physics.*;
public class FixedStringForce implements IForcable {
public var length:Number;
private var position:Vector;
public var springConstant:Number;
private var mass:Mass;
private var isEnabled:Boolean;
public function FixedStringForce(_arg1:Vector, _arg2:Mass, _arg3:Number=-1, _arg4:Number=0.5){
this.position = _arg1;
this.mass = _arg2;
if (_arg3 == -1){
this.length = this.mass.position.subtract(this.position).length;
} else {
this.length = _arg3;
};
this.springConstant = _arg4;
this.isEnabled = true;
}
public function get enabled():Boolean{
return (this.isEnabled);
}
public function set enabled(_arg1:Boolean):void{
this.isEnabled = _arg1;
}
public function applyForce():void{
var _local1:Vector;
var _local2:Number;
var _local3:Number;
var _local4:Vector;
if (this.isEnabled){
_local1 = this.mass.position.add(this.mass.velocity).subtract(this.position);
_local2 = (_local1.length - this.length);
if (_local2 > 0){
_local3 = (_local2 * this.springConstant);
_local4 = _local1.normalised(_local3);
this.mass.velocity = this.mass.velocity.subtract(_local4);
};
};
}
}
}//package sfb.maths.physics.forces
Section 30
//IForcable (sfb.maths.physics.forces.IForcable)
package sfb.maths.physics.forces {
public interface IForcable {
function get enabled():Boolean;
function set enabled(_arg1:Boolean):void;
function applyForce():void;
}
}//package sfb.maths.physics.forces
Section 31
//SpringForce (sfb.maths.physics.forces.SpringForce)
package sfb.maths.physics.forces {
import sfb.maths.*;
import sfb.maths.physics.*;
public class SpringForce implements IForcable {
public var length:Number;
public var springConstant:Number;
private var isEnabled:Boolean;
private var mass1:Mass;
private var mass2:Mass;
public function SpringForce(_arg1:Mass, _arg2:Mass, _arg3:Number=-1, _arg4:Number=0.5){
this.mass1 = _arg1;
this.mass2 = _arg2;
if (_arg3 == -1){
this.length = this.mass1.position.subtract(this.mass2.position).length;
} else {
this.length = _arg3;
};
this.springConstant = _arg4;
this.isEnabled = true;
}
public function get enabled():Boolean{
return (this.isEnabled);
}
public function set enabled(_arg1:Boolean):void{
this.isEnabled = _arg1;
}
public function applyForce():void{
var _local1:Vector;
var _local2:Number;
var _local3:Number;
var _local4:Vector;
if (this.isEnabled){
_local1 = this.mass2.position.add(this.mass2.velocity).subtract(this.mass1.position.add(this.mass1.velocity));
_local2 = (_local1.length - this.length);
_local3 = (_local2 * this.springConstant);
_local4 = _local1.normalised(_local3);
this.mass1.velocity = this.mass1.velocity.add(_local4);
this.mass2.velocity = this.mass2.velocity.subtract(_local4);
};
}
}
}//package sfb.maths.physics.forces
Section 32
//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 33
//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 reverse():Vector{
return (new Vector(-(this.point.x), -(this.point.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 perpendicular(_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.subtract(_arg1.multiply((2 * _arg1.dotProduct(this)))));
}
public function setFromDO(_arg1:DisplayObject):void{
this.point.x = _arg1.x;
this.point.y = _arg1.y;
}
public function equals(_arg1:Vector, _arg2:Number=0):Boolean{
return ((Vector.distance(this, _arg1) <= _arg2));
}
public static function interpolate(_arg1:Vector, _arg2:Vector, _arg3:Number):Vector{
return (Vector.newFromPoint(Point.interpolate(_arg1.toPoint(), _arg2.toPoint(), (1 - _arg3))));
}
public static function newFromPoint(_arg1:Point):Vector{
return (new Vector(_arg1.x, _arg1.y));
}
public static function distance(_arg1:Vector, _arg2:Vector):Number{
return (Point.distance(_arg1.toPoint(), _arg2.toPoint()));
}
public static function newFromDisplayObject(_arg1:DisplayObject):Vector{
return (new Vector(_arg1.x, _arg1.y));
}
public static function nearest(_arg1:Vector, _arg2:Array):Vector{
var _local3:Number;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:Vector;
_local3 = Number.POSITIVE_INFINITY;
_local4 = 0;
_local5 = 0;
_local6 = _arg2.length;
while (_local5 < _local6) {
_local7 = _arg1.subtract(_arg2[_local5]);
if (_local7.length < _local3){
_local3 = _local7.length;
_local4 = _local5;
};
_local5++;
};
return (_arg2[_local4]);
}
}
}//package sfb.maths
Section 34
//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 35
//MainLoop (MainLoop)
package {
import flash.media.*;
public dynamic class MainLoop extends Sound {
}
}//package
Section 36
//MenuLoop (MenuLoop)
package {
import flash.media.*;
public dynamic class MenuLoop extends Sound {
}
}//package
Section 37
//ReelSound (ReelSound)
package {
import flash.media.*;
public dynamic class ReelSound extends Sound {
}
}//package
Section 38
//Splash1 (Splash1)
package {
import flash.media.*;
public dynamic class Splash1 extends Sound {
}
}//package
Section 39
//Splash2 (Splash2)
package {
import flash.media.*;
public dynamic class Splash2 extends Sound {
}
}//package
Section 40
//Splash3 (Splash3)
package {
import flash.media.*;
public dynamic class Splash3 extends Sound {
}
}//package
Section 41
//Splash4 (Splash4)
package {
import flash.media.*;
public dynamic class Splash4 extends Sound {
}
}//package
Section 42
//TapShape1 (TapShape1)
package {
import code.*;
public dynamic class TapShape1 extends TapShape {
}
}//package
Section 43
//WaterLoop (WaterLoop)
package {
import flash.media.*;
public dynamic class WaterLoop extends Sound {
}
}//package