Section 1
//AIState (Base.AIState)
package Base {
import UI.*;
import Game.*;
import Pad.*;
public class AIState extends State {
protected var gameData:GameData;
protected var pad:PadManager;
protected var ui:UIManager;
protected var _gameContext:GameEntry;
public var frTik:int;
protected var snd:SoundModule;
public var frCnt:int;
public function AIState(_arg1:GameEntry){
if (_arg1 != null){
_gameContext = _arg1;
gameData = _gameContext.getGameData();
pad = _gameContext.getPadManager();
snd = gameData.getSoundModule();
ui = _gameContext.getUIManager();
};
}
override public function CPUDecision():void{
}
override public function NetworkDecision():void{
}
public function getFramesDelay(_arg1:int):Boolean{
return (((_arg1)>=frCnt) ? true : false);
}
override public function Entry():void{
}
override public function PadInput():void{
}
override public function Update():void{
}
public function setFramesDelay(_arg1:int):void{
frCnt = _arg1;
frTik = 0;
}
override public function Exit():void{
}
}
}//package Base
Section 2
//AnimationEvent (Base.AnimationEvent)
package Base {
import flash.events.*;
import flash.display.*;
public class AnimationEvent extends Event {
private var _mc:MovieClip;
public static const COMPLETE:String = "complete";
public function AnimationEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:MovieClip=null){
super(_arg1, _arg2, _arg3);
_mc = _arg4;
}
public function getMovieClip():MovieClip{
return (_mc);
}
}
}//package Base
Section 3
//ArrayTools (Base.ArrayTools)
package Base {
public class ArrayTools {
public static function Shuffle(_arg1:Array, _arg2:Number=0, _arg3:Number=0):Array{
var _local4:Number;
var _local5:Number;
var _local6:*;
if (_arg3 == 0){
_arg3 = (_arg1.length - 1);
};
_local4 = _arg3;
while (_local4 > _arg2) {
_local5 = (Math.floor((Math.random() * _arg3)) + _arg2);
_local6 = _arg1[_local4];
_arg1[_local4] = _arg1[_local5];
_arg1[_local5] = _local6;
_local4--;
};
return (_arg1);
}
public static function orderNumerically(_arg1, _arg2):Number{
var _local3:*;
var _local4:*;
_local3 = Number(_arg1[0]);
_local4 = Number(_arg2[0]);
if (_local3 < _local4){
return (-1);
};
if (_local3 > _local4){
return (1);
};
return (0);
}
}
}//package Base
Section 4
//DisplayObjectFactory (Base.DisplayObjectFactory)
package Base {
import flash.display.*;
import flash.utils.*;
public class DisplayObjectFactory {
var _objectsIdle:Array;
var _objectsAll:Array;
var ClassReference:Class;
var _objectsActive:Array;
public function DisplayObjectFactory(){
_objectsAll = new Array();
_objectsIdle = new Array();
_objectsActive = new Array();
}
public function traceAllInventory():void{
var _local1:String;
var _local2:int;
_local1 = "All[";
_local2 = _objectsAll.length;
while (_local2--) {
_local1 = (_local1 + (_objectsAll[_local2] + ","));
};
_local1 = (_local1 + "]");
trace(_local1);
}
public function deleteInstance(_arg1:DisplayObject):void{
var _local2:int;
_local2 = -1;
_local2 = _objectsAll.indexOf(_arg1);
if (_local2 == -1){
return;
};
_objectsAll.splice(_local2, 1);
_local2 = _objectsIdle.indexOf(_arg1);
if (_local2 == -1){
return;
};
_objectsIdle.splice(_local2, 1);
_local2 = _objectsActive.indexOf(_arg1);
if (_local2 == -1){
return;
};
_objectsActive.splice(_local2, 1);
}
public function traceIdleInventory():void{
var _local1:String;
var _local2:int;
_local1 = "Idle[";
_local2 = _objectsIdle.length;
while (_local2--) {
_local1 = (_local1 + (_objectsIdle[_local2] + ","));
};
_local1 = (_local1 + "]");
trace(_local1);
}
public function returnInstance(_arg1:DisplayObject):void{
var _local2:int;
_local2 = _objectsActive.indexOf(_arg1);
if (_local2 == -1){
trace(("Error returning object " + _arg1));
return;
};
_objectsActive.splice(_local2, 1);
_objectsIdle.push(_arg1);
}
public function get objectsIdle():Array{
return (_objectsIdle);
}
public function get objectsAll():Array{
return (_objectsAll);
}
public function getSpriteInstance(_arg1:String):Sprite{
var _local2:Sprite;
var _local3:int;
var _local4:Class;
_local3 = _objectsIdle.length;
while (_local3--) {
_local2 = (_objectsIdle[_local3] as Sprite);
if (getQualifiedClassName(_local2) == _arg1){
_objectsIdle.splice(_local3, 1);
_objectsActive.push(_local2);
return (_local2);
};
};
_local4 = (getDefinitionByName(_arg1) as Class);
_local2 = (new (_local4) as Sprite);
_objectsAll.push(_local2);
_objectsActive.push(_local2);
return (_local2);
}
public function get objectsActive():Array{
return (_objectsActive);
}
public function getMovieClipInstance(_arg1:String):MovieClip{
var _local2:MovieClip;
var _local3:int;
var _local4:Class;
_local3 = _objectsIdle.length;
while (_local3--) {
_local2 = (_objectsIdle[_local3] as MovieClip);
if (getQualifiedClassName(_local2) == _arg1){
_objectsIdle.splice(_local3, 1);
_objectsActive.push(_local2);
return (_local2);
};
};
_local4 = (getDefinitionByName(_arg1) as Class);
_local2 = (new (_local4) as MovieClip);
_objectsAll.push(_local2);
_objectsActive.push(_local2);
return (_local2);
}
}
}//package Base
Section 5
//Entity (Base.Entity)
package Base {
import Game.*;
public class Entity {
public var _displayObjectFactory:DisplayObjectFactory;
public var _id:int;
private var _currentAIState:AIState;
private var _cpuControlled:Boolean;
public var _type:int;
public var _gameData:GameData;
private var _networkControlled:Boolean;
public var _gameContext:GameEntry;
private var _followingAIState:AIState;
private var _nextAIState:AIState;
public function Entity(_arg1:GameEntry, _arg2:AIState=null, _arg3:int=1, _arg4:int=1, _arg5:Boolean=false, _arg6:Boolean=false){
_gameContext = _arg1;
_gameData = _gameContext.getGameData();
_displayObjectFactory = _arg1.getDisplayObjectFactory();
_currentAIState = null;
_nextAIState = null;
if (_arg2 != null){
_nextAIState = _arg2;
};
_id = _arg3;
_type = _arg4;
_cpuControlled = _arg5;
_networkControlled = _arg6;
}
public function getFollowingState(){
return (_followingAIState);
}
public function isCPUControlled(){
return (_cpuControlled);
}
public function getCurrentState(){
return (_currentAIState);
}
public function setFollowingState(_arg1:AIState):void{
_followingAIState = _arg1;
}
public function isNetworkControlled(){
return (_networkControlled);
}
public function setNextState(_arg1:AIState):void{
_nextAIState = _arg1;
}
public function deleteCurrentState():void{
_currentAIState = null;
}
public function Update():int{
if (_currentAIState != _nextAIState){
_currentAIState = _nextAIState;
_currentAIState.Entry();
};
if (_currentAIState == _nextAIState){
if (_cpuControlled){
_currentAIState.CPUDecision();
} else {
if (_networkControlled){
_currentAIState.NetworkDecision();
} else {
_currentAIState.PadInput();
};
};
_currentAIState.Update();
if (_currentAIState != _nextAIState){
_currentAIState.Exit();
_currentAIState = null;
if (!_nextAIState){
trace(("Entity Deleted?: " + getID()));
return (1);
};
};
};
return (0);
}
public function getType():int{
return (_type);
}
public function getID():int{
return (_id);
}
}
}//package Base
Section 6
//FuncProxy (Base.FuncProxy)
package Base {
public dynamic class FuncProxy {
public static function create(_arg1:Object, _arg2:Function, ... _args):Function{
var aParameters:Array;
var i:Number;
var fProxy:Function;
var oTarget = _arg1;
var fFunction = _arg2;
var rest = _args;
aParameters = new Array();
i = 2;
while (i < rest.length) {
aParameters[(i - 2)] = rest[i];
i = (i + 1);
};
fProxy = function ():void{
var _local1:Array;
_local1 = rest.concat(aParameters);
fFunction.apply(oTarget, _local1);
};
return (fProxy);
}
}
}//package Base
Section 7
//GameEntry (Base.GameEntry)
package Base {
import flash.events.*;
import UI.*;
import flash.display.*;
import Game.*;
import Pad.*;
public class GameEntry extends Sprite {
private var _displayObjectFactory:DisplayObjectFactory;
private var _gameData:GameData;
private var _profiler:Profile;
private var _gameMgr:GameManager;
private var _padMgr:PadManager;
private var _timeMgr:Time;
private var _uiMgr:UIManager;
private var _spriteAnimator:SpriteEntityAnimator;
public var _stage:Stage;
public function GameEntry(){
trace("|----@ GAME ENTRY @----|");
_stage = this.stage;
this.addEventListener(Event.ENTER_FRAME, Update, false, 1, true);
_timeMgr = new Time();
_padMgr = new PadManager(this);
_uiMgr = new UIManager(this);
_gameData = new GameData(this);
_gameMgr = new GameManager(this);
_spriteAnimator = new SpriteEntityAnimator(this);
_displayObjectFactory = new DisplayObjectFactory();
}
public function getUIManager():UIManager{
return (_uiMgr);
}
public function getGameManager():GameManager{
return (_gameMgr);
}
public function getStageSprite(){
return (_stage);
}
public function getGameData():GameData{
return (_gameData);
}
public function getProfiler():Profile{
return (_profiler);
}
public function getDT(){
return (_timeMgr.getElapsedTime());
}
public function getPadManager():PadManager{
return (_padMgr);
}
public function getDisplayObjectFactory():DisplayObjectFactory{
return (_displayObjectFactory);
}
public function getParent(){
return (_stage);
}
public function getSpriteAnimator():SpriteEntityAnimator{
return (_spriteAnimator);
}
function Update(_arg1:Event):void{
_timeMgr.markTimeThisTick();
_uiMgr.Update();
_padMgr.Update();
_gameMgr.Update();
_spriteAnimator.Update();
}
public function getTimeManager(){
return (_timeMgr);
}
}
}//package Base
Section 8
//GameState (Base.GameState)
package Base {
import UI.*;
import Game.*;
import Pad.*;
public class GameState extends State {
protected var pad:PadManager;
protected var ui:UIManager;
protected var _gameContext:GameEntry;
private var _isTransitioning:Boolean;
protected var snd:SoundModule;
protected var gameData:GameData;
private static var _isFading:Boolean;
private static var _lastTransitionFrame:Number;
private static var _screenFade:SpriteEntity;
private static var _fadeSpeed:Number;
private static var _levelToReach:Number;
private static var _transition:SpriteEntity;
private static var _currentAlphaVal:Number;
public function GameState(_arg1:GameEntry){
if (_arg1 != null){
_gameContext = _arg1;
gameData = _gameContext.getGameData();
pad = _gameContext.getPadManager();
snd = gameData.getSoundModule();
ui = _gameContext.getUIManager();
};
}
override public function CPUDecision():void{
}
public function handleFadeIn():void{
_currentAlphaVal = (_currentAlphaVal - _fadeSpeed);
if (_currentAlphaVal <= _levelToReach){
_currentAlphaVal = _levelToReach;
_isFading = false;
_screenFade.removeSprite();
_screenFade = null;
};
_screenFade.getMovieClip().alpha = _currentAlphaVal;
}
override public function NetworkDecision():void{
}
public function continueFadeOut(_arg1:Number, _arg2:Number):void{
_isFading = true;
_levelToReach = _arg2;
}
override public function Entry():void{
}
override public function PadInput():void{
}
public function startFadeIn(_arg1:Number):void{
_isFading = true;
_levelToReach = 0;
_fadeSpeed = _arg1;
}
public function getTransitionFrame():Number{
if (_transition){
return (_transition.getCurrentFrame());
};
return (_lastTransitionFrame);
}
public function isTransitioning():Boolean{
if (_transition){
if (_transition.isAnimating()){
_transition.animateSprite();
return (true);
};
_lastTransitionFrame = _transition.getCurrentFrame();
_transition.removeSprite();
_transition = null;
};
return (false);
}
public function isFading():Boolean{
return (_isFading);
}
override public function Update():void{
}
public function startScreenTransition(_arg1:GameEntry, _arg2:String, _arg3:int, _arg4:int):void{
_transition = new SpriteEntity(_arg1, _arg2, _arg1._stage);
_transition.startAnimating(_arg3, _arg4, false);
}
public function handleFadeOut():void{
if (_isFading){
_currentAlphaVal = (_currentAlphaVal + _fadeSpeed);
if (_currentAlphaVal >= _levelToReach){
_currentAlphaVal = _levelToReach;
_isFading = false;
};
_screenFade.getMovieClip().alpha = _currentAlphaVal;
};
}
public function startFadeOut(_arg1:GameEntry, _arg2:String, _arg3:Number, _arg4:Number=1):void{
trace(("spriteName " + _arg2));
_screenFade = new SpriteEntity(_arg1, _arg2, _arg1._stage);
_fadeSpeed = _arg3;
_levelToReach = _arg4;
_currentAlphaVal = 0;
_isFading = true;
_screenFade.getMovieClip().alpha = _currentAlphaVal;
}
override public function Exit():void{
}
}
}//package Base
Section 9
//Profile (Base.Profile)
package Base {
import flash.utils.*;
public class Profile {
private var _profiles:Array;
private var _gameContext:GameEntry;
public function Profile(_arg1:GameEntry){
_gameContext = _arg1;
_profiles = [];
}
public function StartProfile(_arg1:String):void{
var _local2:int;
var _local3:int;
_local2 = getTimer();
_local3 = 0;
while (_local3 < _profiles.length) {
if (_profiles[_local3].name == _arg1){
_profiles[_local3].startTime = _local2;
_profiles[_local3].endTime = 0;
};
_local3++;
};
}
public function EndProfile(_arg1:String):void{
var _local2:int;
var _local3:int;
_local2 = getTimer();
_local3 = 0;
while (_local3 < _profiles.length) {
if (_profiles[_local3].name == _arg1){
_profiles[_local3].endTime = _local2;
};
_local3++;
};
}
public function RegisterProfile(_arg1:String):void{
var _local2:Number;
trace(("**** registering profile ****" + _arg1));
_profiles.push(new Object());
_local2 = (_profiles.length - 1);
_profiles[_local2].name = _arg1;
_profiles[_local2].startTime = 0;
_profiles[_local2].endTime = 0;
}
public function ReportProfile():void{
var _local1:int;
var _local2:int;
trace("*********************************");
trace(("Reporting Profile " + _profiles.length));
trace(("frameRate: " + (1 / _gameContext.getTimeManager().getAverageTime())));
_local1 = 0;
while (_local1 < _profiles.length) {
_local2 = (_profiles[_local1].endTime - _profiles[_local1].startTime);
trace(((("Profile " + _profiles[_local1].name) + ": ") + _local2));
_local1++;
};
trace("*********************************");
}
}
}//package Base
Section 10
//RandomNumber (Base.RandomNumber)
package Base {
public class RandomNumber {
public static var seed:uint = 1;
public static function nextDoubleRange(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + ((_arg2 - _arg1) * nextDouble())));
}
public static function nextIntRange(_arg1:Number, _arg2:Number):uint{
_arg1 = (_arg1 - 0.4999);
_arg2 = (_arg2 + 0.4999);
return (Math.round((_arg1 + ((_arg2 - _arg1) * nextDouble()))));
}
public static function nextDouble():Number{
return ((gen() / 2147483647));
}
public static function gen():uint{
return ((seed = ((seed * 16807) % 2147483647)));
}
public static function nextInt():uint{
return (gen());
}
}
}//package Base
Section 11
//SoundModule (Base.SoundModule)
package Base {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import Game.*;
public class SoundModule {
private const soundVolDefault:Number = 1;
private const musicVolDefault:Number = 1;
private var fadeInChannel:SoundChannel;
private var hash:Object;
private var currMusic:String;// = null
private var fadeOutStep:Number;
private var fadeOutStr:String;
private var fadeInStep:Number;
private var musicVolTarget:Number;// = 1
private var fadeInStr:String;
private var fadeInSoundInterval:uint;
private var fadeInMusicInterval:uint;
private var musicMute:Boolean;
public var _soundData:SoundData;
private var mutedVolume:Number;// = 1
private var fadeOutSoundInterval:uint;
private var activeSounds:Array;
private var currMusicChannel:SoundChannel;// = null
private var fadeOutChannel:SoundChannel;
private var fadeOutMusicInterval:uint;
private static var MAX_SOUNDS:Number = 30;
public function SoundModule(){
musicVolTarget = 1;
currMusic = null;
currMusicChannel = null;
mutedVolume = 1;
super();
hash = new Object();
activeSounds = new Array();
_soundData = new SoundData();
}
public function getCurrentMusicChannel():SoundChannel{
return (currMusicChannel);
}
public function stopSound(_arg1:SoundChannel):void{
var _local2:Number;
_local2 = activeSounds.length;
while (_local2--) {
if (activeSounds[_local2][1] == _arg1){
_arg1.stop();
_arg1 = null;
activeSounds.splice(_local2, 1);
break;
};
};
}
public function updateFadeOutChannel(_arg1:Timer, _arg2:SoundChannel, _arg3:Number, ... _args):void{
var _local5:Number;
var _local6:SoundTransform;
_local5 = (_arg2.soundTransform.volume - _arg3);
_local6 = new SoundTransform(_local5, 0);
if (_local5 <= 0){
_arg1.stop();
_arg1.removeEventListener(TimerEvent.TIMER, this.updateFadeOutChannel);
_arg1 = null;
_arg2.stop();
deactivateChannel(_arg2);
_arg2 = null;
} else {
_arg2.soundTransform = _local6;
};
}
public function playFromGroup(_arg1:Array):SoundChannel{
var _local2:*;
var _local3:Object;
var _local4:Number;
var _local5:SoundChannel;
_local2 = Math.floor((_arg1.length * Math.random()));
_local3 = _arg1[_local2];
_local4 = ((_local3.loop)==true) ? 9999 : 0;
_local5 = playSound(_local3.linkage, _local3.vol, _local3.pan, _local3.offset, _local4, _local3.force);
return (_local5);
}
public function setMusicMute(_arg1:Boolean):void{
var _local2:SoundTransform;
if (currMusicChannel == null){
musicMute = _arg1;
return;
};
if (fadeInSoundInterval > 0){
clearInterval(fadeInSoundInterval);
fadeInSoundInterval = 0;
};
switch (_arg1){
case true:
_local2 = new SoundTransform(0, 0);
currMusicChannel.soundTransform = _local2;
musicMute = true;
break;
case false:
_local2 = new SoundTransform(mutedVolume, 0);
currMusicChannel.soundTransform = _local2;
musicMute = false;
break;
};
}
public function getMusicMute():Boolean{
return (musicMute);
}
public function crossFadeMusic(_arg1:SoundChannel, _arg2:SoundChannel, _arg3:Number):void{
if (_arg1 != null){
addChannelToFadeOut(_arg1, _arg3);
};
if (_arg2 != null){
addChannelToFadeIn(_arg2, _arg3);
};
}
public function addChannelToFadeOut(_arg1:SoundChannel, _arg2:Number):void{
var _local3:SoundTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Timer;
trace(("Add Fade Out: " + _arg1));
_local3 = _arg1.soundTransform;
_local4 = (_local3.volume * 100);
_local5 = (_local4 / _arg2);
_local6 = (_arg2 / _local4);
_local7 = (_arg2 / _local6);
if (_local5 < 0.02){
_local5 = 0.02;
};
_local8 = new Timer(_local7, _local6);
_local8.addEventListener(TimerEvent.TIMER, FuncProxy.create(this, updateFadeOutChannel, _local8, _arg1, _local5));
_local8.start();
}
public function updateFadeInChannel(_arg1:Timer, _arg2:SoundChannel, _arg3:Number, ... _args):void{
var _local5:Number;
var _local6:SoundTransform;
_local5 = (_arg2.soundTransform.volume + _arg3);
_local6 = new SoundTransform(_local5, 0);
if (_local5 >= musicVolTarget){
_arg1.stop();
_arg1.removeEventListener(TimerEvent.TIMER, this.updateFadeOutChannel);
_arg1 = null;
} else {
_arg2.soundTransform = _local6;
};
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:Number=0, _arg5:int=0, _arg6:Boolean=false):SoundChannel{
var _local7:Number;
var _local8:Sound;
var _local9:SoundTransform;
var _local10:SoundChannel;
if (_arg2 > 1){
_arg2 = 1;
};
if ((((_arg3 < -1)) || ((_arg3 > 1)))){
_arg3 = 0;
};
if ((((hash[_arg1] == undefined)) || ((hash[_arg1] == null)))){
loadSound(_arg1);
} else {
if (!_arg6){
_local7 = activeSounds.length;
if (_local7 > 0){
while (_local7--) {
if (activeSounds[_local7][0] == _arg1){
return (null);
};
};
};
};
};
if (activeSounds.length < MAX_SOUNDS){
_local8 = hash[_arg1];
_local9 = new SoundTransform(_arg2, _arg3);
_local10 = _local8.play(_arg4, _arg5, _local9);
if (_local10 == null){
trace("Sound Failed to Play");
return (null);
};
activeSounds.push([_arg1, _local10]);
_local10.addEventListener(Event.SOUND_COMPLETE, FuncProxy.create(this, soundCompleteHandler, _arg1, _local10));
return (_local10);
} else {
trace("Active Sounds exceeds Maximum Allowed");
};
return (null);
}
public function startLoopFade(_arg1:String, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:int=9999, _arg7:Boolean=false):SoundChannel{
var _local8:Number;
var _local9:Sound;
var _local10:SoundTransform;
var _local11:SoundChannel;
if ((((hash[_arg1] == undefined)) || ((hash[_arg1] == null)))){
loadSound(_arg1);
} else {
if (!_arg7){
_local8 = activeSounds.length;
if (_local8 > 0){
while (_local8--) {
if (activeSounds[_local8][0] == _arg1){
trace(("Sound Already Playing:" + _arg1), _local8);
return (null);
};
};
};
};
};
if (activeSounds.length < MAX_SOUNDS){
_local9 = hash[_arg1];
_local10 = new SoundTransform(0, _arg4);
_local11 = _local9.play(_arg5, _arg6, _local10);
if (_local11 == null){
trace("Loop Sound Failed to Play");
return (null);
};
activeSounds.push([_arg1, _local11]);
addChannelToFadeIn(_local11, _arg2);
return (_local11);
} else {
trace("Active Sounds exceeds Maximum Allowed");
};
return (null);
}
public function playSoundByEvent(_arg1:Object):SoundChannel{
var _local2:Number;
var _local3:SoundChannel;
_local2 = ((_arg1.loop)==true) ? 9999 : 0;
_local3 = playSound(_arg1.linkage, _arg1.vol, _arg1.pan, _arg1.offset, _local2, _arg1.force);
return (_local3);
}
public function traceActiveSounds():void{
var _local1:Number;
trace("");
_local1 = activeSounds.length;
while (_local1--) {
trace((("[" + activeSounds[_local1][0]) + "]"));
};
trace("");
}
public function loadSound(_arg1:String):void{
var _local2:Class;
var _local3:Sound;
trace(((">> SoundModule.loadSound(" + _arg1) + ")"));
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = (new (_local2) as Sound);
hash[_arg1] = _local3;
}
public function soundCompleteHandler(_arg1:String, _arg2:SoundChannel):void{
deactivateChannel(_arg2);
_arg2.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
_arg2 = null;
}
public function stopMusic():void{
if (currMusicChannel == null){
return;
};
addChannelToFadeOut(currMusicChannel, 1000);
currMusicChannel = null;
}
public function soundIsPlaying(_arg1:Object):Boolean{
var _local2:*;
for (_local2 in activeSounds) {
if (activeSounds[_local2][0] == _arg1.linkage){
return (true);
};
};
return (false);
}
public function playMusic(_arg1:String, _arg2:Number=1, _arg3:Number=1):SoundChannel{
var _local4:Sound;
var _local5:SoundChannel;
var _local6:SoundTransform;
if (currMusicChannel != null){
_local5 = currMusicChannel;
};
currMusicChannel = null;
if ((((hash[_arg1] == undefined)) || ((hash[_arg1] == null)))){
loadSound(_arg1);
};
_local4 = hash[_arg1];
if (musicMute){
musicVolTarget = 0;
} else {
musicVolTarget = _arg3;
};
mutedVolume = _arg3;
_local6 = new SoundTransform(_arg2, 0);
currMusicChannel = _local4.play(0, 9999, _local6);
if (currMusicChannel == null){
return (null);
};
currMusicChannel.addEventListener(Event.SOUND_COMPLETE, FuncProxy.create(this, soundCompleteHandler, _arg1));
if (_arg2 != _arg3){
crossFadeMusic(_local5, currMusicChannel, 2000);
} else {
if (_local5 != null){
addChannelToFadeOut(_local5, 2000);
};
};
return (currMusicChannel);
}
public function stopAllSounds():void{
var _local1:Number;
var _local2:SoundChannel;
_local1 = activeSounds.length;
while (_local1--) {
_local2 = activeSounds[_local1][1];
_local2.stop();
_local2 = null;
};
activeSounds = new Array();
}
public function unMuteSound(_arg1:SoundChannel, _arg2:Number=1):void{
var _local3:SoundTransform;
_local3 = new SoundTransform(_arg2, 0);
_arg1.soundTransform = _local3;
}
public function deactivateChannel(_arg1:SoundChannel):void{
var _local2:int;
_local2 = activeSounds.length;
while (_local2--) {
if (activeSounds[_local2][1] == _arg1){
activeSounds.splice(_local2, 1);
_arg1 = null;
return;
};
};
}
public function addChannelToFadeIn(_arg1:SoundChannel, _arg2:Number):void{
var _local3:SoundTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Timer;
_local3 = _arg1.soundTransform;
_local4 = (musicVolTarget * 100);
_local5 = (_local4 / _arg2);
_local6 = (_arg2 / _local4);
_local7 = (_arg2 / _local6);
if (_local5 < 0.02){
_local5 = 0.02;
};
_local8 = new Timer(_local7, _local6);
_local8.addEventListener(TimerEvent.TIMER, FuncProxy.create(this, updateFadeInChannel, _local8, _arg1, _local5));
_local8.start();
}
public function muteSound(_arg1:SoundChannel):void{
var _local2:SoundTransform;
_local2 = new SoundTransform(0, 0);
_arg1.soundTransform = _local2;
}
}
}//package Base
Section 12
//SpriteAnimator (Base.SpriteAnimator)
package Base {
import flash.events.*;
import flash.display.*;
public class SpriteAnimator extends EventDispatcher {
public var _loopAnim:Boolean;
public var _startFrame:int;
public var _isPlayingBackwards:Boolean;
public var _framerate:Number;
public var _animateTimer:Number;
var _gameContext:GameEntry;
public var _c:int;
public var _animate:Boolean;
public var _endFrame:int;
var _mc:MovieClip;
public var _lastFrame:int;
public function SpriteAnimator(_arg1:GameEntry, _arg2:MovieClip){
_gameContext = _arg1;
_mc = _arg2;
_animateTimer = 0;
}
public function reverseAnimation():void{
var _local1:*;
var _local2:*;
_local1 = _endFrame;
_local2 = _startFrame;
_startFrame = _local1;
_endFrame = _local2;
_isPlayingBackwards = ((_startFrame)>_endFrame) ? true : false;
}
public function getCurrentFrame():int{
return (_mc.currentFrame);
}
public function doneAnimating():void{
if (_animate == false){
return;
};
_animate = false;
if (hasEventListener(AnimationEvent.COMPLETE)){
dispatchEvent(new AnimationEvent(AnimationEvent.COMPLETE, false, false, _mc));
};
}
public function getEndFrame():Number{
return (_endFrame);
}
public function setFramerate(_arg1:int):void{
_framerate = (1 / _arg1);
}
public function isAnimating():Boolean{
return (_animate);
}
public function moveToFrame(_arg1:int):void{
_mc.gotoAndStop(_arg1);
_lastFrame = _arg1;
}
public function getFramerate():Number{
return (_framerate);
}
public function startAnimating(_arg1:int, _arg2:int, _arg3:Boolean=false, _arg4:int=-1, _arg5:Number=32){
_c = ((_arg4)>-1) ? _arg4 : _arg1;
_startFrame = _arg1;
_endFrame = _arg2;
moveToFrame(_arg1);
_framerate = (1 / _arg5);
_loopAnim = _arg3;
_animate = true;
_animateTimer = _framerate;
_isPlayingBackwards = ((_startFrame)>_endFrame) ? true : false;
}
public function isLooping():Boolean{
return (_loopAnim);
}
public function getStartFrame():Number{
return (_startFrame);
}
public function animateSprite():int{
_animateTimer = (_animateTimer - _gameContext.getDT());
if (_animateTimer <= 0){
_animateTimer = _framerate;
if (_startFrame <= _endFrame){
_c++;
if (_c > _endFrame){
if (_loopAnim){
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
return (1);
};
};
} else {
_c--;
if (_c < _endFrame){
if (_loopAnim){
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
return (1);
};
};
};
moveToFrame(_c);
};
return (0);
}
}
}//package Base
Section 13
//SpriteEntity (Base.SpriteEntity)
package Base {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class SpriteEntity {
private var _selectableChildren:Array;
public var _lastFrame:int;
private var _mouseRollOff:Boolean;
public var _loopAnim:Boolean;
public var _mc:MovieClip;
public var _clipHeight:Number;
private var _isSelectable:Boolean;
public var _flipped:Boolean;
public var _isPlayingBackwards:Boolean;
private var _returnVal:int;
public var _framerate:Number;
private var _children:Array;
var mouseWasOverLastFrame:Boolean;// = false
private var _mouseIsOver:Boolean;
private var _startingPositionX:Number;
private var _startingPositionY:Number;
private var _moveSpeed:Number;
public var _centerPoint:Number;
private var _mouseRollOn:Boolean;
private var _gameContext:GameEntry;
public var _animate:Boolean;
private var _destPosX:Number;
private var _destPosY:Number;
public var _spName:String;
public var _faceDir:Number;
public var _endFrame:int;
public var _animateTimer:Number;
public var _startFrame:int;
public var _clipWidth:Number;
public var _c:int;
public function SpriteEntity(_arg1:GameEntry, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Number=0, _arg5:Number=0, _arg6:Boolean=false, _arg7:int=-1, _arg8:int=-1){
var _local9:*;
var _local10:Class;
mouseWasOverLastFrame = false;
super();
_gameContext = _arg1;
_local9 = _arg3.getChildByName(_arg2);
if (_arg6){
_local9 = null;
};
if (_local9){
_mc = _local9;
} else {
_local10 = (getDefinitionByName(_arg2) as Class);
_mc = new (_local10);
_mc.name = _arg2;
_mc.x = _arg4;
_mc.y = _arg5;
if (_arg7 < 0){
_arg3.addChild(_mc);
} else {
_arg3.addChildAt(_mc, _arg7);
};
};
_spName = _arg2;
_mc.visible = true;
_mc.gotoAndStop(1);
_flipped = false;
_c = 1;
_startFrame = 0;
_endFrame = 0;
_lastFrame = 0;
_framerate = 32;
_animateTimer = 0;
_animate = false;
_loopAnim = false;
_isPlayingBackwards = false;
_returnVal = _arg8;
_mc.mouseEnabled = false;
_isSelectable = false;
if (_returnVal > -1){
setSelectable(_arg8);
};
_mouseIsOver = false;
_mouseRollOn = false;
_mouseRollOff = false;
_children = [];
_selectableChildren = [];
}
public function setRotation(_arg1:Number){
_mc.rotation = _arg1;
}
public function setDestPosX(_arg1:Number){
_destPosX = _arg1;
}
public function getArea():Number{
return ((_mc.width * _mc.height));
}
public function animateSprite():int{
_animateTimer = (_animateTimer - _gameContext.getDT());
if (_animateTimer <= 0){
_animateTimer = _framerate;
if (_startFrame <= _endFrame){
_c++;
if (_c > _endFrame){
if (_loopAnim){
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
return (1);
};
};
} else {
_c--;
if (_c < _endFrame){
if (_loopAnim){
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
return (1);
};
};
};
moveToFrame(_c);
};
return (0);
}
public function getVisibility():Boolean{
return (_mc.visible);
}
public function addNestedChild(_arg1:String, _arg2:int=-1):SpriteEntity{
var _local3:SpriteEntity;
_local3 = new SpriteEntity(_gameContext, _arg1, _mc);
if (_arg2 > -1){
_local3.setSelectable(_arg2);
_selectableChildren.push(_local3);
} else {
_children.push(_local3);
};
return (_local3);
}
public function setPositionX(_arg1:Number){
_mc.x = _arg1;
}
public function setPositionY(_arg1:Number){
_mc.y = _arg1;
}
public function getWidth():Number{
return (_mc.width);
}
public function isMouseOver():Boolean{
var _local1:Rectangle;
if (_mc.visible == false){
return (false);
};
_mouseRollOn = false;
_mouseRollOff = false;
_local1 = _mc.getBounds(_gameContext._stage);
if ((((((((_gameContext.getPadManager().getMousePosX() < _local1.left)) || ((_gameContext.getPadManager().getMousePosX() > _local1.right)))) || ((_gameContext.getPadManager().getMousePosY() < _local1.top)))) || ((_gameContext.getPadManager().getMousePosY() > _local1.bottom)))){
if (mouseWasOverLastFrame){
_mouseRollOff = true;
};
mouseWasOverLastFrame = false;
_mouseIsOver = false;
return (false);
};
if (_mouseIsOver){
mouseWasOverLastFrame = true;
} else {
_mouseRollOn = true;
mouseWasOverLastFrame = true;
};
_mouseIsOver = true;
return (true);
}
public function getFramerate():Number{
return (_framerate);
}
public function setVisibility(_arg1:Boolean){
_mc.visible = _arg1;
}
public function startAnimating(_arg1:int, _arg2:int, _arg3:Boolean=false, _arg4:Number=32){
_c = _arg1;
_startFrame = _arg1;
_endFrame = _arg2;
moveToFrame(_arg1);
_framerate = (1 / _arg4);
_loopAnim = _arg3;
_animate = true;
_animateTimer = _framerate;
_isPlayingBackwards = ((_startFrame)>_endFrame) ? true : false;
}
public function getHeight():Number{
return (_mc.height);
}
public function getStartFrame():Number{
return (_startFrame);
}
public function getReturnVal():int{
return (_returnVal);
}
public function addNewChild(_arg1:String, _arg2:int, _arg3:int, _arg4:Boolean=false, _arg5:int=-1):SpriteEntity{
var _local6:SpriteEntity;
_local6 = new SpriteEntity(_gameContext, _arg1, _mc, _arg2, _arg3, _arg4);
if (_arg5 > -1){
_local6.setSelectable(_arg5);
_selectableChildren.push(_local6);
} else {
_children.push(_local6);
};
return (_local6);
}
public function setFaceDir(_arg1:Number):void{
_faceDir = _arg1;
}
public function setStartingPositionToPosition():void{
_startingPositionX = getPositionX();
_startingPositionY = getPositionY();
}
public function getSelectableChild(_arg1:int):SpriteEntity{
return (_selectableChildren[_arg1]);
}
public function getStartingPositionX():Number{
return (_startingPositionX);
}
public function getStartingPositionY():Number{
return (_startingPositionY);
}
public function isLooping():Boolean{
return (_loopAnim);
}
public function getMoveSpeed():Number{
return (_moveSpeed);
}
public function getScaleY():Number{
return (_mc.scaleY);
}
public function setScaleX(_arg1:Number):void{
_mc.scaleX = _arg1;
}
public function setScaleY(_arg1:Number):void{
_mc.scaleY = _arg1;
}
public function getScaleX():Number{
return (_mc.scaleX);
}
public function isAnimating():Boolean{
return (_animate);
}
public function getSelectable():Boolean{
return (_isSelectable);
}
public function getChild(_arg1:int):SpriteEntity{
return (_selectableChildren[_arg1]);
}
public function setSelectable(_arg1:int):void{
_isSelectable = true;
_returnVal = _arg1;
_mc.mouseEnabled = true;
_mc.buttonMode = true;
_mc.useHandCursor = true;
}
public function removeSprite():void{
var _local1:int;
_local1 = 0;
_local1 = _children.length;
if (_local1 > 0){
while (_local1--) {
_children[_local1] = null;
};
_children = [];
};
_local1 = _selectableChildren.length;
if (_local1 > 0){
while (_local1--) {
_selectableChildren[_local1] = null;
};
_selectableChildren = [];
};
_mc.parent.removeChild(_mc);
_mc = null;
}
public function getSelectableChildren():Array{
return (_selectableChildren);
}
public function getNumChildren():Number{
return (_children.length);
}
public function getChildren():Array{
return (_children);
}
public function setFramerate(_arg1:int):void{
_framerate = (1 / _arg1);
}
public function isMouseRollOff():Boolean{
return (_mouseRollOff);
}
public function getPositionX():Number{
return (_mc.x);
}
public function getPositionY():Number{
return (_mc.y);
}
public function moveToFrame(_arg1:int):void{
_mc.gotoAndStop(_arg1);
_lastFrame = _arg1;
}
public function setPosition(_arg1:Number, _arg2:Number){
_mc.x = _arg1;
_mc.y = _arg2;
}
public function scaleSprite(_arg1:Number):void{
_mc.scaleX = (_mc.scaleX * _arg1);
_mc.scaleY = (_mc.scaleY * _arg1);
}
public function setMoveSpeed(_arg1:Number){
_moveSpeed = _arg1;
}
public function playFlipped(){
if (_flipped){
return;
};
_flipped = true;
_mc.scaleX = (_mc.scaleX * -1);
}
public function isMouseRollOn():Boolean{
return (_mouseRollOn);
}
public function getFaceDir():Number{
return (_faceDir);
}
public function getDestPosY():Number{
return (_destPosY);
}
public function setFlipped():void{
_flipped = (_flipped) ? false : true;
_mc.scaleX = (_mc.scaleX * -1);
}
public function reverseAnimation():void{
var _local1:*;
var _local2:*;
_local1 = _endFrame;
_local2 = _startFrame;
_startFrame = _local1;
_endFrame = _local2;
_isPlayingBackwards = ((_startFrame)>_endFrame) ? true : false;
}
public function getEndFrame():Number{
return (_endFrame);
}
public function setDestPosY(_arg1:Number){
_destPosY = _arg1;
}
public function getDestPosX():Number{
return (_destPosX);
}
public function isAtDestination():Boolean{
return (((((_mc.x == _destPosX)) && ((_mc.y == _destPosY)))) ? true : false);
}
public function getSelectableChildMouseIsOver():SpriteEntity{
var _local1:int;
_local1 = _selectableChildren.length;
while (_local1--) {
if (_selectableChildren[_local1].isMouseOver()){
return (_selectableChildren[_local1]);
};
};
return (null);
}
public function getNumSelectableChildren():Number{
return (_selectableChildren.length);
}
public function isVisible():Boolean{
return (_mc.visible);
}
public function getCurrentFrame():int{
return (_mc.currentFrame);
}
public function getMovieClip():MovieClip{
return (_mc);
}
public function playUnflipped(){
if (_flipped){
_mc.scaleX = (_mc.scaleX * -1);
};
_flipped = false;
}
public function doneAnimating():void{
_animate = false;
}
public function isFlipped():Boolean{
return (_flipped);
}
}
}//package Base
Section 14
//SpriteEntityAnimator (Base.SpriteEntityAnimator)
package Base {
public class SpriteEntityAnimator {
var _animateTimer:int;
var _gameContext:GameEntry;
var toAnimate:Array;
var toRemove:Array;
public function SpriteEntityAnimator(_arg1:GameEntry){
_gameContext = _arg1;
toAnimate = new Array();
toRemove = new Array();
_animateTimer = 0;
}
public function addSpriteToAnimate(_arg1:SpriteEntity, _arg2:Object, _arg3:Function, _arg4:Array):void{
toAnimate.push(new Array(_arg1, _arg2, _arg3, _arg4));
}
public function Update():void{
var _local1:int;
var _local2:SpriteEntity;
var _local3:int;
var _local4:int;
var _local5:Object;
var _local6:Function;
var _local7:Array;
_local1 = toAnimate.length;
if (_local1 < 1){
return;
};
_local2 = null;
toRemove = [];
while (_local1--) {
_local2 = toAnimate[_local1][0];
_local3 = _local2.animateSprite();
if (_local3 == 1){
toRemove.push(_local1);
};
};
_local1 = toRemove.length;
if (_local1 > 0){
_local4 = toRemove[_local1];
_local2 = toAnimate[_local4][0];
_local5 = toAnimate[_local4][1];
_local6 = toAnimate[_local4][2];
_local7 = toAnimate[_local4][3];
_local6.apply(_local5, _local7);
toAnimate.splice(_local4, 1);
};
}
}
}//package Base
Section 15
//State (Base.State)
package Base {
public class State {
public function Entry():void{
}
public function CPUDecision():void{
}
public function Exit():void{
}
public function Update():void{
}
public function NetworkDecision():void{
}
public function PadInput():void{
}
}
}//package Base
Section 16
//Time (Base.Time)
package Base {
import flash.utils.*;
class Time {
private var _timer:Timer;
private var _averageTime:Array;
private var _startTime;
private var _timeLastTick;
private var _currentTime;
private var _gameSpeed;
private var _currentPlaceInAvgArray;
static var MAX_GAME_SPEED = 100;
static var MIN_GAME_SPEED = 0.001;
static var INITIAL_GAME_SPEED = 1;
function Time(){
_timer = new Timer(0, 0);
_timer.start();
_currentTime = 0;
_timeLastTick = 0.001;
_gameSpeed = INITIAL_GAME_SPEED;
_startTime = ((getTimer() * INITIAL_GAME_SPEED) / 1000);
_averageTime = new Array(0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666);
_currentPlaceInAvgArray = 0;
_currentTime = getTimer();
}
public function resetStartTime():void{
_startTime = ((getTimer() * INITIAL_GAME_SPEED) / 1000);
}
public function setGameSpeed(_arg1:Number){
_gameSpeed = _arg1;
if (_gameSpeed < MIN_GAME_SPEED){
_gameSpeed = MIN_GAME_SPEED;
} else {
if (_gameSpeed > MAX_GAME_SPEED){
_gameSpeed = MIN_GAME_SPEED;
};
};
}
public function getTotalTimeElapsed():Number{
return ((_currentTime - _startTime));
}
public function getAverageTime():Number{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < 10) {
_local1 = (_local1 + _averageTime[_local2]);
_local2++;
};
_local1 = (_local1 / 10);
return (_local1);
}
public function getFramerate():Number{
return (Math.floor((1 / getAverageTime())));
}
public function getElapsedTime():Number{
return (_timeLastTick);
}
public function markTimeThisTick(){
var _local1:*;
_local1 = (((getTimer() * _gameSpeed) / 1000) - _startTime);
_timeLastTick = (_local1 - _currentTime);
_currentTime = _local1;
var _local2 = _currentPlaceInAvgArray++;
_averageTime[_local2] = _timeLastTick;
if (_currentPlaceInAvgArray >= 10){
_currentPlaceInAvgArray = 0;
};
if (_timeLastTick <= 0){
_timeLastTick = 0.001;
};
}
public function getCurTime():Number{
return (_currentTime);
}
public function getGameSpeed():Number{
return (_gameSpeed);
}
}
}//package Base
Section 17
//batman_avatar_33 (BatmanBB_SpacePirates_fla.batman_avatar_33)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class batman_avatar_33 extends MovieClip {
public function batman_avatar_33(){
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
gotoAndPlay(2);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 18
//bbCalled_fxAnim_61 (BatmanBB_SpacePirates_fla.bbCalled_fxAnim_61)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class bbCalled_fxAnim_61 extends MovieClip {
public function bbCalled_fxAnim_61(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 19
//beetleBar_20 (BatmanBB_SpacePirates_fla.beetleBar_20)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class beetleBar_20 extends MovieClip {
public function beetleBar_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 20
//btn_instructions_41 (BatmanBB_SpacePirates_fla.btn_instructions_41)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class btn_instructions_41 extends MovieClip {
public function btn_instructions_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 21
//btn_music_42 (BatmanBB_SpacePirates_fla.btn_music_42)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class btn_music_42 extends MovieClip {
public function btn_music_42(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 22
//combo_timer_39 (BatmanBB_SpacePirates_fla.combo_timer_39)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class combo_timer_39 extends MovieClip {
public function combo_timer_39(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 23
//comboDisplay_38 (BatmanBB_SpacePirates_fla.comboDisplay_38)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
import flash.text.*;
public dynamic class comboDisplay_38 extends MovieClip {
public var counter:TextField;
public var comboTimer:MovieClip;
public function comboDisplay_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 24
//dmgBar_22 (BatmanBB_SpacePirates_fla.dmgBar_22)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class dmgBar_22 extends MovieClip {
public function dmgBar_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 25
//GUI_spacebar_40 (BatmanBB_SpacePirates_fla.GUI_spacebar_40)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class GUI_spacebar_40 extends MovieClip {
public function GUI_spacebar_40(){
addFrameScript(0, frame1, 52, frame53);
}
function frame1(){
stop();
}
function frame53(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 26
//hud_beetlebar_34 (BatmanBB_SpacePirates_fla.hud_beetlebar_34)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class hud_beetlebar_34 extends MovieClip {
public function hud_beetlebar_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 27
//hud_beetlebar_call_icon_37 (BatmanBB_SpacePirates_fla.hud_beetlebar_call_icon_37)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class hud_beetlebar_call_icon_37 extends MovieClip {
public function hud_beetlebar_call_icon_37(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 28
//hud_healthbar_35 (BatmanBB_SpacePirates_fla.hud_healthbar_35)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class hud_healthbar_35 extends MovieClip {
public function hud_healthbar_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 29
//InstScrn_Cont_54 (BatmanBB_SpacePirates_fla.InstScrn_Cont_54)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class InstScrn_Cont_54 extends MovieClip {
public function InstScrn_Cont_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 30
//InstScrn_Play_51 (BatmanBB_SpacePirates_fla.InstScrn_Play_51)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class InstScrn_Play_51 extends MovieClip {
public function InstScrn_Play_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 31
//loaderingbar2copy_15 (BatmanBB_SpacePirates_fla.loaderingbar2copy_15)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class loaderingbar2copy_15 extends MovieClip {
public var mainLoadingBar_mc:MovieClip;
public function loaderingbar2copy_15(){
addFrameScript(11, frame12);
}
function frame12(){
gotoAndPlay(1);
}
}
}//package BatmanBB_SpacePirates_fla
Section 32
//loading_18 (BatmanBB_SpacePirates_fla.loading_18)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class loading_18 extends MovieClip {
public function loading_18(){
addFrameScript(29, frame30);
}
function frame30(){
gotoAndPlay(1);
}
}
}//package BatmanBB_SpacePirates_fla
Section 33
//newHighScoreMC_58 (BatmanBB_SpacePirates_fla.newHighScoreMC_58)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class newHighScoreMC_58 extends MovieClip {
public function newHighScoreMC_58(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 34
//Play_TitleCard_44 (BatmanBB_SpacePirates_fla.Play_TitleCard_44)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class Play_TitleCard_44 extends MovieClip {
public function Play_TitleCard_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 35
//playAgainBtn_59 (BatmanBB_SpacePirates_fla.playAgainBtn_59)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class playAgainBtn_59 extends MovieClip {
public function playAgainBtn_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 36
//preloader_14 (BatmanBB_SpacePirates_fla.preloader_14)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
import flash.text.*;
public dynamic class preloader_14 extends MovieClip {
public var done_txt:TextField;
public var parentLoader_mc:MovieClip;
public function preloader_14(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 37
//soundPreload_31 (BatmanBB_SpacePirates_fla.soundPreload_31)
package BatmanBB_SpacePirates_fla {
import flash.display.*;
public dynamic class soundPreload_31 extends MovieClip {
public function soundPreload_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatmanBB_SpacePirates_fla
Section 38
//CN_Game (code.CN_Game)
package code {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class CN_Game extends MovieClip {
public var loadDisplay:MovieClip;
var _loadInfo:LoaderInfo;
public var beetleClip:MovieClip;
var _loaded:Boolean;
public function CN_Game(){
addFrameScript(113, frame114);
_loadInfo = this.loaderInfo;
this.gotoAndStop(5);
_loadInfo.addEventListener(Event.INIT, onRootLoaderInit, false, 0, true);
_loadInfo.addEventListener(ProgressEvent.PROGRESS, onRootLoaderProgress, false, 0, true);
_loadInfo.addEventListener(Event.COMPLETE, onRootLoaderComplete, false, 0, true);
}
public function onRootLoaderInit(_arg1:Event):void{
this.loadDisplay.gotoAndStop(2);
}
public function onRootLoaderProgress(_arg1:Event):void{
var _local2:*;
_local2 = Math.round(((loaderInfo.bytesLoaded / loaderInfo.bytesTotal) * 100));
this.loadDisplay.done_txt.text = (_local2 + "%");
}
public function onRootLoaderComplete(_arg1:Event):void{
_loadInfo.removeEventListener(Event.INIT, onRootLoaderInit);
_loadInfo.removeEventListener(ProgressEvent.PROGRESS, onRootLoaderProgress);
_loadInfo.removeEventListener(Event.COMPLETE, onRootLoaderComplete);
this.loadDisplay.gotoAndPlay(3);
_loaded = true;
addEventListener("enterFrame", UpdateLoader, false, 0, true);
}
public function UpdateLoader(_arg1:Event):void{
if (_loaded){
removeEventListener("enterFrame", UpdateLoader);
gotoAndPlay(99);
return;
};
}
function frame114(){
stop();
}
}
}//package code
Section 39
//Beetle_Attack_Hammer_Drop (Game.AIStates.Beetle_Attack_Hammer_Drop)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Attack_Hammer_Drop extends AIState {
var done:Boolean;
var timer:int;
var hero:Hero;
var dir;
var beetle:BlueBeetle;
public function Beetle_Attack_Hammer_Drop(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_HAMMER_DROP);
if (beetle._targetEnemy._x < 300){
beetle.moveTo(700, GameData._groundY);
beetle._dir = -1;
beetle._xvel = ((beetle._targetEnemy._x - beetle._x) / 28);
} else {
beetle.moveTo(-100, GameData._groundY);
beetle._xvel = ((beetle._targetEnemy._x - beetle._x) / 28);
beetle._dir = 1;
};
beetle.sprite.scaleX = beetle._dir;
beetle._yvel = -40;
done = false;
timer = 0;
}
override public function Update():void{
timer++;
if (timer == 15){
snd.playSoundByEvent(SoundData.BEETLE_HAMMER_ATTACK);
};
beetle.updateAnimation();
beetle._yvel = (beetle._yvel + GameData._gravity);
beetle.offsetPosition(beetle._xvel, beetle._yvel);
if (beetle._y > GameData._groundY){
beetle.moveTo(beetle._x, GameData._groundY);
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_ATTACK_HAMMER_HIT]);
};
}
public function toString():String{
return ("Beetle_Attack_Hammer_Drop()");
}
override public function Exit():void{
beetle._collides = false;
}
}
}//package Game.AIStates
Section 40
//Beetle_Attack_Hammer_Hit (Game.AIStates.Beetle_Attack_Hammer_Hit)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Attack_Hammer_Hit extends AIState {
var done:Boolean;
var hero:Hero;
var dir;
var beetle:BlueBeetle;
public function Beetle_Attack_Hammer_Hit(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
beetle._collides = false;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
hero = gameData._hero;
beetle.startAnimating(BlueBeetle.ANIM_HAMMER_HIT);
gameData.hitSpark("hammer");
beetle._targetEnemy.takeDamage(BlueBeetle.DAMAGE_HAMMER);
gameData._comboCount++;
hero._lastHitTime = gameData._gameTimer;
beetle._targetEnemy._punched = true;
beetle._targetEnemy._inAir = true;
beetle._targetEnemy._yvel = -20;
gameData.shake();
beetle._targetEnemy.glowOn();
beetle._targetEnemy._healthBar.visible = false;
}
override public function Update():void{
beetle._targetEnemy.glowOn();
gameData.updateShake();
beetle.updateAnimation();
if (!beetle._animator.isAnimating()){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_POSE]);
};
}
public function toString():String{
return ("Beetle_Attack_Hammer_Drop()");
}
override public function Exit():void{
beetle._targetEnemy.glowOff();
}
}
}//package Game.AIStates
Section 41
//Beetle_Attack_Jet (Game.AIStates.Beetle_Attack_Jet)
package Game.AIStates {
import Base.*;
import flash.media.*;
import Game.*;
public class Beetle_Attack_Jet extends AIState {
var done:Boolean;
var hero:Hero;
var dir;
var _loop:SoundChannel;
var beetle:BlueBeetle;
public function Beetle_Attack_Jet(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_JET);
beetle.moveTo(-100, 300);
beetle.sprite.scaleX = 1;
beetle._collides = true;
done = false;
dir = "right";
beetle._dir = 1;
_loop = snd.playSoundByEvent(SoundData.BEETLE_JETPACK);
}
override public function Update():void{
beetle.updateAnimation();
if (dir == "right"){
beetle._dir = 1;
beetle.offsetPosition(40, 0);
if (beetle._x > 800){
gameData.beetleComplete();
beetle.sprite.scaleX = -1;
dir = "left";
};
} else {
beetle._dir = -1;
beetle.offsetPosition(-40, 0);
if (beetle._x < -200){
gameData.beetleComplete();
done = true;
};
};
if (done){
beetle._dir = 0;
beetle.sprite.scaleX = 1;
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_LAND]);
return;
};
gameData.checkBeetleCollision();
}
public function toString():String{
return ("Beetle_Attack_Jet()");
}
override public function Exit():void{
beetle._collides = false;
snd.stopSound(_loop);
}
}
}//package Game.AIStates
Section 42
//Beetle_Attack_Rocket_Aim (Game.AIStates.Beetle_Attack_Rocket_Aim)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Attack_Rocket_Aim extends AIState {
var hero:Hero;
var beetle:BlueBeetle;
public function Beetle_Attack_Rocket_Aim(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_ROCKET_AIM);
}
override public function Update():void{
beetle.updateAnimation();
if (!beetle._animator.isAnimating()){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_ATTACK_ROCKET_FIRE]);
};
}
public function toString():String{
return ("Beetle_Attack_Rocket_Aim()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 43
//Beetle_Attack_Rocket_Drop (Game.AIStates.Beetle_Attack_Rocket_Drop)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Attack_Rocket_Drop extends AIState {
var done:Boolean;
var timer:int;
var hero:Hero;
var dir;
var beetle:BlueBeetle;
public function Beetle_Attack_Rocket_Drop(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
var _local1:*;
var _local2:*;
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_ROCKET_DROP);
_local1 = ((beetle._targetEnemy._y - GameData._groundY) / Math.tan(0.785));
if (beetle._targetEnemy._x < 300){
beetle.moveTo(700, GameData._groundY);
beetle._dir = -1;
} else {
beetle.moveTo(-100, GameData._groundY);
beetle._dir = 1;
};
_local2 = (((beetle._dir * 20) + (beetle._targetEnemy._x - beetle._x)) + (beetle._dir * _local1));
beetle._xvel = (_local2 / 25);
beetle.sprite.scaleX = beetle._dir;
beetle._yvel = -40;
done = false;
timer = 0;
}
override public function Update():void{
timer++;
trace(("timer = " + timer));
beetle._yvel = (beetle._yvel + GameData._gravity);
beetle.offsetPosition(beetle._xvel, beetle._yvel);
if (beetle._y > GameData._groundY){
beetle.moveTo(beetle._x, GameData._groundY);
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_ATTACK_ROCKET_AIM]);
};
}
public function toString():String{
return ("Beetle_Attack_Rocket_Drop()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 44
//Beetle_Attack_Rocket_Fire (Game.AIStates.Beetle_Attack_Rocket_Fire)
package Game.AIStates {
import Base.*;
import flash.display.*;
import Game.*;
public class Beetle_Attack_Rocket_Fire extends AIState {
var beamMask:DisplayObject;
var timer:int;
var hero:Hero;
var beetle:BlueBeetle;
var beam:DisplayObject;
public function Beetle_Attack_Rocket_Fire(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
trace(("@ --> ENTER " + this));
beetle._targetEnemy.glowOn();
beetle._targetEnemy._healthBar.visible = false;
beetle.startAnimating(BlueBeetle.ANIM_ROCKET_FIRE);
timer = 0;
beetle._targetEnemy.takeDamage(BlueBeetle.DAMAGE_ROCKET);
if (beetle._targetEnemy._yvel >= 0){
beetle._targetEnemy._yvel = (beetle._targetEnemy._yvel - 20);
};
gameData._comboCount++;
hero = gameData._hero;
hero._lastHitTime = gameData._gameTimer;
beam = beetle.sprite.getChildByName("beam");
_local1 = (beetle._x + beam.x);
if (beetle._dir == -1){
_local1 = (_local1 + 60);
};
_local2 = (beetle._y + beam.y);
_local3 = (beetle._targetEnemy._x - 20);
if (!beetle._targetEnemy._isFacingRight){
_local3 = (beetle._targetEnemy._x + 20);
};
_local4 = (beetle._targetEnemy._y - 70);
_local5 = (_local3 - _local1);
_local6 = (_local4 - _local2);
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
beam.scaleX = (_local7 / 245);
beam.visible = true;
if (beetle._dir == 1){
gameData._beamSplash.scaleX = -1;
gameData._beamSplash.x = (_local1 + (_local7 * Math.cos(0.785)));
} else {
gameData._beamSplash.scaleX = 1;
gameData._beamSplash.x = (_local1 - (_local7 * Math.cos(0.785)));
};
gameData._beamSplash.y = (_local2 - (_local7 * Math.sin(0.785)));
gameData._beamSplash.visible = true;
gameData._beamSplash.play();
snd.playSoundByEvent(SoundData.BEETLE_BEAM_ATTACK);
}
override public function Update():void{
timer++;
beetle.updateAnimation();
beetle._targetEnemy.glowOn();
if (timer < 30){
gameData.hitSpark("rocket");
} else {
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_POSE]);
};
}
public function toString():String{
return ("Beetle_Attack_Rocket_Fire()");
}
override public function Exit():void{
beam.visible = false;
gameData._beamSplash.stop();
gameData._beamSplash.visible = false;
beetle._targetEnemy.glowOff();
beetle._targetEnemy._healthBar.visible = true;
}
}
}//package Game.AIStates
Section 45
//Beetle_Finish (Game.AIStates.Beetle_Finish)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Finish extends AIState {
var timer:int;
var hero:Hero;
var beetle:BlueBeetle;
public function Beetle_Finish(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_LEAVE);
beetle.moveTo(beetle._x, GameData._groundY);
timer = 0;
snd.playSoundByEvent(SoundData.BEETLE_TAKEOFF);
}
override public function Update():void{
beetle.updateAnimation();
timer++;
if (timer > 7){
beetle.offsetPosition(0, -60);
};
if (beetle._y < -200){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_INACTIVE]);
};
}
public function toString():String{
return ("Beetle_Finish()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 46
//Beetle_Inactive (Game.AIStates.Beetle_Inactive)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Inactive extends AIState {
var beetle:BlueBeetle;
public function Beetle_Inactive(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + beetle.getID()));
gameData._beetle._animator.moveToFrame(1);
beetle._active = false;
beetle._recycle = false;
beetle.moveTo(-200, -200);
gameData._background.gotoAndStop(1);
}
override public function Update():void{
if (beetle._recycle){
beetle._active = true;
beetle._recycle = false;
if (beetle._attackType == BlueBeetle.ATTACK_JET){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_ATTACK_JET]);
} else {
if (beetle._attackType == BlueBeetle.ATTACK_HAMMER){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_ATTACK_HAMMER_DROP]);
} else {
if (beetle._attackType == BlueBeetle.ATTACK_ROCKET){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_ATTACK_ROCKET_DROP]);
};
};
};
};
}
public function toString():String{
return ("Beetle_Inactive()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 47
//Beetle_Land (Game.AIStates.Beetle_Land)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Land extends AIState {
var hero:Hero;
var _landed:Boolean;
var beetle:BlueBeetle;
public function Beetle_Land(_arg1:GameEntry, _arg2:BlueBeetle){
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_JET_DROP);
beetle.moveTo(100, -200);
beetle.sprite.scaleX = 1;
_landed = false;
}
override public function Update():void{
var _local1:*;
beetle.updateAnimation();
if (_landed){
if (!beetle._animator.isAnimating()){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_POSE]);
return;
};
};
_local1 = (Math.floor((GameData._groundY - beetle.sprite.y)) / 8);
beetle.offsetPosition(0, _local1);
if ((GameData._groundY - beetle._y) < 3){
_landed = true;
return;
};
if ((GameData._groundY - beetle._y) < 50){
beetle.startAnimating(BlueBeetle.ANIM_LAND);
};
}
public function toString():String{
return ("Beetle_Land()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 48
//Beetle_Pose (Game.AIStates.Beetle_Pose)
package Game.AIStates {
import Base.*;
import Game.*;
public class Beetle_Pose extends AIState {
var timer:int;
var hero:Hero;
var STATE_DURATION;// = 45
var beetle:BlueBeetle;
public function Beetle_Pose(_arg1:GameEntry, _arg2:BlueBeetle){
STATE_DURATION = 45;
super(_arg1);
beetle = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(("@ --> ENTER " + this));
beetle.startAnimating(BlueBeetle.ANIM_POSE);
beetle.moveTo(beetle._x, GameData._groundY);
timer = 0;
snd.playSoundByEvent(SoundData.BEETLE_POSE);
}
override public function Update():void{
timer++;
beetle.updateAnimation();
if (timer > STATE_DURATION){
beetle.setNextState(beetle.AIStates[BlueBeetle.STATE_LEAVES]);
};
}
public function toString():String{
return ("Beetle_Pose()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 49
//BigEnemy_Attack_Melee (Game.AIStates.BigEnemy_Attack_Melee)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Attack_Melee extends AIState {
var timer:int;
var enemy:BigEnemy;
var hero:Hero;
var uppercut:Boolean;
public function BigEnemy_Attack_Melee(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._hitBatman = false;
enemy._isMoving = false;
enemy._isAttacking = true;
enemy.startAnimating(BigEnemy.ANIM_MELEE);
enemy._lastAttackTime = gameData._gameTimer;
timer = 0;
}
override public function Update():void{
timer++;
enemy.updateAnimation();
if (enemy._punched){
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
return;
};
if (timer > BigEnemy.MELEE_DURATION){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_IDLE]);
};
}
public function toString():String{
return ("BigEnemy_Attack_Melee()");
}
override public function Exit():void{
enemy._isAttacking = false;
}
}
}//package Game.AIStates
Section 50
//BigEnemy_Dead (Game.AIStates.BigEnemy_Dead)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Dead extends AIState {
var enemy:BigEnemy;
var hero:Hero;
public function BigEnemy_Dead(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
if (enemy._isProne){
trace("...prone");
enemy.startAnimating(BigEnemy.ANIM_DEAD_PRONE);
} else {
trace("...standing");
enemy.startAnimating(BigEnemy.ANIM_DEAD_STANDING);
};
enemy._isWalking = false;
enemy._isMoving = false;
enemy._isProne = false;
enemy._inAir = false;
enemy._punched = false;
gameData._tokenManager.spawnTokens(10, enemy._x, (enemy._y - 120));
gameData._killCounter++;
gameData._hero._mostRecentEnemy = null;
gameData.addScore(GameData.SCORE_BIGENEMY_DEFEAT);
}
override public function Update():void{
enemy.updateAnimation();
if (!enemy._animator.isAnimating()){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_INACTIVE]);
};
}
public function toString():String{
return ("BigEnemy_Dead()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 51
//BigEnemy_Hit (Game.AIStates.BigEnemy_Hit)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Hit extends AIState {
var timer:int;
var enemy:BigEnemy;
var hero:Hero;
public function BigEnemy_Hit(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(BigEnemy.ANIM_HIT);
enemy._isWalking = false;
timer = 0;
enemy.showHealthBar();
if (enemy._knockback){
trace("*** knockback ***");
if (enemy._isFacingRight){
enemy._xvel = -20;
} else {
enemy._xvel = 20;
};
};
}
override public function Update():void{
if (enemy._health <= 0){
trace("%%% enemy dead %%%");
enemy.setNextState(enemy.AIStates[Enemy.STATE_DEAD]);
return;
};
timer++;
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_AIR]);
return;
};
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_PRONE]);
return;
};
if (enemy._knockback){
if (enemy._isFacingRight){
enemy._xvel = (enemy._xvel + 2);
if (enemy._xvel >= 0){
enemy._xvel = 0;
enemy._knockback = false;
};
} else {
enemy._xvel = (enemy._xvel - 2);
if (enemy._xvel <= 0){
enemy._xvel = 0;
enemy._knockback = false;
};
};
enemy.offsetPosition(enemy._xvel, 0);
};
enemy.updateAnimation();
if (((!(enemy._knockback)) && ((timer > Enemy.HIT_DURATION)))){
enemy._punched = false;
enemy.setNextState(enemy.AIStates[Enemy.STATE_IDLE]);
return;
};
}
public function toString():String{
return ("BigEnemy_Hit()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 52
//BigEnemy_Idle (Game.AIStates.BigEnemy_Idle)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Idle extends AIState {
var enemy:BigEnemy;
var hero:Hero;
var _startTime:int;
var uppercut:Boolean;
public function BigEnemy_Idle(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
var _local1:Number;
var _local2:*;
_local1 = (hero._x - enemy._x);
if (Math.abs(_local1) > Enemy.STOP_DISTANCE){
enemy._isMoving = true;
enemy._isWalking = true;
} else {
if ((gameData._gameTimer - enemy._lastAttackTime) >= enemy._attackRecharge_melee){
if (!hero._isStunned){
_local2 = (Math.random() * 0.5);
if ((gameData._gameTimer - _startTime) > (gameData._decisionTime + _local2)){
enemy._isAttacking = true;
};
};
};
};
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._isMoving = false;
enemy._isAttacking = false;
enemy.moveTo(enemy._x, GameData._groundY);
enemy.startAnimating(BigEnemy.ANIM_IDLE);
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
} else {
enemy.sprite.scaleX = -1;
};
enemy._juggleCount = 0;
_startTime = gameData._gameTimer;
}
override public function Update():void{
enemy.updateAnimation();
enemy.faceHero();
if (enemy._punched){
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_PRONE]);
} else {
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_HIT]);
};
return;
};
if (enemy._isAttacking){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_ATTACK_MELEE]);
return;
};
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_AIR]);
return;
};
if (enemy._isMoving){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_WALK]);
return;
};
}
public function toString():String{
return ("BigEnemy_Idle()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 53
//BigEnemy_Inactive (Game.AIStates.BigEnemy_Inactive)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Inactive extends AIState {
var enemy:BigEnemy;
public function BigEnemy_Inactive(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._active = false;
enemy._punched = false;
enemy._knockback = false;
enemy.moveTo(-200, -200);
enemy._recycle = false;
}
override public function Update():void{
if (enemy._recycle){
enemy._recycle = false;
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_WALK]);
};
}
public function toString():String{
return ("BigEnemy_Inactive()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 54
//BigEnemy_InAir (Game.AIStates.BigEnemy_InAir)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_InAir extends AIState {
var enemy:BigEnemy;
var hero:Hero;
public function BigEnemy_InAir(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(BigEnemy.ANIM_AIR);
enemy._isWalking = false;
enemy.offsetPosition(0, -1);
if (enemy._isFacingRight){
enemy._xvel = -3;
} else {
enemy._xvel = 3;
};
enemy.showHealthBar("Air");
}
override public function Update():void{
enemy._yvel = (enemy._yvel + GameData._gravityJuggled);
enemy.updateAnimation();
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
} else {
enemy.sprite.scaleX = -1;
};
enemy.offsetPosition(enemy._xvel, enemy._yvel);
if (enemy._x < 60){
enemy.moveTo(60, enemy._y);
};
if (enemy._x > 540){
enemy.moveTo(540, enemy._y);
};
if (enemy._y >= GameData._groundY){
enemy._xvel = 0;
enemy._yvel = 0;
enemy._inAir = false;
enemy._isProne = true;
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_PRONE]);
enemy.moveTo(enemy._x, GameData._groundY);
};
}
public function toString():String{
return ("BigEnemy_InAir()");
}
override public function Exit():void{
enemy.hideHealthBar();
}
}
}//package Game.AIStates
Section 55
//BigEnemy_Prone (Game.AIStates.BigEnemy_Prone)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Prone extends AIState {
var timer;
var enemy:BigEnemy;
var hero:Hero;
public function BigEnemy_Prone(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(BigEnemy.ANIM_PRONE);
enemy._isWalking = false;
enemy._inAir = false;
timer = 0;
enemy.showHealthBar("Prone");
}
override public function Update():void{
timer++;
enemy.updateAnimation();
if (enemy._health <= 0){
trace("%%% enemy dead %%%");
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_DEAD]);
return;
};
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
return;
};
if (timer > 50){
enemy._isProne = false;
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_IDLE]);
};
enemy._yvel = (enemy._yvel + GameData._gravity);
enemy.offsetPosition(0, enemy._yvel);
if (enemy._y >= GameData._groundY){
enemy._xvel = 0;
enemy._yvel = 0;
enemy.moveTo(enemy._x, GameData._groundY);
};
}
public function toString():String{
return ("BigEnemy_Prone()");
}
override public function Exit():void{
enemy._punched = false;
enemy._knockback = false;
enemy.hideHealthBar();
}
}
}//package Game.AIStates
Section 56
//BigEnemy_Walk (Game.AIStates.BigEnemy_Walk)
package Game.AIStates {
import Base.*;
import Game.*;
public class BigEnemy_Walk extends AIState {
var timer:int;
var enemy:BigEnemy;
var hero:Hero;
public function BigEnemy_Walk(_arg1:GameEntry, _arg2:BigEnemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
var _local1:Number;
var _local2:Boolean;
_local1 = (hero._x - enemy._x);
if (_local1 > 0){
enemy._isFacingRight = true;
} else {
enemy._isFacingRight = false;
};
_local2 = (((enemy._x > 50)) && ((enemy._x < 550)));
if (Math.abs(_local1) < 80){
enemy._isMoving = false;
enemy._isWalking = false;
};
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(BigEnemy.ANIM_WALK);
enemy._isWalking = true;
enemy.moveTo(enemy._x, GameData._groundY);
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
} else {
enemy.sprite.scaleX = -1;
};
}
override public function Update():void{
timer++;
enemy.updateAnimation();
if (enemy._punched){
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_PRONE]);
} else {
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_HIT]);
};
return;
};
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_AIR]);
return;
};
if (enemy._isMoving){
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
enemy.offsetPosition(BigEnemy._xvelWalk, 0);
} else {
enemy.sprite.scaleX = -1;
enemy.offsetPosition(-(BigEnemy._xvelWalk), 0);
};
if (enemy._isAttacking){
};
} else {
enemy.setNextState(enemy.AIStates[BigEnemy.STATE_IDLE]);
};
}
public function toString():String{
return ("BigEnemy_Walk()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 57
//Enemy_Attack_Melee (Game.AIStates.Enemy_Attack_Melee)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Attack_Melee extends AIState {
var timer:int;
var enemy:Enemy;
var hero:Hero;
var uppercut:Boolean;
public function Enemy_Attack_Melee(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._hitBatman = false;
enemy._isMoving = false;
enemy._isAttacking = true;
enemy.startAnimating(Enemy.ANIM_MELEE);
enemy._lastAttackTime = gameData._gameTimer;
timer = 0;
}
override public function Update():void{
timer++;
enemy.updateAnimation();
if (enemy._punched){
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
return;
};
if (timer > Enemy.MELEE_DURATION){
enemy.setNextState(enemy.AIStates[Enemy.STATE_IDLE]);
};
}
public function toString():String{
return ("Enemy_Attack_Melee()");
}
override public function Exit():void{
enemy._isAttacking = false;
}
}
}//package Game.AIStates
Section 58
//Enemy_Attack_Shoot (Game.AIStates.Enemy_Attack_Shoot)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Attack_Shoot extends AIState {
var timer:int;
var enemy:Enemy;
var hero;
var shotFired:Boolean;
public function Enemy_Attack_Shoot(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._hitBatman = false;
enemy._isMoving = false;
enemy._isAttacking = true;
enemy.startAnimating(Enemy.ANIM_SHOOT);
timer = 0;
shotFired = false;
}
override public function Update():void{
var _local1:*;
timer++;
enemy.updateAnimation();
if ((((timer > 20)) && (!(shotFired)))){
trace(">>shoot!");
_local1 = (-1 + (2 * int(enemy._isFacingRight)));
gameData.spawnBullet((enemy._x - (_local1 * 10)), (enemy._y - 109), (20 * _local1));
shotFired = true;
enemy._lastAttackTime = gameData._gameTimer;
if (Math.random() < 0.5){
snd.playSoundByEvent(SoundData.ENEMY_RANGED_ATTACK1);
} else {
snd.playSoundByEvent(SoundData.ENEMY_RANGED_ATTACK2);
};
};
if (((shotFired) && ((timer > 100)))){
enemy.setNextState(enemy.AIStates[Enemy.STATE_IDLE]);
};
if (enemy._punched){
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[Enemy.STATE_PRONE]);
} else {
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
};
return;
};
}
public function toString():String{
return ("Enemy_Attack_Shoot()");
}
override public function Exit():void{
enemy._isAttacking = false;
enemy._isShooting = false;
}
}
}//package Game.AIStates
Section 59
//Enemy_Dead (Game.AIStates.Enemy_Dead)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Dead extends AIState {
var enemy:Enemy;
var hero:Hero;
public function Enemy_Dead(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
if (enemy._isProne){
trace("...prone");
enemy.startAnimating(Enemy.ANIM_DEAD_PRONE);
} else {
trace("...standing");
enemy.startAnimating(Enemy.ANIM_DEAD_STANDING);
};
enemy._isWalking = false;
enemy._isMoving = false;
enemy._isProne = false;
enemy._inAir = false;
enemy._punched = false;
gameData._tokenManager.spawnTokens(5, enemy._x, (enemy._y - 120));
gameData._killCounter++;
gameData.addScore((GameData.SCORE_ENEMY_DEFEAT * gameData._comboCount));
gameData._hero._mostRecentEnemy = null;
snd.playSoundByEvent(SoundData.ENEMY_DEATH);
}
override public function Update():void{
enemy.updateAnimation();
if (!enemy._animator.isAnimating()){
enemy.setNextState(enemy.AIStates[Enemy.STATE_INACTIVE]);
};
}
public function toString():String{
return ("Enemy_Dead()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 60
//Enemy_Hit (Game.AIStates.Enemy_Hit)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Hit extends AIState {
var timer:int;
var enemy:Enemy;
var hero:Hero;
public function Enemy_Hit(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(Enemy.ANIM_HIT);
enemy._isWalking = false;
timer = 0;
enemy.showHealthBar();
if (enemy._knockback){
trace("*** knockback ***");
if (enemy._isFacingRight){
enemy._xvel = -20;
} else {
enemy._xvel = 20;
};
};
}
override public function Update():void{
if (enemy._health <= 0){
trace("%%% enemy dead %%%");
enemy.setNextState(enemy.AIStates[Enemy.STATE_DEAD]);
return;
};
timer++;
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[Enemy.STATE_AIR]);
return;
};
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[Enemy.STATE_PRONE]);
return;
};
if (enemy._knockback){
if (enemy._isFacingRight){
enemy._xvel = (enemy._xvel + 2);
if (enemy._xvel >= 0){
enemy._xvel = 0;
enemy._knockback = false;
};
} else {
enemy._xvel = (enemy._xvel - 2);
if (enemy._xvel <= 0){
enemy._xvel = 0;
enemy._knockback = false;
};
};
enemy.offsetPosition(enemy._xvel, 0);
};
enemy.updateAnimation();
if (((!(enemy._knockback)) && ((timer > Enemy.HIT_DURATION)))){
enemy._punched = false;
enemy.setNextState(enemy.AIStates[Enemy.STATE_IDLE]);
return;
};
}
public function toString():String{
return ("Enemy_Hit()");
}
override public function Exit():void{
if (!enemy._isProne){
enemy._healthBar.visible = false;
};
}
}
}//package Game.AIStates
Section 61
//Enemy_Idle (Game.AIStates.Enemy_Idle)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Idle extends AIState {
var enemy:Enemy;
var hero;
var _startTime:Number;
var uppercut:Boolean;
public function Enemy_Idle(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
var _local1:Number;
var _local2:*;
_local1 = (hero._x - enemy._x);
if (Math.abs(_local1) > Enemy.STOP_DISTANCE){
enemy._isMoving = true;
enemy._isWalking = true;
} else {
if ((gameData._gameTimer - enemy._lastAttackTime) >= enemy._attackRecharge_melee){
if (!hero._isStunned){
_local2 = (Math.random() * 0.5);
if ((gameData._gameTimer - _startTime) > (gameData._decisionTime + _local2)){
enemy._isAttacking = true;
};
};
};
};
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._isMoving = false;
enemy._isAttacking = false;
enemy.moveTo(enemy._x, GameData._groundY);
enemy.startAnimating(Enemy.ANIM_IDLE);
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
} else {
enemy.sprite.scaleX = -1;
};
enemy._juggleCount = 0;
_startTime = gameData._gameTimer;
}
override public function Update():void{
enemy.updateAnimation();
enemy.faceHero();
if (enemy._punched){
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[Enemy.STATE_PRONE]);
} else {
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
};
return;
};
if (enemy._isAttacking){
enemy.setNextState(enemy.AIStates[Enemy.STATE_ATTACK_MELEE]);
return;
};
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[Enemy.STATE_AIR]);
return;
};
if (enemy._isMoving){
enemy.setNextState(enemy.AIStates[Enemy.STATE_WALK]);
return;
};
}
public function toString():String{
return ("Enemy_Idle()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 62
//Enemy_Inactive (Game.AIStates.Enemy_Inactive)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Inactive extends AIState {
var enemy:Enemy;
public function Enemy_Inactive(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy._active = false;
enemy._punched = false;
enemy._knockback = false;
enemy._isShooting = false;
enemy.moveTo(-200, -200);
enemy.hideHealthBar();
enemy._recycle = false;
}
override public function Update():void{
if (enemy._recycle){
enemy._recycle = false;
enemy.setNextState(enemy.AIStates[Enemy.STATE_WALK]);
};
}
public function toString():String{
return ("Enemy_Inactive()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 63
//Enemy_InAir (Game.AIStates.Enemy_InAir)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_InAir extends AIState {
var enemy:Enemy;
var hero:Hero;
public function Enemy_InAir(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(Enemy.ANIM_AIR);
enemy._isWalking = false;
enemy.offsetPosition(0, -1);
if (enemy._isFacingRight){
enemy._xvel = -3;
} else {
enemy._xvel = 3;
};
enemy.showHealthBar("Air");
snd.playSoundByEvent(SoundData.ENEMY_GRUNT1);
snd.playSoundByEvent(SoundData.ENEMY_AIRBOURNE);
}
override public function Update():void{
enemy._yvel = (enemy._yvel + GameData._gravityJuggled);
enemy.updateAnimation();
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
} else {
enemy.sprite.scaleX = -1;
};
enemy.offsetPosition(enemy._xvel, enemy._yvel);
if (enemy._x < 60){
enemy.moveTo(60, enemy._y);
};
if (enemy._x > 540){
enemy.moveTo(540, enemy._y);
};
if (enemy._y >= GameData._groundY){
enemy._xvel = 0;
enemy._yvel = 0;
enemy._inAir = false;
enemy._isProne = true;
enemy.setNextState(enemy.AIStates[Enemy.STATE_PRONE]);
enemy.moveTo(enemy._x, GameData._groundY);
};
}
public function toString():String{
return ("Enemy_InAir()");
}
override public function Exit():void{
enemy.hideHealthBar();
}
}
}//package Game.AIStates
Section 64
//Enemy_Prone (Game.AIStates.Enemy_Prone)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Prone extends AIState {
var timer;
var enemy:Enemy;
var hero:Hero;
public function Enemy_Prone(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(Enemy.ANIM_PRONE);
enemy._isWalking = false;
enemy._inAir = false;
enemy.showHealthBar("Prone");
timer = 0;
snd.playSoundByEvent(SoundData.ENEMY_HIT_GROUND);
}
override public function Update():void{
timer++;
enemy.updateAnimation();
if (enemy._health <= 0){
trace("%%% enemy dead %%%");
enemy.setNextState(enemy.AIStates[Enemy.STATE_DEAD]);
return;
};
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
return;
};
if (timer > 50){
enemy._isProne = false;
enemy.setNextState(enemy.AIStates[Enemy.STATE_IDLE]);
};
enemy._yvel = (enemy._yvel + GameData._gravity);
enemy.offsetPosition(0, enemy._yvel);
if (enemy._y >= GameData._groundY){
enemy._xvel = 0;
enemy._yvel = 0;
enemy.moveTo(enemy._x, GameData._groundY);
};
}
public function toString():String{
return ("Enemy_Prone()");
}
override public function Exit():void{
enemy._punched = false;
enemy._knockback = false;
enemy._healthBar.visible = false;
}
}
}//package Game.AIStates
Section 65
//Enemy_Walk (Game.AIStates.Enemy_Walk)
package Game.AIStates {
import Base.*;
import Game.*;
public class Enemy_Walk extends AIState {
var timer:int;
var enemy:Enemy;
var hero:Hero;
public function Enemy_Walk(_arg1:GameEntry, _arg2:Enemy){
super(_arg1);
enemy = _arg2;
hero = gameData._hero;
}
override public function CPUDecision():void{
var _local1:Number;
var _local2:Boolean;
_local1 = (hero._x - enemy._x);
if (_local1 > 0){
enemy._isFacingRight = true;
} else {
enemy._isFacingRight = false;
};
_local2 = (((enemy._x > 50)) && ((enemy._x < 550)));
if (((_local2) && ((Math.abs(_local1) > 300)))){
if ((gameData._gameTimer - enemy._lastAttackTime) >= gameData._attackRecharge){
if (gameData._gunsEnabled){
enemy._isShooting = true;
return;
};
};
};
if (Math.abs(_local1) < Enemy.STOP_DISTANCE){
enemy._isMoving = false;
enemy._isWalking = false;
};
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + enemy.getID()));
enemy.startAnimating(Enemy.ANIM_WALK);
enemy._isWalking = true;
enemy.moveTo(enemy._x, GameData._groundY);
if (enemy._isFacingRight){
enemy.sprite.scaleX = 1;
} else {
enemy.sprite.scaleX = -1;
};
}
override public function Update():void{
timer++;
enemy.faceHero();
enemy.updateAnimation();
if (enemy._isShooting){
enemy.setNextState(enemy.AIStates[Enemy.STATE_ATTACK_SHOOT]);
return;
};
if (enemy._punched){
if (enemy._isProne){
enemy.setNextState(enemy.AIStates[Enemy.STATE_PRONE]);
} else {
enemy.setNextState(enemy.AIStates[Enemy.STATE_HIT]);
};
return;
};
if (enemy._inAir){
enemy.setNextState(enemy.AIStates[Enemy.STATE_AIR]);
return;
};
if (enemy._isMoving){
if (enemy._isFacingRight){
enemy.offsetPosition(Enemy._xvelWalk, 0);
} else {
enemy.offsetPosition(-(Enemy._xvelWalk), 0);
};
} else {
enemy.setNextState(enemy.AIStates[Enemy.STATE_IDLE]);
};
}
public function toString():String{
return ("Enemy_Walk()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 66
//Hero_Attack_BeltSword (Game.AIStates.Hero_Attack_BeltSword)
package Game.AIStates {
import Base.*;
import flash.utils.*;
import Game.*;
public class Hero_Attack_BeltSword extends AIState {
var hero:Hero;
var playedSound:Boolean;
var hitEnemy:Boolean;
public function Hero_Attack_BeltSword(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hitEnemy = false;
hero.startAnimating(Hero.ANIM_BELTSWORD);
playedSound = false;
snd.playFromGroup(SoundData.GROUP_HERO_SWING);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
}
override public function Update():void{
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = gameData.checkBatAttackCollision();
if (_local1.length != 0){
_local3 = 0;
while (_local3 < _local1.length) {
_local4 = _local1[_local3];
if (!_local4._collide){
} else {
trace("*** HERO HIT ENEMY : BELTSWORD ***");
hitEnemy = true;
hero._lastHitTime = gameData._gameTimer;
_local4.takeDamage(Hero.DAMAGE_BELTSWORD);
_local4._punched = true;
_local4._collide = false;
_local4._knockback = true;
gameData.hitSpark();
gameData._comboCount++;
gameData.addScore((GameData.SCORE_BELT_HIT * gameData._comboCount));
if (_local4._inAir){
_local4._juggleCount++;
_local4._yvel = ((4 - _local4._juggleCount) * -5);
};
};
_local3++;
};
};
if (((hitEnemy) && (!(playedSound)))){
snd.playFromGroup(SoundData.GROUP_HERO_PUNCH);
playedSound = true;
};
_local2 = gameData.checkEnemyAttackCollision();
if ((((_local2 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
hero.updateAnimation();
if (!hero._animator.isAnimating()){
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
hero._isAttacking = false;
};
}
public function toString():String{
return ("Hero_Attack_BeltSword()");
}
override public function Exit():void{
gameData.setEnemiesCollide();
}
}
}//package Game.AIStates
Section 67
//Hero_Attack_FootSweep (Game.AIStates.Hero_Attack_FootSweep)
package Game.AIStates {
import Base.*;
import flash.utils.*;
import Game.*;
public class Hero_Attack_FootSweep extends AIState {
var hero:Hero;
var playedSound:Boolean;
var hitEnemy:Boolean;
public function Hero_Attack_FootSweep(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero.startAnimating(Hero.ANIM_FOOTSWEEP);
snd.playSoundByEvent(SoundData.HERO_SLIDE);
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
hero._isMoving = false;
hitEnemy = false;
if (hero._isFacingRight){
hero._xvel = 20;
} else {
hero._xvel = -20;
};
playedSound = false;
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
if ((((pad.getCurrentKeyAction() == "Down")) || ((pad.getCurrentKeyActionHeld() == "Down")))){
hero._isCrouching = true;
} else {
hero._isCrouching = false;
};
}
override public function Update():void{
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
gameData._tokenManager.checkCollision();
hero.updateAnimation();
_local1 = gameData.checkBatAttackCollision();
if (_local1.length != 0){
_local3 = 0;
while (_local3 < _local1.length) {
_local4 = _local1[_local3];
if (!_local4._collide){
} else {
trace("*** HERO HIT ENEMY : FOOTSWEEP ***");
hitEnemy = true;
hero._lastHitTime = gameData._gameTimer;
_local4.takeDamage(Hero.DAMAGE_FOOTSWEEP);
_local4._punched = true;
_local4._isProne = true;
_local4._collide = false;
_local4._yvel = -10;
gameData.hitSpark();
gameData._comboCount++;
gameData.addScore((GameData.SCORE_FOOTSWEEP_HIT * gameData._comboCount));
};
_local3++;
};
};
if (((hitEnemy) && (!(playedSound)))){
snd.playSoundByEvent(SoundData.HERO_KICK4);
playedSound = true;
};
_local2 = gameData.checkEnemyAttackCollision();
if ((((_local2 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
if (hero._isFacingRight){
hero._xvel = (hero._xvel - 2);
} else {
hero._xvel = (hero._xvel + 2);
};
hero.offsetPosition(hero._xvel, 0);
if (hero._xvel == 0){
if (hero._isCrouching){
hero.setNextState(hero.AIStates[Hero.STATE_DUCK]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
};
};
}
public function toString():String{
return ("Hero_Attack_FootSweep()");
}
override public function Exit():void{
hero._isAttacking = false;
gameData.setEnemiesCollide();
}
}
}//package Game.AIStates
Section 68
//Hero_Attack_JumpKick (Game.AIStates.Hero_Attack_JumpKick)
package Game.AIStates {
import Base.*;
import flash.utils.*;
import Game.*;
public class Hero_Attack_JumpKick extends AIState {
var hero:Hero;
var hitEnemy:Boolean;
public function Hero_Attack_JumpKick(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hitEnemy = false;
hero.startAnimating(Hero.ANIM_JUMPKICK);
snd.playFromGroup(SoundData.GROUP_HERO_SWING);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
}
override public function Update():void{
var _local1:Array;
var _local2:*;
var _local3:*;
_local1 = gameData.checkBatAttackCollision();
if (_local1.length != 0){
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = _local1[_local2];
if (!_local3._collide){
} else {
trace("*** HERO HIT ENEMY : JUMPKICK ***");
hitEnemy = true;
hero._lastHitTime = gameData._gameTimer;
_local3.takeDamage(Hero.DAMAGE_JUMPKICK);
_local3._punched = true;
_local3._collide = false;
gameData.hitSpark();
gameData._comboCount++;
gameData.addScore((GameData.SCORE_JUMPKICK_HIT * gameData._comboCount));
};
_local2++;
};
};
if (hitEnemy){
snd.playFromGroup(SoundData.GROUP_HERO_KICK);
};
hero.updateAnimation();
hero._yvel = (hero._yvel + GameData._gravity);
if (hero._isMoving){
if (hero._isFacingRight){
if (hero._isWalking){
hero.offsetPosition(Hero._xvelWalk, hero._yvel);
} else {
hero.offsetPosition(Hero._xvelRun, hero._yvel);
};
} else {
if (hero._isWalking){
hero.offsetPosition(-(Hero._xvelWalk), hero._yvel);
} else {
hero.offsetPosition(-(Hero._xvelRun), hero._yvel);
};
};
} else {
hero.offsetPosition(0, hero._yvel);
};
if (hero._y >= GameData._groundY){
hero._yvel = 0;
if (hero._isMoving){
if (hero._isWalking){
hero.setNextState(hero.AIStates[Hero.STATE_WALK]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_RUN]);
};
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
};
};
}
public function toString():String{
return ("Hero_Attack_JumpKick()");
}
override public function Exit():void{
hero._isJumping = false;
gameData.setEnemiesCollide();
}
}
}//package Game.AIStates
Section 69
//Hero_Attack_LeftJab (Game.AIStates.Hero_Attack_LeftJab)
package Game.AIStates {
import Base.*;
import flash.utils.*;
import Game.*;
public class Hero_Attack_LeftJab extends AIState {
var timer:Number;
var hero:Hero;
var playedSound:Boolean;
var jump:Boolean;
var hitEnemy:Boolean;
var doubleAttack:Boolean;
public function Hero_Attack_LeftJab(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
timer = 0;
jump = false;
doubleAttack = false;
hitEnemy = false;
playedSound = false;
hero.startAnimating(Hero.ANIM_LEFTJAB);
if (pad.getCurrentKeyAction() == "Up"){
jump = true;
trace("*** UPPERCUT ***");
};
snd.playFromGroup(SoundData.GROUP_HERO_SWING);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
if (pad.getCurrentKeyAction() == "Attack"){
doubleAttack = true;
};
if (pad.getCurrentKeyAction() == "Up"){
jump = true;
trace("*** UPPERCUT ***");
};
}
override public function Update():void{
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = gameData.checkBatAttackCollision();
if (_local1.length != 0){
_local3 = 0;
while (_local3 < _local1.length) {
_local4 = _local1[_local3];
if (!_local4._collide){
} else {
trace("*** HERO HIT ENEMY : JAB ***");
hitEnemy = true;
hero._lastHitTime = gameData._gameTimer;
_local4.takeDamage(Hero.DAMAGE_JAB);
_local4._punched = true;
_local4._collide = false;
gameData.hitSpark();
gameData.addScore((GameData.SCORE_JAB_HIT * gameData._comboCount));
gameData._comboCount++;
if (_local4._inAir){
_local4._juggleCount++;
_local4._yvel = ((4 - _local4._juggleCount) * -5);
};
};
_local3++;
};
};
if (((hitEnemy) && (!(playedSound)))){
_local5 = Math.random();
snd.playFromGroup(SoundData.GROUP_HERO_PUNCH);
playedSound = true;
};
_local2 = gameData.checkEnemyAttackCollision();
if ((((_local2 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
if ((((timer < 1)) && (jump))){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_UPKNEE]);
return;
};
timer++;
hero.updateAnimation();
if (!hero._animator.isAnimating()){
if (doubleAttack){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_RIGHTCROSS]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
hero._isAttacking = false;
};
};
}
public function toString():String{
return ("Hero_Attack_LeftJab()");
}
override public function Exit():void{
hero._isJumping = false;
gameData.setEnemiesCollide();
}
}
}//package Game.AIStates
Section 70
//Hero_Attack_RightCross (Game.AIStates.Hero_Attack_RightCross)
package Game.AIStates {
import Base.*;
import flash.utils.*;
import Game.*;
public class Hero_Attack_RightCross extends AIState {
var timer:Number;
var tripleAttack:Boolean;
var hero:Hero;
var playedSound:Boolean;
var hitEnemy:Boolean;
public function Hero_Attack_RightCross(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
timer = 0;
tripleAttack = false;
hero.startAnimating(Hero.ANIM_RIGHTCROSS);
hitEnemy = false;
playedSound = false;
snd.playFromGroup(SoundData.GROUP_HERO_SWING);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
if (pad.getCurrentKeyAction() == "Attack"){
tripleAttack = true;
};
}
override public function Update():void{
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = gameData.checkBatAttackCollision();
if (_local1.length != 0){
_local3 = 0;
while (_local3 < _local1.length) {
_local4 = _local1[_local3];
if (!_local4._collide){
} else {
trace("*** HERO HIT ENEMY : RIGHT CROSS ***");
hitEnemy = true;
hero._lastHitTime = gameData._gameTimer;
_local4.takeDamage(Hero.DAMAGE_RIGHTCROSS);
_local4._punched = true;
_local4._collide = false;
gameData.hitSpark();
gameData._comboCount++;
gameData.addScore((GameData.SCORE_RIGHT_HIT * gameData._comboCount));
if (_local4._inAir){
_local4._juggleCount++;
_local4._yvel = ((4 - _local4._juggleCount) * -5);
};
};
_local3++;
};
};
if (((hitEnemy) && (!(playedSound)))){
snd.playFromGroup(SoundData.GROUP_HERO_PUNCH);
playedSound = true;
};
_local2 = gameData.checkEnemyAttackCollision();
if ((((_local2 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
timer++;
hero.updateAnimation();
if (!hero._animator.isAnimating()){
if (tripleAttack){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_BELTSWORD]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
hero._isAttacking = false;
};
};
}
public function toString():String{
return ("Hero_Attack_RightCross()");
}
override public function Exit():void{
hero._isJumping = false;
gameData.setEnemiesCollide();
}
}
}//package Game.AIStates
Section 71
//Hero_Attack_UpKnee (Game.AIStates.Hero_Attack_UpKnee)
package Game.AIStates {
import Base.*;
import flash.utils.*;
import Game.*;
public class Hero_Attack_UpKnee extends AIState {
var hero:Hero;
var playedSound:Boolean;
var hitEnemy:Boolean;
public function Hero_Attack_UpKnee(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero._isJumping = false;
hitEnemy = false;
playedSound = false;
hero.startAnimating(Hero.ANIM_UPKNEE);
snd.playFromGroup(SoundData.GROUP_HERO_SWING);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
}
override public function Update():void{
var _local1:Object;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = gameData.checkBatAttackCollision();
if (_local1.length != 0){
_local3 = 0;
while (_local3 < _local1.length) {
_local4 = _local1[_local3];
if (!_local4._collide){
} else {
trace("*** HERO HIT ENEMY : KNEE ***");
hitEnemy = true;
hero._lastHitTime = gameData._gameTimer;
_local4.takeDamage(Hero.DAMAGE_UPKNEE);
_local4._punched = true;
_local4._inAir = true;
_local4._collide = false;
_local4._juggleCount++;
gameData.addScore((GameData.SCORE_KNEE_HIT * gameData._comboCount));
if (_local4._juggleCount < 5){
_local4._yvel = ((4 - _local4._juggleCount) * -7);
};
gameData.hitSpark("up");
gameData._comboCount++;
};
_local3++;
};
};
if (((hitEnemy) && (!(playedSound)))){
snd.playFromGroup(SoundData.GROUP_HERO_KICK);
playedSound = true;
};
_local2 = gameData.checkEnemyAttackCollision();
if ((((_local2 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
hero.updateAnimation();
if (!hero._animator.isAnimating()){
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
hero._isAttacking = false;
};
}
public function toString():String{
return ("Hero_Attack_UpKnee()");
}
override public function Exit():void{
gameData.setEnemiesCollide();
}
}
}//package Game.AIStates
Section 72
//Hero_Defeat (Game.AIStates.Hero_Defeat)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Defeat extends AIState {
var timer:int;
var hero:Hero;
public function Hero_Defeat(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
trace(((("@ --> ENTER " + this) + " | ") + hero.getID()));
hero.startAnimating(Hero.ANIM_DEFEAT);
timer = 0;
}
override public function PadInput():void{
}
override public function Update():void{
timer++;
hero.updateAnimation();
if (timer == 100){
gameData._gameOver = true;
};
if (hero._recycle){
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
};
}
public function toString():String{
return ("Hero_Defeat()");
}
override public function Exit():void{
trace(((("@ <-- EXIT " + this) + " | ") + hero.getID()));
hero._isStunned = false;
}
}
}//package Game.AIStates
Section 73
//Hero_Duck (Game.AIStates.Hero_Duck)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Duck extends AIState {
var hero:Hero;
public function Hero_Duck(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero.startAnimating(Hero.ANIM_DUCK);
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
snd.playSoundByEvent(SoundData.HERO_DUCK);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
if ((((pad.getCurrentKeyAction() == "MoveRight")) || ((pad.getCurrentKeyActionHeld() == "MoveRight")))){
hero._isFacingRight = true;
};
if ((((pad.getCurrentKeyAction() == "MoveLeft")) || ((pad.getCurrentKeyActionHeld() == "MoveLeft")))){
hero._isFacingRight = false;
};
if ((((pad.getCurrentKeyAction() == "Attack")) || ((pad.getCurrentKeyActionHeld() == "Attack")))){
hero._isAttacking = true;
};
if ((((pad.getCurrentKeyAction() == "Down")) || ((pad.getCurrentKeyActionHeld() == "Down")))){
hero._isCrouching = true;
} else {
if (pad.getCurrentKeyAction() == "Up"){
hero._isCrouching = true;
} else {
hero._isCrouching = false;
};
};
}
override public function Update():void{
var _local1:*;
hero.updateAnimation();
_local1 = gameData.checkEnemyAttackCollision();
if ((((_local1 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
return;
};
if (hero._isJumping){
hero.setNextState(hero.AIStates[Hero.STATE_JUMP]);
return;
};
if (hero._isCrouching){
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
if (hero._isAttacking){
trace("attacking...");
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_FOOTSWEEP]);
};
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
hero._isCrouching = false;
};
}
public function toString():String{
return ("Hero_Duck()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 74
//Hero_Idle (Game.AIStates.Hero_Idle)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Idle extends AIState {
var hero:Hero;
var uppercut:Boolean;
public function Hero_Idle(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero._recycle = false;
hero._isMoving = false;
hero._isWalking = false;
hero._isAttacking = false;
hero._isStunned = false;
uppercut = false;
hero.startAnimating(Hero.ANIM_IDLE);
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
}
override public function PadInput():void{
if (GameData.CHEATS_ENABLED){
if (pad.getCurrentKeyAction() == "AddHealth"){
hero.addHealth(25);
};
if (pad.getCurrentKeyAction() == "MoreDifficult"){
gameData._killCounter++;
};
if (pad.getCurrentKeyAction() == "LessDifficult"){
gameData._killCounter--;
};
if (pad.getCurrentKeyAction() == "Die"){
hero.takeDamage(100);
};
};
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
if ((((pad.getCurrentKeyAction() == "MoveRight")) || ((pad.getCurrentKeyActionHeld() == "MoveRight")))){
hero._isFacingRight = true;
hero._isMoving = true;
};
if ((((pad.getCurrentKeyAction() == "MoveLeft")) || ((pad.getCurrentKeyActionHeld() == "MoveLeft")))){
hero._isFacingRight = false;
hero._isMoving = true;
};
if (pad.getCurrentKeyAction() == "Jump"){
hero._isJumping = true;
};
if (pad.getCurrentKeyAction() == "Attack"){
hero._isAttacking = true;
if ((((pad.getCurrentKeyAction() == "Up")) || ((pad.getCurrentKeyActionHeld() == "Up")))){
uppercut = true;
};
};
if ((((pad.getCurrentKeyAction() == "Down")) || ((pad.getCurrentKeyActionHeld() == "Down")))){
hero._isCrouching = true;
};
}
override public function Update():void{
var _local1:*;
gameData._tokenManager.checkCollision();
hero.updateAnimation();
_local1 = gameData.checkEnemyAttackCollision();
if ((((_local1 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
return;
};
if (uppercut){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_UPKNEE]);
return;
};
if (hero._isJumping){
hero.setNextState(hero.AIStates[Hero.STATE_JUMP]);
return;
};
if (hero._isMoving){
hero.setNextState(hero.AIStates[Hero.STATE_WALK]);
return;
};
if (hero._isAttacking){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_LEFTJAB]);
return;
};
if (hero._isCrouching){
hero.setNextState(hero.AIStates[Hero.STATE_DUCK]);
return;
};
}
public function toString():String{
return ("Hero_Idle()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 75
//Hero_Jump (Game.AIStates.Hero_Jump)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Jump extends AIState {
var timer:int;
var hero:Hero;
var jumpkick:Boolean;
public function Hero_Jump(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
jumpkick = false;
timer = 0;
if (hero._isFacingRight){
if (hero._isWalking){
hero._xvel = Hero._xvelWalk;
} else {
hero._xvel = Hero._xvelRun;
};
} else {
if (hero._isWalking){
hero._xvel = -(Hero._xvelWalk);
} else {
hero._xvel = -(Hero._xvelRun);
};
};
hero._yvel = Hero._yJumpVel;
hero.startAnimating(Hero.ANIM_JUMP);
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
snd.playSoundByEvent(SoundData.HERO_JUMP);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
if (pad.getCurrentKeyAction() == "Attack"){
jumpkick = true;
};
}
override public function Update():void{
hero.updateAnimation();
hero._yvel = (hero._yvel + GameData._gravity);
if (jumpkick){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_JUMPKICK]);
return;
};
if (hero._isMoving){
hero.offsetPosition(hero._xvel, hero._yvel);
} else {
hero.offsetPosition(0, hero._yvel);
};
if (hero._y >= GameData._groundY){
hero._yvel = 0;
if (hero._isMoving){
if (hero._isWalking){
hero.setNextState(hero.AIStates[Hero.STATE_WALK]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_RUN]);
};
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
};
};
}
public function toString():String{
return ("Hero_Jump()");
}
override public function Exit():void{
hero._isJumping = false;
snd.playSoundByEvent(SoundData.HERO_LAND);
}
}
}//package Game.AIStates
Section 76
//Hero_Run (Game.AIStates.Hero_Run)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Run extends AIState {
var hero:Hero;
var uppercut:Boolean;
public function Hero_Run(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero.startAnimating(Hero.ANIM_RUN);
uppercut = false;
hero._isWalking = false;
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
}
override public function PadInput():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = pad.getCurrentKeyAction();
_local2 = pad.getCurrentKeyActionHeld();
_local3 = pad.getKeyActionHeld("MoveLeft");
_local4 = pad.getKeyActionHeld("MoveRight");
_local5 = pad.getCurrentKeyActionUp();
if (_local1 == "Beetle"){
gameData.callBlueBeetle();
};
if (((!(_local4)) && (!(_local3)))){
hero._isMoving = false;
};
if (_local1 == "MoveRight"){
hero._isMoving = true;
hero.sprite.scaleX = 1;
hero._isFacingRight = true;
} else {
if (_local1 == "MoveLeft"){
hero._isMoving = true;
hero.sprite.scaleX = -1;
hero._isFacingRight = false;
} else {
if (_local2 == "MoveRight"){
if ((((_local5 == "MoveLeft")) || ((_local3 == false)))){
hero._isMoving = true;
hero.sprite.scaleX = 1;
hero._isFacingRight = true;
};
} else {
if (_local2 == "MoveLeft"){
if ((((_local5 == "MoveRight")) || ((_local4 == false)))){
hero._isMoving = true;
hero.sprite.scaleX = -1;
hero._isFacingRight = false;
};
};
};
};
};
if ((((_local1 == "Jump")) || ((_local2 == "Jump")))){
hero._isJumping = true;
};
if ((((_local1 == "Attack")) || ((_local2 == "Attack")))){
if ((((_local1 == "Up")) || ((_local2 == "Up")))){
uppercut = true;
};
hero._isAttacking = true;
};
if ((((_local1 == "Down")) || ((_local2 == "Down")))){
hero._isCrouching = true;
};
}
override public function Update():void{
var _local1:*;
gameData._tokenManager.checkCollision();
hero.updateAnimation();
_local1 = gameData.checkEnemyAttackCollision();
if ((((_local1 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
if (uppercut){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_UPKNEE]);
return;
};
if (hero._isJumping){
hero.setNextState(hero.AIStates[Hero.STATE_JUMP]);
return;
};
if (hero._isMoving){
if (hero._isFacingRight){
hero.offsetPosition(Hero._xvelRun, 0);
} else {
hero.offsetPosition(-(Hero._xvelRun), 0);
};
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
};
if (hero._isAttacking){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_LEFTJAB]);
};
}
public function toString():String{
return ("Hero_Run()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 77
//Hero_Stunned (Game.AIStates.Hero_Stunned)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Stunned extends AIState {
var hero:Hero;
public function Hero_Stunned(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero._isMoving = false;
hero._isAttacking = false;
hero.startAnimating(Hero.ANIM_STUNNED);
}
override public function PadInput():void{
if (pad.getCurrentKeyAction() == "Beetle"){
gameData.callBlueBeetle();
};
}
override public function Update():void{
gameData._tokenManager.checkCollision();
hero.updateAnimation();
if (hero._isJumping){
hero._yvel = (hero._yvel + GameData._gravity);
if (hero._isMoving){
if (hero._isFacingRight){
if (hero._isWalking){
hero.offsetPosition(Hero._xvelWalk, hero._yvel);
} else {
hero.offsetPosition(Hero._xvelRun, hero._yvel);
};
} else {
if (hero._isWalking){
hero.offsetPosition(-(Hero._xvelWalk), hero._yvel);
} else {
hero.offsetPosition(-(Hero._xvelRun), hero._yvel);
};
};
};
if (hero._y >= GameData._groundY){
if (hero._health > 0){
hero._isStunned = false;
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_DEFEAT]);
};
};
} else {
if (!hero._animator.isAnimating()){
if (hero._health > 0){
hero._isStunned = false;
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
} else {
hero.setNextState(hero.AIStates[Hero.STATE_DEFEAT]);
};
};
};
}
public function toString():String{
return ("Hero_Stunned()");
}
override public function Exit():void{
}
}
}//package Game.AIStates
Section 78
//Hero_Walk (Game.AIStates.Hero_Walk)
package Game.AIStates {
import Base.*;
import Game.*;
public class Hero_Walk extends AIState {
var timer:int;
var hero:Hero;
var uppercut:Boolean;
public function Hero_Walk(_arg1:GameEntry, _arg2:Hero){
super(_arg1);
hero = _arg2;
}
override public function Entry():void{
hero.startAnimating(Hero.ANIM_WALK);
hero._isStunned = false;
hero._isWalking = true;
uppercut = false;
if (hero._isFacingRight){
hero.sprite.scaleX = 1;
} else {
hero.sprite.scaleX = -1;
};
timer = 0;
hero.loopChannel = snd.playSoundByEvent(SoundData.HERO_FOOTSTEPS);
}
public function goLeft(){
hero._isMoving = true;
hero.sprite.scaleX = -1;
hero._isFacingRight = false;
}
override public function PadInput():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = pad.getCurrentKeyAction();
_local2 = pad.getCurrentKeyActionHeld();
_local3 = pad.getKeyActionHeld("MoveLeft");
_local4 = pad.getKeyActionHeld("MoveRight");
_local5 = pad.getCurrentKeyActionUp();
if (_local1 == "Beetle"){
gameData.callBlueBeetle();
};
if (((!(_local4)) && (!(_local3)))){
hero._isMoving = false;
};
if (_local1 == "MoveRight"){
hero._isMoving = true;
hero.sprite.scaleX = 1;
hero._isFacingRight = true;
} else {
if (_local1 == "MoveLeft"){
hero._isMoving = true;
hero.sprite.scaleX = -1;
hero._isFacingRight = false;
} else {
if (_local2 == "MoveRight"){
if ((((_local5 == "MoveLeft")) || ((_local3 == false)))){
hero._isMoving = true;
hero.sprite.scaleX = 1;
hero._isFacingRight = true;
};
} else {
if (_local2 == "MoveLeft"){
if ((((_local5 == "MoveRight")) || ((_local4 == false)))){
hero._isMoving = true;
hero.sprite.scaleX = -1;
hero._isFacingRight = false;
};
};
};
};
};
if ((((_local1 == "Jump")) || ((_local2 == "Jump")))){
hero._isJumping = true;
};
if ((((_local1 == "Attack")) || ((_local2 == "Attack")))){
if ((((_local1 == "Up")) || ((_local2 == "Up")))){
uppercut = true;
};
hero._isAttacking = true;
};
if ((((_local1 == "Down")) || ((_local2 == "Down")))){
hero._isCrouching = true;
};
}
public function goRight(){
hero._isMoving = true;
hero.sprite.scaleX = 1;
hero._isFacingRight = true;
}
override public function Update():void{
var _local1:*;
timer++;
gameData._tokenManager.checkCollision();
hero.updateAnimation();
_local1 = gameData.checkEnemyAttackCollision();
if ((((_local1 == 1)) && (!(hero._isStunned)))){
trace("*** ENEMY HIT HERO : MELEE ***");
hero.takeDamage(Enemy.DAMAGE_MELEE);
hero._isStunned = true;
hero.setNextState(hero.AIStates[Hero.STATE_STUNNED]);
};
if (uppercut){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_UPKNEE]);
return;
};
if (timer > 10){
hero.setNextState(hero.AIStates[Hero.STATE_RUN]);
return;
};
if (hero._isCrouching){
hero.setNextState(hero.AIStates[Hero.STATE_DUCK]);
return;
};
if (hero._isJumping){
hero.setNextState(hero.AIStates[Hero.STATE_JUMP]);
return;
};
if (hero._isMoving){
if (hero._isFacingRight){
hero.offsetPosition(Hero._xvelWalk, 0);
} else {
hero.offsetPosition(-(Hero._xvelWalk), 0);
};
if (hero._isAttacking){
hero.setNextState(hero.AIStates[Hero.STATE_ATTACK_LEFTJAB]);
};
} else {
hero.setNextState(hero.AIStates[Hero.STATE_IDLE]);
};
}
public function toString():String{
return ("Hero_Walk()");
}
override public function Exit():void{
snd.stopSound(hero.loopChannel);
}
}
}//package Game.AIStates
Section 79
//G_GameOver (Game.GameStates.G_GameOver)
package Game.GameStates {
import Base.*;
import UI.*;
import flash.display.*;
import Game.*;
public class G_GameOver extends GameState {
var _screen:SpriteEntity;
var replayButton:UIButton;
public function G_GameOver(_arg1:GameEntry){
super(_arg1);
}
override public function Entry():void{
var _local1:DisplayObject;
var _local2:Boolean;
var _local3:*;
var _local4:*;
trace("@ --> ENTER G_GAMEOVER");
gameData._gameOver = false;
_screen = ui.showScreen("screen_gameover", gameData.getGameLayer(GameData.STAGE));
replayButton = ui.addButton(_screen.getMovieClip(), "btnReplay", 1, true, false);
replayButton.addButtonAnimation(UIButton.STATE_OUT, 1, 1);
replayButton.addButtonAnimation(UIButton.STATE_OVER, 2, 13);
replayButton.addButtonAnimation(UIButton.STATE_DOWN, 15, 20);
replayButton.addButtonAnimation(UIButton.STATE_UP, 1, 1);
snd.stopMusic();
snd.playSoundByEvent(SoundData.MUSIC_END);
_local1 = _screen._mc.getChildByName("newHighScore");
_local2 = gameData.checkBestScore();
if (_local2){
_local1.visible = true;
} else {
_local1.visible = false;
};
_local3 = _screen._mc.getChildByName("scoreTxt");
_local3.text = gameData._score;
_local4 = _screen._mc.getChildByName("defeatedTxt");
_local4.text = gameData._killCounter;
}
override public function Update():void{
if (ui.getUIReturnVal() == 1){
trace(">>replay");
gameData._tracker.sendEventReplay();
gameData.reset();
_gameContext.getGameManager().setNextState(G_InPlay);
};
}
override public function Exit():void{
trace("@ <-- EXIT G_GAMEOVER");
ui.removeScreen();
gameData._hero.sprite.gotoAndStop(1);
}
}
}//package Game.GameStates
Section 80
//G_Init (Game.GameStates.G_Init)
package Game.GameStates {
import Base.*;
public class G_Init extends GameState {
public function G_Init(_arg1:GameEntry){
super(_arg1);
}
override public function Entry():void{
trace("@ --> ENTER G_INIT");
gameData._tracker.sendEventPlay();
_gameContext.stage.stageFocusRect = false;
_gameContext.stage.focus = gameData._board;
gameData.configGameLayers();
gameData.initHUD();
gameData.initBlueBeetle();
gameData.initBullets();
gameData.initHero();
gameData.initEnemies();
gameData.initParticles();
gameData._elapsedFrames = 0;
}
override public function Update():void{
_gameContext.getGameManager().setNextState(G_InPlay);
}
override public function Exit():void{
trace("@ <-- EXIT G_INIT");
}
}
}//package Game.GameStates
Section 81
//G_InPlay (Game.GameStates.G_InPlay)
package Game.GameStates {
import Base.*;
import UI.*;
import flash.display.*;
import Game.*;
public class G_InPlay extends GameState {
var instructions_screen:SpriteEntity;
var showInstructions:Boolean;
var btnInstructions:SpriteEntity;
var paused:Boolean;
var btnMusicOn:SpriteEntity;
var btnContinue:UIButton;
public function G_InPlay(_arg1:GameEntry){
super(_arg1);
}
override public function Entry():void{
trace("@ --> ENTER G_INPLAY");
paused = false;
ui.removeScreen();
gameData._gameOver = false;
_gameContext.stage.stageFocusRect = false;
_gameContext.stage.focus = gameData._board;
snd.playMusic(SoundData.getSoundLinkage(SoundData.MUSIC_GAME));
btnInstructions = new SpriteEntity(_gameContext, "btn_instructions", gameData._hud, 0, 0, false, 0, 1);
btnMusicOn = new SpriteEntity(_gameContext, "btn_musicOn", gameData._hud, 0, 0, false, 0, 2);
gameData._gameTimer = 0;
gameData._hero._lastHitTime = -10;
_gameContext._stage.quality = StageQuality.MEDIUM;
showInstructions = false;
}
override public function Update():void{
if (paused){
if (ui.getUIReturnVal() == 3){
_gameContext.stage.stageFocusRect = false;
_gameContext.stage.focus = gameData._board;
ui.removeScreen();
_gameContext._stage.quality = StageQuality.MEDIUM;
paused = false;
};
return;
};
if (btnMusicOn.isMouseOver()){
if (snd.getMusicMute()){
btnMusicOn.moveToFrame(4);
} else {
btnMusicOn.moveToFrame(2);
};
} else {
if (snd.getMusicMute()){
btnMusicOn.moveToFrame(3);
} else {
btnMusicOn.moveToFrame(1);
};
};
if (btnInstructions.isMouseOver()){
btnInstructions.moveToFrame(2);
} else {
btnInstructions.moveToFrame(1);
};
if (showInstructions){
_gameContext._stage.quality = StageQuality.HIGH;
instructions_screen = ui.showScreen("screen_instructions", gameData.getGameLayer(GameData.STAGE));
instructions_screen._mc.gotoAndStop(2);
btnContinue = ui.addButton(instructions_screen.getMovieClip(), "continueBtn", 3, false, false);
btnContinue.addButtonAnimation(UIButton.STATE_OUT, 1, 1);
btnContinue.addButtonAnimation(UIButton.STATE_OVER, 21, 46);
btnContinue.addButtonAnimation(UIButton.STATE_DOWN, 2, 14);
btnContinue.addButtonAnimation(UIButton.STATE_UP, 1, 1);
paused = true;
showInstructions = false;
};
if (((((btnInstructions.isMouseOver()) && (pad.getMouseReleased()))) && (!(paused)))){
showInstructions = true;
};
if (((((btnMusicOn.isMouseOver()) && (pad.getMouseReleased()))) && (!(paused)))){
if (snd.getMusicMute()){
snd.setMusicMute(false);
} else {
snd.setMusicMute(true);
};
};
if (gameData._gameOver){
_gameContext.getGameManager().setNextState(G_GameOver);
return;
};
gameData.updateBeetle();
gameData._particles.update();
if (gameData._callIn){
snd.stopSound(gameData._hero.loopChannel);
if (gameData._callInClip.currentFrame == gameData._callInClip.totalFrames){
gameData._callIn = false;
gameData._beetle._recycle = true;
};
return;
};
gameData.updateHUD();
if (gameData._beetle._active){
return;
};
gameData.updateGameTimer();
if (gameData._slowMax > 1){
gameData._slowFactor++;
if (gameData._slowFactor == gameData._slowMax){
gameData._slowMax--;
gameData._slowFactor = 0;
};
};
if ((gameData._elapsedFrames % 300) == 0){
gameData.checkForHealthDrop();
};
gameData._elapsedFrames++;
gameData.updateEntities();
gameData._tokenManager.update();
gameData.updateBullets();
gameData.adjustDifficulty();
}
override public function Exit():void{
trace("@ <-- EXIT G_INPLAY");
_gameContext._stage.quality = StageQuality.HIGH;
}
}
}//package Game.GameStates
Section 82
//G_Instructions (Game.GameStates.G_Instructions)
package Game.GameStates {
import Base.*;
import UI.*;
import Game.*;
public class G_Instructions extends GameState {
var timer:int;
var playButton:UIButton;
var skipButton:UIButton;
var _screen:SpriteEntity;
public function G_Instructions(_arg1:GameEntry){
super(_arg1);
}
override public function Entry():void{
trace("@ --> ENTER G_Instructions");
_screen = ui.showScreen("screen_instructions", gameData.getGameLayer(GameData.STAGE));
playButton = ui.addButton(_screen.getMovieClip(), "playBtn", 1, false, false);
playButton.addButtonAnimation(UIButton.STATE_OUT, 1, 1);
playButton.addButtonAnimation(UIButton.STATE_OVER, 21, 46);
playButton.addButtonAnimation(UIButton.STATE_DOWN, 2, 14);
playButton.addButtonAnimation(UIButton.STATE_UP, 1, 1);
timer = 0;
}
override public function Update():void{
_screen.animateSprite();
if (ui.getUIReturnVal() == 1){
snd.playSoundByEvent(SoundData.BTN_PRESS);
_gameContext.getGameManager().setNextState(G_Init);
};
}
override public function Exit():void{
trace("@ <-- EXIT G_Instructions");
}
}
}//package Game.GameStates
Section 83
//G_Intro (Game.GameStates.G_Intro)
package Game.GameStates {
import Base.*;
import UI.*;
import Game.*;
public class G_Intro extends GameState {
var timer:int;
var startButton:UIButton;
var introScreen:SpriteEntity;
public function G_Intro(_arg1:GameEntry){
super(_arg1);
}
override public function Entry():void{
trace("@ --> ENTER G_Intro");
introScreen = ui.showScreen("screen_intro", gameData.getGameLayer(GameData.STAGE));
startButton = ui.addButton(introScreen.getMovieClip(), "btnStart", 1, true, false);
startButton.addButtonAnimation(UIButton.STATE_OUT, 1, 1);
startButton.addButtonAnimation(UIButton.STATE_OVER, 2, 13);
startButton.addButtonAnimation(UIButton.STATE_DOWN, 15, 15);
startButton.addButtonAnimation(UIButton.STATE_UP, 1, 1);
introScreen._mc.x = 300;
introScreen._mc.y = 200;
introScreen._mc.play();
timer = 0;
}
override public function Update():void{
introScreen.animateSprite();
if (ui.getUIReturnVal() == 1){
trace(">>START");
snd.playSoundByEvent(SoundData.BTN_PRESS);
_gameContext.getGameManager().setNextState(G_Story);
};
}
override public function Exit():void{
trace("@ <-- EXIT G_INTRO");
}
}
}//package Game.GameStates
Section 84
//G_Story (Game.GameStates.G_Story)
package Game.GameStates {
import Base.*;
import UI.*;
import Game.*;
public class G_Story extends GameState {
var timer:int;
var storyScreen:SpriteEntity;
var skipButton:UIButton;
var continueButton:UIButton;
public function G_Story(_arg1:GameEntry){
super(_arg1);
}
override public function Entry():void{
trace("@ --> ENTER G_Intro");
storyScreen = ui.showScreen("screen_story", gameData.getGameLayer(GameData.STAGE));
storyScreen._mc.x = 300;
storyScreen._mc.y = 200;
storyScreen.startAnimating(0, 882, false);
skipButton = ui.addButton(storyScreen.getMovieClip(), "btnSkip", 1, false, false);
continueButton = ui.addButton(storyScreen.getMovieClip(), "btnContinue", 2, false, false);
timer = 0;
snd.playMusic(SoundData.getSoundLinkage(SoundData.MUSIC_STORY), 0, 1);
}
override public function Update():void{
storyScreen.animateSprite();
if (skipButton.mouseRollOn()){
snd.playSoundByEvent(SoundData.BTN_OVER);
};
if (continueButton.mouseRollOn()){
snd.playSoundByEvent(SoundData.BTN_OVER);
};
if ((((ui.getUIReturnVal() == 1)) || ((ui.getUIReturnVal() == 2)))){
snd.playSoundByEvent(SoundData.BTN_PRESS);
_gameContext.getGameManager().setNextState(G_Instructions);
};
}
override public function Exit():void{
trace("@ <-- EXIT G_STORY");
}
}
}//package Game.GameStates
Section 85
//BigEnemy (Game.BigEnemy)
package Game {
import Base.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.filters.*;
import Game.AIStates.*;
public class BigEnemy extends Entity {
public var _xvel:Number;
public var _collide;// = false
public var _health:int;
public var _beetleHit:Boolean;
public var _juggleCount:int;
public var _punched:Boolean;// = false
public var _healthBar;
public var _hitBatman:Boolean;
public var _active:Boolean;
public var _attackRecharge_melee;
public var _lastAttackTime;
public var loopChannel:SoundChannel;
public var _knockback:Boolean;// = false
public var sprite:MovieClip;
public var AIStates:Array;
public var _animator:SpriteAnimator;
public var _recycle:Boolean;
public var _isAttacking:Boolean;// = false
public var _isFacingRight:Boolean;// = true
public var _isProne:Boolean;// = false
public var _inAir:Boolean;// = false
public var _hesitationTime;
public var _yvel:int;
public var _glow:GlowFilter;
var snd:SoundModule;
public var _isMoving:Boolean;// = false
public var _x:int;
public var _y:int;
public var _isWalking:Boolean;// = false
public static const STATE_INACTIVE:int = 0;
public static const ANIM_IDLE:Object = {start:90, end:90, loop:true};
public static const ANIM_PRONE:Object = {start:45, end:52, loop:false};
public static const ANIM_HIT:Object = {start:33, end:33, loop:false};
public static const ANIM_MELEE:Object = {start:90, end:110, loop:false};
public static const _maxX = 575;
public static const STATE_ATTACK_SHOOT:int = 7;
public static const STATE_WALK:int = 2;
public static const MELEE_DURATION = 30;
public static const STATE_AIR:int = 4;
public static const ANIM_DEAD_PRONE:Object = {start:53, end:69, loop:false};
public static const ANIM_DEAD_STANDING:Object = {start:43, end:69, loop:false};
public static const STATE_HIT:int = 3;
public static const HIT_DURATION = 9;
public static const STATE_IDLE:int = 1;
public static const STATE_ATTACK_MELEE:int = 6;
public static const _xvelWalk = 4;
public static const DAMAGE_MELEE = 10;
public static const STATE_DEAD:int = 8;
public static const _minX = 25;
public static const STATE_PRONE:int = 5;
public static const MAX_HEALTH = 100;
public static const STATE_MAXCOUNT = 16;
public static const ANIM_AIR:Object = {start:38, end:44, loop:false};
public static const ANIM_WALK:Object = {start:1, end:32, loop:true};
public function BigEnemy(_arg1:GameEntry, _arg2:int, _arg3:int, _arg4){
_isFacingRight = true;
_isMoving = false;
_isAttacking = false;
_isWalking = false;
_punched = false;
_knockback = false;
_inAir = false;
_isProne = false;
_collide = false;
trace("-- new BigEnemy()");
AIStates = new Array(STATE_MAXCOUNT);
AIStates[STATE_INACTIVE] = new BigEnemy_Inactive(_arg1, this);
AIStates[STATE_IDLE] = new BigEnemy_Idle(_arg1, this);
AIStates[STATE_WALK] = new BigEnemy_Walk(_arg1, this);
AIStates[STATE_HIT] = new BigEnemy_Hit(_arg1, this);
AIStates[STATE_AIR] = new BigEnemy_InAir(_arg1, this);
AIStates[STATE_PRONE] = new BigEnemy_Prone(_arg1, this);
AIStates[STATE_DEAD] = new BigEnemy_Dead(_arg1, this);
AIStates[STATE_ATTACK_MELEE] = new BigEnemy_Attack_Melee(_arg1, this);
super(_arg1, AIStates[STATE_INACTIVE], _arg4, 1, true);
snd = _gameData.getSoundModule();
_x = _arg2;
_y = _arg3;
}
public function showHealthBar(_arg1:String="Normal"){
_healthBar.visible = true;
if (!_isFacingRight){
_healthBar.scaleX = -1;
} else {
_healthBar.scaleX = 1;
};
switch (_arg1){
case "Normal":
_healthBar.x = 8;
_healthBar.y = -185;
break;
case "Prone":
_healthBar.x = -41;
_healthBar.y = -88;
break;
case "Air":
_healthBar.x = -6;
_healthBar.y = -160;
break;
};
}
public function faceHero(){
if (_gameData._hero._x < _x){
_isFacingRight = false;
sprite.scaleX = -1;
} else {
_isFacingRight = true;
sprite.scaleX = 1;
};
}
public function glowOff(){
_glow = null;
sprite.filters = [];
_healthBar.visible = true;
}
public function startAnimating(_arg1:Object):void{
_animator.startAnimating(_arg1.start, _arg1.end, _arg1.loop);
updateAnimation();
}
public function updateAnimation():int{
var _local1:int;
_animator.animateSprite();
_local1 = _animator.animateSprite();
return (_local1);
}
public function moveTo(_arg1:Number, _arg2:Number){
_x = _arg1;
_y = _arg2;
sprite.x = _arg1;
sprite.y = _arg2;
if (_y > GameData._groundY){
_y = GameData._groundY;
sprite.y = GameData._groundY;
};
}
public function Init():void{
sprite = new bigPirate();
sprite.gotoAndStop(1);
sprite.x = _x;
sprite.y = _y;
_animator = new SpriteAnimator(_gameContext, sprite);
_yvel = 0;
_recycle = false;
loopChannel = new SoundChannel();
_active = false;
_health = MAX_HEALTH;
_beetleHit = false;
_hesitationTime = 1;
_lastAttackTime = 0;
_attackRecharge_melee = 1;
_healthBar = sprite.getChildByName("healthBar");
_healthBar.visible = false;
}
public function inBounds():Boolean{
return ((((_x > -50)) && ((_x < 650))));
}
public function updateHealthBar(){
var _local1:*;
_local1 = (1 + Math.floor(((100 * _health) / MAX_HEALTH)));
_healthBar.gotoAndStop(_local1);
}
public function reset(){
sprite.gotoAndStop(1);
_recycle = true;
if (Math.random() < 0.5){
moveTo(800, GameData._groundY);
} else {
moveTo(-200, GameData._groundY);
};
_xvel = 0;
_yvel = 0;
_active = true;
_health = MAX_HEALTH;
_knockback = false;
_punched = false;
_inAir = false;
_isProne = false;
_juggleCount = 0;
_collide = true;
_hitBatman = false;
updateHealthBar();
_healthBar.visible = false;
_lastAttackTime = -10;
}
public function takeDamage(_arg1:int){
trace((("BigEnemy:takeDamage(" + (_arg1 / 3)) + ")"));
_health = (_health - (_arg1 / 3));
if (_health <= 0){
_collide = false;
_health = 0;
};
updateHealthBar();
}
public function offsetPosition(_arg1:Number, _arg2:Number){
_arg1 = (_arg1 / _gameData._slowMax);
_arg2 = (_arg2 / _gameData._slowMax);
_x = (_x + _arg1);
_y = (_y + _arg2);
sprite.x = (sprite.x + _arg1);
sprite.y = (sprite.y + _arg2);
if (_y > GameData._groundY){
_y = GameData._groundY;
sprite.y = GameData._groundY;
};
}
public function glowOn(){
var _local1:*;
_local1 = (8 + Math.floor((8 * Math.random())));
_glow = new GlowFilter(13421823, 0.7, _local1, _local1, _local1, 1, false, false);
sprite.filters = [_glow];
_healthBar.visible = false;
}
function toString():String{
return ("BigEnemy()");
}
public function hideHealthBar(){
_healthBar.visible = false;
}
}
}//package Game
Section 86
//BlueBeetle (Game.BlueBeetle)
package Game {
import Base.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.filters.*;
import Game.AIStates.*;
public class BlueBeetle extends Entity {
public var _xvel:Number;
public var _active:Boolean;
public var _targetEnemy;
public var loopChannel:SoundChannel;
public var _attackType:int;
public var sprite:MovieClip;
public var AIStates:Array;
public var _animator:SpriteAnimator;
public var _dir;// = 0
public var _collides;// = false
public var _isFacingRight:Boolean;
public var _recycle:Boolean;
public var _yvel:Number;
public var _glow:GlowFilter;
var snd:SoundModule;
public var _x:Number;
public var _y:Number;
public static const STATE_INACTIVE:int = 0;
public static const ATTACK_JET = 0;
public static const STATE_ATTACK_HAMMER_HIT:int = 4;
public static const STATE_ATTACK_JET:int = 1;
public static const STATE_ATTACK_ROCKET_DROP:int = 5;
public static const ANIM_ROCKET_FIRE:Object = {start:63, end:63, loop:false};
public static const DAMAGE_HAMMER = 50;
public static const ANIM_HAMMER_DROP:Object = {start:80, end:80, loop:true};
public static const STATE_POSE:int = 8;
public static const DAMAGE_ROCKET = 50;
public static const _minX = 25;
public static const ANIM_ROCKET_AIM:Object = {start:43, end:56, loop:false};
public static const STATE_LEAVES:int = 9;
public static const ATTACK_ROCKET = 2;
public static const DAMAGE_JET = 25;
public static const ATTACK_HAMMER = 1;
public static const STATE_MAXCOUNT = 16;
public static const STATE_ATTACK_ROCKET_AIM:int = 6;
public static const ANIM_JET:Object = {start:1, end:3, loop:true};
public static const ANIM_ROCKET_DROP:Object = {start:41, end:41, loop:false};
public static const _maxX = 575;
public static const STATE_ATTACK_ROCKET_FIRE:int = 7;
public static const ANIM_LAND:Object = {start:21, end:40, loop:false};
public static const STATE_ATTACK_HAMMER_DROP:int = 3;
public static const ANIM_JET_DROP:Object = {start:21, end:21, loop:true};
public static const ANIM_HAMMER_HIT:Object = {start:82, end:114, loop:false};
public static const ANIM_LEAVE:Object = {start:124, end:135, loop:false};
public static const STATE_LAND:int = 2;
public static const ANIM_POSE:Object = {start:115, end:123, loop:false};
public function BlueBeetle(_arg1:GameEntry, _arg2:int, _arg3:int){
_collides = false;
_dir = 0;
trace("-- new BlueBeetle()");
AIStates = new Array(STATE_MAXCOUNT);
AIStates[STATE_INACTIVE] = new Beetle_Inactive(_arg1, this);
AIStates[STATE_ATTACK_JET] = new Beetle_Attack_Jet(_arg1, this);
AIStates[STATE_ATTACK_HAMMER_DROP] = new Beetle_Attack_Hammer_Drop(_arg1, this);
AIStates[STATE_ATTACK_HAMMER_HIT] = new Beetle_Attack_Hammer_Hit(_arg1, this);
AIStates[STATE_ATTACK_ROCKET_DROP] = new Beetle_Attack_Rocket_Drop(_arg1, this);
AIStates[STATE_ATTACK_ROCKET_AIM] = new Beetle_Attack_Rocket_Aim(_arg1, this);
AIStates[STATE_ATTACK_ROCKET_FIRE] = new Beetle_Attack_Rocket_Fire(_arg1, this);
AIStates[STATE_LAND] = new Beetle_Land(_arg1, this);
AIStates[STATE_POSE] = new Beetle_Pose(_arg1, this);
AIStates[STATE_LEAVES] = new Beetle_Finish(_arg1, this);
super(_arg1, AIStates[STATE_INACTIVE]);
snd = _gameData.getSoundModule();
_x = _arg2;
_y = _arg3;
_yvel = 0;
}
public function startAnimating(_arg1:Object):void{
_animator.startAnimating(_arg1.start, _arg1.end, _arg1.loop);
updateAnimation();
}
public function moveTo(_arg1:Number, _arg2:Number){
_x = _arg1;
_y = _arg2;
sprite.x = _arg1;
sprite.y = _arg2;
}
public function Init():void{
sprite = new beetle();
sprite.gotoAndStop(1);
moveTo(-200, -200);
_animator = new SpriteAnimator(_gameContext, sprite);
loopChannel = new SoundChannel();
_active = false;
_recycle = false;
_attackType = 0;
_isFacingRight = true;
_glow = new GlowFilter(13421823, 0.7, 8, 8, 2, 1, false, false);
sprite.filters = [_glow];
}
public function updateAnimation():int{
var _local1:int;
_animator.animateSprite();
_local1 = _animator.animateSprite();
return (_local1);
}
public function offsetPosition(_arg1:Number, _arg2:Number){
_x = (_x + _arg1);
_y = (_y + _arg2);
sprite.x = (sprite.x + _arg1);
sprite.y = (sprite.y + _arg2);
}
function toString():String{
return ("Hero()");
}
}
}//package Game
Section 87
//Enemy (Game.Enemy)
package Game {
import Base.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.filters.*;
import Game.AIStates.*;
public class Enemy extends Entity {
public var _xvel:Number;
public var _collide;// = false
public var _health:int;
public var _beetleHit:Boolean;
public var _juggleCount:int;
public var _punched:Boolean;// = false
public var _hitBatman:Boolean;
public var _active:Boolean;
public var _healthBar;
public var _attackRecharge_melee;
public var _lastAttackTime;
public var loopChannel:SoundChannel;
public var _knockback:Boolean;// = false
public var sprite:MovieClip;
public var AIStates:Array;
public var _recycle:Boolean;
public var _animator:SpriteAnimator;
public var _isAttacking:Boolean;// = false
public var _isFacingRight:Boolean;// = true
public var _isProne:Boolean;// = false
public var _isShooting:Boolean;// = false
public var _inAir:Boolean;// = false
public var _yvel:int;
public var _glow:GlowFilter;
var snd:SoundModule;
public var _isMoving:Boolean;// = false
public var _x:int;
public var _y:int;
public var _isWalking:Boolean;// = false
public static const DAMAGE_MELEE = 10;
public static const STOP_DISTANCE = 90;
public static const STATE_DEAD:int = 8;
public static const ANIM_DEAD_STANDING:Object = {start:43, end:69, loop:false};
public static const MELEE_DURATION = 30;
public static const STATE_HIT:int = 3;
public static const ANIM_MELEE:Object = {start:77, end:85, loop:false};
public static const STATE_ATTACK_MELEE:int = 6;
public static const DAMAGE_SHOOT = 10;
public static const _minX = 25;
public static const STATE_PRONE:int = 5;
public static const MAX_HEALTH = 75;
public static const STATE_MAXCOUNT = 16;
public static const ANIM_WALK:Object = {start:1, end:32, loop:true};
public static const ANIM_IDLE:Object = {start:1, end:1, loop:true};
public static const ANIM_HIT:Object = {start:33, end:33, loop:true};
public static const _maxX = 575;
public static const ANIM_PRONE:Object = {start:45, end:52, loop:false};
public static const STATE_WALK:int = 2;
public static const ANIM_SHOOT:Object = {start:85, end:95, loop:false};
public static const STATE_AIR:int = 4;
public static const STATE_ATTACK_SHOOT:int = 7;
public static const ANIM_DEAD_PRONE:Object = {start:53, end:69, loop:false};
public static const HIT_DURATION = 15;
public static const STATE_IDLE:int = 1;
public static const _xvelWalk = 4;
public static const STATE_INACTIVE:int = 0;
public static const ANIM_AIR:Object = {start:38, end:44, loop:false};
public function Enemy(_arg1:GameEntry, _arg2:int, _arg3:int, _arg4){
_isFacingRight = true;
_isMoving = false;
_isAttacking = false;
_isWalking = false;
_punched = false;
_knockback = false;
_inAir = false;
_isProne = false;
_isShooting = false;
_collide = false;
trace("-- new Enemy()");
AIStates = new Array(STATE_MAXCOUNT);
AIStates[STATE_INACTIVE] = new Enemy_Inactive(_arg1, this);
AIStates[STATE_IDLE] = new Enemy_Idle(_arg1, this);
AIStates[STATE_WALK] = new Enemy_Walk(_arg1, this);
AIStates[STATE_HIT] = new Enemy_Hit(_arg1, this);
AIStates[STATE_AIR] = new Enemy_InAir(_arg1, this);
AIStates[STATE_PRONE] = new Enemy_Prone(_arg1, this);
AIStates[STATE_DEAD] = new Enemy_Dead(_arg1, this);
AIStates[STATE_ATTACK_MELEE] = new Enemy_Attack_Melee(_arg1, this);
AIStates[STATE_ATTACK_SHOOT] = new Enemy_Attack_Shoot(_arg1, this);
super(_arg1, AIStates[STATE_INACTIVE], _arg4, 1, true);
snd = _gameData.getSoundModule();
_x = _arg2;
_y = _arg3;
}
public function glowOn(){
var _local1:*;
_local1 = (8 + Math.floor((8 * Math.random())));
_glow = new GlowFilter(13421823, 0.7, _local1, _local1, _local1, 1, false, false);
sprite.filters = [_glow];
_healthBar.visible = false;
}
public function showHealthBar(_arg1:String="Normal"){
_healthBar.visible = true;
if (!_isFacingRight){
_healthBar.scaleX = -1;
} else {
_healthBar.scaleX = 1;
};
switch (_arg1){
case "Normal":
_healthBar.x = 8;
_healthBar.y = -170;
break;
case "Prone":
_healthBar.x = -6;
_healthBar.y = -62;
break;
case "Air":
_healthBar.x = -53;
_healthBar.y = -131;
break;
};
}
public function faceHero(){
if (_gameData._hero._x < _x){
_isFacingRight = false;
sprite.scaleX = -1;
} else {
_isFacingRight = true;
sprite.scaleX = 1;
};
}
public function glowOff(){
_glow = null;
sprite.filters = [];
_healthBar.visible = true;
}
public function startAnimating(_arg1:Object):void{
_animator.startAnimating(_arg1.start, _arg1.end, _arg1.loop, -1, (32 / _gameData._slowMax));
updateAnimation();
}
public function updateAnimation():int{
var _local1:int;
_animator.animateSprite();
_local1 = _animator.animateSprite();
return (_local1);
}
public function moveTo(_arg1:Number, _arg2:Number){
_x = _arg1;
_y = _arg2;
sprite.x = _arg1;
sprite.y = _arg2;
if (_y > GameData._groundY){
_y = GameData._groundY;
sprite.y = GameData._groundY;
};
}
public function Init():void{
sprite = new pirateLizard();
sprite.gotoAndStop(1);
sprite.x = _x;
sprite.y = _y;
_animator = new SpriteAnimator(_gameContext, sprite);
_healthBar = sprite.getChildByName("healthBar");
_healthBar.visible = false;
_yvel = 0;
_recycle = false;
loopChannel = new SoundChannel();
_active = false;
_health = MAX_HEALTH;
_beetleHit = false;
_lastAttackTime = 0;
_collide = true;
_attackRecharge_melee = 1;
}
public function inBounds():Boolean{
return ((((_x > -50)) && ((_x < 650))));
}
public function updateHealthBar(){
var _local1:*;
_local1 = (1 + Math.floor(((100 * _health) / MAX_HEALTH)));
_healthBar.gotoAndStop(_local1);
}
public function reset(){
sprite.gotoAndStop(1);
_recycle = true;
if (Math.random() < 0.5){
moveTo(((100 * Math.random()) + 700), GameData._groundY);
} else {
moveTo(((100 * Math.random()) - 200), GameData._groundY);
};
_xvel = 0;
_yvel = 0;
_active = true;
_health = MAX_HEALTH;
_knockback = false;
_punched = false;
_inAir = false;
_isProne = false;
_juggleCount = 0;
_collide = true;
_hitBatman = false;
_healthBar.visible = false;
_lastAttackTime = -10;
updateHealthBar();
}
public function takeDamage(_arg1:int){
trace((("Enemy:takeDamage(" + _arg1) + ")"));
_health = (_health - _arg1);
if (_health <= 0){
_collide = false;
_health = 0;
};
updateHealthBar();
}
public function offsetPosition(_arg1:Number, _arg2:Number){
_arg1 = (_arg1 / _gameData._slowMax);
_arg2 = (_arg2 / _gameData._slowMax);
_x = (_x + _arg1);
_y = (_y + _arg2);
sprite.x = (sprite.x + _arg1);
sprite.y = (sprite.y + _arg2);
if (_y > GameData._groundY){
_y = GameData._groundY;
sprite.y = GameData._groundY;
};
}
function toString():String{
return ("Enemy()");
}
public function hideHealthBar(){
_healthBar.visible = false;
}
}
}//package Game
Section 88
//GameData (Game.GameData)
package Game {
import Base.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
import Tracker.*;
import Game.AIStates.*;
import flash.text.*;
import flash.geom.*;
public class GameData {
public var _shakeAngle;
private var _controls;
public var _particles:ParticleSystem;
public var _attackRecharge:int;
public var _hud:MovieClip;
public var _callIn:Boolean;
public var _elapsedFrames:int;
public var _gameOver:Boolean;
public var _beetle:BlueBeetle;
public var _shakeAmplitude;
public var _paused:Boolean;
public var _slowFactor:int;
public var _tokenManager:TokenManager;
public var _beetleBar;
public var _slowMax:int;
public var _bullets:Array;
public var _bigEnemyEnabled:Boolean;
public var _bestScore:int;
public var _score:int;
public var _beamSplash:MovieClip;
public var _healthBar;
public var _soundModule:SoundModule;
private var _gameContext:GameEntry;
var _hudSounds:SoundChannel;
public var _maxEnemiesAllowed:int;
public var _decisionTime:Number;
var _savedGame:SharedObject;
public var _callInClip;
public var _comboCount:int;
public var _bigEnemy:BigEnemy;
public var _background:MovieClip;
public var _gunsEnabled:Boolean;
public var _hero:Hero;
public var _foreground:Sprite;
public var _board:Sprite;
public var _enemies:Array;
var _savedGameDirectory:String;// = "BatmanBB_DoubleTeam"
public var _gameTimer:Number;
public var _tracker:GameTrack_AS3;
public var _killCounter:int;
public static const BULLET_VEL = 60;
public static const FOREGROUND:int = 3;
public static const SCORE_FOOTSWEEP_HIT = 0;
public static const BOARD:int = 2;
public static const _gravity = 3;
public static const SCORE_JAB_HIT = 0;
public static const SCORE_ENEMY_DEFEAT = 5;
public static const CHEATS_ENABLED:Boolean = false;
public static const SCORE_RIGHT_HIT = 0;
public static const STAGE:int = 0;
public static const SCORE_KNEE_HIT = 0;
public static const SCORE_BELT_HIT = 0;
public static const SCORE_JUMPKICK_HIT = 0;
public static const BACKGROUND:int = 1;
public static const _gravityJuggled = 1;
public static const _groundY = 370;
public static const SCORE_BIGENEMY_DEFEAT = 10;
public function GameData(_arg1:GameEntry){
_controls = [{keyAction:"Jump", keyID:88}, {keyAction:"Up", keyID:38}, {keyAction:"Down", keyID:40}, {keyAction:"MoveLeft", keyID:37}, {keyAction:"MoveRight", keyID:39}, {keyAction:"Attack", keyID:90}, {keyAction:"Beetle", keyID:32}, {keyAction:"AddHealth", keyID:72}, {keyAction:"MoreDifficult", keyID:190}, {keyAction:"LessDifficult", keyID:188}, {keyAction:"Die", keyID:81}];
_savedGameDirectory = "BatmanBB_DoubleTeam";
super();
_gameContext = _arg1;
_gameContext.getPadManager().setKeyControls(_controls);
_tracker = new GameTrack_AS3(_gameContext.parent);
_tracker.loadTracker();
_soundModule = new SoundModule();
_tokenManager = new TokenManager(_gameContext);
Init();
}
public function spawnBigEnemy(){
trace("-- GameData:spawnBigEnemy() --");
_bigEnemy.reset();
}
public function shake(){
_shakeAmplitude = 10;
_shakeAngle = 0;
}
public function hitSpark(_arg1:String=""){
var _local2:*;
var _local3:*;
_local2 = _hero.sprite.getChildByName("hitpoint");
_local3 = (1 - (2 * Number(_hero._isFacingRight)));
if (_arg1 == "up"){
_particles.generate(20, 1, 0, (_hero._x - (_local3 * _local2.x)), (_hero._y + _local2.y));
_particles.generate(1, 2, 0, (_hero._x - (_local3 * _local2.x)), (_hero._y + _local2.y));
_particles.generate(3, 3, 0, (_hero._x - (_local3 * _local2.x)), (_hero._y + _local2.y));
} else {
if (_arg1 == "beetle"){
_local2 = _beetle.sprite.getChildByName("hitpoint");
_local3 = 0;
_particles.generate(20, 10, _local3, (_beetle._x + (_beetle._dir * _local2.x)), (_beetle._y + _local2.y));
_particles.generate(10, 11, _local3, (_beetle._x + (_beetle._dir * _local2.x)), (_beetle._y + _local2.y));
_particles.generate(20, 12, _local3, (_beetle._x + (_beetle._dir * _local2.x)), (_beetle._y + _local2.y));
} else {
if (_arg1 == "rocket"){
_local2 = _beetle.sprite.getChildByName("hitpoint");
_local3 = 0;
_particles.generate(10, 10, _local3, _beetle._targetEnemy._x, (_beetle._targetEnemy._y - 80));
_particles.generate(10, 11, _local3, _beetle._targetEnemy._x, (_beetle._targetEnemy._y - 80));
_particles.generate(20, 12, _local3, _beetle._targetEnemy._x, (_beetle._targetEnemy._y - 80));
} else {
if (_arg1 == "hammer"){
_local2 = _beetle.sprite.getChildByName("hitpoint");
_local3 = 0;
_particles.generate(30, 11, _local3, _beetle._targetEnemy._x, (_beetle._targetEnemy._y - 80));
_particles.generate(40, 12, _local3, _beetle._targetEnemy._x, (_beetle._targetEnemy._y - 80));
} else {
_particles.generate(20, 1, _local3, (_hero._x - (_local3 * _local2.x)), (_hero._y + _local2.y));
_particles.generate(1, 2, _local3, (_hero._x - (_local3 * _local2.x)), (_hero._y + _local2.y));
_particles.generate(3, 3, _local3, (_hero._x - (_local3 * _local2.x)), (_hero._y + _local2.y));
};
};
};
};
}
public function checkBatAttackCollision():Array{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Array;
var _local6:*;
_local1 = _enemies.length;
_local2 = _hero.sprite.getChildByName("attackbox");
_local3 = _hero.sprite.getChildByName("hitbox");
_local5 = new Array();
_local6 = 0;
while (_local6 < _local1) {
if (((((!(_enemies[_local6]._active)) || (!(_enemies[_local6]._collide)))) || ((_enemies[_local6]._health <= 0)))){
} else {
_local4 = _enemies[_local6].sprite.getChildByName("hitbox");
if (_local2.hitTestObject(_local4)){
_local5.push(_enemies[_local6]);
_hero._mostRecentEnemy = _enemies[_local6];
};
};
_local6++;
};
if (((_bigEnemy._active) && (_bigEnemy._collide))){
_local4 = _bigEnemy.sprite.getChildByName("hitbox");
if (_local2.hitTestObject(_local4)){
hitSpark();
_local5.push(_bigEnemy);
_hero._mostRecentEnemy = _bigEnemy;
};
};
return (_local5);
}
public function updateBeetleBar(){
var _local1:*;
if (_beetleBar == null){
_beetleBar = _hud.getChildByName("beetlebar");
};
_local1 = Math.floor((_hero._numTokens / 3));
_beetleBar.gotoAndStop((1 + _local1));
}
public function callBlueBeetle(){
var _local1:*;
var _local2:Array;
var _local3:*;
var _local4:*;
if (_hero._numTokens < 100){
return;
};
_local1 = BlueBeetle.ATTACK_JET;
_local2 = new Array();
if (_bigEnemy._active){
if (((_bigEnemy._inAir) || (_bigEnemy._isProne))){
_local2.push(_bigEnemy);
};
};
_local3 = 0;
while (_local3 < _enemies.length) {
if (((_enemies[_local3]._inAir) || (_enemies[_local3]._isProne))){
_local2.push(_enemies[_local3]);
};
_local3++;
};
ArrayTools.Shuffle(_local2);
_local4 = 0;
while (_local4 < _local2.length) {
if (_local2[_local4]._inAir){
_beetle._targetEnemy = _local2[_local4];
_local1 = BlueBeetle.ATTACK_ROCKET;
break;
} else {
if (_local2[_local4]._isProne){
_beetle._targetEnemy = _local2[_local4];
_local1 = BlueBeetle.ATTACK_HAMMER;
break;
};
};
_local4++;
};
if (_callInClip == null){
_callInClip = _gameContext.parent.getChildByName("beetleClip");
};
trace(("## beetleclip:" + _callInClip));
_callIn = true;
_callInClip.gotoAndPlay(2);
_beetle._attackType = _local1;
_hero._numTokens = (_hero._numTokens - 100);
if (_hero._numTokens < 0){
_hero._numTokens = 0;
};
useBeetle();
_background.gotoAndStop(2);
}
public function getSoundModule():SoundModule{
return (_soundModule);
}
public function resetHUD(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = _hud.getChildByName("bbCall1");
_local2 = _hud.getChildByName("bbCall2");
_local3 = _hud.getChildByName("bbCall3");
_local1.gotoAndStop(1);
_local2.gotoAndStop(1);
_local3.gotoAndStop(1);
_local4 = _hud.getChildByName("batmanAvatar");
_local4.gotoAndStop(1);
}
public function addBeetle(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = _hud.getChildByName("bbCall1");
_local3 = _hud.getChildByName("bbCall2");
_local4 = _hud.getChildByName("bbCall3");
_local5 = _hud.getChildByName("spacebar");
if (_arg1 == 1){
_local2.play();
_local5.gotoAndPlay(2);
} else {
if (_arg1 == 2){
_local3.play();
_local5.gotoAndPlay(2);
} else {
if (_arg1 == 3){
_local4.play();
_local5.gotoAndPlay(2);
};
};
};
_soundModule.playSoundByEvent(SoundData.BEETLE_CALL_READY);
}
public function Init():void{
RandomNumber.seed = Math.floor(((Math.random() * 20) + 1));
_gameContext.getPadManager().setKeyControls(_controls);
_tokenManager.init();
_callInClip = _gameContext.parent.getChildByName("beetleClip");
_gameOver = false;
_killCounter = 0;
_gunsEnabled = false;
_slowMax = 1;
_slowFactor = 0;
_decisionTime = 1;
_attackRecharge = 2;
_score = 0;
_gameTimer = 0;
_gameContext.scrollRect = new Rectangle(0, 0, 600, 400);
}
public function initHero(){
_hero = new Hero(_gameContext, 300, _groundY);
_hero.Init();
_board.addChildAt(_hero.sprite, 0);
}
public function setEnemiesCollide(){
var _local1:*;
_local1 = 0;
while (_local1 < _enemies.length) {
_enemies[_local1]._collide = true;
_local1++;
};
_bigEnemy._collide = true;
}
public function checkBeetleCollision(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = _enemies.length;
_local2 = _beetle.sprite.getChildByName("attackbox");
_local4 = 0;
while (_local4 < _local1) {
_local5 = _enemies[_local4];
if (_local5._beetleHit){
_local5.glowOn();
} else {
_local5.glowOff();
};
if (((((((!(_local5.inBounds())) || (!(_local5._active)))) || (!(_local5._collide)))) || (_local5._beetleHit))){
} else {
_local3 = _local5.sprite.getChildByName("hitbox");
if (_local2.hitTestObject(_local3)){
_comboCount++;
_hero._lastHitTime = _gameTimer;
_local5._punched = true;
_local5._beetleHit = true;
_local5.takeDamage(BlueBeetle.DAMAGE_JET);
_local5.Update();
_local5.Update();
hitSpark("beetle");
_soundModule.playSoundByEvent(SoundData.BEETLE_JETPACK_ATTACK);
};
};
_local4++;
};
if (_bigEnemy._beetleHit){
_bigEnemy.glowOn();
} else {
_bigEnemy.glowOff();
};
if (((((((_bigEnemy.inBounds()) && (_bigEnemy._active))) && (_bigEnemy._collide))) && (!(_bigEnemy._beetleHit)))){
_local3 = _bigEnemy.sprite.getChildByName("hitbox");
if (_local2.hitTestObject(_local3)){
_comboCount++;
_hero._lastHitTime = _gameTimer;
_bigEnemy._punched = true;
_bigEnemy._beetleHit = true;
_bigEnemy.takeDamage(BlueBeetle.DAMAGE_JET);
hitSpark("beetle");
_bigEnemy.Update();
_bigEnemy.Update();
_soundModule.playSoundByEvent(SoundData.BEETLE_JETPACK_ATTACK);
};
};
}
public function checkEnemyAttackCollision():int{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local1 = _enemies.length;
_local2 = _hero.sprite.getChildByName("hitbox");
_local4 = 0;
while (_local4 < _local1) {
if (((((((!(_enemies[_local4]._active)) || (!(_enemies[_local4]._isAttacking)))) || (_enemies[_local4]._hitBatman))) || (_hero._isStunned))){
} else {
_local3 = _enemies[_local4].sprite.getChildByName("attackbox");
if (_local2.hitTestObject(_local3)){
_enemies[_local4]._hitBatman = true;
_soundModule.playSoundByEvent(SoundData.HERO_HIT_BY_MELEE1);
damageSpark((1 - (2 * Number(_enemies[_local4]._isFacingRight))));
return (1);
};
};
_local4++;
};
_local5 = 0;
while (_local5 < _bullets.length) {
if (!_bullets[_local5]._active){
} else {
_local6 = _bullets[_local5].getChildByName("hitbox");
if (_local2.hitTestObject(_local6)){
trace(((">>bullet " + _local5) + " hit"));
_bullets[_local5]._active = false;
_bullets[_local5].play();
_soundModule.playSoundByEvent(SoundData.HERO_HIT_BY_RANGED1);
damageSpark((1 - (2 * Number((_bullets[_local5].xvel > 0)))));
return (1);
};
};
_local5++;
};
if (((((((_bigEnemy._active) && (_bigEnemy._isAttacking))) && (!(_bigEnemy._hitBatman)))) && (!(_hero._isStunned)))){
_local3 = _bigEnemy.sprite.getChildByName("attackbox");
if (_local2.hitTestObject(_local3)){
_bigEnemy._hitBatman = true;
_soundModule.playSoundByEvent(SoundData.HERO_HIT_BY_MELEE2);
damageSpark((1 - (2 * Number(_bigEnemy._isFacingRight))));
return (1);
};
};
return (0);
}
public function updateBeetle(){
_beetle.Update();
}
public function updateHealthBar(){
var _local1:*;
var _local2:*;
if (_healthBar == null){
_healthBar = _hud.getChildByName("healthbar");
};
_local1 = (101 - _hero._health);
_healthBar.gotoAndStop(_local1);
_local2 = _hud.getChildByName("batmanAvatar");
if (_hero._health <= 25){
if (_local2.currentFrame == 1){
_local2.gotoAndPlay(2);
};
_hudSounds = _soundModule.playSoundByEvent(SoundData.HERO_HEALTH_LOW);
} else {
_local2.gotoAndStop(1);
_soundModule.stopSound(_hudSounds);
};
}
public function reset(){
var _local1:*;
var _local2:Enemy;
trace(">>> GameData.reset() <<<");
_gameOver = false;
_hero.reset();
_tokenManager.reset();
resetBullets();
resetHUD();
_local1 = 0;
while (_local1 < _enemies.length) {
_local2 = _enemies[_local1];
_local2._active = false;
_local2._recycle = false;
_local2.moveTo(-200, -200);
_local2.setNextState(_enemies[_local1].AIStates[Enemy.STATE_INACTIVE]);
_local1++;
};
_bigEnemy._active = false;
_bigEnemy._recycle = false;
_bigEnemy.moveTo(-200, -200);
_bigEnemy.setNextState(_bigEnemy.AIStates[BigEnemy.STATE_INACTIVE]);
_killCounter = 0;
_maxEnemiesAllowed = 1;
_gunsEnabled = false;
_slowMax = 1;
_slowFactor = 0;
_decisionTime = 1;
_attackRecharge = 2;
_score = 0;
_gameTimer = 0;
}
public function spawnBullet(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:*;
var _local5:MovieClip;
_local4 = 0;
while (_local4 < _bullets.length) {
if (!_bullets[_local4]._active){
_local5 = _bullets[_local4];
_local5._active = true;
_local5._vel = _arg3;
_local5.x = _arg1;
_local5.y = _arg2;
_local5.gotoAndPlay(2);
if (_arg3 < 0){
_local5.scaleX = -1;
} else {
_local5.scaleX = 1;
};
return;
};
_local4++;
};
}
public function resetBullets(){
var _local1:*;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < _bullets.length) {
_local2 = _bullets[_local1];
_local2._active = false;
_local2._vel = 0;
_local2.x = -200;
_local2.y = -200;
_local2.gotoAndStop(1);
_local1++;
};
}
public function toString():String{
return ("GameData()");
}
public function initBlueBeetle(){
var _local1:*;
_beetle = new BlueBeetle(_gameContext, -200, -200);
_beetle.Init();
_board.addChildAt(_beetle.sprite, 0);
_local1 = _beetle.sprite.getChildByName("beam");
_local1.visible = false;
_beamSplash = new beamSplash();
_board.addChildAt(_beamSplash, 1);
_beamSplash.stop();
_beamSplash.visible = false;
}
public function updateHUD(){
var _local1:*;
var _local2:*;
var _local3:*;
updateHealthBar();
updateBeetleBar();
updateComboHUD();
_local1 = _hud.getChildByName("scorebox");
_local1.text = _score;
_local2 = _hud.getChildByName("combo");
_local3 = _local2.getChildByName("counter");
_local3.text = _comboCount;
}
public function addScore(_arg1:int){
_score = (_score + _arg1);
}
public function updateComboHUD(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = _hud.getChildByName("combo");
_local2 = _local1.getChildByName("comboTimer");
_local3 = (60 - Math.floor(((60 * (_gameTimer - _hero._lastHitTime)) / Hero.COMBO_DURATION)));
_local2.gotoAndStop(_local3);
if ((_gameTimer - _hero._lastHitTime) > Hero.COMBO_DURATION){
_comboCount = 0;
};
}
public function initParticles(){
_particles = new ParticleSystem(_gameContext);
_gameContext.addChild(_particles);
_particles.init();
}
public function initBullets(){
var _local1:*;
var _local2:MovieClip;
_bullets = new Array();
_local1 = 0;
while (_local1 < 50) {
_local2 = new bullet();
_local2._active = false;
_local2._vel = 0;
_local2.x = -200;
_local2.y = -200;
_bullets.push(_local2);
_board.addChildAt(_local2, 0);
_local1++;
};
}
public function beetleComplete(){
var _local1:*;
var _local2:*;
_local1 = _enemies.length;
_local2 = 0;
while (_local2 < _local1) {
_enemies[_local2]._beetleHit = false;
_enemies[_local2].glowOff();
_local2++;
};
_bigEnemy._beetleHit = false;
_bigEnemy.glowOff();
}
public function useBeetle(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = _hud.getChildByName("bbCall1");
_local2 = _hud.getChildByName("bbCall2");
_local3 = _hud.getChildByName("bbCall3");
if (_hero._numTokens < 100){
_local1.gotoAndStop(1);
_local2.gotoAndStop(1);
_local3.gotoAndStop(1);
} else {
if (_hero._numTokens < 200){
_local2.gotoAndStop(1);
_local3.gotoAndStop(1);
} else {
_local3.gotoAndStop(1);
};
};
_soundModule.playSoundByEvent(SoundData.BEETLE_CALLED_ANIM);
}
public function adjustDifficulty(){
var _local1:*;
var _local2:*;
var _local3:*;
_decisionTime = (1 - (_killCounter / 200));
if (_decisionTime < 0){
_decisionTime = 0;
};
_maxEnemiesAllowed = (1 + Math.floor((_killCounter / 10)));
if (_killCounter > 20){
_gunsEnabled = true;
};
if (_killCounter > 40){
_bigEnemyEnabled = true;
} else {
_bigEnemyEnabled = false;
};
if (((_bigEnemyEnabled) && (!(_bigEnemy._active)))){
spawnBigEnemy();
};
_local1 = _enemies.length;
_local2 = 0;
_local3 = 0;
while (_local3 < _local1) {
if (_enemies[_local3]._active){
_local2++;
};
_local3++;
};
if (_bigEnemy._active){
_maxEnemiesAllowed = (_maxEnemiesAllowed - 4);
};
if (_local2 < _maxEnemiesAllowed){
spawnEnemy();
};
}
public function damageSpark(_arg1:int){
_particles.generate(10, 5, _arg1, _hero._x, (_hero._y - 80));
_particles.generate(1, 6, _arg1, _hero._x, (_hero._y - 80));
_particles.generate(3, 7, _arg1, _hero._x, (_hero._y - 80));
}
public function updateBullets(){
var _local1:*;
_local1 = 0;
while (_local1 < _bullets.length) {
if (_bullets[_local1]._active){
_bullets[_local1].x = (_bullets[_local1].x + (_bullets[_local1]._vel / _slowMax));
if ((((_bullets[_local1].x < -100)) || ((_bullets[_local1].x > 700)))){
_bullets[_local1]._active = false;
_bullets[_local1].x = -200;
_bullets[_local1].y = -200;
};
} else {
_bullets[_local1].gotoAndStop(1);
_bullets[_local1].x = -200;
_bullets[_local1].y = -200;
};
_local1++;
};
}
public function updateGameTimer(){
_gameTimer = (_gameTimer + _gameContext.getDT());
}
public function configGameLayers():void{
_background = new BG();
_gameContext.addChild(_background);
_board = new Sprite();
_gameContext.addChild(_board);
_gameContext.addChild(_tokenManager);
_foreground = new Sprite();
_gameContext.addChild(_foreground);
}
public function updateShake(){
if (_shakeAmplitude > 0){
_shakeAngle = (_shakeAngle + (3.14 / 2));
_gameContext.y = (_shakeAmplitude * Math.sin(_shakeAngle));
_shakeAmplitude = (_shakeAmplitude - 0.4);
} else {
_shakeAmplitude = 0;
_shakeAngle = 0;
};
}
public function updateEntities(){
var _local1:*;
_hero.Update();
_local1 = 0;
while (_local1 < _enemies.length) {
_enemies[_local1].Update();
_local1++;
};
_bigEnemy.Update();
}
public function getGameLayer(_arg1:Number):DisplayObjectContainer{
switch (_arg1){
case STAGE:
return (_gameContext._stage);
case BACKGROUND:
return (_background);
case BOARD:
return (_board);
case FOREGROUND:
return (_foreground);
default:
return (_gameContext._stage);
};
}
public function spawnEnemy(){
var _local1:*;
var _local2:*;
_local1 = _enemies.length;
_local2 = 0;
while (_local2 < _local1) {
if (!_enemies[_local2]._active){
_enemies[_local2].reset();
return;
};
_local2++;
};
}
public function initHUD(){
_hud = new HUD();
_gameContext.addChild(_hud);
}
public function checkForHealthDrop(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = (100 - _hero._health);
_local2 = (100 - _killCounter);
_local3 = ((_local1 * _local2) / 10000);
if ((((Math.random() < _local3)) && ((_hero._health > 0)))){
_tokenManager.spawnHealth();
};
}
public function checkBestScore():Boolean{
_savedGame = SharedObject.getLocal(_savedGameDirectory);
trace((">> prev best score:" + _savedGame.data.bestScore));
if (_savedGame.data.bestScore == undefined){
_savedGame.data.bestScore = _score;
_bestScore = _score;
trace("%%% no best score found %%%");
return (true);
};
_bestScore = _savedGame.data.bestScore;
if (_score > _bestScore){
trace("********** new personal best score *************");
_savedGame.data.bestScore = _score;
return (true);
};
trace("(((( not a high score ))))");
return (false);
}
public function initEnemies(){
var _local1:*;
var _local2:Enemy;
_enemies = new Array();
_local1 = 0;
while (_local1 < 50) {
_local2 = new Enemy(_gameContext, -200, -200, _local1);
_enemies.push(_local2);
_local2.Init();
_board.addChildAt(_local2.sprite, 1);
_local1++;
};
_bigEnemy = new BigEnemy(_gameContext, -200, -200, (50 + 1));
_bigEnemy.Init();
_board.addChildAt(_bigEnemy.sprite, 0);
}
}
}//package Game
Section 89
//GameManager (Game.GameManager)
package Game {
import Base.*;
import Game.GameStates.*;
public class GameManager {
private var _currentGameState;
private var _followingGameState;
private var _nextGameState;
private var _gameContext:GameEntry;
public function GameManager(_arg1:GameEntry){
trace("|----@ GAME MANAGER @----|");
_gameContext = _arg1;
_currentGameState = null;
setNextState(G_Intro);
}
public function setNextState(_arg1){
_nextGameState = new _arg1(_gameContext);
}
public function getFollowingGameState(){
return (_followingGameState);
}
public function getCurrentGameState():GameState{
return (_currentGameState);
}
public function setFollowingGameState(_arg1){
_followingGameState = _arg1;
}
public function Update(){
if (_nextGameState.isTransitioning()){
return;
};
if (_currentGameState != _nextGameState){
_currentGameState = _nextGameState;
_currentGameState.Entry();
} else {
if (_currentGameState == _nextGameState){
_currentGameState.Update();
if (_currentGameState != _nextGameState){
_currentGameState.Exit();
_currentGameState = null;
};
};
};
}
}
}//package Game
Section 90
//Hero (Game.Hero)
package Game {
import Base.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import Game.AIStates.*;
public class Hero extends Entity {
public var _xvel:Number;
public var _isStunned:Boolean;// = false
public var _health:int;
public var _isCrouching:Boolean;// = false
public var _mostRecentEnemy;
public var loopChannel:SoundChannel;
public var _numTokens:int;
public var sprite:MovieClip;
public var AIStates:Array;
public var _lastHitTime:Number;
public var _animator:SpriteAnimator;
public var _isAttacking:Boolean;// = false
public var _recycle:Boolean;// = false
public var _isFacingRight:Boolean;// = true
public var _yvel:Number;
public var _isJumping:Boolean;// = false
var snd:SoundModule;
public var _isMoving:Boolean;// = false
public var _x:Number;
public var _y:Number;
public var _isWalking:Boolean;// = false
public static const STATE_ATTACK_BELTSWORD:int = 9;
public static const ANIM_BELTSWORD:Object = {start:173, end:184, loop:false};
public static const ANIM_RIGHTCROSS:Object = {start:158, end:171, loop:false};
public static const STATE_ATTACK_LEFTJAB:int = 7;
public static const STATE_RUN:int = 2;
public static const ANIM_DEFEAT:Object = {start:204, end:212, loop:false};
public static const ANIM_JUMP:Object = {start:90, end:144, loop:false};
public static const STATE_STUNNED:int = 6;
public static const ANIM_DUCK:Object = {start:223, end:230, loop:false};
public static const ANIM_JUMPKICK:Object = {start:213, end:222, loop:false};
public static const DAMAGE_JAB = 10;
public static const _minX = 25;
public static const STATE_ATTACK_RIGHTCROSS:int = 8;
public static const DAMAGE_UPKNEE = 15;
public static const _yJumpVel = -35;
public static const ANIM_WALK:Object = {start:49, end:68, loop:true};
public static const STATE_MAXCOUNT = 16;
public static const STATE_JUMP:int = 4;
public static const STATE_DEFEAT:int = 13;
public static const ANIM_IDLE:Object = {start:1, end:48, loop:true};
public static const STATE_DUCK:int = 5;
public static const STATE_ATTACK_JUMPKICK:int = 11;
public static const DAMAGE_JUMPKICK = 25;
public static const COMBO_DURATION = 2;
public static const DAMAGE_FOOTSWEEP = 15;
public static const ANIM_LEFTJAB:Object = {start:145, end:155, loop:false};
public static const STATE_WALK:int = 1;
public static const ANIM_UPKNEE:Object = {start:185, end:203, loop:false};
public static const ANIM_RUN:Object = {start:69, end:89, loop:true};
public static const STATE_IDLE:int = 0;
public static const STATE_ATTACK_UPKNEE:int = 10;
public static const DAMAGE_BELTSWORD = 25;
public static const _maxX = 575;
public static const _xvelWalk = 10;
public static const _xvelRun = 20;
public static const DAMAGE_RIGHTCROSS = 15;
public static const STATE_ATTACK_FOOTSWEEP:int = 12;
public static const ANIM_FOOTSWEEP:Object = {start:245, end:260, loop:false};
public static const ANIM_STUNNED:Object = {start:231, end:244, loop:false};
public function Hero(_arg1:GameEntry, _arg2:int, _arg3:int){
_isFacingRight = true;
_isMoving = false;
_isJumping = false;
_isAttacking = false;
_isWalking = false;
_isCrouching = false;
_isStunned = false;
_recycle = false;
trace("-- new Hero()");
AIStates = new Array(STATE_MAXCOUNT);
AIStates[STATE_IDLE] = new Hero_Idle(_arg1, this);
AIStates[STATE_WALK] = new Hero_Walk(_arg1, this);
AIStates[STATE_RUN] = new Hero_Run(_arg1, this);
AIStates[STATE_JUMP] = new Hero_Jump(_arg1, this);
AIStates[STATE_STUNNED] = new Hero_Stunned(_arg1, this);
AIStates[STATE_DUCK] = new Hero_Duck(_arg1, this);
AIStates[STATE_ATTACK_LEFTJAB] = new Hero_Attack_LeftJab(_arg1, this);
AIStates[STATE_ATTACK_RIGHTCROSS] = new Hero_Attack_RightCross(_arg1, this);
AIStates[STATE_ATTACK_BELTSWORD] = new Hero_Attack_BeltSword(_arg1, this);
AIStates[STATE_ATTACK_UPKNEE] = new Hero_Attack_UpKnee(_arg1, this);
AIStates[STATE_ATTACK_JUMPKICK] = new Hero_Attack_JumpKick(_arg1, this);
AIStates[STATE_ATTACK_FOOTSWEEP] = new Hero_Attack_FootSweep(_arg1, this);
AIStates[STATE_DEFEAT] = new Hero_Defeat(_arg1, this);
super(_arg1, AIStates[STATE_IDLE]);
snd = _gameData.getSoundModule();
_x = _arg2;
_y = _arg3;
_yvel = 0;
}
public function startAnimating(_arg1:Object):void{
_animator.startAnimating(_arg1.start, _arg1.end, _arg1.loop, -1, (32 / _gameData._slowMax));
updateAnimation();
}
public function Init():void{
sprite = new batman();
sprite.gotoAndStop(1);
sprite.x = _x;
sprite.y = _y;
_animator = new SpriteAnimator(_gameContext, sprite);
loopChannel = new SoundChannel();
_numTokens = 0;
_health = 100;
_lastHitTime = 0;
}
public function updateAnimation():int{
var _local1:int;
_animator.animateSprite();
_local1 = _animator.animateSprite();
return (_local1);
}
public function getToken(){
trace("$$ token $$");
if (_numTokens < 300){
if ((((_numTokens >= 90)) && ((_numTokens < 100)))){
_gameData.addBeetle(1);
} else {
if ((((_numTokens >= 190)) && ((_numTokens < 200)))){
_gameData.addBeetle(2);
} else {
if (_numTokens == 290){
_gameData.addBeetle(3);
};
};
};
_numTokens = (_numTokens + 10);
};
snd.playSoundByEvent(SoundData.HERO_PICKUP_BEETLES);
}
public function reset(){
_recycle = true;
_isFacingRight = true;
_isMoving = false;
_isJumping = false;
_isAttacking = false;
_isWalking = false;
_isCrouching = false;
_isStunned = false;
_health = 100;
_numTokens = 0;
_x = 300;
sprite.x = 300;
setNextState(AIStates[Hero.STATE_IDLE]);
}
public function offsetPosition(_arg1:Number, _arg2:Number){
_arg1 = (_arg1 / _gameData._slowMax);
_arg2 = (_arg2 / _gameData._slowMax);
_x = (_x + _arg1);
_y = (_y + _arg2);
sprite.x = (sprite.x + _arg1);
sprite.y = (sprite.y + _arg2);
if (_x < 20){
_x = 20;
sprite.x = 20;
};
if (_x > 580){
_x = 580;
sprite.x = 580;
};
if (_y > GameData._groundY){
_y = GameData._groundY;
sprite.y = GameData._groundY;
};
}
public function addHealth(_arg1:int){
_health = (_health + _arg1);
if (_health > 100){
_health = 100;
};
snd.playSoundByEvent(SoundData.HERO_PICKUP_HEALTH);
}
public function takeDamage(_arg1:int){
_health = (_health - _arg1);
}
function toString():String{
return ("Hero()");
}
}
}//package Game
Section 91
//ParticleSystem (Game.ParticleSystem)
package Game {
import Base.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import Game.*;
import flash.geom.*;
class ParticleSystem extends MovieClip {
private var _varDelay:Number;
private var _count:Number;
private var _gameData:GameData;
private var _mc:MovieClip;
private var _moveCount;
private var _paused:Boolean;
private var _genInterval:Number;
private var _xvar:Number;
private var _initScale:Number;
private var _movesMax;// = 16
private var _initAlpha:Number;
private var _alphaVel:Number;
private var _bmp:Bitmap;
private var _yvar:Number;
private var _rotVar:Number;
private var _baseDepth;// = 0
private var _trashcan:Array;
private var _pool:Array;
private var _xvel:Number;
private var _particleLinkage:String;
private var _particles:Array;
private var _radial:Boolean;
private var _grav;// = 0
private var _scaleVel:Number;
private var _yvel:Number;
private var _blend;
private var _multiple;
private var _rotVel;
private var _bmpData:BitmapData;
private var _gameContext:GameEntry;
private var _bmpRect:Rectangle;
private var _dir:int;
private var _angle;
private var _life:Number;
private var _srcx;
private var _srcy;
function ParticleSystem(_arg1:GameEntry){
_movesMax = 16;
_grav = 0;
_baseDepth = 0;
super();
_gameContext = _arg1;
_gameData = _arg1.getGameData();
_xvel = 50;
_yvel = 50;
_radial = true;
_xvar = 3;
_yvar = 3;
_rotVar = 180;
_rotVel = 0;
_initScale = 1;
_scaleVel = -0.2;
_varDelay = 5;
_initAlpha = 1;
_alphaVel = -0.05;
_genInterval = 1;
_blend = "add";
_multiple = 1;
_life = 100;
}
public function moveTo(_arg1, _arg2){
x = _arg1;
y = _arg2;
}
public function resume(){
if (!_paused){
return;
};
trace("running");
_paused = false;
}
public function cleanUp(){
var _local1:*;
var _local2:*;
_paused = true;
_local1 = _particles.length;
while (_local1--) {
_local2 = _particles[_local1];
_local2.x = -100;
_local2.y = -100;
_pool.push(_local2);
};
_particles = [];
}
public function update(){
var _local1:*;
var _local2:*;
_local1 = _particles.length;
while (_local1--) {
_local2 = _particles[_local1];
_local2.tick = (_local2.tick + (1 / _gameData._slowMax));
_local2.vy = (_local2.vy - _grav);
if (_local2.tick > 1){
_local2.y = (_local2.y - (_local2.vy / _gameData._slowMax));
_local2.x = (_local2.x + (_local2.vx / _gameData._slowMax));
};
_local2.rotation = (_local2.rotation - (_rotVel / _gameData._slowMax));
if (_local2.tick > _local2.delay){
_local2.alpha = (_local2.alpha + (_local2.alphaVel / _gameData._slowMax));
};
_local2.scaleX = (_local2.scaleY = (_local2.scaleY + (_local2.scaleVel / _gameData._slowMax)));
if ((((((_local2.alpha <= 0.1)) || ((_local2.scaleX <= 0.1)))) || ((_local2.tick > _local2.life)))){
_particles.splice(_local1, 1);
_local2.x = -100;
_local2.y = -100;
_local2.visible = false;
_pool.push(_local2);
};
_local2.blendMode = _blend;
};
}
public function init(){
var _local1:*;
var _local2:particle;
trace("-- ParticleSystem.init() --");
_particles = [];
_trashcan = [];
_count = 0;
_paused = false;
_pool = new Array();
_local1 = 0;
while (_local1 < 200) {
_local2 = new particle();
this.addChildAt(_local2, _count);
_count++;
_local2.x = -100;
_local2.y = -100;
_pool.push(_local2);
_local1++;
};
_srcx = 300;
_srcy = 200;
_dir = 0;
}
public function generate(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number){
var _local6:*;
var _local7:particle;
var _local8:*;
var _local9:*;
if (_arg2 == 2){
_xvel = (_yvel = 15);
} else {
_xvel = (_yvel = 40);
};
_local6 = _arg1;
if (_paused == false){
while (_local6--) {
if ((_count % _genInterval) != 0){
return;
};
if (_pool.length == 0){
_local7 = new particle();
this.addChildAt(_local7, _count);
_count++;
_pool.push(_local7);
} else {
_local7 = _pool.pop();
_local7.visible = true;
};
_local7.gotoAndStop(_arg2);
_local7.scaleX = (_local7.scaleY = (Math.random() * _initScale));
_local7.x = _arg4;
_local7.y = _arg5;
_local7.scaleVel = _scaleVel;
_local7.alphaVel = _alphaVel;
_local7.life = _life;
_local7.v = _xvel;
_local8 = 360;
if (_arg2 == 1){
_local7.scaleVel = -0.1;
_local8 = 90;
} else {
if (_arg2 == 2){
_local7.scaleVel = 1;
_local7.alphaVel = -0.5;
_local8 = 90;
} else {
if (_arg2 == 3){
_local7.scaleVel = 0;
_local7.alphaVel = -0.1;
_local7.life = 10;
_local8 = 90;
} else {
if (_arg2 == 5){
_local7.scaleVel = -0.1;
_local8 = 90;
} else {
if (_arg2 == 6){
_local7.scaleVel = 1;
_local7.alphaVel = -0.5;
_local8 = 90;
} else {
if (_arg2 == 7){
_local7.scaleVel = 0;
_local7.alphaVel = -0.1;
_local7.life = 10;
_local8 = 90;
} else {
if (_arg2 == 10){
_local7.scaleVel = 0.2;
_local7.life = 40;
_local7.alphaVel = -0.05;
_local7.v = 15;
} else {
if (_arg2 == 11){
_local7.scaleVel = 1;
_local7.alphaVel = -0.02;
_local7.life = 40;
_local7.v = 10;
} else {
if (_arg2 == 12){
_local7.scaleVel = 0.05;
_local7.alphaVel = -0.02;
_local7.life = 40;
_local7.v = (Math.random() * 40);
} else {
if (_arg2 == 13){
_local7.scaleVel = 0.05;
_local7.alphaVel = -0.02;
_local7.life = 40;
_local7.v = (Math.random() * 20);
};
};
};
};
};
};
};
};
};
};
if (_radial == true){
if (_arg3 == 0){
_dir = 45;
} else {
if (_arg3 == -1){
_dir = 135;
} else {
_dir = 315;
};
};
_local9 = ((3.14 / 180) * (_dir + (_local8 * Math.random())));
_local7.vx = (_local7.v * Math.cos(_local9));
_local7.vy = (_local7.v * Math.sin(_local9));
} else {
_local7.vx = _xvel;
_local7.vy = _yvel;
};
_local7.rotation = ((-180 / 3.14) * Math.atan2(_local7.vy, _local7.vx));
_local7.alpha = _initAlpha;
_local7.delay = _varDelay;
_local7.tick = 0;
_particles.push(_local7);
};
};
}
public function pause(){
trace("paused");
_paused = true;
}
}
}//package Game
Section 92
//SoundData (Game.SoundData)
package Game {
public class SoundData {
public static var HERO_PICKUP_HEALTH:Object = {linkage:"heroPickupHealth", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_SWING6:Object = {linkage:"heroSwing6", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_SWING8:Object = {linkage:"heroSwing8", vol:1, pan:0, offset:0, loop:false, force:true};
public static var BOSS_FOOTSTEPS:Object = {linkage:"bossFootsteps", vol:1, pan:0, offset:0, loop:true, force:false};
public static var HERO_SWING4:Object = {linkage:"heroSwing4", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_SWING5:Object = {linkage:"heroSwing5", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_SLIDE:Object = {linkage:"heroSlide", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_JETPACK:Object = {linkage:"beetleJetpack", vol:1, pan:0, offset:0, loop:true, force:false};
public static var HERO_LAND:Object = {linkage:"heroLand", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_HIT_GROUND:Object = {linkage:"enemyHitGround", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_DEATH:Object = {linkage:"bossDeath", vol:1, pan:0, offset:0, loop:false, force:false};
public static var MUSIC_STORY:Object = {linkage:"music_story", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_POSE:Object = {linkage:"beetlePose", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_KICK1:Object = {linkage:"heroKick1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_KICK2:Object = {linkage:"heroKick2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_KICK3:Object = {linkage:"heroKick3", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_KICK4:Object = {linkage:"heroKick4", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_RANGED_ATTACK2:Object = {linkage:"enemyRangedAttack2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_GRUNT1:Object = {linkage:"bossGrunt1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_GRUNT2:Object = {linkage:"bossGrunt2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_GRUNT3:Object = {linkage:"bossGrunt3", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_RANGED_ATTACK1:Object = {linkage:"enemyRangedAttack1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_GRUNT6:Object = {linkage:"bossGrunt6", vol:1, pan:0, offset:0, loop:false, force:false};
public static var GROUP_HERO_SWING:Array = [HERO_SWING1, HERO_SWING2, HERO_SWING3, HERO_SWING4, HERO_SWING5, HERO_SWING6];
public static var HERO_HEALTH_LOW:Object = {linkage:"heroHealthLow", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_GRUNT5:Object = {linkage:"bossGrunt5", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_FOOTSTEPS:Object = {linkage:"enemyFootsteps", vol:1, pan:0, offset:0, loop:true, force:false};
public static var BOSS_GRUNT4:Object = {linkage:"bossGrunt4", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_JUMP:Object = {linkage:"heroJump", vol:1, pan:0, offset:0, loop:false, force:true};
public static var BEETLE_TAKEOFF:Object = {linkage:"beetleTakeoff", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_FOOTSTEPS:Object = {linkage:"heroFootsteps", vol:1, pan:0, offset:0, loop:true, force:false};
public static var BTN_PRESS:Object = {linkage:"sfx_buttonpress", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_MELEE_ATTACK1:Object = {linkage:"enemyMeleeAttack1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_MELEE_ATTACK2:Object = {linkage:"enemyMeleeAttack2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var GROUP_HERO_PUNCH:Array = [HERO_PUNCH1, HERO_PUNCH2, HERO_PUNCH3, HERO_PUNCH4, HERO_PUNCH5, HERO_PUNCH6];
public static var ENEMY_MELEE_ATTACK4:Object = {linkage:"enemyMeleeAttack4", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_MELEE_ATTACK3:Object = {linkage:"enemyMeleeAttack3", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_AIRBOURNE:Object = {linkage:"enemyAirbourne", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_CALLED_ANIM:Object = {linkage:"beetleCalledAnim", vol:1, pan:0, offset:0, loop:false, force:false};
public static var MUSIC_END:Object = {linkage:"music_end", vol:1, pan:0, offset:0, loop:false, force:false};
public static var GROUP_HERO_KICK:Array = [HERO_KICK1, HERO_KICK2, HERO_KICK3, HERO_KICK4];
public static var MUSIC_INTRO:Object = {linkage:"music_introSting", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_HIT_BY_RANGED1:Object = {linkage:"heroHitByRanged1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_HIT_BY_RANGED2:Object = {linkage:"heroHitByRanged2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_JETPACK_ATTACK:Object = {linkage:"beetleJetpackAttack", vol:0.6, pan:0, offset:0, loop:false, force:true};
public static var HERO_PICKUP_BEETLES:Object = {linkage:"heroPickupBeetles", vol:1, pan:0, offset:0, loop:false, force:true};
public static var BOSS_MELEE_ATTACK1:Object = {linkage:"bossMeleeAttack1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BOSS_MELEE_ATTACK2:Object = {linkage:"bossMeleeAttack2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_DEATH:Object = {linkage:"enemyDeath", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_BEAM_ATTACK:Object = {linkage:"beetleBeamAttack", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_PUNCH1:Object = {linkage:"heroPunch1", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_PUNCH2:Object = {linkage:"heroPunch2", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_PUNCH3:Object = {linkage:"heroPunch3", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_PUNCH4:Object = {linkage:"heroPunch4", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_PUNCH5:Object = {linkage:"heroPunch5", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_PUNCH6:Object = {linkage:"heroPunch6", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_DEATH:Object = {linkage:"heroDeath", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_HAMMER_ATTACK:Object = {linkage:"beetleHammerAttack", vol:2, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_GRUNT3:Object = {linkage:"enemyGrunt3", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_GRUNT5:Object = {linkage:"enemyGrunt5", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_GRUNT6:Object = {linkage:"enemyGrunt6", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_DUCK:Object = {linkage:"heroDuck", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_GRUNT1:Object = {linkage:"enemyGrunt1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_GRUNT2:Object = {linkage:"enemyGrunt2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var ENEMY_GRUNT4:Object = {linkage:"enemyGrunt4", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_LANDING:Object = {linkage:"beetleLanding", vol:1, pan:0, offset:0, loop:false, force:false};
public static var MUSIC_GAME:Object = {linkage:"music_game", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_HIT_BY_MELEE1:Object = {linkage:"heroHitByMelee1", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_HIT_BY_MELEE2:Object = {linkage:"heroHitByMelee2", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BEETLE_CALL_READY:Object = {linkage:"beetleCallReady", vol:1, pan:0, offset:0, loop:false, force:false};
public static var BTN_OVER:Object = {linkage:"sfx_buttonover", vol:1, pan:0, offset:0, loop:false, force:false};
public static var HERO_SWING2:Object = {linkage:"heroSwing2", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_SWING3:Object = {linkage:"heroSwing3", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_SWING7:Object = {linkage:"heroSwing7", vol:1, pan:0, offset:0, loop:false, force:true};
public static var HERO_SWING1:Object = {linkage:"heroSwing1", vol:1, pan:0, offset:0, loop:false, force:true};
public static function setTransform(_arg1:Object, _arg2:Number, _arg3:Number){
_arg1.vol = _arg2;
_arg1.pan = _arg3;
}
public static function getSoundLinkage(_arg1:Object):String{
return (_arg1.linkage);
}
}
}//package Game
Section 93
//TokenManager (Game.TokenManager)
package Game {
import Base.*;
import flash.display.*;
public class TokenManager extends MovieClip {
var MAX_TOKENS;// = 50
var _healthToken;
var _gameContext:GameEntry;
var SCARAB_EXPIRE;// = 150
var _tokenList:Array;
public function TokenManager(_arg1:GameEntry){
MAX_TOKENS = 50;
SCARAB_EXPIRE = 150;
super();
_gameContext = _arg1;
}
public function spawnTokens(_arg1:int, _arg2:Number, _arg3:Number){
var _local4:MovieClip;
var _local5:*;
var _local6:*;
trace(((("%%% spawn tokens %%% " + _arg2) + ":") + _arg3));
_local5 = 0;
_local6 = 0;
while (_local6 < MAX_TOKENS) {
_local4 = _tokenList[_local6];
if (!_local4.active){
_local4.gotoAndStop(1);
_local4.active = true;
_local4.age = 0;
_local4.x = _arg2;
_local4.y = _arg3;
_local4.xvel = (40 * (-0.5 + Math.random()));
_local4.yvel = (-20 * Math.random());
++_local5;
if (_local5 == _arg1){
return;
};
};
_local6++;
};
}
public function init(){
var _local1:*;
var _local2:MovieClip;
_tokenList = [];
_local1 = 0;
while (_local1 < MAX_TOKENS) {
_local2 = new token();
_local2.x = -100;
_local2.y = -100;
_local2.velx = 0;
_local2.vely = 0;
_local2.active = false;
_local2.age = 0;
this.addChild(_local2);
_tokenList.push(_local2);
_local1++;
};
_healthToken = new health();
_healthToken.x = 400;
_healthToken.y = -100;
_healthToken.active = false;
this.addChild(_healthToken);
}
public function checkCollision(){
var _local1:MovieClip;
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = _gameContext.getGameData()._hero;
_local3 = _local2.sprite.getChildByName("hitbox");
_local4 = 0;
while (_local4 < MAX_TOKENS) {
_local1 = _tokenList[_local4];
if (_local1.active){
if (_local3.hitTestObject(_local1)){
_local1.active = false;
_local1.xvel = 0;
_local1.yvel = 0;
_local2.getToken();
_local1.play();
};
};
_local4++;
};
if (!_healthToken.active){
return;
};
if (_local3.hitTestObject(_healthToken)){
_healthToken.active = false;
_healthToken.xvel = 0;
_healthToken.yvel = 0;
_healthToken.play();
_gameContext.getGameData()._hero.addHealth(25);
};
}
public function reset(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < MAX_TOKENS) {
_local2 = _tokenList[_local1];
_local2.x = -100;
_local2.y = -100;
_local2.velx = 0;
_local2.vely = 0;
_local2.active = false;
_local2.age = 0;
_local1++;
};
_healthToken.x = 400;
_healthToken.y = -100;
_healthToken.active = false;
_healthToken.yvel = 0;
}
public function spawnHealth(){
trace("%%% spawn health %%% ");
_healthToken.x = (50 + (500 * Math.random()));
_healthToken.y = -100;
_healthToken.active = true;
_healthToken.yvel = 0;
_healthToken.gotoAndStop(1);
}
public function update(){
var _local1:MovieClip;
var _local2:*;
if (_healthToken.active){
_healthToken.yvel = (_healthToken.yvel + GameData._gravity);
_healthToken.y = (_healthToken.y + _healthToken.yvel);
if (_healthToken.y > GameData._groundY){
_healthToken.yvel = -(Math.floor((_healthToken.yvel / 2)));
};
if (_healthToken.y > GameData._groundY){
_healthToken.y = GameData._groundY;
};
};
_local2 = 0;
for (;_local2 < MAX_TOKENS;_local2++) {
_local1 = _tokenList[_local2];
if (_local1.active){
_local1.age++;
if (_local1.age == (SCARAB_EXPIRE - 16)){
_local1.gotoAndPlay(20);
continue;
} else {
if (_local1.age == SCARAB_EXPIRE){
_local1.active = false;
continue;
};
};
_local1.yvel = (_local1.yvel + GameData._gravity);
_local1.x = (_local1.x + _local1.xvel);
_local1.y = (_local1.y + _local1.yvel);
if ((((_local1.x < 0)) || ((_local1.x > 600)))){
_local1.xvel = -(_local1.xvel);
} else {
if (_local1.xvel > 0){
_local1.xvel = (_local1.xvel - 1);
if (_local1.xvel < 0){
_local1.xvel = 0;
};
} else {
if (_local1.xvel < 0){
_local1.xvel = (_local1.xvel + 1);
if (_local1.xvel > 0){
_local1.xvel = 0;
};
};
};
};
if (_local1.y > GameData._groundY){
_local1.yvel = -(Math.floor((_local1.yvel / 2)));
_local1.y = (_local1.y + _local1.yvel);
};
if (_local1.y > GameData._groundY){
_local1.y = GameData._groundY;
};
};
};
}
}
}//package Game
Section 94
//PadManager (Pad.PadManager)
package Pad {
import Base.*;
import flash.events.*;
public class PadManager {
private var _tapBufferMax:Number;
private var _handleMouseRelease:Boolean;
private var _keysDown:Object;
private var _lastKeyPressed:Number;
private var _padData:Array;
private var _gameContext:GameEntry;
private var _handleMousePress:Boolean;
private var _keyTarget:Object;
private var keyStage;
var _keyPressed:Boolean;
private var _lastKeyReleaseTime:Number;
private var _tapBufferMin:Number;
private var _mouseData:Object;
private var _keyTargeting:Boolean;
private var doubleTapTime:Number;// = 0.2
public function PadManager(_arg1:GameEntry){
doubleTapTime = 0.2;
super();
trace("|----@ PAD MANAGER @----|");
_gameContext = _arg1;
keyStage = _gameContext._stage;
_keysDown = new Object();
_padData = new Array();
_lastKeyPressed = 0;
_lastKeyReleaseTime = 0;
_keyTargeting = false;
_keyPressed = false;
_mouseData = new Object();
_mouseData.mouseJustPressed = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseReleased = false;
_mouseData.mouseTimePressed = 0;
_mouseData.mousePressedPosX = 0;
_mouseData.mousePressedPosY = 0;
_mouseData.mousePosX = 0;
_mouseData.mousePosY = 0;
_handleMousePress = false;
_handleMouseRelease = false;
Init();
}
public function getKeyDoubleTapped(_arg1):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < _padData.length) {
if ((((_padData[_local2].keyAction == _arg1)) && (_padData[_local2].doubleTapped))){
return (true);
};
_local2++;
};
return (false);
}
public function getMouseStillPressed():Boolean{
return (_mouseData.mouseStillPressed);
}
private function mouseUpHandler(_arg1:MouseEvent):void{
_handleMouseRelease = true;
}
private function doubleClickHandler(_arg1:MouseEvent):void{
}
public function getKeyActionHeld(_arg1):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < _padData.length) {
if ((((_padData[_local2].keyAction == _arg1)) && (_padData[_local2].keyStillPressed))){
return (true);
};
_local2++;
};
return (false);
}
public function Update():void{
var _local1:int;
var _local2:Number;
if (_mouseData.mouseReleased){
_mouseData.mouseReleased = false;
};
if (_handleMouseRelease){
_handleMouseRelease = false;
_mouseData.mouseJustPressed = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseReleased = true;
} else {
if (_mouseData.mouseJustPressed){
_mouseData.mouseJustPressed = false;
_mouseData.mouseReleased = false;
_mouseData.mouseStillPressed = true;
};
if (_mouseData.mouseStillPressed){
_mouseData.mouseTimePressed = (_mouseData.mouseTimePressed + _gameContext.getDT());
};
};
if (_handleMousePress){
_handleMousePress = false;
_mouseData.mouseJustPressed = true;
_mouseData.mousePressedPosX = keyStage.mouseX;
_mouseData.mousePressedPosY = keyStage.mouseY;
_mouseData.mouseReleased = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseTimePressed = 0;
};
_mouseData.mousePosX = keyStage.mouseX;
_mouseData.mousePosY = keyStage.mouseY;
_local1 = 0;
while (_local1 < _padData.length) {
if (isDown(_padData[_local1].keyID)){
if (((!(_padData[_local1].keyPressed)) && (!(_padData[_local1].keyStillPressed)))){
if (_padData[_local1].keyID == _lastKeyPressed){
_local2 = (_gameContext.getTimeManager().getCurTime() - _lastKeyReleaseTime);
if (_local2 < doubleTapTime){
_padData[_local1].doubleTapped = true;
};
};
_padData[_local1].keyPressed = true;
_padData[_local1].keyStillPressed = false;
_padData[_local1].keyReleased = false;
_padData[_local1].timePressed = 0;
} else {
if (((_padData[_local1].keyPressed) || (_padData[_local1].keyStillPressed))){
_padData[_local1].keyPressed = false;
_padData[_local1].keyStillPressed = true;
_padData[_local1].keyReleased = false;
_padData[_local1].timePressed = (_padData[_local1].timePressed + _gameContext.getDT());
};
};
} else {
if (((_padData[_local1].keyStillPressed) || (_padData[_local1].keyPressed))){
_padData[_local1].keyPressed = false;
_padData[_local1].keyStillPressed = false;
_padData[_local1].keyReleased = true;
_padData[_local1].doubleTapped = false;
_lastKeyPressed = _padData[_local1].keyID;
_lastKeyReleaseTime = _gameContext.getTimeManager().getCurTime();
} else {
_padData[_local1].keyReleased = false;
};
};
_local1++;
};
}
public function getAnyKeyPressed():Boolean{
if (_keyPressed){
return (true);
};
return (false);
}
public function getMousePosX():Number{
return (_mouseData.mousePosX);
}
public function getMousePosY():Number{
return (_mouseData.mousePosY);
}
private function mouseOutHandler(_arg1:MouseEvent):void{
}
public function resetListener():void{
keyStage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
keyStage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
keyStage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
keyStage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
}
public function getMouseTimePressed():Number{
return (_mouseData.mouseTimePressed);
}
public function getPadData():Array{
return (_padData);
}
private function clickHandler(_arg1:MouseEvent):void{
}
public function getKeyJustPressed(_arg1:Number){
return (_padData[_arg1].keyPressed);
}
public function getMouseJustPressed():Boolean{
return (_mouseData.mouseJustPressed);
}
public function Init():void{
keyStage.addEventListener(MouseEvent.CLICK, clickHandler);
keyStage.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
keyStage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
keyStage.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
keyStage.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
keyStage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
keyStage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
keyStage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
keyStage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
}
public function getKeyStillPressed(_arg1:Number){
return (_padData[_arg1].keyStillPressed);
}
public function getCurrentKeyActionUp():String{
var _local1:*;
_local1 = 0;
while (_local1 < _padData.length) {
if (_padData[_local1].keyReleased){
return (_padData[_local1].keyAction);
};
_local1++;
};
return ("");
}
private function mouseWheelHandler(_arg1:MouseEvent):void{
}
private function keyReleased(_arg1:KeyboardEvent):void{
_keyPressed = false;
delete _keysDown[_arg1.keyCode];
}
public function getCurrentKeyActionHeld():String{
var _local1:*;
_local1 = 0;
while (_local1 < _padData.length) {
if (_padData[_local1].keyStillPressed){
return (_padData[_local1].keyAction);
};
_local1++;
};
return ("");
}
private function keyPressed(_arg1:KeyboardEvent):void{
_keyPressed = true;
_keysDown[_arg1.keyCode] = true;
}
public function getMouseReleased():Boolean{
return (_mouseData.mouseReleased);
}
public function getTimeKeyActionHeld():Number{
var _local1:*;
_local1 = 0;
while (_local1 < _padData.length) {
if (_padData[_local1].keyStillPressed){
return (_padData[_local1].timePressed);
};
_local1++;
};
return (0);
}
public function getMousePressedPosX():Number{
return (_mouseData.mousePressedPosX);
}
public function getMousePressedPosY():Number{
return (_mouseData.mousePressedPosY);
}
private function mouseMoveHandler(_arg1:MouseEvent):void{
}
private function mouseDownHandler(_arg1:MouseEvent):void{
_handleMousePress = true;
}
public function isDown(_arg1:uint):Boolean{
return (Boolean(_keysDown[_arg1]));
}
public function getPadDataLength():Number{
return (_padData.length);
}
public function getCurrentKeyAction():String{
var _local1:*;
_local1 = 0;
while (_local1 < _padData.length) {
if (_padData[_local1].keyPressed){
return (_padData[_local1].keyAction);
};
_local1++;
};
return ("");
}
public function setKeyControls(_arg1:Array):void{
var _local2:Number;
_local2 = 0;
while (_local2 < _arg1.length) {
_padData.push({keyID:_arg1[_local2].keyID, keyAction:_arg1[_local2].keyAction, keyPressed:false, keyReleased:false, keyStillPressed:false, timePressed:0, doubleTapped:false});
_local2++;
};
}
public function deconstruct():void{
_keysDown = new Object();
_mouseData = new Object();
keyStage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
keyStage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
keyStage.removeEventListener(MouseEvent.CLICK, clickHandler);
keyStage.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
keyStage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
keyStage.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
keyStage.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
keyStage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
keyStage.removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
}
private function mouseOverHandler(_arg1:MouseEvent):void{
}
public function toString():String{
return ("PadManager()");
}
}
}//package Pad
Section 95
//GameTrack_AS3 (Tracker.GameTrack_AS3)
package Tracker {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class GameTrack_AS3 {
var container:DisplayObjectContainer;
var trkLoader:Loader;
var tracker;
public function GameTrack_AS3(_arg1:DisplayObjectContainer){
container = _arg1;
}
public function sendEventPlaySaved(){
trackNewEvent("play_saved");
}
private function trackNewEvent(_arg1:String){
if (this.tracker != null){
this.tracker.sendTracking(_arg1);
trace("Event Sent to Omniture Component");
};
}
public function sendEventPlay(){
trackNewEvent("play");
}
public function sendEventWin(){
trackNewEvent("win");
}
private function trkLoadComplete(_arg1:Event):void{
this.tracker = _arg1.target.content;
trace(("LoadComplete(): " + this.tracker));
}
public function sendEventLose(){
trackNewEvent("lose");
}
public function sendEventReplay(){
trackNewEvent("replay");
}
public function loadTracker():void{
var _local1:URLRequest;
var _local2:LoaderContext;
trace("-- loadTracker() --");
_local1 = new URLRequest("tracker_AS3.swf");
_local2 = new LoaderContext();
trkLoader = new Loader();
configureListeners(trkLoader.contentLoaderInfo);
trace(("Loading tracker.swf into game ..." + _local1));
trkLoader.load(_local1, _local2);
container.addChild(trkLoader);
}
private function configureListeners(_arg1:IEventDispatcher):void{
_arg1.addEventListener(Event.COMPLETE, trkLoadComplete, false, 0, true);
}
public function sendEventCustom(_arg1:String){
trackNewEvent(("cust_" + _arg1));
}
}
}//package Tracker
Section 96
//UIButton (UI.UIButton)
package UI {
import Base.*;
import flash.display.*;
public class UIButton extends SpriteEntity {
public var normFrame:int;// = 1
public var sfxUp:Object;// = null
public var animOutEnd:int;// = 1
public var animOverEnd:int;// = 2
public var sfxOver:Object;// = null
public var animGreyEnd:int;// = 1
public var selectOnDown:Boolean;// = false
public var animUpStart:int;// = 3
public var rollOn:Boolean;
public var animDownEnd:int;// = 3
public var sfxOut:Object;// = null
public var hasSound:Boolean;// = false
public var unselectOthers:Boolean;// = false
public var iName:String;// = ""
public var animGreyStart:int;// = 1
public var animUpEnd:int;// = 3
public var rollOff:Boolean;
public var isDisabled:Boolean;// = false
public var sfxDown:Object;// = null
public var greyFrame:int;// = 4
public var animOverStart:int;// = 2
public var animDownStart:int;// = 3
public var downFrame:int;// = 3
public var isSelected:Boolean;// = false
public var isAnimated:Boolean;// = false
public var animOutStart:int;// = 1
public var overFrame:int;// = 2
public static const STATE_OUT:int = 1;
public static const STATE_UP:int = 4;
public static const STATE_OVER:int = 2;
public static const STATE_DOWN:int = 3;
public static const STATE_DISABLED:int = 5;
public function UIButton(_arg1:GameEntry, _arg2:String, _arg3:DisplayObjectContainer, _arg4:int, _arg5:Boolean=false, _arg6:Boolean=false, _arg7:Boolean=false){
iName = "";
isAnimated = false;
hasSound = false;
isSelected = false;
isDisabled = false;
selectOnDown = false;
unselectOthers = false;
normFrame = 1;
overFrame = 2;
downFrame = 3;
greyFrame = 4;
animOutStart = 1;
animOutEnd = 1;
animOverStart = 2;
animOverEnd = 2;
animDownStart = 3;
animDownEnd = 3;
animUpStart = 3;
animUpEnd = 3;
animGreyStart = 1;
animGreyEnd = 1;
sfxOut = null;
sfxOver = null;
sfxDown = null;
sfxUp = null;
super(_arg1, _arg2, _arg3);
iName = _arg2;
setSelectable(_arg4);
this.isAnimated = _arg5;
this.selectOnDown = _arg6;
this.unselectOthers = _arg7;
}
public function setSelected(_arg1:Boolean):void{
var _local2:int;
isSelected = _arg1;
_local2 = ((isSelected)==false) ? normFrame : downFrame;
moveToFrame(_local2);
}
public function mouseRollOn():void{
rollOn = true;
rollOff = false;
}
public function mouseRollOff():void{
rollOn = false;
rollOff = true;
}
public function addButtonSounds(_arg1:int, _arg2:Object):void{
hasSound = true;
switch (_arg1){
case STATE_OUT:
sfxOut = _arg2;
break;
case STATE_OVER:
sfxOver = _arg2;
break;
case STATE_DOWN:
sfxDown = _arg2;
break;
case STATE_UP:
sfxUp = _arg2;
break;
};
}
public function toString():String{
return (iName);
}
public function addButtonAnimation(_arg1:int, _arg2:int, _arg3:int):void{
isAnimated = true;
switch (_arg1){
case STATE_OUT:
animOutStart = _arg2;
animOutEnd = _arg3;
break;
case STATE_OVER:
animOverStart = _arg2;
animOverEnd = _arg3;
break;
case STATE_DOWN:
animDownStart = _arg2;
animDownEnd = _arg3;
break;
case STATE_UP:
animUpStart = _arg2;
animUpEnd = _arg3;
break;
};
}
public function setDisabled(_arg1:Boolean):void{
var _local2:int;
isDisabled = _arg1;
_local2 = ((isDisabled)==false) ? normFrame : greyFrame;
moveToFrame(_local2);
}
}
}//package UI
Section 97
//UIManager (UI.UIManager)
package UI {
import Base.*;
import flash.display.*;
import Game.*;
import Pad.*;
public class UIManager {
private var _screens:Array;
private var _screen:SpriteEntity;
private var bArray:Array;
private var _gameContext:GameEntry;
private var b:UIButton;
private var _padMgr:PadManager;
private var _uiReturnVal:int;
private var bSelected:Array;
private var n:int;
public var _runUpdate:Boolean;
public function UIManager(_arg1:GameEntry){
trace("|----@ UI MANAGER @----|");
_gameContext = _arg1;
_padMgr = _arg1.getPadManager();
_screen = null;
_screens = new Array();
_runUpdate = true;
n = 0;
b = null;
bArray = [];
bSelected = [];
}
public function addButton(_arg1:DisplayObjectContainer, _arg2:String, _arg3:int, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:Boolean=false):UIButton{
var _local7:UIButton;
_local7 = new UIButton(_gameContext, _arg2, _arg1, _arg3, _arg4, _arg6);
bArray.push(_local7);
return (_local7);
}
public function showScreen(_arg1:String, _arg2:DisplayObjectContainer, _arg3:int=0, _arg4:int=0, _arg5:int=-1, _arg6:Boolean=true):SpriteEntity{
var _local7:SpriteEntity;
if (_arg6){
removeScreen();
_screen = new SpriteEntity(_gameContext, _arg1, _arg2, _arg3, _arg4, true, _arg5);
return (_screen);
};
_local7 = new SpriteEntity(_gameContext, _arg1, _arg2, _arg3, _arg4, true, _arg5);
_screens.push(_local7);
return (_local7);
}
public function getUIReturnVal():int{
return (_uiReturnVal);
}
public function getScreens():Array{
return (_screens);
}
public function removeScreen():void{
n = bArray.length;
while (n--) {
b = bArray[n];
b.removeSprite();
b = null;
};
bArray = [];
if (_screen != null){
_screen.removeSprite();
_screen = null;
};
}
public function clearSelected():void{
var _local1:int;
_local1 = bSelected.length;
while (_local1--) {
bSelected[_local1].setSelected(false);
};
bSelected.splice(0);
}
public function Update():void{
if (!_runUpdate){
return;
};
_uiReturnVal = -1;
if (_screen != null){
n = bArray.length;
while (n--) {
b = bArray[n];
if ((((b == null)) || (b.isDisabled))){
} else {
if (b.isMouseOver()){
if (_padMgr.getMouseJustPressed()){
b.startAnimating(b.animDownStart, b.animDownEnd);
if (b.selectOnDown){
_uiReturnVal = b.getReturnVal();
if (b.isSelected){
return;
};
clearSelected();
b.setSelected(true);
bSelected.push(b);
return;
};
};
if (((_padMgr.getMouseReleased()) && ((b.selectOnDown == false)))){
b.startAnimating(b.animOutStart, b.animOutEnd);
b.animateSprite();
_uiReturnVal = b.getReturnVal();
return;
};
};
if (b.isSelected){
_uiReturnVal = b.getReturnVal();
} else {
if (b.isMouseRollOff()){
b.mouseRollOff();
b.startAnimating(b.animOutStart, b.animOutEnd);
if (b.sfxOut != null){
_gameContext.getGameData().getSoundModule().playSoundByEvent(b.sfxOut);
};
};
if (b.isMouseRollOn()){
b.mouseRollOn();
b.startAnimating(b.animOverStart, b.animOverEnd);
if (b.sfxOver != null){
_gameContext.getGameData().getSoundModule().playSoundByEvent(b.sfxOver);
};
};
if (b.isAnimating()){
b.animateSprite();
};
};
};
};
};
}
public function addScreen(_arg1:String, _arg2:DisplayObjectContainer, _arg3:int=0, _arg4:int=0, _arg5:int=-1, _arg6:Boolean=true):void{
}
public function getScreen():SpriteEntity{
return (_screen);
}
public function promoteScreenToFocus():void{
}
public function setUIReturnVal(_arg1:int):void{
_uiReturnVal = _arg1;
}
public function setSelected(_arg1:UIButton):void{
_arg1.setSelected(true);
bSelected.push(_arg1);
}
}
}//package UI
Section 98
//batman (batman)
package {
import flash.display.*;
public dynamic class batman extends MovieClip {
public var hitbox:MovieClip;
public var attackbox:MovieClip;
public var hitpoint:MovieClip;
}
}//package
Section 99
//beamSplash (beamSplash)
package {
import flash.display.*;
public dynamic class beamSplash extends MovieClip {
}
}//package
Section 100
//beetle (beetle)
package {
import flash.display.*;
public dynamic class beetle extends MovieClip {
public var beamMask:MovieClip;
public var attackbox:MovieClip;
public var beam:MovieClip;
public var hitpoint:MovieClip;
}
}//package
Section 101
//beetleBeamAttack (beetleBeamAttack)
package {
import flash.media.*;
public dynamic class beetleBeamAttack extends Sound {
}
}//package
Section 102
//beetleCalledAnim (beetleCalledAnim)
package {
import flash.media.*;
public dynamic class beetleCalledAnim extends Sound {
}
}//package
Section 103
//beetleCallReady (beetleCallReady)
package {
import flash.media.*;
public dynamic class beetleCallReady extends Sound {
}
}//package
Section 104
//beetleHammerAttack (beetleHammerAttack)
package {
import flash.media.*;
public dynamic class beetleHammerAttack extends Sound {
}
}//package
Section 105
//beetleJetpack (beetleJetpack)
package {
import flash.media.*;
public dynamic class beetleJetpack extends Sound {
}
}//package
Section 106
//beetleJetpackAttack (beetleJetpackAttack)
package {
import flash.media.*;
public dynamic class beetleJetpackAttack extends Sound {
}
}//package
Section 107
//beetleLanding (beetleLanding)
package {
import flash.media.*;
public dynamic class beetleLanding extends Sound {
}
}//package
Section 108
//beetlePose (beetlePose)
package {
import flash.media.*;
public dynamic class beetlePose extends Sound {
}
}//package
Section 109
//beetleTakeoff (beetleTakeoff)
package {
import flash.media.*;
public dynamic class beetleTakeoff extends Sound {
}
}//package
Section 110
//BG (BG)
package {
import flash.display.*;
public dynamic class BG extends MovieClip {
public function BG(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 111
//bigPirate (bigPirate)
package {
import flash.display.*;
public dynamic class bigPirate extends MovieClip {
public var healthBar:MovieClip;
public var hitbox:MovieClip;
public var attackbox:MovieClip;
}
}//package
Section 112
//bossDeath (bossDeath)
package {
import flash.media.*;
public dynamic class bossDeath extends Sound {
}
}//package
Section 113
//bossFootsteps (bossFootsteps)
package {
import flash.media.*;
public dynamic class bossFootsteps extends Sound {
}
}//package
Section 114
//bossGrunt1 (bossGrunt1)
package {
import flash.media.*;
public dynamic class bossGrunt1 extends Sound {
}
}//package
Section 115
//bossGrunt2 (bossGrunt2)
package {
import flash.media.*;
public dynamic class bossGrunt2 extends Sound {
}
}//package
Section 116
//bossGrunt3 (bossGrunt3)
package {
import flash.media.*;
public dynamic class bossGrunt3 extends Sound {
}
}//package
Section 117
//bossGrunt4 (bossGrunt4)
package {
import flash.media.*;
public dynamic class bossGrunt4 extends Sound {
}
}//package
Section 118
//bossGrunt5 (bossGrunt5)
package {
import flash.media.*;
public dynamic class bossGrunt5 extends Sound {
}
}//package
Section 119
//bossGrunt6 (bossGrunt6)
package {
import flash.media.*;
public dynamic class bossGrunt6 extends Sound {
}
}//package
Section 120
//bossMelee1 (bossMelee1)
package {
import flash.media.*;
public dynamic class bossMelee1 extends Sound {
}
}//package
Section 121
//bossMelee2 (bossMelee2)
package {
import flash.media.*;
public dynamic class bossMelee2 extends Sound {
}
}//package
Section 122
//bullet (bullet)
package {
import flash.display.*;
public dynamic class bullet extends MovieClip {
public var hitbox:MovieClip;
public function bullet(){
addFrameScript(0, frame1, 12, frame13, 27, frame28);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame28(){
gotoAndStop(1);
}
}
}//package
Section 123
//enemyAirbourne (enemyAirbourne)
package {
import flash.media.*;
public dynamic class enemyAirbourne extends Sound {
}
}//package
Section 124
//enemyDeath (enemyDeath)
package {
import flash.media.*;
public dynamic class enemyDeath extends Sound {
}
}//package
Section 125
//enemyFootsteps (enemyFootsteps)
package {
import flash.media.*;
public dynamic class enemyFootsteps extends Sound {
}
}//package
Section 126
//enemyGrunt1 (enemyGrunt1)
package {
import flash.media.*;
public dynamic class enemyGrunt1 extends Sound {
}
}//package
Section 127
//enemyGrunt2 (enemyGrunt2)
package {
import flash.media.*;
public dynamic class enemyGrunt2 extends Sound {
}
}//package
Section 128
//enemyGrunt3 (enemyGrunt3)
package {
import flash.media.*;
public dynamic class enemyGrunt3 extends Sound {
}
}//package
Section 129
//enemyGrunt4 (enemyGrunt4)
package {
import flash.media.*;
public dynamic class enemyGrunt4 extends Sound {
}
}//package
Section 130
//enemyGrunt5 (enemyGrunt5)
package {
import flash.media.*;
public dynamic class enemyGrunt5 extends Sound {
}
}//package
Section 131
//enemyGrunt6 (enemyGrunt6)
package {
import flash.media.*;
public dynamic class enemyGrunt6 extends Sound {
}
}//package
Section 132
//enemyHitGround (enemyHitGround)
package {
import flash.media.*;
public dynamic class enemyHitGround extends Sound {
}
}//package
Section 133
//enemyRangedAttack1 (enemyRangedAttack1)
package {
import flash.media.*;
public dynamic class enemyRangedAttack1 extends Sound {
}
}//package
Section 134
//enemyRangedAttack2 (enemyRangedAttack2)
package {
import flash.media.*;
public dynamic class enemyRangedAttack2 extends Sound {
}
}//package
Section 135
//health (health)
package {
import flash.display.*;
public dynamic class health extends MovieClip {
public function health(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package
Section 136
//heroDeath (heroDeath)
package {
import flash.media.*;
public dynamic class heroDeath extends Sound {
}
}//package
Section 137
//heroDuck (heroDuck)
package {
import flash.media.*;
public dynamic class heroDuck extends Sound {
}
}//package
Section 138
//heroFootsteps (heroFootsteps)
package {
import flash.media.*;
public dynamic class heroFootsteps extends Sound {
}
}//package
Section 139
//heroHealthLow (heroHealthLow)
package {
import flash.media.*;
public dynamic class heroHealthLow extends Sound {
}
}//package
Section 140
//heroHitByMelee1 (heroHitByMelee1)
package {
import flash.media.*;
public dynamic class heroHitByMelee1 extends Sound {
}
}//package
Section 141
//heroHitByMelee2 (heroHitByMelee2)
package {
import flash.media.*;
public dynamic class heroHitByMelee2 extends Sound {
}
}//package
Section 142
//heroHitByRanged1 (heroHitByRanged1)
package {
import flash.media.*;
public dynamic class heroHitByRanged1 extends Sound {
}
}//package
Section 143
//heroHitByRanged2 (heroHitByRanged2)
package {
import flash.media.*;
public dynamic class heroHitByRanged2 extends Sound {
}
}//package
Section 144
//heroJump (heroJump)
package {
import flash.media.*;
public dynamic class heroJump extends Sound {
}
}//package
Section 145
//heroKick1 (heroKick1)
package {
import flash.media.*;
public dynamic class heroKick1 extends Sound {
}
}//package
Section 146
//heroKick2 (heroKick2)
package {
import flash.media.*;
public dynamic class heroKick2 extends Sound {
}
}//package
Section 147
//heroKick3 (heroKick3)
package {
import flash.media.*;
public dynamic class heroKick3 extends Sound {
}
}//package
Section 148
//heroKick4 (heroKick4)
package {
import flash.media.*;
public dynamic class heroKick4 extends Sound {
}
}//package
Section 149
//heroLand (heroLand)
package {
import flash.media.*;
public dynamic class heroLand extends Sound {
}
}//package
Section 150
//heroPickupBeetles (heroPickupBeetles)
package {
import flash.media.*;
public dynamic class heroPickupBeetles extends Sound {
}
}//package
Section 151
//heroPickupHealth (heroPickupHealth)
package {
import flash.media.*;
public dynamic class heroPickupHealth extends Sound {
}
}//package
Section 152
//heroPunch1 (heroPunch1)
package {
import flash.media.*;
public dynamic class heroPunch1 extends Sound {
}
}//package
Section 153
//heroPunch2 (heroPunch2)
package {
import flash.media.*;
public dynamic class heroPunch2 extends Sound {
}
}//package
Section 154
//heroPunch3 (heroPunch3)
package {
import flash.media.*;
public dynamic class heroPunch3 extends Sound {
}
}//package
Section 155
//heroPunch4 (heroPunch4)
package {
import flash.media.*;
public dynamic class heroPunch4 extends Sound {
}
}//package
Section 156
//heroPunch5 (heroPunch5)
package {
import flash.media.*;
public dynamic class heroPunch5 extends Sound {
}
}//package
Section 157
//heroPunch6 (heroPunch6)
package {
import flash.media.*;
public dynamic class heroPunch6 extends Sound {
}
}//package
Section 158
//heroSlide (heroSlide)
package {
import flash.media.*;
public dynamic class heroSlide extends Sound {
}
}//package
Section 159
//heroSwing1 (heroSwing1)
package {
import flash.media.*;
public dynamic class heroSwing1 extends Sound {
}
}//package
Section 160
//heroSwing2 (heroSwing2)
package {
import flash.media.*;
public dynamic class heroSwing2 extends Sound {
}
}//package
Section 161
//heroSwing3 (heroSwing3)
package {
import flash.media.*;
public dynamic class heroSwing3 extends Sound {
}
}//package
Section 162
//heroSwing4 (heroSwing4)
package {
import flash.media.*;
public dynamic class heroSwing4 extends Sound {
}
}//package
Section 163
//heroSwing5 (heroSwing5)
package {
import flash.media.*;
public dynamic class heroSwing5 extends Sound {
}
}//package
Section 164
//heroSwing6 (heroSwing6)
package {
import flash.media.*;
public dynamic class heroSwing6 extends Sound {
}
}//package
Section 165
//heroSwing7 (heroSwing7)
package {
import flash.media.*;
public dynamic class heroSwing7 extends Sound {
}
}//package
Section 166
//heroSwing8 (heroSwing8)
package {
import flash.media.*;
public dynamic class heroSwing8 extends Sound {
}
}//package
Section 167
//HUD (HUD)
package {
import flash.display.*;
import flash.text.*;
public dynamic class HUD extends MovieClip {
public var btn_musicOn:MovieClip;
public var beetlebar:MovieClip;
public var bbCall1:MovieClip;
public var bbCall3:MovieClip;
public var bbCall2:MovieClip;
public var healthbar:MovieClip;
public var combo:MovieClip;
public var spacebar:MovieClip;
public var btn_instructions:MovieClip;
public var batmanAvatar:MovieClip;
public var scorebox:TextField;
}
}//package
Section 168
//music_end (music_end)
package {
import flash.media.*;
public dynamic class music_end extends Sound {
}
}//package
Section 169
//music_game (music_game)
package {
import flash.media.*;
public dynamic class music_game extends Sound {
}
}//package
Section 170
//music_story (music_story)
package {
import flash.media.*;
public dynamic class music_story extends Sound {
}
}//package
Section 171
//particle (particle)
package {
import flash.display.*;
public dynamic class particle extends MovieClip {
public function particle(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 172
//pirateLizard (pirateLizard)
package {
import flash.display.*;
public dynamic class pirateLizard extends MovieClip {
public var healthBar:MovieClip;
public var hitbox:MovieClip;
public var attackbox:MovieClip;
}
}//package
Section 173
//screen_gameover (screen_gameover)
package {
import flash.display.*;
import flash.text.*;
public dynamic class screen_gameover extends MovieClip {
public var defeatedTxt:TextField;
public var newHighScore:MovieClip;
public var btnReplay:MovieClip;
public var scoreTxt:TextField;
}
}//package
Section 174
//screen_instructions (screen_instructions)
package {
import flash.display.*;
public dynamic class screen_instructions extends MovieClip {
public var continueBtn:MovieClip;
public var playBtn:MovieClip;
}
}//package
Section 175
//screen_intro (screen_intro)
package {
import flash.display.*;
public dynamic class screen_intro extends MovieClip {
public var btnStart:MovieClip;
public function screen_intro(){
addFrameScript(221, frame222);
}
function frame222(){
stop();
}
}
}//package
Section 176
//screen_story (screen_story)
package {
import flash.display.*;
public dynamic class screen_story extends MovieClip {
public var btnContinue:MovieClip;
public var btnSkip:MovieClip;
}
}//package
Section 177
//screen_titlecard (screen_titlecard)
package {
import flash.display.*;
public dynamic class screen_titlecard extends MovieClip {
public var btnStart:MovieClip;
}
}//package
Section 178
//sfx_buttonover (sfx_buttonover)
package {
import flash.media.*;
public dynamic class sfx_buttonover extends Sound {
}
}//package
Section 179
//sfx_buttonpress (sfx_buttonpress)
package {
import flash.media.*;
public dynamic class sfx_buttonpress extends Sound {
}
}//package
Section 180
//token (token)
package {
import flash.display.*;
public dynamic class token extends MovieClip {
public function token(){
addFrameScript(0, frame1, 14, frame15, 37, frame38);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame38(){
stop();
}
}
}//package