Section 1
//ecxplodre_286 (CosmoCabsv03_fla.ecxplodre_286)
package CosmoCabsv03_fla {
import flash.display.*;
public dynamic class ecxplodre_286 extends MovieClip {
public function ecxplodre_286(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package CosmoCabsv03_fla
Section 2
//generatedword_290 (CosmoCabsv03_fla.generatedword_290)
package CosmoCabsv03_fla {
import flash.display.*;
public dynamic class generatedword_290 extends MovieClip {
public function generatedword_290(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package CosmoCabsv03_fla
Section 3
//hiscores_293 (CosmoCabsv03_fla.hiscores_293)
package CosmoCabsv03_fla {
import flash.display.*;
import flash.text.*;
public dynamic class hiscores_293 extends MovieClip {
public var score5:TextField;
public var name1:TextField;
public var name3:TextField;
public var name4:TextField;
public var name2:TextField;
public var name5:TextField;
public var data:Object;
public var score2:TextField;
public var score3:TextField;
public var score1:TextField;
public var score4:TextField;
public function hiscores_293(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package CosmoCabsv03_fla
Section 4
//MainTimeline (CosmoCabsv03_fla.MainTimeline)
package CosmoCabsv03_fla {
import net.superflashbros.game.*;
import net.superflashbros.audio.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var time_txt:TextField;
public var t_sfb:ContextMenuItem;
public var ag:MovieClip;
public var playAgain_btn:SimpleButton;
public var sfbt_mc:MovieClip;
public var next1_btn:SimpleButton;
public var t_menu:ContextMenu;
public var health_mc:MovieClip;
public var ag_mc:MovieClip;
public var agt_mc:MovieClip;
public var sfb:MovieClip;
public var sf_btn:SimpleButton;
public var speed3_txt:TextField;
public var sfb_btn:SimpleButton;
public var score:int;
public var hiscores_mc:MovieClip;
public var moreScores_mc:MovieClip;
public var pmg_btn:SimpleButton;
public var t_high:ContextMenuItem;
public var ag_btn:SimpleButton;
public var name_txt:TextField;
public var fare_txt:TextField;
public var speed2_txt:TextField;
public var funds_txt:TextField;
public var start_btn:SimpleButton;
public var t_low:ContextMenuItem;
public var distance_txt:TextField;
public var next3_btn:SimpleButton;
public var score_txt:TextField;
public var rate_mc:MovieClip;
public var world_mc:MainWorld;
public var sfb_mc:MovieClip;
public var speed1_txt:TextField;
public var t_med:ContextMenuItem;
public var a_btn:SimpleButton;
public var arrow_mc:MovieClip;
public var submit_btn:SimpleButton;
public var next2_btn:SimpleButton;
public var playMore_btn:SimpleButton;
public var t_pmg:ContextMenuItem;
public var t_ag:ContextMenuItem;
public var hud_mc:HUD;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
public function onSFB(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.superflashbros.net/");
navigateToURL(_local2, "_blank");
}
public function onHigh(_arg1:Event):void{
stage.quality = StageQuality.HIGH;
}
public function onAG(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.armorgames.com/");
navigateToURL(_local2, "_blank");
}
public function onM(_arg1:KeyboardEvent):void{
if (AudioManager.getInstance().muted){
AudioManager.getInstance().unmute();
} else {
AudioManager.getInstance().mute();
};
}
public function onQ(_arg1:KeyboardEvent):void{
if (this.stage.quality == StageQuality.LOW.toUpperCase()){
trace(1);
this.stage.quality = StageQuality.MEDIUM;
} else {
if (this.stage.quality == StageQuality.MEDIUM.toUpperCase()){
trace(2);
this.stage.quality = StageQuality.HIGH;
} else {
trace(3);
this.stage.quality = StageQuality.LOW;
};
};
}
function frame2(){
MusicManager.getInstance().addMusic(MenuLoop, "menu");
Controls.get().init(this.stage);
Controls.get().registerKeyPress("M", onM);
Controls.get().registerKeyPress("Q", onQ);
this.start_btn.addEventListener(MouseEvent.CLICK, onStart);
this.playMore_btn.addEventListener(MouseEvent.CLICK, onAG);
this.sfb_btn.addEventListener(MouseEvent.CLICK, onSFB);
this.ag_btn.addEventListener(MouseEvent.CLICK, onAG);
this.agt_mc.addEventListener(MouseEvent.CLICK, onAG);
this.sfbt_mc.addEventListener(MouseEvent.CLICK, onSFB);
this.sfb_mc.addEventListener(MouseEvent.CLICK, onSFB);
this.ag_mc.addEventListener(MouseEvent.CLICK, onAG);
score = 0;
stop();
}
function frame3(){
MusicManager.getInstance().playMusic("menu", 400000000, 1, 0, 200);
this.next1_btn.addEventListener(MouseEvent.CLICK, onNext1);
}
function frame5(){
this.next3_btn.addEventListener(MouseEvent.CLICK, onNext3);
}
function frame6(){
this.stage.quality = StageQuality.LOW;
}
function frame7(){
stop();
}
function frame1(){
stop();
this.ag.addEventListener(MouseEvent.CLICK, onAG);
this.sfb.addEventListener(MouseEvent.CLICK, onSFB);
this.loaderInfo.addEventListener(Event.COMPLETE, onLoaded);
this.agt_mc.addEventListener(MouseEvent.CLICK, onAG);
this.sfbt_mc.addEventListener(MouseEvent.CLICK, onSFB);
this.ag.buttonMode = true;
this.sfb.buttonMode = true;
this.ag.useHandCursor = true;
this.sfb.useHandCursor = true;
t_menu = new ContextMenu();
t_menu.hideBuiltInItems();
t_high = new ContextMenuItem("Quality: High");
t_high.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onHigh);
t_menu.customItems.push(t_high);
t_med = new ContextMenuItem("Quality: Medium");
t_med.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMed);
t_menu.customItems.push(t_med);
t_low = new ContextMenuItem("Quality: Low");
t_low.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onLow);
t_menu.customItems.push(t_low);
t_sfb = new ContextMenuItem("SuperFlashBros.net", true);
t_sfb.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onSFB);
t_menu.customItems.push(t_sfb);
t_ag = new ContextMenuItem("ArmorGames.com");
t_ag.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onAG);
t_menu.customItems.push(t_ag);
t_pmg = new ContextMenuItem("Play More Games!");
t_pmg.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onAG);
t_menu.customItems.push(t_pmg);
this.contextMenu = t_menu;
stop();
}
function frame4(){
this.next2_btn.addEventListener(MouseEvent.CLICK, onNext2);
}
function frame8(){
MusicManager.getInstance().playMusic("menu", 400000000, 1, 0, 200);
this.playAgain_btn.addEventListener(MouseEvent.CLICK, onPlayAgain);
this.pmg_btn.addEventListener(MouseEvent.CLICK, onAG);
this.sf_btn.addEventListener(MouseEvent.CLICK, onSFB);
this.a_btn.addEventListener(MouseEvent.CLICK, onAG);
this.submit_btn.addEventListener(MouseEvent.CLICK, onSubmit);
this.sfb_mc.addEventListener(MouseEvent.CLICK, onSFB);
this.ag_mc.addEventListener(MouseEvent.CLICK, onAG);
this.moreScores_mc.addEventListener(MouseEvent.CLICK, onScores);
if (score > 90000){
this.rate_mc.gotoAndStop(1);
} else {
if (score > 60000){
this.rate_mc.gotoAndStop(2);
} else {
if (score > 30000){
this.rate_mc.gotoAndStop(3);
} else {
if (score > 10000){
this.rate_mc.gotoAndStop(4);
} else {
this.rate_mc.gotoAndStop(5);
};
};
};
};
this.score_txt.text = String(score);
loadScores();
stop();
}
public function doScores(_arg1:Object):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:Array;
_local2 = _arg1.top10.split("<u/*/u>");
_local3 = 0;
_local4 = Math.min(_local2.length, 5);
while (_local3 < _local4) {
_local5 = _local2[_local3].split("</*/>");
this.hiscores_mc[("name" + (_local3 + 1))].text = _local5[0];
this.hiscores_mc[("score" + (_local3 + 1))].text = _local5[1];
_local3++;
};
}
public function loadScores():void{
var _local1:URLRequest;
var _local2:URLLoader;
this.hiscores_mc.gotoAndStop(1);
_local1 = new URLRequest("http://rankz.armorbot.com/get/top10.php");
_local1.data = new URLVariables();
_local1.data.SU0249 = "MjMyOGolZSVhJW4lcw==";
_local1.data.flashkey = "eUZYUU5oTWg=";
_local1.method = "POST";
_local2 = new URLLoader();
_local2.addEventListener(Event.COMPLETE, onLoadScores);
_local2.load(_local1);
}
public function onLoaded(_arg1:Event){
this.play();
}
public function onSubmit(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLVariables;
var _local4:Number;
var _local5:String;
var _local6:URLLoader;
if ((((this.name_txt.text.length > 1)) && (!((this.name_txt.text == "YOUR NAME"))))){
TextField(this.name_txt).mouseEnabled = false;
this.submit_btn.visible = false;
_local2 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLVariables();
_local3.flashkey = "eUZYUU5oTWg=";
_local3.SU0249 = "MjMyOGolZSVhJW4lcw==";
_local3.bmFtZTE = this.name_txt.text;
_local4 = score;
_local5 = (_local4 + "Z");
_local3.c2NvcmUx = _local5.split("0").join("U");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("").join("A");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("AU").join("Y");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("A1").join("B");
_local3.c2NvcmUx = _local3.c2NvcmUx.split(".").join("N");
_local2.data = _local3;
_local6 = new URLLoader();
_local6.dataFormat = URLLoaderDataFormat.TEXT;
_local6.addEventListener(Event.COMPLETE, onSendScores);
_local6.load(_local2);
};
}
public function onScores(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://rankz.armorbot.com/cosmocabs/");
navigateToURL(_local2, "_blank");
}
public function onLow(_arg1:Event):void{
stage.quality = StageQuality.LOW;
}
public function onNext2(_arg1:MouseEvent){
this.gotoAndStop(1, "Controls3");
}
public function onNext3(_arg1:MouseEvent){
this.gotoAndPlay(1, "Loading");
}
public function onNext1(_arg1:MouseEvent){
this.gotoAndStop(1, "Controls2");
}
public function onSendScores(_arg1:Event):void{
var _local2:URLLoader;
var _local3:URLVariables;
_local2 = URLLoader(_arg1.target);
_local3 = new URLVariables(_local2.data.substring(1));
if (String(_local3["success"]) == "true"){
loadScores();
} else {
this.hiscores_mc.gotoAndStop(3);
};
}
public function onMed(_arg1:Event):void{
stage.quality = StageQuality.MEDIUM;
}
public function onPlayAgain(_arg1:MouseEvent){
this.gotoAndStop(1, "Controls1");
}
public function onStart(_arg1:MouseEvent){
this.gotoAndStop(1, "Controls1");
}
public function onLoadScores(_arg1:Event):void{
var _local2:URLLoader;
var _local3:URLVariables;
_local2 = URLLoader(_arg1.target);
_local3 = new URLVariables(_local2.data);
if (String(_local3["success"]) == "true"){
this.hiscores_mc.gotoAndStop(2);
setTimeout(doScores, 100, _local3);
} else {
this.hiscores_mc.gotoAndStop(3);
};
}
}
}//package CosmoCabsv03_fla
Section 5
//Symbol219_103 (CosmoCabsv03_fla.Symbol219_103)
package CosmoCabsv03_fla {
import flash.display.*;
public dynamic class Symbol219_103 extends MovieClip {
public function Symbol219_103(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package CosmoCabsv03_fla
Section 6
//Symbol266_76 (CosmoCabsv03_fla.Symbol266_76)
package CosmoCabsv03_fla {
import flash.display.*;
public dynamic class Symbol266_76 extends MovieClip {
public function Symbol266_76(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package CosmoCabsv03_fla
Section 7
//AudioManager (net.superflashbros.audio.AudioManager)
package net.superflashbros.audio {
import flash.media.*;
public class AudioManager {
private var isMuted:Boolean;
private var setVolume:Number;
private static var INSTANCE:AudioManager;
public function mute():void{
var _local1:SoundTransform;
this.isMuted = true;
this.setVolume = SoundMixer.soundTransform.volume;
_local1 = SoundMixer.soundTransform;
_local1.volume = 0;
SoundMixer.soundTransform = _local1;
}
public function unmute():void{
var _local1:SoundTransform;
this.isMuted = false;
_local1 = SoundMixer.soundTransform;
_local1.volume = this.setVolume;
SoundMixer.soundTransform = _local1;
}
public function get muted():Boolean{
return (this.isMuted);
}
public static function getInstance():AudioManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (AudioManager);
return (INSTANCE);
}
}
}//package net.superflashbros.audio
Section 8
//MusicManager (net.superflashbros.audio.MusicManager)
package net.superflashbros.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 net.superflashbros.audio
Section 9
//SFXManager (net.superflashbros.audio.SFXManager)
package net.superflashbros.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 static function getInstance():SFXManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (SFXManager);
return (INSTANCE);
}
}
}//package net.superflashbros.audio
Section 10
//VoiceManager (net.superflashbros.audio.VoiceManager)
package net.superflashbros.audio {
import flash.events.*;
import flash.media.*;
public class VoiceManager {
private var isTalking:Boolean;
private var voiceChannel:SoundChannel;
private var voice_array:Array;
private static var INSTANCE:VoiceManager;
public function VoiceManager(){
this.voice_array = [];
}
public function addVoice(_arg1:Class, _arg2:String):void{
this.voice_array[_arg2] = new (_arg1);
}
private function completeListener(_arg1:Event):void{
this.voiceChannel = null;
this.isTalking = false;
}
public function stopVoice():void{
if (this.voiceChannel){
this.voiceChannel.stop();
this.voiceChannel = null;
};
this.isTalking = false;
}
public function playVoice(_arg1:String, _arg2:Number=1, _arg3:Number=0):void{
if (((((!(this.isTalking)) && (this.voice_array[_arg1]))) && (!(this.voiceChannel)))){
this.voiceChannel = Sound(this.voice_array[_arg1]).play(0, 0, new SoundTransform(_arg2, _arg3));
this.voiceChannel.addEventListener(Event.SOUND_COMPLETE, this.completeListener);
this.isTalking = true;
};
}
public static function getInstance():VoiceManager{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (VoiceManager);
return (INSTANCE);
}
}
}//package net.superflashbros.audio
Section 11
//Camera (net.superflashbros.game.Camera)
package net.superflashbros.game {
import flash.display.*;
import flash.geom.*;
public class Camera {
public var boundBox:Rectangle;
public var target:DisplayObject;
public var world:World;
public var elasticity:Number;
public function Camera(_arg1:DisplayObject, _arg2:World, _arg3:Rectangle=null, _arg4:Number=0){
this.target = _arg1;
this.world = _arg2;
this.boundBox = ((_arg3) || (new Rectangle(275, 200, 1, 1)));
this.elasticity = _arg4;
}
protected function adjustX(_arg1:Number, _arg2:int):void{
if (_arg1 > 0){
this.world.x = (this.world.x - ((_arg2 * _arg1) * (1 - elasticity)));
};
}
protected function adjustY(_arg1:Number, _arg2:int):void{
if (_arg1 > 0){
this.world.y = (this.world.y - ((_arg2 * _arg1) * (1 - elasticity)));
};
}
public function follow():void{
var _local1:Rectangle;
_local1 = target.getBounds(target.stage);
this.adjustX((this.boundBox.left - _local1.left), -1);
this.adjustX((_local1.right - this.boundBox.right), 1);
this.adjustY((this.boundBox.top - _local1.top), -1);
this.adjustY((_local1.bottom - this.boundBox.bottom), 1);
}
}
}//package net.superflashbros.game
Section 12
//Controls (net.superflashbros.game.Controls)
package net.superflashbros.game {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class Controls extends EventDispatcher {
private var regKeyPress:Array;
private var keyDown:Array;
private var regKeys:Array;
private static var INSTANCE:Controls;
private static var keyCodes: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 function init(_arg1:Stage){
this.keyDown = [];
this.regKeys = [];
this.regKeyPress = [];
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDownListener);
_arg1.addEventListener(KeyboardEvent.KEY_UP, this.keyUpListener);
}
public function registerKeyPress(_arg1:String, _arg2:Function):void{
this.regKeyPress.push(new KeyPress(keyCodes[_arg1.toUpperCase()], _arg2));
}
public function getKeys(_arg1:String="default"):Object{
var _local2:Object;
var _local3:String;
var _local4:uint;
if (this.regKeys[_arg1]){
_local2 = {};
for (_local3 in this.regKeys[_arg1]) {
_local4 = ((Keyboard[this.regKeys[_arg1][_local3]]) || (Controls.keyCodes[this.regKeys[_arg1][_local3]]));
_local2[_local3] = Boolean(this.keyDown[_local4]);
};
return (_local2);
//unresolved jump
};
return (null);
}
private function keyUpListener(_arg1:KeyboardEvent):void{
delete this.keyDown[_arg1.keyCode];
}
private function keyDownListener(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:uint;
_local2 = 0;
_local3 = this.regKeyPress.length;
while (_local2 < _local3) {
if (_arg1.keyCode == this.regKeyPress[_local2].key){
this.regKeyPress[_local2].listener(_arg1);
break;
};
_local2++;
};
this.keyDown[_arg1.keyCode] = true;
}
public function registerKey(_arg1:String, _arg2:String, _arg3:String="default"):void{
if (!this.regKeys[_arg3]){
this.regKeys[_arg3] = [];
};
this.regKeys[_arg3][_arg2] = _arg1.toUpperCase();
}
public static function get():Controls{
if (INSTANCE){
return (INSTANCE);
};
INSTANCE = new (Controls);
return (INSTANCE);
}
}
}//package net.superflashbros.game
class KeyPress {
public var listener:Function;
public var key:int;
private function KeyPress(_arg1:int, _arg2:Function){
this.key = _arg1;
this.listener = _arg2;
}
}
Section 13
//IEndable (net.superflashbros.game.IEndable)
package net.superflashbros.game {
public interface IEndable {
function endGame():void;
}
}//package net.superflashbros.game
Section 14
//IHUD (net.superflashbros.game.IHUD)
package net.superflashbros.game {
public interface IHUD {
function update(_arg1:World):void;
}
}//package net.superflashbros.game
Section 15
//LargeTerrain (net.superflashbros.game.LargeTerrain)
package net.superflashbros.game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class LargeTerrain extends Terrain implements IEndable {
protected var timer:Timer;
protected var testRect:Rectangle;
public function LargeTerrain(){
this.timer = new Timer(250);
this.timer.addEventListener(TimerEvent.TIMER, this.showHideBlocks);
this.timer.start();
this.testRect = new Rectangle(-40, -40, (this.stage.width + 80), (this.stage.height + 80));
}
protected function showHideBlocks(_arg1:TimerEvent){
var _local2:Rectangle;
var _local3:DisplayObject;
var _local4:uint;
var _local5:uint;
_local4 = 0;
_local5 = this.numChildren;
while (_local4 < _local5) {
_local3 = this.getChildAt(_local4);
_local2 = _local3.getBounds(this.stage);
_local3.visible = testRect.intersects(_local2);
_local4++;
};
}
override public function endGame():void{
super.endGame();
this.timer.stop();
}
}
}//package net.superflashbros.game
Section 16
//MovingObstacle (net.superflashbros.game.MovingObstacle)
package net.superflashbros.game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import net.superflashbros.utils.*;
public class MovingObstacle extends Terrain implements IEndable {
protected var timer:Timer;
protected var testRect:Rectangle;
public function MovingObstacle(){
this.timer = new Timer(250);
this.timer.addEventListener(TimerEvent.TIMER, this.showHideBlocks);
this.timer.start();
this.testRect = new Rectangle(-100, -100, (this.stage.width + 200), (this.stage.height + 200));
}
override public function fullHitTest(_arg1:DisplayObject):Rectangle{
return (FullHitTest.objectBackground(_arg1, this));
}
protected function showHideBlocks(_arg1:TimerEvent){
this.visible = testRect.intersects(this.getBounds(this.stage));
}
override public function endGame():void{
super.endGame();
this.timer.stop();
}
}
}//package net.superflashbros.game
Section 17
//Terrain (net.superflashbros.game.Terrain)
package net.superflashbros.game {
import flash.display.*;
import flash.geom.*;
import net.superflashbros.maths.*;
import net.superflashbros.physics.*;
import net.superflashbros.utils.*;
public class Terrain extends MovieClip implements IEndable {
public var friction:Number;
public var hitMapScale:Number;// = 0.6
public var hitTrace:Sprite;
public var elasticity:Number;
public var hitMap:BitmapData;
public function Terrain(){
var _local1:Matrix;
hitMapScale = 0.6;
super();
this.elasticity = 1;
this.friction = 0.8;
this.hitMap = new BitmapData((this.width * hitMapScale), (this.height * hitMapScale), true, 0);
_local1 = new Matrix();
_local1.scale(hitMapScale, hitMapScale);
this.hitMap.draw(this, _local1);
this.hitTrace = new Sprite();
this.addChild(this.hitTrace);
}
public function fullHitTest(_arg1:DisplayObject):Rectangle{
return (FullHitTest.objectHitMask(_arg1, this, hitMap, hitMapScale));
}
public function endGame():void{
this.hitMap.dispose();
}
public function simpleHitTest(_arg1:DisplayObject):Boolean{
return (this.getBounds(this.stage).intersects(_arg1.getBounds(this.stage)));
}
public function hitTest(_arg1:PointMass):Boolean{
var _local2:Rectangle;
var _local3:Vector;
if (this.simpleHitTest(_arg1)){
_local2 = this.fullHitTest(_arg1);
if (_local2.width == 0){
return (false);
};
_local2.offset(_arg1.velocity.x, _arg1.velocity.y);
_local3 = FullHitTest.normalFromRectangle(_arg1, _local2);
_arg1.velocity = _arg1.velocity.reflect(_local3.getNormalised(1));
_arg1.notifyHit(_local2);
_arg1.render();
return (true);
};
return (false);
}
}
}//package net.superflashbros.game
Section 18
//World (net.superflashbros.game.World)
package net.superflashbros.game {
import flash.events.*;
import flash.display.*;
import net.superflashbros.maths.*;
import net.superflashbros.physics.*;
import flash.utils.*;
public class World extends MovieClip {
public var hud:IHUD;
public var airResistance:Number;
public var camera:Camera;
public var character:PointMass;
public var renderTimer:Timer;
private var loopLength:int;
private var loopCount:int;
public var forces:Array;
private var isPaused:Boolean;
public function World(){
this.forces = [];
this.airResistance = 0;
this.renderTimer = new Timer(60);
this.renderTimer.addEventListener(TimerEvent.TIMER, this.render);
this.renderTimer.start();
}
public function unpause():void{
this.isPaused = false;
this.renderTimer.start();
}
public function get paused():Boolean{
return (this.isPaused);
}
public function endGame():void{
this.renderTimer.stop();
loopLength = this.numChildren;
loopCount = 0;
while (loopCount < loopLength) {
if ((this.getChildAt(loopCount) is IEndable)){
IEndable(this.getChildAt(loopCount)).endGame();
};
loopCount++;
};
}
public function render(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:PointMass;
_local4 = this.forces.length;
loopLength = this.numChildren;
loopCount = 0;
while (loopCount < loopLength) {
if ((this.getChildAt(loopCount) is PointMass)){
_local5 = PointMass(this.getChildAt(loopCount));
_local3 = 0;
while (_local3 < _local4) {
_local5.velocity = (_local5.velocity.add(this.forces[_local3].getAcceleration(_local5)) as Vector);
_local3++;
};
_local5.velocity = _local5.velocity.multiply((1 - this.airResistance));
_local5.render();
} else {
if ((((this.getChildAt(loopCount) is Terrain)) && (this.character))){
Terrain(this.getChildAt(loopCount)).hitTest(this.character);
};
};
loopCount++;
};
if (this.camera){
this.camera.follow();
};
if (this.hud){
this.hud.update(this);
};
_arg1.updateAfterEvent();
}
override public function removeChild(_arg1:DisplayObject):DisplayObject{
this.loopCount--;
this.loopLength--;
return (super.removeChild(_arg1));
}
public function pause():void{
this.isPaused = true;
this.renderTimer.stop();
}
}
}//package net.superflashbros.game
Section 19
//Constants (net.superflashbros.maths.Constants)
package net.superflashbros.maths {
public class Constants {
public static const TO_RAD:Number = 0.0174532925199433;
public static const TO_DEG:Number = 57.2957795130823;
}
}//package net.superflashbros.maths
Section 20
//Vector (net.superflashbros.maths.Vector)
package net.superflashbros.maths {
import flash.geom.*;
public class Vector extends Point {
public function Vector(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function divide(_arg1:Number):Vector{
return (new Vector((this.x / _arg1), (this.y / _arg1)));
}
public function getModulus():Number{
return (this.length);
}
public function multiply(_arg1:Number):Vector{
return (new Vector((this.x * _arg1), (this.y * _arg1)));
}
public function getAngleTo(_arg1:Vector):Number{
var _local2:Vector;
_local2 = (_arg1.subtract(this) as Vector);
return (Math.atan2(_local2.x, -(_local2.y)));
}
override public function add(_arg1:Point):Point{
return (new Vector((this.x + _arg1.x), (this.y + _arg1.y)));
}
public function reflect(_arg1:Vector):Vector{
return ((this.add(_arg1.multiply((2 * this.getModulus()))) as Vector));
}
override public function toString():String{
return (((("Vector - x=" + this.x) + ", y=") + this.y));
}
override public function subtract(_arg1:Point):Point{
return (new Vector((this.x - _arg1.x), (this.y - _arg1.y)));
}
public function dotProduct(_arg1:Vector):Number{
return (((this.x * _arg1.x) + (this.y * _arg1.y)));
}
public function getNormalised(_arg1:Number=1):Vector{
var _local2:Point;
_local2 = new Point(this.x, this.y);
_local2.normalize(_arg1);
return (new Vector(_local2.x, _local2.y));
}
public static function interpolate(_arg1:Point, _arg2:Point, _arg3:Number):Point{
var _local4:Point;
_local4 = Point.interpolate(_arg1, _arg2, (1 - _arg3));
return (new Vector(_local4.x, _local4.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]) as Vector);
if (_local7.length < _local3){
_local3 = _local7.length;
_local4 = _local5;
};
_local5++;
};
return (_arg2[_local4]);
}
}
}//package net.superflashbros.maths
Section 21
//IForcable (net.superflashbros.physics.IForcable)
package net.superflashbros.physics {
import net.superflashbros.maths.*;
public interface IForcable {
function getAcceleration(_arg1:PointMass):Vector;
}
}//package net.superflashbros.physics
Section 22
//PointMass (net.superflashbros.physics.PointMass)
package net.superflashbros.physics {
import flash.display.*;
import flash.geom.*;
import net.superflashbros.maths.*;
public class PointMass extends MovieClip {
public var position:Vector;
public var mass:Number;
public var velocity:Vector;
public function PointMass(_arg1:Vector=null, _arg2:Number=1){
this.position = ((_arg1) || (new Vector(0, 0)));
this.velocity = new Vector();
this.mass = _arg2;
if (this.stage){
this.x = this.x;
this.y = this.y;
};
}
public function notifyHit(_arg1:Rectangle):void{
}
public function render():void{
this.position = (this.position.add(this.velocity) as Vector);
this.x = this.position.x;
this.y = this.position.y;
}
override public function set y(_arg1:Number):void{
super.y = _arg1;
this.position.y = _arg1;
}
override public function set x(_arg1:Number):void{
super.x = _arg1;
this.position.x = _arg1;
}
}
}//package net.superflashbros.physics
Section 23
//SolidMass (net.superflashbros.physics.SolidMass)
package net.superflashbros.physics {
import net.superflashbros.maths.*;
public class SolidMass extends PointMass {
public var friction:Number;
public var centerOfMass:Vector;
public var elasticity:Number;
public function SolidMass(_arg1:Vector=null, _arg2:Number=1, _arg3:Vector=null, _arg4:Number=0.7, _arg5:Number=0.5){
this.position = ((_arg1) || (new Vector()));
this.velocity = new Vector();
this.mass = _arg2;
this.centerOfMass = ((_arg3) || (new Vector()));
this.elasticity = _arg4;
this.friction = _arg5;
}
}
}//package net.superflashbros.physics
Section 24
//VectorForce (net.superflashbros.physics.VectorForce)
package net.superflashbros.physics {
import net.superflashbros.maths.*;
public class VectorForce implements IForcable {
public var magnitude:Number;
public var direction:Vector;
public function VectorForce(_arg1:Vector=null, _arg2:Number=1){
this.direction = ((_arg1.getNormalised()) || (new Vector()));
this.magnitude = _arg2;
}
public function getAcceleration(_arg1:PointMass):Vector{
return (this.direction.getNormalised(this.magnitude));
}
}
}//package net.superflashbros.physics
Section 25
//FullHitTest (net.superflashbros.utils.FullHitTest)
package net.superflashbros.utils {
import flash.display.*;
import flash.geom.*;
import net.superflashbros.maths.*;
public class FullHitTest {
private static var INITIALISED:Boolean;
private static var TURN_RED:ColorTransform;
private static function init():void{
TURN_RED = new ColorTransform(1, 0, 0, 1, 0xFF, -255, -255, 0);
INITIALISED = true;
}
public static function objectHitMaskScaled(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:BitmapData, _arg4:Number=1):Rectangle{
var _local5:Rectangle;
var _local6:Point;
var _local7:Matrix;
var _local8:BitmapData;
var _local9:BitmapData;
var _local10:Rectangle;
if (!INITIALISED){
FullHitTest.init();
};
_local5 = _arg1.getBounds(_arg1.stage);
_local6 = new Point(_arg1.x, _arg1.y);
_local6 = _arg1.parent.localToGlobal(_local6);
_local7 = _arg1.transform.concatenatedMatrix.clone();
_local7.tx = (_local6.x - _local5.left);
_local7.ty = (_local6.y - _local5.top);
_local7.scale(_arg4, _arg4);
_local8 = new BitmapData((_arg1.width * _arg4), (_arg1.height * _arg4), true, 0);
_local8.draw(_arg1, _local7);
_local7.a = (_local7.d = 1);
_local7.b = (_local7.c = 0);
_local9 = new BitmapData((_arg1.width * _arg4), (_arg1.height * _arg4), true, 0);
_local5 = _arg1.getBounds(_arg2);
_local7.tx = (-(_local5.x) * _arg4);
_local7.ty = (-(_local5.y) * _arg4);
_local9.draw(_arg3, _local7, TURN_RED);
_local9.copyChannel(_local8, _local8.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.BLUE);
_local10 = GeomTools.scaleRectangle(_local9.getColorBoundsRect(4294967295, 4294902015), (1 / _arg4), true);
_local8.dispose();
_local9.dispose();
return (_local10);
}
public static function objectBackground(_arg1:DisplayObject, _arg2:DisplayObject):Rectangle{
var _local3:Rectangle;
var _local4:Point;
var _local5:Matrix;
var _local6:BitmapData;
var _local7:BitmapData;
var _local8:Rectangle;
if (!INITIALISED){
FullHitTest.init();
};
_local3 = _arg1.getBounds(_arg1.stage);
_local4 = new Point(_arg1.x, _arg1.y);
_local4 = _arg1.parent.localToGlobal(_local4);
_local5 = new Matrix(1, 0, 0, 1, (_local4.x - _local3.left), (_local4.y - _local3.top));
_local5.a = _arg1.transform.concatenatedMatrix.a;
_local5.b = _arg1.transform.concatenatedMatrix.b;
_local5.c = _arg1.transform.concatenatedMatrix.c;
_local5.d = _arg1.transform.concatenatedMatrix.d;
_local6 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local6.draw(_arg1, _local5);
_local5.a = (_local5.d = 1);
_local5.b = (_local5.c = 0);
_local7 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local3 = _arg1.getBounds(_arg2);
_local5.tx = -(_local3.x);
_local5.ty = -(_local3.y);
_local7.draw(_arg2, _local5, TURN_RED);
_local7.copyChannel(_local6, _local6.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.BLUE);
_local8 = _local7.getColorBoundsRect(4294967295, 4294902015);
_local6.dispose();
_local7.dispose();
return (_local8);
}
public static function normalFromRectangle(_arg1:DisplayObject, _arg2:Rectangle):Vector{
var _local3:Rectangle;
var _local4:Vector;
var _local5:Vector;
_local3 = _arg1.getBounds(_arg1.parent);
_local4 = new Vector((_arg1.x - _local3.left), (_arg1.y - _local3.top));
if (_arg1["centerOfMass"]){
_local4 = (_local4.add(_arg1["centerOfMass"]) as Vector);
};
_local5 = new Vector((_arg2.left + (_arg2.width / 2)), (_arg2.top + (_arg2.height / 2)));
return ((_local4.subtract(_local5) as Vector).getNormalised());
}
public static function objectHitMask(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:BitmapData, _arg4:Number=1):Rectangle{
var _local5:Rectangle;
var _local6:Point;
var _local7:Matrix;
var _local8:BitmapData;
var _local9:BitmapData;
var _local10:Rectangle;
if (!INITIALISED){
FullHitTest.init();
};
_local5 = _arg1.getBounds(_arg1.stage);
_local6 = new Point(_arg1.x, _arg1.y);
_local6 = _arg1.parent.localToGlobal(_local6);
_local7 = _arg1.transform.concatenatedMatrix.clone();
_local7.tx = (_local6.x - _local5.left);
_local7.ty = (_local6.y - _local5.top);
_local7.scale(_arg4, _arg4);
_local8 = new BitmapData((_arg1.width * _arg4), (_arg1.height * _arg4), true, 0);
_local8.draw(_arg1, _local7);
_local7.a = (_local7.d = 1);
_local7.b = (_local7.c = 0);
_local9 = new BitmapData((_arg1.width * _arg4), (_arg1.height * _arg4), true, 0);
_local5 = _arg1.getBounds(_arg2);
_local7.tx = (-(_local5.x) * _arg4);
_local7.ty = (-(_local5.y) * _arg4);
_local9.draw(_arg3, _local7, TURN_RED);
_local9.copyChannel(_local8, _local8.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.BLUE);
_local10 = GeomTools.scaleRectangle(_local9.getColorBoundsRect(4294967295, 4294902015), (1 / _arg4), true);
_local8.dispose();
_local9.dispose();
return (_local10);
}
}
}//package net.superflashbros.utils
Section 26
//GeomTools (net.superflashbros.utils.GeomTools)
package net.superflashbros.utils {
import flash.geom.*;
public class GeomTools {
public static function scaleRectangle(_arg1:Rectangle, _arg2:Number, _arg3:Boolean):Rectangle{
var _local4:Rectangle;
_local4 = _arg1.clone();
_local4.inflate(((_arg2 - 1) * _local4.width), ((_arg2 - 1) * _local4.height));
if (_arg3){
_local4.offset(((_arg2 - 1) * _local4.left), ((_arg2 - 1) * _local4.top));
};
return (_local4);
}
}
}//package net.superflashbros.utils
Section 27
//Beam (Beam)
package {
import flash.media.*;
public dynamic class Beam extends Sound {
}
}//package
Section 28
//BossHit1 (BossHit1)
package {
import flash.media.*;
public dynamic class BossHit1 extends Sound {
}
}//package
Section 29
//BossHit2 (BossHit2)
package {
import flash.media.*;
public dynamic class BossHit2 extends Sound {
}
}//package
Section 30
//BossHit3 (BossHit3)
package {
import flash.media.*;
public dynamic class BossHit3 extends Sound {
}
}//package
Section 31
//BossHit4 (BossHit4)
package {
import flash.media.*;
public dynamic class BossHit4 extends Sound {
}
}//package
Section 32
//BossSlow1 (BossSlow1)
package {
import flash.media.*;
public dynamic class BossSlow1 extends Sound {
}
}//package
Section 33
//BossSlow2 (BossSlow2)
package {
import flash.media.*;
public dynamic class BossSlow2 extends Sound {
}
}//package
Section 34
//BossSlow3 (BossSlow3)
package {
import flash.media.*;
public dynamic class BossSlow3 extends Sound {
}
}//package
Section 35
//BossSlow4 (BossSlow4)
package {
import flash.media.*;
public dynamic class BossSlow4 extends Sound {
}
}//package
Section 36
//Cab (Cab)
package {
import net.superflashbros.game.*;
import net.superflashbros.audio.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import net.superflashbros.maths.*;
import net.superflashbros.physics.*;
import flash.utils.*;
public class Cab extends SolidMass {
private var regenTimer:Timer;
private var music:MusicManager;
public var beam_mc:MovieClip;
private var voice:VoiceManager;
public var flame:MovieClip;
private var regen:Array;
public var health:int;
private var leftToGo:int;
public var fare_int:int;
private var timeTimer:Timer;
private var respawnFlashTimer:Timer;
public var isPassenger:Boolean;
private var waiterID:uint;
private var isRespawning:Boolean;
private var sfx:SFXManager;
private var waiterPositions:Array;
public var funds_int:int;
private var controls:Controls;
public var time:int;
public var waiter:Waiter;
public function Cab(){
addFrameScript(0, frame1);
super(new Vector(this.x, this.y), 0.8, null, 0.6);
this.controls = Controls.get();
this.controls.registerKey("left", "LEFT");
this.controls.registerKey("right", "RIGHT");
this.controls.registerKey("up", "UP");
this.controls.registerKey("down", "DOWN");
this.controls.registerKey("space", "SPACE");
this.controls.registerKeyPress("P", this.onP);
this.sfx = SFXManager.getInstance();
this.sfx.addSFX(CabExplode, "CabExplode");
this.sfx.addSFX(CabHit1, "CabHit1");
this.sfx.addSFX(CabHit2, "CabHit2");
this.sfx.addSFX(CabHit3, "CabHit3");
this.sfx.addSFX(Siren, "siren");
this.sfx.addSFX(Regen, "regen");
this.sfx.addSFX(Beam, "beam");
this.voice = VoiceManager.getInstance();
this.voice.addVoice(Traveller1Hit1, "Traveller1Hit1");
this.voice.addVoice(Traveller1Hit2, "Traveller1Hit2");
this.voice.addVoice(Traveller1Hit3, "Traveller1Hit3");
this.voice.addVoice(Traveller1Thanks1, "Traveller1Thanks1");
this.voice.addVoice(Traveller1Thanks2, "Traveller1Thanks2");
this.voice.addVoice(Traveller1Thanks3, "Traveller1Thanks3");
this.voice.addVoice(Traveller1NoThanks1, "Traveller1NoThanks1");
this.voice.addVoice(Traveller1NoThanks2, "Traveller1NoThanks2");
this.voice.addVoice(Traveller1NoThanks1, "Traveller1There1");
this.voice.addVoice(Traveller1NoThanks2, "Traveller1There2");
this.voice.addVoice(Traveller2Hit1, "Traveller2Hit1");
this.voice.addVoice(Traveller2Hit2, "Traveller2Hit2");
this.voice.addVoice(Traveller2Hit3, "Traveller2Hit3");
this.voice.addVoice(Traveller2Hit3, "Traveller2Hit4");
this.voice.addVoice(Traveller2Thanks1, "Traveller2Thanks1");
this.voice.addVoice(Traveller2Thanks2, "Traveller2Thanks2");
this.voice.addVoice(Traveller2Thanks3, "Traveller2Thanks3");
this.voice.addVoice(Traveller2NoThanks1, "Traveller2NoThanks1");
this.voice.addVoice(Traveller2NoThanks2, "Traveller2NoThanks2");
this.voice.addVoice(Traveller2NoThanks1, "Traveller2There1");
this.voice.addVoice(Traveller2NoThanks2, "Traveller2There2");
this.voice.addVoice(BossHit1, "BossHit1");
this.voice.addVoice(BossHit2, "BossHit2");
this.voice.addVoice(BossHit3, "BossHit3");
this.voice.addVoice(BossHit4, "BossHit4");
this.voice.addVoice(BossSlow1, "BossSlow1");
this.voice.addVoice(BossSlow2, "BossSlow2");
this.voice.addVoice(BossSlow3, "BossSlow3");
this.voice.addVoice(BossSlow4, "BossSlow4");
this.music = MusicManager.getInstance();
this.music.addMusic(MusicLoop, "game");
this.music.playMusic("game");
this.health = 4;
regen = [];
regen.push(new Vector(1891, 1682.15));
regen.push(new Vector(2070, 1721.15));
regen.push(new Vector(2455, 1668.15));
regen.push(new Vector(2727, 1665.2));
regen.push(new Vector(3129, 1284.6));
regen.push(new Vector(3063, 1040.85));
regen.push(new Vector(2796, 810.1));
regen.push(new Vector(2135, 681.25));
regen.push(new Vector(1715, 639.3));
regen.push(new Vector(1474, 801.15));
regen.push(new Vector(938, 850.1));
regen.push(new Vector(889, 1235.65));
regen.push(new Vector(1506, 1739.15));
this.waiterPositions = [];
this.waiterPositions.push(new Point(2226, 1932.9));
this.waiterPositions.push(new Point(2468, 1905.9));
this.waiterPositions.push(new Point(2994, 1684.15));
this.waiterPositions.push(new Point(3251, 1409.45));
this.waiterPositions.push(new Point(3103, 1155.75));
this.waiterPositions.push(new Point(3396, 1154.75));
this.waiterPositions.push(new Point(3112, 817.15));
this.waiterPositions.push(new Point(3053, 668.3));
this.waiterPositions.push(new Point(2875, 522.4));
this.waiterPositions.push(new Point(2406, 852.05));
this.waiterPositions.push(new Point(2232, 576.4));
this.waiterPositions.push(new Point(2234, 576.35));
this.waiterPositions.push(new Point(1867, 741.2));
this.waiterPositions.push(new Point(1647, 615.3));
this.waiterPositions.push(new Point(1217, 444.5));
this.waiterPositions.push(new Point(960, 658.25));
this.waiterPositions.push(new Point(834, 833.1));
this.waiterPositions.push(new Point(640, 1130.75));
this.waiterPositions.push(new Point(1058, 1152.75));
this.waiterPositions.push(new Point(811, 1763.1));
this.waiterPositions.push(new Point(1252, 2001.85));
this.waiterPositions.push(new Point(1238, 1415.45));
this.waiterPositions.push(new Point(1755, 1929.9));
this.regenTimer = new Timer(1000, 1);
this.regenTimer.addEventListener(TimerEvent.TIMER, this.respawn);
this.respawnFlashTimer = new Timer(200, 10);
this.respawnFlashTimer.addEventListener(TimerEvent.TIMER, this.respawnFlashTime);
this.respawnFlashTimer.addEventListener(TimerEvent.TIMER_COMPLETE, this.respawnFlashTimeUp);
this.funds = 25000;
this.timeTimer = new Timer(1000);
this.timeTimer.addEventListener(TimerEvent.TIMER, this.timeTime);
this.timeTimer.start();
this.time = 0;
this.leftToGo = 4;
this.isPassenger = false;
this.createWaiter();
}
private function createWaiter():void{
var _local1:Point;
this.waiter = new Waiter();
this.waiterID = this.pickNewID();
_local1 = this.waiterPositions[this.waiterID];
this.parent.addChild(this.waiter);
this.waiter.x = _local1.x;
this.waiter.y = _local1.y;
this.setDistTime(_local1);
}
private function pickNewID():uint{
var _local1:uint;
_local1 = Math.floor((Math.random() * this.waiterPositions.length));
if (_local1 == this.waiterID){
return (this.pickNewID());
};
return (_local1);
}
private function setDistTime(_arg1:Point):void{
time = uint((this.position.subtract(_arg1).length / 50));
}
public function get fare():int{
return (this.fare_int);
}
public function get funds():int{
return (this.funds_int);
}
private function onP(_arg1:KeyboardEvent):void{
if (MainWorld(this.parent).paused){
this.timeTimer.start();
MainWorld(this.parent).unpause();
} else {
this.timeTimer.stop();
MainWorld(this.parent).pause();
};
}
private function setStartFare(_arg1:Point):void{
this.fare = uint(((this.position.subtract(_arg1).length * 10) + (this.time * 500)));
}
private function setStateFrame(_arg1:String):void{
if (this.currentLabel != _arg1){
this.gotoAndStop(_arg1);
};
}
private function createDropOff():void{
var _local1:String;
var _local2:Point;
_local1 = this.waiter.voice;
this.waiter = new Waiter();
this.waiter.voice = _local1;
this.waiterID = this.pickNewID();
_local2 = this.waiterPositions[this.waiterID];
this.parent.addChild(this.waiter);
this.waiter.x = _local2.x;
this.waiter.y = _local2.y;
this.waiter.empty();
this.setStartFare(_local2);
this.setDistTime(_local2);
}
override public function notifyHit(_arg1:Rectangle):void{
var _local2:String;
var _local3:Point;
var _local4:Number;
var _local5:Spark;
var _local6:uint;
if ((((this.health > 0)) && (!(this.isRespawning)))){
this.velocity = this.velocity.multiply(this.elasticity);
_local2 = ("CabHit" + (Math.floor((Math.random() * 3)) + 1));
this.sfx.playSFX(_local2);
if (this.isPassenger){
_local2 = ((this.waiter.voice + "Hit") + (Math.floor((Math.random() * 8)) + 1));
this.voice.playVoice(_local2);
} else {
_local2 = ("BossHit" + (Math.floor((Math.random() * 8)) + 1));
this.voice.playVoice(_local2, 1.5);
};
this.health--;
if (this.health == 0){
this.explode();
} else {
this.isRespawning = true;
this.respawnFlashTimer.reset();
this.respawnFlashTimer.delay = 100;
this.respawnFlashTimer.start();
_local3 = _arg1.topLeft.add(new Point((_arg1.width / 2), (_arg1.height / 2)));
_local3 = _local3.add(this.getBounds(this.parent).topLeft);
_local3 = _local3.add(this.velocity);
_local4 = this.velocity.length;
_local6 = 0;
while (_local6 < 10) {
_local5 = new Spark();
_local5.x = _local3.x;
_local5.y = _local3.y;
_local5.velocity.x = ((Math.random() * _local4) - (_local4 / 2));
_local5.velocity.y = (((Math.random() * _local4) - (_local4 / 2)) - 2);
this.parent.addChild(_local5);
_local6++;
};
};
};
}
override public function render():void{
var _local1:Object;
var _local2:String;
if (this.health > 0){
_local1 = this.controls.getKeys();
if (_local1.UP){
this.velocity.y = (this.velocity.y - 2);
};
if (_local1.DOWN){
this.velocity.y = (this.velocity.y + 0.8);
};
if (_local1.LEFT){
this.velocity.x = (this.velocity.x - 2);
};
if (_local1.RIGHT){
this.velocity.x = (this.velocity.x + 2);
};
if (_local1.SPACE){
this.sfx.playSFX("beam", 400000, 0.5, 0, true);
this.setStateFrame("beam");
if (((((!(this.isPassenger)) && (this["beam_mc"]))) && (this.waiter["man_mc"]))){
if (this["beam_mc"].hitTestObject(this.waiter["man_mc"])){
this.waiter.collect(this);
this.createDropOff();
this.isPassenger = true;
};
} else {
if (((this.isPassenger) && (this["beam_mc"]))){
if (this["beam_mc"].hitTestObject(this.waiter["base_mc"])){
this.waiter.dropOff(this);
this.funds = (this.funds + this.fare);
this.fare = 0;
this.createWaiter();
this.isPassenger = false;
this.leftToGo--;
if (this.leftToGo <= 0){
this.endGame();
};
};
};
};
} else {
this.sfx.stopSFX("beam");
if (this.velocity.y < -2.8){
this.setStateFrame("up");
} else {
if (this.velocity.y > 2.8){
this.setStateFrame("down");
} else {
this.setStateFrame("still");
};
};
};
this.rotation = (this.velocity.x * 1.4);
if (this.velocity.length > 12){
this.velocity = this.velocity.getNormalised(12);
} else {
if (((((!(this.isPassenger)) && ((this.velocity.length < 5)))) && ((Math.random() > 0.98)))){
_local2 = ("BossSlow" + (Math.floor((Math.random() * 8)) + 1));
this.voice.playVoice(_local2, 2);
};
};
super.render();
};
}
private function respawnFlashTime(_arg1:TimerEvent):void{
if (this.transform.colorTransform.redOffset == 0){
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 100, -100, -100);
} else {
this.transform.colorTransform = new ColorTransform();
};
}
private function respawn(_arg1:Event):void{
var _local2:Vector;
this.sfx.playSFX("regen");
_local2 = Vector.nearest(this.position, regen);
this.x = _local2.x;
this.y = _local2.y;
this.health = 4;
this.velocity.x = 0;
this.velocity.y = -2;
this.isRespawning = true;
this.respawnFlashTimer.reset();
this.respawnFlashTimer.delay = 200;
this.respawnFlashTimer.start();
this.setStateFrame("still");
}
private function timeTime(_arg1:TimerEvent):void{
if (this.time != 0){
this.time = (this.time - 1);
};
this.fare = (this.fare * 0.99);
if (this.fare < 0){
this.fare = 0;
};
}
public function set fare(_arg1:int):void{
this.fare_int = _arg1;
if (this.fare_int < 0){
this.fare_int = 0;
};
}
public function set funds(_arg1:int):void{
this.funds_int = _arg1;
if (this.funds_int < 0){
this.funds_int = 0;
};
}
public function fine():void{
if (((((this.velocity.length * 12) > 90)) && ((this.health > 0)))){
this.funds = (this.funds - 500);
this.sfx.playSFX("siren");
};
}
private function respawnFlashTimeUp(_arg1:TimerEvent):void{
this.transform.colorTransform = new ColorTransform();
this.isRespawning = false;
}
function frame1(){
stop();
}
private function endGame():void{
MainWorld(this.parent).endGame();
this.sfx.stopAllSFX();
this.regenTimer.stop();
this.timeTimer.stop();
this.respawnFlashTimer.stop();
setTimeout(moveToScores, 3000);
}
private function explode():void{
this.sfx.playSFX("CabExplode");
this.funds = (this.funds - 8000);
this.setStateFrame("explode");
this.regenTimer.start();
}
public function moveToScores():void{
Object(this.root).score = this.funds;
MovieClip(this.root).gotoAndStop(1, "Scores");
}
}
}//package
Section 37
//CabExplode (CabExplode)
package {
import flash.media.*;
public dynamic class CabExplode extends Sound {
}
}//package
Section 38
//CabHit1 (CabHit1)
package {
import flash.media.*;
public dynamic class CabHit1 extends Sound {
}
}//package
Section 39
//CabHit2 (CabHit2)
package {
import flash.media.*;
public dynamic class CabHit2 extends Sound {
}
}//package
Section 40
//CabHit3 (CabHit3)
package {
import flash.media.*;
public dynamic class CabHit3 extends Sound {
}
}//package
Section 41
//HUD (HUD)
package {
import net.superflashbros.game.*;
import flash.display.*;
import flash.geom.*;
import net.superflashbros.maths.*;
import flash.text.*;
public class HUD extends MovieClip implements IHUD {
public var time_txt:TextField;
public var funds_txt:TextField;
public var speed2_txt:TextField;
public var distance_txt:TextField;
public var fare:uint;
public var pointTarget:DisplayObject;
public var funds:uint;
public var health_mc:MovieClip;
public var speed1_txt:TextField;
public var speed3_txt:TextField;
public var arrow_mc:MovieClip;
public var time:uint;
public var fare_txt:TextField;
public function HUD(){
World(this.parent["world_mc"]).hud = this;
}
public function update(_arg1:World):void{
var _local2:Cab;
var _local3:String;
var _local4:Rectangle;
var _local5:Vector;
var _local6:String;
var _local7:uint;
var _local8:uint;
var _local9:String;
var _local10:String;
_local2 = Cab(_arg1.character);
_local3 = String(Math.round((_local2.velocity.length * 12)));
while (_local3.length < 3) {
_local3 = ("0" + _local3);
};
this["speed1_txt"].text = _local3.charAt(0);
this["speed2_txt"].text = _local3.charAt(1);
this["speed3_txt"].text = _local3.charAt(2);
this.pointTarget = _local2.waiter;
_local4 = this.pointTarget.getBounds(_local2.parent);
_local5 = new Vector((_local4.x + (_local4.width / 2)), (_local4.y + (_local4.height / 2)));
this.arrow_mc.rotation = (Constants.TO_DEG * _local2.position.getAngleTo(_local5));
_local6 = String(Math.round(((_local5.subtract(_local2.position) as Vector).length * 3)));
while (_local6.length < 6) {
_local6 = ("0" + _local6);
};
this["distance_txt"].text = _local6;
if (this["health_mc"].currentFrame != (5 - _local2.health)){
this["health_mc"].gotoAndStop((5 - _local2.health));
};
_local7 = Math.floor((_local2.time / 60));
_local8 = (_local2.time - (_local7 * 60));
_local9 = String(_local7);
if (_local9.length < 2){
_local9 = ("0" + _local9);
};
_local10 = String(_local8);
if (_local10.length < 2){
_local10 = ("0" + _local10);
};
this["time_txt"].text = ((_local9 + ":") + _local10);
this["fare_txt"].text = String(_local2.fare);
this["funds_txt"].text = String(_local2.funds);
}
}
}//package
Section 42
//MainTerrain (MainTerrain)
package {
import net.superflashbros.game.*;
public dynamic class MainTerrain extends LargeTerrain {
}
}//package
Section 43
//MainWorld (MainWorld)
package {
import net.superflashbros.game.*;
import flash.geom.*;
import net.superflashbros.maths.*;
import net.superflashbros.physics.*;
public class MainWorld extends World {
public var cab_mc:Cab;
public var art_mc:MainTerrain;
public function MainWorld(){
this.forces.push(new VectorForce(new Vector(0, 1), 0.7));
this.airResistance = 0.09;
this.character = this.cab_mc;
this.camera = new Camera(this.character, this, new Rectangle(270, 130, 100, 75), 0.7);
}
}
}//package
Section 44
//MenuLoop (MenuLoop)
package {
import flash.media.*;
public dynamic class MenuLoop extends Sound {
}
}//package
Section 45
//MusicLoop (MusicLoop)
package {
import flash.media.*;
public dynamic class MusicLoop extends Sound {
}
}//package
Section 46
//Regen (Regen)
package {
import flash.media.*;
public dynamic class Regen extends Sound {
}
}//package
Section 47
//Siren (Siren)
package {
import flash.media.*;
public dynamic class Siren extends Sound {
}
}//package
Section 48
//Spark (Spark)
package {
import net.superflashbros.physics.*;
public class Spark extends PointMass {
private var time:int;
public function Spark(){
addFrameScript(0, frame1);
this.gotoAndStop(Math.floor(((Math.random() * 3) + 1)));
this.rotation = (Math.random() * 360);
this.cacheAsBitmap = true;
this.time = (5 + (Math.random() * 15));
}
function frame1(){
stop();
}
override public function render():void{
super.render();
if (this.time-- < 0){
if (this.parent){
this.parent.removeChild(this);
};
};
}
}
}//package
Section 49
//SpeedCam (SpeedCam)
package {
public dynamic class SpeedCam extends SpeedCamera {
}
}//package
Section 50
//SpeedCamera (SpeedCamera)
package {
import net.superflashbros.game.*;
import flash.display.*;
import flash.geom.*;
import net.superflashbros.utils.*;
public class SpeedCamera extends MovingObstacle {
public var block_mc:MovieClip;
override public function fullHitTest(_arg1:DisplayObject):Rectangle{
var _local2:Cab;
_local2 = Cab(_arg1);
if (_local2.getBounds(parent).intersects(this["block_mc"].getBounds(parent))){
_local2.fine();
};
return (FullHitTest.objectBackground(_arg1, this));
}
}
}//package
Section 51
//TrafficCrossing (TrafficCrossing)
package {
import net.superflashbros.game.*;
public dynamic class TrafficCrossing extends MovingObstacle {
}
}//package
Section 52
//Traveller1Hit1 (Traveller1Hit1)
package {
import flash.media.*;
public dynamic class Traveller1Hit1 extends Sound {
}
}//package
Section 53
//Traveller1Hit2 (Traveller1Hit2)
package {
import flash.media.*;
public dynamic class Traveller1Hit2 extends Sound {
}
}//package
Section 54
//Traveller1Hit3 (Traveller1Hit3)
package {
import flash.media.*;
public dynamic class Traveller1Hit3 extends Sound {
}
}//package
Section 55
//Traveller1NoThanks1 (Traveller1NoThanks1)
package {
import flash.media.*;
public dynamic class Traveller1NoThanks1 extends Sound {
}
}//package
Section 56
//Traveller1NoThanks2 (Traveller1NoThanks2)
package {
import flash.media.*;
public dynamic class Traveller1NoThanks2 extends Sound {
}
}//package
Section 57
//Traveller1Thanks1 (Traveller1Thanks1)
package {
import flash.media.*;
public dynamic class Traveller1Thanks1 extends Sound {
}
}//package
Section 58
//Traveller1Thanks2 (Traveller1Thanks2)
package {
import flash.media.*;
public dynamic class Traveller1Thanks2 extends Sound {
}
}//package
Section 59
//Traveller1Thanks3 (Traveller1Thanks3)
package {
import flash.media.*;
public dynamic class Traveller1Thanks3 extends Sound {
}
}//package
Section 60
//Traveller1There1 (Traveller1There1)
package {
import flash.media.*;
public dynamic class Traveller1There1 extends Sound {
}
}//package
Section 61
//Traveller1There2 (Traveller1There2)
package {
import flash.media.*;
public dynamic class Traveller1There2 extends Sound {
}
}//package
Section 62
//Traveller2Hit1 (Traveller2Hit1)
package {
import flash.media.*;
public dynamic class Traveller2Hit1 extends Sound {
}
}//package
Section 63
//Traveller2Hit2 (Traveller2Hit2)
package {
import flash.media.*;
public dynamic class Traveller2Hit2 extends Sound {
}
}//package
Section 64
//Traveller2Hit3 (Traveller2Hit3)
package {
import flash.media.*;
public dynamic class Traveller2Hit3 extends Sound {
}
}//package
Section 65
//Traveller2Hit4 (Traveller2Hit4)
package {
import flash.media.*;
public dynamic class Traveller2Hit4 extends Sound {
}
}//package
Section 66
//Traveller2NoThanks1 (Traveller2NoThanks1)
package {
import flash.media.*;
public dynamic class Traveller2NoThanks1 extends Sound {
}
}//package
Section 67
//Traveller2NoThanks2 (Traveller2NoThanks2)
package {
import flash.media.*;
public dynamic class Traveller2NoThanks2 extends Sound {
}
}//package
Section 68
//Traveller2Thanks1 (Traveller2Thanks1)
package {
import flash.media.*;
public dynamic class Traveller2Thanks1 extends Sound {
}
}//package
Section 69
//Traveller2Thanks2 (Traveller2Thanks2)
package {
import flash.media.*;
public dynamic class Traveller2Thanks2 extends Sound {
}
}//package
Section 70
//Traveller2Thanks3 (Traveller2Thanks3)
package {
import flash.media.*;
public dynamic class Traveller2Thanks3 extends Sound {
}
}//package
Section 71
//Traveller2There1 (Traveller2There1)
package {
import flash.media.*;
public dynamic class Traveller2There1 extends Sound {
}
}//package
Section 72
//Traveller2There2 (Traveller2There2)
package {
import flash.media.*;
public dynamic class Traveller2There2 extends Sound {
}
}//package
Section 73
//Waiter (Waiter)
package {
import net.superflashbros.audio.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Waiter extends MovieClip {
private var voiceManager:VoiceManager;
private var fadeTimer:Timer;
public var voice:String;
public var man_mc:MovieClip;
public var base_mc:MovieClip;
private var hiTimer:Timer;
public function Waiter(){
addFrameScript(0, frame1);
this.hiTimer = new Timer((Math.random() * 20000));
this.hiTimer.addEventListener(TimerEvent.TIMER, this.hiTime);
this.voiceManager = VoiceManager.getInstance();
this.voice = ["Traveller1", "Traveller2"][Math.floor((Math.random() * 2))];
}
public function dropOff(_arg1:Cab):void{
this.gotoAndStop(2);
if (_arg1.time > 0){
this.voiceManager.playVoice(((this.voice + "Thanks") + Math.floor(((Math.random() * 3) + 1))));
_arg1.funds = (_arg1.funds + 20000);
} else {
this.voiceManager.playVoice(((this.voice + "NoThanks") + Math.floor(((Math.random() * 3) + 1))));
};
this.fadeTimer = new Timer(60, 50);
this.fadeTimer.addEventListener(TimerEvent.TIMER, this.fadeTime);
this.fadeTimer.start();
}
public function collect(_arg1:Cab):void{
this.gotoAndStop(3);
this.hiTimer.stop();
if (_arg1.time > 0){
this.voiceManager.playVoice(((this.voice + "Thanks") + Math.floor(((Math.random() * 3) + 1))));
_arg1.fare = (_arg1.fare + 20000);
};
this.fadeTimer = new Timer(60, 50);
this.fadeTimer.addEventListener(TimerEvent.TIMER, this.fadeTime);
this.fadeTimer.start();
}
protected function fadeTime(_arg1:TimerEvent):void{
this.alpha = (this.alpha - 0.02);
if (this.alpha <= 0){
if (this.parent){
this.parent.removeChild(this);
};
};
}
override public function toString():String{
return (((("Waiter - x=" + this.x) + ", y=") + this.y));
}
private function hiTime(_arg1:TimerEvent):void{
this.voiceManager.playVoice((this.voice + "Hi"));
this.hiTimer.delay = (Math.random() * 20000);
}
function frame1(){
stop();
}
public function empty():void{
this.gotoAndStop(3);
this.hiTimer.stop();
}
}
}//package