Section 1
//Batman_beaten_260 (batman_fla.Batman_beaten_260)
package batman_fla {
import flash.display.*;
public dynamic class Batman_beaten_260 extends MovieClip {
public function Batman_beaten_260(){
addFrameScript(27, frame28);
}
function frame28(){
gotoAndPlay(5);
}
}
}//package batman_fla
Section 2
//Batman_fall1_254 (batman_fla.Batman_fall1_254)
package batman_fla {
import flash.display.*;
public dynamic class Batman_fall1_254 extends MovieClip {
public function Batman_fall1_254(){
addFrameScript(67, frame68);
}
function frame68(){
stop();
}
}
}//package batman_fla
Section 3
//batman_jump_group01_250 (batman_fla.batman_jump_group01_250)
package batman_fla {
import flash.display.*;
public dynamic class batman_jump_group01_250 extends MovieClip {
public function batman_jump_group01_250(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package batman_fla
Section 4
//chamber_131 (batman_fla.chamber_131)
package batman_fla {
import flash.display.*;
public dynamic class chamber_131 extends MovieClip {
public function chamber_131(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package batman_fla
Section 5
//chamberbroken_133 (batman_fla.chamberbroken_133)
package batman_fla {
import flash.display.*;
public dynamic class chamberbroken_133 extends MovieClip {
public function chamberbroken_133(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package batman_fla
Section 6
//Chamberempty_136 (batman_fla.Chamberempty_136)
package batman_fla {
import flash.display.*;
public dynamic class Chamberempty_136 extends MovieClip {
public function Chamberempty_136(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package batman_fla
Section 7
//FIRE_scarecrow_die_119 (batman_fla.FIRE_scarecrow_die_119)
package batman_fla {
import flash.display.*;
public dynamic class FIRE_scarecrow_die_119 extends MovieClip {
public function FIRE_scarecrow_die_119(){
addFrameScript(36, frame37);
}
function frame37(){
stop();
}
}
}//package batman_fla
Section 8
//gas_mc_33 (batman_fla.gas_mc_33)
package batman_fla {
import flash.display.*;
public dynamic class gas_mc_33 extends MovieClip {
public function gas_mc_33(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package batman_fla
Section 9
//healthMeter_126 (batman_fla.healthMeter_126)
package batman_fla {
import flash.display.*;
public dynamic class healthMeter_126 extends MovieClip {
public var bar:MovieClip;
}
}//package batman_fla
Section 10
//p_thug_attack_3_184 (batman_fla.p_thug_attack_3_184)
package batman_fla {
import flash.display.*;
public dynamic class p_thug_attack_3_184 extends MovieClip {
public function p_thug_attack_3_184(){
addFrameScript(1, frame2);
}
function frame2(){
(this.parent as EnemyThree).HurtPlayer();
}
}
}//package batman_fla
Section 11
//p_thug_beaten_187 (batman_fla.p_thug_beaten_187)
package batman_fla {
import flash.display.*;
public dynamic class p_thug_beaten_187 extends MovieClip {
public function p_thug_beaten_187(){
addFrameScript(27, frame28);
}
function frame28(){
gotoAndPlay(5);
}
}
}//package batman_fla
Section 12
//scarecrow_City_3 (batman_fla.scarecrow_City_3)
package batman_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class scarecrow_City_3 extends MovieClip {
public var gas_mc:MovieClip;
public function scarecrow_City_3(){
addFrameScript(0, frame1, 304, frame305);
}
function frame305(){
stop();
Batman.batmanClass.keysDisabled = false;
}
function frame1(){
Batman.batmanClass.keysDisabled = true;
}
}
}//package batman_fla
Section 13
//scarecrow_fall_getUp_93 (batman_fla.scarecrow_fall_getUp_93)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_fall_getUp_93 extends MovieClip {
public function scarecrow_fall_getUp_93(){
addFrameScript(4, frame5);
}
function frame5(){
(this.parent.parent.parent as EnemyScarecrow).DroppedFromSky();
}
}
}//package batman_fla
Section 14
//scarecrow_FIRE_kick_101 (batman_fla.scarecrow_FIRE_kick_101)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_FIRE_kick_101 extends MovieClip {
public function scarecrow_FIRE_kick_101(){
addFrameScript(16, frame17);
}
function frame17(){
}
}
}//package batman_fla
Section 15
//scarecrow_FIRE_punch_2_105 (batman_fla.scarecrow_FIRE_punch_2_105)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_FIRE_punch_2_105 extends MovieClip {
public function scarecrow_FIRE_punch_2_105(){
addFrameScript(4, frame5, 8, frame9);
}
function frame5(){
}
function frame9(){
}
}
}//package batman_fla
Section 16
//scarecrow_FIRE_talk_79 (batman_fla.scarecrow_FIRE_talk_79)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_FIRE_talk_79 extends MovieClip {
public function scarecrow_FIRE_talk_79(){
addFrameScript(38, frame39);
}
function frame39(){
gotoAndPlay(3);
}
}
}//package batman_fla
Section 17
//scarecrow_fireBall_114 (batman_fla.scarecrow_fireBall_114)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_fireBall_114 extends MovieClip {
public function scarecrow_fireBall_114(){
addFrameScript(29, frame30);
}
function frame30(){
}
}
}//package batman_fla
Section 18
//Scarecrow_mc_266 (batman_fla.Scarecrow_mc_266)
package batman_fla {
import flash.display.*;
public dynamic class Scarecrow_mc_266 extends MovieClip {
public var throwVile:MovieClip;
}
}//package batman_fla
Section 19
//scarecrow_putAway_112 (batman_fla.scarecrow_putAway_112)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_putAway_112 extends MovieClip {
public function scarecrow_putAway_112(){
addFrameScript(0, frame1, 31, frame32, 53, frame54);
}
function frame1(){
}
function frame32(){
}
function frame54(){
}
}
}//package batman_fla
Section 20
//scarecrow_talk_39 (batman_fla.scarecrow_talk_39)
package batman_fla {
import flash.display.*;
public dynamic class scarecrow_talk_39 extends MovieClip {
public function scarecrow_talk_39(){
addFrameScript(38, frame39);
}
function frame39(){
gotoAndPlay(3);
}
}
}//package batman_fla
Section 21
//scarecrowmenu_267 (batman_fla.scarecrowmenu_267)
package batman_fla {
import flash.display.*;
public dynamic class scarecrowmenu_267 extends MovieClip {
public var gas_mc:MovieClip;
public function scarecrowmenu_267(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package batman_fla
Section 22
//thug_attack_1_169 (batman_fla.thug_attack_1_169)
package batman_fla {
import flash.display.*;
public dynamic class thug_attack_1_169 extends MovieClip {
public function thug_attack_1_169(){
addFrameScript(2, frame3);
}
function frame3(){
(this.parent as EnemyTwo).HurtPlayer();
}
}
}//package batman_fla
Section 23
//thug_beaten_172 (batman_fla.thug_beaten_172)
package batman_fla {
import flash.display.*;
public dynamic class thug_beaten_172 extends MovieClip {
public function thug_beaten_172(){
addFrameScript(27, frame28);
}
function frame28(){
gotoAndPlay(5);
}
}
}//package batman_fla
Section 24
//thug2_attack_1_212 (batman_fla.thug2_attack_1_212)
package batman_fla {
import flash.display.*;
public dynamic class thug2_attack_1_212 extends MovieClip {
public function thug2_attack_1_212(){
addFrameScript(3, frame4, 16, frame17);
}
function frame17(){
(this.parent as EnemyOne).HurtPlayer();
}
function frame4(){
(this.parent as EnemyOne).HurtPlayer();
}
}
}//package batman_fla
Section 25
//thug2_beaten_215 (batman_fla.thug2_beaten_215)
package batman_fla {
import flash.display.*;
public dynamic class thug2_beaten_215 extends MovieClip {
public function thug2_beaten_215(){
addFrameScript(27, frame28);
}
function frame28(){
gotoAndPlay(5);
}
}
}//package batman_fla
Section 26
//TutorialBoxFour_286 (batman_fla.TutorialBoxFour_286)
package batman_fla {
import flash.display.*;
public dynamic class TutorialBoxFour_286 extends MovieClip {
public function TutorialBoxFour_286(){
addFrameScript(130, frame131);
}
function frame131(){
stop();
}
}
}//package batman_fla
Section 27
//tutorialBoxOne_281 (batman_fla.tutorialBoxOne_281)
package batman_fla {
import flash.display.*;
public dynamic class tutorialBoxOne_281 extends MovieClip {
public function tutorialBoxOne_281(){
addFrameScript(130, frame131);
}
function frame131(){
stop();
}
}
}//package batman_fla
Section 28
//tutorialBoxThree_285 (batman_fla.tutorialBoxThree_285)
package batman_fla {
import flash.display.*;
public dynamic class tutorialBoxThree_285 extends MovieClip {
public function tutorialBoxThree_285(){
addFrameScript(130, frame131);
}
function frame131(){
stop();
}
}
}//package batman_fla
Section 29
//tutorialBoxTwo_283 (batman_fla.tutorialBoxTwo_283)
package batman_fla {
import flash.display.*;
public dynamic class tutorialBoxTwo_283 extends MovieClip {
public function tutorialBoxTwo_283(){
addFrameScript(130, frame131);
}
function frame131(){
stop();
}
}
}//package batman_fla
Section 30
//tutroialBoxFive_287 (batman_fla.tutroialBoxFive_287)
package batman_fla {
import flash.display.*;
public dynamic class tutroialBoxFive_287 extends MovieClip {
public function tutroialBoxFive_287(){
addFrameScript(130, frame131);
}
function frame131(){
stop();
}
}
}//package batman_fla
Section 31
//BackButton (BackButton)
package {
import flash.display.*;
import flash.events.*;
public class BackButton extends MovieClip {
public function BackButton(){
this.gotoAndStop(1);
this.buttonMode = true;
addEventListener(MouseEvent.CLICK, backToMenu);
addEventListener(MouseEvent.MOUSE_OVER, showGlow);
addEventListener(MouseEvent.MOUSE_OUT, hideGlow);
}
public function showGlow(_arg1:Event){
this.gotoAndStop(2);
}
public function backToMenu(_arg1:Event){
removeEventListener(MouseEvent.CLICK, backToMenu);
this.parent.removeChild(this);
Main.mainClass.gameScreen.gotoAndStop(1);
}
public function hideGlow(_arg1:Event){
this.gotoAndStop(1);
}
}
}//package
Section 32
//Batarang (Batarang)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class Batarang extends MovieClip {
private var clickSound:Sound;
private var direction:String;
public function Batarang(){
clickSound = new ClickSound();
super();
if (Main.mainClass.player.scaleX < 0){
direction = "left";
};
if (Main.mainClass.player.scaleX > 0){
direction = "right";
};
this.addEventListener(Event.ENTER_FRAME, batarangLoop, false, 0, true);
}
public function batarangLoop(_arg1:Event){
var _local2:uint;
if (direction == "left"){
this.x = (this.x - 20);
this.rotation = (this.rotation - 10);
};
if (direction == "right"){
this.x = (this.x + 20);
this.rotation = (this.rotation + 10);
};
_local2 = 0;
while (_local2 < Main.enemyArray.length) {
if (this.hitTestObject(Main.enemyArray[_local2])){
Main.enemyArray[_local2].enemyHurt();
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, batarangLoop);
};
_local2++;
};
if (Main.mainClass.currentLevel == 1){
if (((this.hitTestObject(Main.mainClass.levelOne.Switch)) && ((Main.mainClass.levelOne.door.doorOpen == false)))){
clickSound.play();
Main.mainClass.levelOne.door.doorOpen = true;
};
};
if (Main.mainClass.currentLevel == 2){
if (Main.scareCrowArray.length > 0){
if (this.hitTestObject(Main.scareCrowArray[0])){
Main.scareCrowArray[0].enemyHurt();
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, batarangLoop);
};
};
};
if (Main.mainClass.currentLevel == 4){
if (Main.scareCrowArray.length > 0){
if (this.hitTestObject(Main.scareCrowArray[0])){
Main.scareCrowArray[0].enemyHurt();
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, batarangLoop);
};
};
};
}
}
}//package
Section 33
//BatarangCollect (BatarangCollect)
package {
import flash.display.*;
import flash.events.*;
public class BatarangCollect extends MovieClip {
public var collectMessage:MovieClip;
public function BatarangCollect(){
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
this.gotoAndStop(1);
}
private function loop(_arg1:Event):void{
if (((this.hitTestObject(Main.mainClass.player)) && ((this.currentFrame == 1)))){
Main.mainClass.batarangCollected = true;
this.gotoAndStop(2);
};
if (collectMessage){
if (collectMessage.currentFrame == 1){
collectMessage.gotoAndPlay(2);
};
if (collectMessage.currentFrame == collectMessage.totalFrames){
this.removeEventListener(Event.ENTER_FRAME, loop);
(parent as MovieClip).removeChild(this);
};
};
}
}
}//package
Section 34
//BatarangSound (BatarangSound)
package {
import flash.media.*;
public dynamic class BatarangSound extends Sound {
}
}//package
Section 35
//BatarangSwitch (BatarangSwitch)
package {
import flash.display.*;
public class BatarangSwitch extends MovieClip {
public function BatarangSwitch(){
this.gotoAndStop(1);
}
}
}//package
Section 36
//Batman (Batman)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class Batman extends MovieClip {
private var fallAnim:Boolean;// = false
public var sliding:Boolean;// = false
private var batarangSound:Sound;
private var gravity:Number;// = 2
public var speed:Number;// = 11
private var ST:SoundTransform;
public var attackBox:MovieClip;
public var Kick:MovieClip;
private var downDown:Boolean;// = false
public var health:Number;// = 100
public var falling:Boolean;// = false
private var maxFallSpeed:int;// = -15
private var punchSound:Sound;
public var keysDisabled:Boolean;// = false
private var deadAnim:Boolean;// = false
private var regenRate:Number;// = 0.5
public var rightDown:Boolean;// = false
private var jumpHeight:Number;// = 20
private var jumping:Boolean;// = false
private var kickPressed:Boolean;// = false
public var regenTimer:Number;// = 150
public var Punch:MovieClip;
private var punchPressed:Boolean;// = false
private var fadeSpeed:Number;// = 0.1
public var hitBox:MovieClip;
private var slid:Boolean;// = false
public var hurtBox:MovieClip;
private var leftDown:Boolean;// = false
private var jumpSound:Sound;
private var reload:uint;// = 0
private var glideSpeed:int;// = -3
private var jumpSoundPlayed:Boolean;// = false
public var slideFriction:Number;// = 0.5
private var kicking:Boolean;// = false
private var upDown:Boolean;// = false
private var landSound:Sound;
public var damageReload:uint;// = 0
private var punching:Boolean;// = false
public static var Inputs:Input;
public static var batmanClass;
public function Batman(){
landSound = new LandSound();
batarangSound = new BatarangSound();
jumpSound = new JumpSound();
punchSound = new PunchSound();
jumpSoundPlayed = false;
ST = new SoundTransform(0.4);
leftDown = false;
rightDown = false;
downDown = false;
upDown = false;
jumping = false;
falling = false;
punchPressed = false;
kickPressed = false;
punching = false;
kicking = false;
speed = 11;
jumpHeight = 20;
gravity = 2;
glideSpeed = -3;
maxFallSpeed = -15;
sliding = false;
slid = false;
slideFriction = 0.5;
health = 100;
regenRate = 0.5;
regenTimer = 150;
damageReload = 0;
fadeSpeed = 0.1;
keysDisabled = false;
reload = 0;
fallAnim = false;
deadAnim = false;
super();
batmanClass = this;
Inputs = new Input(Main.mainClass);
this.gotoAndStop(1);
this.scaleX = 0.45;
this.scaleY = 0.45;
this.addEventListener(Event.ENTER_FRAME, playerLoop, false, 0, true);
}
private function jump():void{
if (!jumpSoundPlayed){
jumpSound.play(0, 0, ST);
jumpSoundPlayed = true;
this.gotoAndStop(4);
};
jumpHeight = (jumpHeight - gravity);
this.y = (this.y - jumpHeight);
if (jumpHeight <= 0){
jumping = false;
falling = true;
jumpSoundPlayed = false;
};
}
public function addHealth(_arg1:int):void{
_arg1 = (_arg1 + health);
}
public function removeBatman():void{
this.removeEventListener(Event.ENTER_FRAME, playerLoop);
(parent as MovieClip).removeChild(this);
}
private function playerLoop(_arg1:Event):void{
var _local2:Boolean;
var _local3:int;
var _local4:Batarang;
if (((Input.isKeyPressed(32)) && (Main.mainClass.debugMode))){
Main.mainClass.batarangCollected = true;
Main.mainClass.removeLevel(Main.mainClass.currentLevel);
};
if (!keysDisabled){
if (((Input.isKeyDown(65)) && (!(Input.isKeyDown(68))))){
leftDown = true;
rightDown = false;
};
if (((Input.isKeyDown(68)) && (!(Input.isKeyDown(65))))){
rightDown = true;
leftDown = false;
};
if (Input.isKeyPressed(74)){
punchPressed = true;
} else {
punchPressed = false;
};
if (Input.isKeyPressed(75)){
kickPressed = true;
} else {
kickPressed = false;
};
if (Input.isKeyDown(87)){
upDown = true;
punching = false;
kicking = false;
};
if (Input.isKeyDown(83)){
downDown = true;
};
if (Input.isKeyReleased(65)){
leftDown = false;
punching = false;
kicking = false;
};
if (Input.isKeyReleased(68)){
rightDown = false;
punching = false;
kicking = false;
};
if (Input.isKeyReleased(83)){
sliding = false;
slid = false;
downDown = false;
speed = 11;
if (((!(jumping)) && (!(falling)))){
if (((rightDown) || (leftDown))){
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
};
};
};
if (Input.isKeyReleased(87)){
upDown = false;
if (jumping){
jumpHeight = 0;
jumping = false;
falling = true;
};
};
};
if (((((((((((Input.isKeyPressed(65)) && (!(jumping)))) && (!(falling)))) && (!(sliding)))) && (!(kicking)))) && (!(punching)))){
gotoAndStop(2);
};
if (((((((((((Input.isKeyPressed(68)) && (!(jumping)))) && (!(falling)))) && (!(sliding)))) && (!(kicking)))) && (!(punching)))){
gotoAndStop(2);
};
if (((((((((((((Input.isKeyReleased(65)) && (!(jumping)))) && (!(falling)))) && (!(sliding)))) && (!(rightDown)))) && (!(kicking)))) && (!(punching)))){
gotoAndStop(1);
};
if (((((((((((((Input.isKeyReleased(68)) && (!(jumping)))) && (!(falling)))) && (!(sliding)))) && (!(leftDown)))) && (!(kicking)))) && (!(punching)))){
gotoAndStop(1);
};
if (((((leftDown) && (!(kicking)))) && (!(punching)))){
this.x = (this.x - speed);
this.scaleX = -0.45;
};
if (((((rightDown) && (!(kicking)))) && (!(punching)))){
this.x = (this.x + speed);
this.scaleX = 0.45;
};
if (punchPressed){
if (((((((((((!(kicking)) && (!(punching)))) && (!(leftDown)))) && (!(rightDown)))) && (!(jumping)))) && (!(falling)))){
this.gotoAndStop(6);
punching = true;
punchSound.play(0, 0, ST);
};
};
if (((punching) && (this.Punch))){
if (this.Punch.currentFrame == this.Punch.totalFrames){
this.Punch.gotoAndStop(1);
if (((!(leftDown)) && (!(rightDown)))){
this.gotoAndStop("idle");
} else {
this.gotoAndStop(2);
};
punching = false;
};
};
if (kickPressed){
if (((((((((((!(kicking)) && (!(punching)))) && (!(leftDown)))) && (!(rightDown)))) && (!(jumping)))) && (!(falling)))){
this.gotoAndStop(8);
kicking = true;
punchSound.play(0, 0, ST);
};
};
if (((kicking) && (this.Kick))){
if (this.Kick.currentFrame == this.Kick.totalFrames){
this.Kick.gotoAndStop(1);
if (((!(leftDown)) && (!(rightDown)))){
this.gotoAndStop("idle");
} else {
this.gotoAndStop(2);
};
kicking = false;
};
};
reload++;
if (((((((Input.isKeyPressed(76)) && ((reload > 8)))) && (Main.mainClass.batarangCollected))) && (!(sliding)))){
_local4 = new Batarang();
_local4.x = this.x;
_local4.y = (this.y - 50);
Main.mainClass.addChild(_local4);
reload = 0;
batarangSound.play(0, 0, ST);
};
if (((((leftDown) && (downDown))) || (((rightDown) && (downDown))))){
if (((((!(slid)) && (!(jumping)))) && (!(falling)))){
if (!sliding){
speed = 15;
this.gotoAndStop(3);
};
sliding = true;
speed = (speed - slideFriction);
if (speed <= 0){
speed = 11;
this.gotoAndStop(2);
sliding = false;
slid = true;
};
};
};
if ((((regenTimer > 50)) && ((health < 100)))){
health = (health + regenRate);
} else {
regenTimer++;
};
if (health < 1){
playerDie();
};
if (upDown){
if (!falling){
jumping = true;
};
};
if (jumping){
jump();
};
if (falling){
fall();
};
_local2 = false;
_local3 = 0;
while (_local3 < Main.platformArray.length) {
if (this.hitBox.hitTestObject(Main.platformArray[_local3])){
_local2 = true;
break;
};
_local3++;
};
if (((((!(_local2)) && (!(jumping)))) && (!(falling)))){
jumpHeight = 0;
falling = true;
};
Input.update();
}
private function fall():void{
var _local1:int;
if (!fallAnim){
gotoAndStop(5);
fallAnim = true;
};
if (upDown){
this.y = (this.y - glideSpeed);
} else {
jumpHeight = (jumpHeight - gravity);
this.y = (this.y - jumpHeight);
};
if (jumpHeight < maxFallSpeed){
jumpHeight = maxFallSpeed;
};
_local1 = 0;
while (_local1 < Main.platformArray.length) {
if (this.hitBox.hitTestObject(Main.platformArray[_local1])){
jumpHeight = 20;
falling = false;
fallAnim = false;
jumpSoundPlayed = false;
landSound.play(0, 0, ST);
if (((leftDown) || (rightDown))){
gotoAndStop(2);
} else {
gotoAndStop(1);
};
};
_local1++;
};
}
public function playerDie():void{
keysDisabled = true;
if (!deadAnim){
deadAnim = true;
Main.mainClass.lives = (Main.mainClass.lives - 1);
this.gotoAndStop(9);
};
if (this.alpha > 0){
this.alpha = (this.alpha - fadeSpeed);
} else {
if (Main.mainClass.lives >= 0){
health = 100;
regenTimer = 150;
this.x = Main.mainClass.startX;
this.y = Main.mainClass.startY;
keysDisabled = false;
this.alpha = 1;
deadAnim = false;
if (((leftDown) || (rightDown))){
gotoAndStop(2);
} else {
gotoAndStop(1);
};
trace(("Player died. lives = " + Main.mainClass.lives));
} else {
if (Main.mainClass.lives < 0){
Main.mainClass.gameOver("lose");
Main.mainClass.lives = 0;
};
};
};
}
}
}//package
Section 37
//Bookshelf (Bookshelf)
package {
import flash.display.*;
import flash.events.*;
public class Bookshelf extends MovieClip {
public var moveBookShelf:Boolean;
public function Bookshelf(){
moveBookShelf = false;
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
}
private function loop(_arg1:Event):void{
if (!moveBookShelf){
if (Main.mainClass.player.hitTestObject(this)){
if (Main.mainClass.player.x > this.x){
if (Batman.batmanClass.sliding){
Main.mainClass.player.x = (Main.mainClass.player.x + (Main.mainClass.player.speed + Batman.batmanClass.slideFriction));
} else {
Main.mainClass.player.x = (Main.mainClass.player.x + Main.mainClass.player.speed);
};
};
if (Main.mainClass.player.x < this.x){
if (Batman.batmanClass.sliding){
Main.mainClass.player.x = (Main.mainClass.player.x - (Main.mainClass.player.speed + Batman.batmanClass.slideFriction));
} else {
Main.mainClass.player.x = (Main.mainClass.player.x - Main.mainClass.player.speed);
};
};
};
} else {
if (((Main.mainClass.player.hitTestObject(this)) && ((this.x < 1720)))){
if (Batman.batmanClass.rightDown){
this.x = (this.x + Batman.batmanClass.speed);
};
} else {
if (this.x > 1720){
this.removeEventListener(Event.ENTER_FRAME, loop);
};
};
};
}
}
}//package
Section 38
//CameraProp (CameraProp)
package {
import flash.display.*;
public dynamic class CameraProp extends MovieClip {
}
}//package
Section 39
//ClickSound (ClickSound)
package {
import flash.media.*;
public dynamic class ClickSound extends Sound {
}
}//package
Section 40
//Collectable (Collectable)
package {
import flash.display.*;
import flash.events.*;
public class Collectable extends MovieClip {
private var arrayNumber:uint;
private static var emptyPosition:uint;
public function Collectable(){
Main.collectableArray.push(this);
arrayNumber = (Main.collectableArray.length - 1);
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
}
public function removeCollectable():void{
this.removeEventListener(Event.ENTER_FRAME, loop);
(parent as MovieClip).removeChild(this);
}
public function calculatePosition():void{
if (arrayNumber > emptyPosition){
arrayNumber--;
};
}
private function loop(_arg1:Event):void{
var _local2:uint;
if (this.hitTestObject(Main.mainClass.player)){
Main.mainClass.collected++;
Main.mainClass.score = (Main.mainClass.score + 2);
emptyPosition = arrayNumber;
Main.collectableArray.splice(arrayNumber, 1);
_local2 = 0;
while (_local2 < Main.collectableArray.length) {
Main.collectableArray[_local2].calculatePosition();
_local2++;
};
removeCollectable();
};
}
}
}//package
Section 41
//CutSceneOne (CutSceneOne)
package {
import flash.display.*;
import flash.events.*;
public dynamic class CutSceneOne extends MovieClip {
public var alarm_mc:MovieClip;
public var skipButton:MovieClip;
public var gas_mc:MovieClip;
public function CutSceneOne(){
addFrameScript(0, frame1, 340, frame341);
}
function frame341(){
skipButton.removeEventListener(MouseEvent.CLICK, skipScene);
stop();
}
function frame1(){
skipButton.addEventListener(MouseEvent.CLICK, skipScene);
}
public function skipScene(_arg1:Event){
gotoAndPlay(341);
}
}
}//package
Section 42
//CutSceneTwo (CutSceneTwo)
package {
import flash.display.*;
public dynamic class CutSceneTwo extends MovieClip {
}
}//package
Section 43
//DamageBox (DamageBox)
package {
import flash.display.*;
import flash.events.*;
public class DamageBox extends MovieClip {
public static var damageBoxClass;
public function DamageBox(){
damageBoxClass = this;
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
this.visible = false;
Main.damageBoxArray.push(this);
}
private function loop(_arg1:Event):void{
if (Main.mainClass.player.hurtBox.hitTestObject(this)){
Batman.batmanClass.health = 0;
Batman.batmanClass.regenTimer = 0;
};
}
public function removeDamageBox():void{
this.removeEventListener(Event.ENTER_FRAME, loop);
(parent as MovieClip).removeChild(this);
}
}
}//package
Section 44
//Dimmer (Dimmer)
package {
import flash.display.*;
public dynamic class Dimmer extends MovieClip {
}
}//package
Section 45
//Door (Door)
package {
import flash.display.*;
import flash.events.*;
public class Door extends MovieClip {
public var doorOpen:Boolean;// = false
public function Door(){
doorOpen = false;
super();
this.addEventListener(Event.ENTER_FRAME, doorLoop, false, 0, true);
}
public function doorLoop(_arg1:Event):void{
if (Main.mainClass.player.hitTestObject(this)){
if (Main.mainClass.player.x > this.x){
if (Batman.batmanClass.sliding){
Main.mainClass.player.x = (Main.mainClass.player.x + (Main.mainClass.player.speed + Batman.batmanClass.slideFriction));
} else {
Main.mainClass.player.x = (Main.mainClass.player.x + Main.mainClass.player.speed);
};
};
if (Main.mainClass.player.x < this.x){
if (Batman.batmanClass.sliding){
Main.mainClass.player.x = (Main.mainClass.player.x - (Main.mainClass.player.speed + Batman.batmanClass.slideFriction));
} else {
Main.mainClass.player.x = (Main.mainClass.player.x - Main.mainClass.player.speed);
};
};
};
if (doorOpen){
this.y = (this.y - 5);
if (this.y < 2230){
Main.mainClass.levelOne.Switch.gotoAndStop(2);
this.removeEventListener(Event.ENTER_FRAME, doorLoop);
parent.removeChild(this);
};
};
}
}
}//package
Section 46
//ElevatorSound (ElevatorSound)
package {
import flash.media.*;
public dynamic class ElevatorSound extends Sound {
}
}//package
Section 47
//Enemy (Enemy)
package {
import flash.display.*;
public dynamic class Enemy extends MovieClip {
public var attackBox:MovieClip;
public var Hit:MovieClip;
}
}//package
Section 48
//EnemyOne (EnemyOne)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
public class EnemyOne extends MovieClip {
public var enemyHealth:int;// = 150
private var PatrolTargetPos:Number;// = 0
private var arrayNumber:uint;
public var enemyHit:Boolean;
private var enemyAttackLeft:Boolean;// = false
private var enemyAttackRight:Boolean;// = false
private var PatrolRange:Number;// = 300
private var guardDieSound:Sound;
private var hitSound:Sound;
public var enemyDead:Boolean;// = false
private var startPoint:Number;
public var attackBox:MovieClip;
private var enemyDeadSound:Boolean;// = false
public var enemyDamageReload:uint;// = 0
public var Hit:MovieClip;
private var glow:GlowFilter;
private var AttackRange:Number;// = 460
private static var emptyPosition:uint;
public static var enemyOneClass;
public static var enemySpeed:uint = 4;
public function EnemyOne(){
enemyAttackRight = false;
enemyAttackLeft = false;
guardDieSound = new GuardDieSound();
hitSound = new HitSound();
enemyDeadSound = false;
enemyDamageReload = 0;
enemyHealth = 150;
enemyDead = false;
AttackRange = 460;
PatrolRange = 300;
PatrolTargetPos = 0;
super();
enemyOneClass = this;
enemyHit = false;
startPoint = this.x;
PatrolTargetPos = (startPoint + PatrolRange);
glow = new GlowFilter();
glow.strength = 2;
this.addEventListener(Event.ENTER_FRAME, enemyLoop, false, 0, true);
Main.enemyArray.push(this);
arrayNumber = (Main.enemyArray.length - 1);
}
function PatrolLoop():void{
if (Math.abs((this.x - PatrolTargetPos)) < 5){
if (PatrolTargetPos < (startPoint + PatrolRange)){
PatrolTargetPos = (startPoint + PatrolRange);
} else {
PatrolTargetPos = (startPoint - PatrolRange);
};
};
if (PatrolTargetPos < this.x){
this.scaleX = -0.52;
this.scaleY = 0.52;
this.x = (this.x - enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if (PatrolTargetPos > this.x){
this.scaleX = 0.52;
this.scaleY = 0.52;
this.x = (this.x + enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
}
function enemyLoop(_arg1:Event){
var _local2:uint;
if (((!(enemyDead)) && (!(enemyHit)))){
if (BatmanIsInRange()){
if ((((((((Main.mainClass.player.x < this.x)) && ((this.x > (startPoint - 460))))) && ((enemyAttackLeft == false)))) && ((enemyAttackRight == false)))){
this.scaleX = -0.52;
this.scaleY = 0.52;
this.x = (this.x - enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if ((((((Main.mainClass.player.x < this.x)) && ((Main.mainClass.player.x > (this.x - 80))))) && ((Batman.batmanClass.health > 1)))){
if (!enemyAttackLeft){
this.gotoAndStop(3);
enemyAttackLeft = true;
};
} else {
if (enemyAttackLeft){
this.gotoAndStop(2);
enemyAttackLeft = false;
};
};
if ((((((((Main.mainClass.player.x > this.x)) && ((this.x < (startPoint + 460))))) && ((enemyAttackLeft == false)))) && ((enemyAttackRight == false)))){
this.scaleX = 0.52;
this.scaleY = 0.52;
this.x = (this.x + enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if ((((((Main.mainClass.player.x > this.x)) && ((Main.mainClass.player.x < (this.x + 80))))) && ((Batman.batmanClass.health > 1)))){
if (!enemyAttackRight){
this.gotoAndStop(3);
enemyAttackRight = true;
};
} else {
if (enemyAttackRight){
this.gotoAndStop(2);
enemyAttackRight = false;
};
};
enemyDamageReload++;
} else {
PatrolLoop();
};
};
Batman.batmanClass.damageReload++;
if (((((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 6)))) && ((Batman.batmanClass.damageReload > 7)))) || (((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 8)))) && ((Batman.batmanClass.damageReload > 7)))))){
enemyHurt();
};
if (enemyHealth < 1){
enemyHealth = 0;
if (!enemyDead){
this.gotoAndStop(4);
enemyDead = true;
};
};
if (glow.strength > 0.1){
glow.strength = (glow.strength - 0.1);
this.filters = [glow];
};
if (glow.strength < 0.1){
this.filters = [];
};
if (enemyDead){
if (!enemyDeadSound){
guardDieSound.play();
enemyDeadSound = true;
};
this.alpha = (this.alpha - 0.05);
if (this.alpha < 0.1){
this.alpha = 1;
Main.mainClass.score = (Main.mainClass.score + 500);
emptyPosition = arrayNumber;
Main.enemyArray.splice(arrayNumber, 1);
_local2 = 0;
while (_local2 < Main.enemyArray.length) {
Main.enemyArray[_local2].calculatePosition();
_local2++;
};
removeEnemy();
};
};
}
public function removeEnemy():void{
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, enemyLoop);
}
public function enemyHurt(){
enemyHealth = (enemyHealth - 10);
if (Main.mainClass.player.x > this.x){
this.x = (this.x - 20);
};
if (Main.mainClass.player.x < this.x){
this.x = (this.x + 20);
};
Batman.batmanClass.damageReload = 0;
if (enemyHealth > 100){
glow.color = 0xFF00;
this.filters = [glow];
glow.strength = 2;
};
if ((((enemyHealth > 50)) && ((enemyHealth < 100)))){
glow.color = 0xFF6600;
this.filters = [glow];
glow.strength = 2;
};
if ((((enemyHealth > 0)) && ((enemyHealth < 33)))){
glow.color = 0xFF0000;
this.filters = [glow];
glow.strength = 2;
};
}
function BatmanIsInRange():Boolean{
if ((((Main.mainClass.player.x > (startPoint - AttackRange))) && ((Main.mainClass.player.x < (startPoint + AttackRange))))){
return (true);
};
return (false);
}
public function calculatePosition():void{
if (arrayNumber > emptyPosition){
arrayNumber--;
};
}
public function HurtPlayer():void{
if (((((((this.attackBox.hitTestObject(Main.mainClass.player)) && ((this.currentFrame == 3)))) && ((enemyDamageReload > 6)))) && (!(enemyHit)))){
hitSound.play();
Batman.batmanClass.regenTimer = 0;
Batman.batmanClass.health = (Batman.batmanClass.health - 10);
enemyDamageReload = 0;
};
}
}
}//package
Section 49
//EnemyScarecrow (EnemyScarecrow)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
public class EnemyScarecrow extends MovieClip {
var HitReload:int;// = 0
public var Dropping:Boolean;
public var StartHeight:Number;
private var laughSound:Sound;
public var DamageReload:uint;// = 0
var Armor:int;// = 2
var FireballReload:uint;// = 0
public var attackBox:MovieClip;
public var dead:MovieClip;
public var StartPoint:Number;
public var Health:int;// = 150
public var trigger_mc:MovieClip;
public var Hit:Boolean;
var MaxFireballReload:uint;// = 100
var DodgePercent:Number;// = 20
public var Dead:Boolean;// = false
public var AttackLeft:Boolean;// = false
public var AttackRight:Boolean;// = false
private var glow:GlowFilter;
var Vspeed:Number;// = 0
var Dodging:Boolean;// = false
var OnFire:Boolean;// = false
public static var Speed:uint = 2;
public function EnemyScarecrow(){
laughSound = new LaughSound();
AttackRight = false;
AttackLeft = false;
DamageReload = 0;
FireballReload = 0;
HitReload = 0;
Dead = false;
Vspeed = 0;
Dodging = false;
OnFire = false;
Health = 150;
Armor = 2;
DodgePercent = 20;
MaxFireballReload = 100;
super();
addFrameScript(0, frame1, 4, frame5, 9, frame10, 14, frame15, 19, frame20, 24, frame25, 29, frame30, 34, frame35, 39, frame40, 44, frame45, 49, frame50, 54, frame55, 59, frame60, 64, frame65, 69, frame70, 74, frame75, 79, frame80, 84, frame85, 89, frame90, 94, frame95);
glow = new GlowFilter();
glow.strength = 2;
Main.scareCrowArray.push(this);
this.gotoAndStop("waitfortrigger");
this.scaleX = 0.7;
this.scaleY = 0.7;
StartHeight = this.y;
StartPoint = this.x;
this.addEventListener(Event.ENTER_FRAME, Loop, false, 0, true);
}
function DeadCheck(){
var _local1:int;
if (Health < 1){
if (!Dead){
Main.mainClass.score = (Main.mainClass.score + 3500);
if (Main.mainClass.currentLevel == 4){
this.gotoAndStop("dead");
} else {
this.gotoAndStop("run");
};
Main.scareCrowArray.splice(0, Main.scareCrowArray.length);
laughSound.play();
Dead = true;
};
};
if (Dead){
if (Main.mainClass.currentLevel < 4){
_local1 = 0;
_local1 = 8;
this.scaleX = 0.7;
this.x = (this.x + _local1);
this.alpha = (this.alpha - 0.01);
if (this.alpha < 0.1){
Main.mainClass.score = (Main.mainClass.score + 3500);
removeScarecrow();
LevelLink.levelLinkClass.cityLevelComplete = true;
Main.mainClass.removeLevel(Main.mainClass.currentLevel);
};
} else {
if (this.dead){
if (this.dead.currentFrame == this.dead.totalFrames){
Main.mainClass.score = (Main.mainClass.score + 3500);
removeScarecrow();
Main.mainClass.removeLevel(Main.mainClass.currentLevel);
};
};
};
};
}
function frame75(){
stop();
}
function frame70(){
stop();
}
function frame35(){
stop();
}
function frame80(){
stop();
}
function frame85(){
stop();
}
function frame65(){
stop();
}
function frame90(){
stop();
}
function frame10(){
stop();
}
function frame95(){
stop();
}
public function DroppedFromSky(){
Dropping = false;
this.gotoAndStop("stance");
}
function frame25(){
stop();
}
function ChasePlayer(){
if ((((((((Main.mainClass.player.x < this.x)) && ((this.x > (StartPoint - 460))))) && ((AttackLeft == false)))) && ((AttackRight == false)))){
this.scaleX = -0.6;
this.x = (this.x - Speed);
if (!OnFire){
if (currentLabel != "walk"){
this.gotoAndStop("walk");
};
} else {
if (currentLabel != "fireWalk"){
this.gotoAndStop("fireWalk");
};
};
};
if ((((((((Main.mainClass.player.x > this.x)) && ((this.x < (StartPoint + 460))))) && ((AttackLeft == false)))) && ((AttackRight == false)))){
this.scaleX = 0.6;
this.x = (this.x + Speed);
if (!OnFire){
if (currentLabel != "walk"){
this.gotoAndStop("walk");
};
} else {
if (currentLabel != "fireWalk"){
this.gotoAndStop("fireWalk");
};
};
};
}
function ShotFireball(){
var _local1:Fireball;
_local1 = new Fireball();
_local1.x = this.x;
_local1.y = (this.y + 15);
if (Main.mainClass.player.x > this.x){
_local1.Speed = 10;
} else {
_local1.Speed = -10;
};
this.parent.addChild(_local1);
}
function DropFromSky(){
Dropping = true;
this.gotoAndStop("land");
}
function frame5(){
stop();
}
function frame1(){
stop();
}
function frame15(){
stop();
}
function frame20(){
stop();
}
function frame40(){
stop();
}
public function removeScarecrow():void{
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, Loop);
}
public function SetDifficulty(_arg1:int){
switch (_arg1){
case 1:
Health = 100;
Armor = 1;
break;
case 2:
Health = 110;
Armor = 2;
break;
case 3:
Health = 120;
Armor = 3;
break;
case 4:
Health = 130;
Armor = 4;
break;
};
}
function enemyHurt(){
if (Health > 100){
glow.color = 0xFF00;
this.filters = [glow];
glow.strength = 2;
};
if ((((Health > 50)) && ((Health < 100)))){
glow.color = 0xFF6600;
this.filters = [glow];
glow.strength = 2;
};
if ((((Health > 0)) && ((Health < 33)))){
glow.color = 0xFF0000;
this.filters = [glow];
glow.strength = 2;
};
if (((OnFire) && (((Math.random() * 100) < DodgePercent)))){
Dodging = true;
this.gotoAndStop("firedodge");
if (Main.mainClass.player.x < this.x){
this.x = (this.x + 20);
} else {
this.x = (this.x - 20);
};
Vspeed = (Vspeed + 7);
this.y = (this.y - Vspeed);
} else {
this.gotoAndStop("hit");
Health = (Health - (10 - Armor));
if (Main.mainClass.player.x > this.x){
this.x = (this.x - 5);
} else {
this.x = (this.x + 5);
};
if (!Dead){
Main.mainClass.score = (Main.mainClass.score + 2);
};
Batman.batmanClass.damageReload = 0;
if (Health < 50){
OnFire = true;
};
HitReload = 10;
};
}
function frame45(){
stop();
}
function frame30(){
stop();
}
function Loop(_arg1:Event){
var _local2:Number;
var _local3:Number;
if (glow.strength > 0.1){
glow.strength = (glow.strength - 0.1);
this.filters = [glow];
};
if (glow.strength < 0.1){
this.filters = [];
};
if (currentLabel == "waitfortrigger"){
if (this.trigger_mc.hitTestObject(Main.mainClass.player)){
DropFromSky();
};
} else {
if (!Dropping){
if (HitReload > 0){
HitReload--;
};
if (((((!(Dead)) && (!(Hit)))) && ((HitReload == 0)))){
if (Dodging){
this.y = (this.y - Vspeed);
Vspeed = (Vspeed - 1);
if (this.y > StartHeight){
this.y = StartHeight;
Dodging = false;
};
} else {
if (FireballReload > 0){
FireballReload--;
};
_local2 = Math.abs((Main.mainClass.player.x - this.x));
_local3 = Math.abs((Main.mainClass.player.y - this.y));
if ((((((((((_local2 > 150)) && ((_local2 < 800)))) && ((_local3 < 100)))) && ((DamageReload > 30)))) && ((FireballReload == 0)))){
DamageReload = 0;
FireballReload = MaxFireballReload;
this.gotoAndStop("fireBall");
setTimeout(ShotFireball, 600);
};
if (DamageReload < 100){
DamageReload++;
};
if (((((this.attackBox.hitTestObject(Main.mainClass.player)) && ((DamageReload > 22)))) && ((HitReload == 0)))){
if (!OnFire){
this.gotoAndStop("smash");
} else {
this.gotoAndStop("fireKick");
};
Batman.batmanClass.health = (Batman.batmanClass.health - 10);
Batman.batmanClass.regenTimer = 0;
DamageReload = 0;
if (this.x > Main.mainClass.player.x){
Main.mainClass.player.x = (Main.mainClass.player.x - Batman.batmanClass.speed);
} else {
Main.mainClass.player.x = (Main.mainClass.player.x + Batman.batmanClass.speed);
};
};
if (DamageReload > 20){
ChasePlayer();
};
CheckBatmanAttack();
};
};
};
DeadCheck();
};
}
function frame55(){
stop();
}
function frame50(){
stop();
}
function CheckBatmanAttack(){
Batman.batmanClass.damageReload++;
if (((((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 6)))) && ((Batman.batmanClass.damageReload > 7)))) || (((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 8)))) && ((Batman.batmanClass.damageReload > 7)))))){
enemyHurt();
};
}
function frame60(){
stop();
}
}
}//package
Section 50
//EnemyThree (EnemyThree)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
public class EnemyThree extends MovieClip {
public var enemyHealth:int;// = 200
private var PatrolTargetPos:Number;// = 0
private var arrayNumber:uint;
public var enemyHit:Boolean;
private var enemyAttackLeft:Boolean;// = false
private var enemyAttackRight:Boolean;// = false
private var PatrolRange:Number;// = 300
private var guardDieSound:Sound;
private var hitSound:Sound;
public var enemyDead:Boolean;// = false
private var startPoint:Number;
public var attackBox:MovieClip;
private var enemyDeadSound:Boolean;// = false
public var enemyDamageReload:uint;// = 0
private var glow:GlowFilter;
private var AttackRange:Number;// = 460
public static var enemyThreeClass;
private static var emptyPosition:uint;
public static var enemySpeed:uint = 4;
public function EnemyThree(){
enemyAttackRight = false;
enemyAttackLeft = false;
guardDieSound = new GuardDieSound();
hitSound = new HitSound();
enemyDeadSound = false;
enemyDamageReload = 0;
enemyHealth = 200;
enemyDead = false;
AttackRange = 460;
PatrolRange = 300;
PatrolTargetPos = 0;
super();
enemyThreeClass = this;
enemyHit = false;
startPoint = this.x;
PatrolTargetPos = (startPoint + PatrolRange);
glow = new GlowFilter();
glow.strength = 2;
this.addEventListener(Event.ENTER_FRAME, enemyLoop, false, 0, true);
Main.enemyArray.push(this);
arrayNumber = (Main.enemyArray.length - 1);
}
function PatrolLoop(){
if (Math.abs((this.x - PatrolTargetPos)) < 5){
if (PatrolTargetPos < (startPoint + PatrolRange)){
PatrolTargetPos = (startPoint + PatrolRange);
} else {
PatrolTargetPos = (startPoint - PatrolRange);
};
};
if (PatrolTargetPos < this.x){
this.scaleX = -0.52;
this.scaleY = 0.52;
this.x = (this.x - enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if (PatrolTargetPos > this.x){
this.scaleX = 0.52;
this.scaleY = 0.52;
this.x = (this.x + enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
}
function enemyLoop(_arg1:Event){
var _local2:uint;
if (Main.mainClass.currentLevel == 3){
AttackRange = 100;
PatrolRange = 80;
};
if (((!(enemyDead)) && (!(enemyHit)))){
if (BatmanIsInRange()){
if ((((((((Main.mainClass.player.x < this.x)) && ((this.x > (startPoint - 460))))) && ((enemyAttackLeft == false)))) && ((enemyAttackRight == false)))){
this.scaleX = -0.52;
this.scaleY = 0.52;
this.x = (this.x - enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if ((((((Main.mainClass.player.x < this.x)) && ((Main.mainClass.player.x > (this.x - 80))))) && ((Batman.batmanClass.health > 1)))){
if (!enemyAttackLeft){
this.gotoAndStop(3);
enemyAttackLeft = true;
};
} else {
if (enemyAttackLeft){
this.gotoAndStop(2);
enemyAttackLeft = false;
};
};
if ((((((((Main.mainClass.player.x > this.x)) && ((this.x < (startPoint + 460))))) && ((enemyAttackLeft == false)))) && ((enemyAttackRight == false)))){
this.scaleX = 0.52;
this.scaleY = 0.52;
this.x = (this.x + enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if ((((((Main.mainClass.player.x > this.x)) && ((Main.mainClass.player.x < (this.x + 80))))) && ((Batman.batmanClass.health > 1)))){
if (!enemyAttackRight){
this.gotoAndStop(3);
enemyAttackRight = true;
};
} else {
if (enemyAttackRight){
this.gotoAndStop(2);
enemyAttackRight = false;
};
};
enemyDamageReload++;
} else {
PatrolLoop();
};
};
Batman.batmanClass.damageReload++;
if (((((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 6)))) && ((Batman.batmanClass.damageReload > 7)))) || (((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 8)))) && ((Batman.batmanClass.damageReload > 7)))))){
enemyHurt();
};
if (enemyHealth < 1){
enemyHealth = 0;
if (!enemyDead){
this.gotoAndStop(4);
enemyDead = true;
};
};
if (glow.strength > 0.1){
glow.strength = (glow.strength - 0.1);
this.filters = [glow];
};
if (glow.strength < 0.1){
this.filters = [];
};
if (enemyDead){
if (!enemyDeadSound){
guardDieSound.play();
enemyDeadSound = true;
};
this.alpha = (this.alpha - 0.05);
if (this.alpha < 0.1){
this.alpha = 1;
Main.mainClass.score = (Main.mainClass.score + 700);
emptyPosition = arrayNumber;
Main.enemyArray.splice(arrayNumber, 1);
_local2 = 0;
while (_local2 < Main.enemyArray.length) {
Main.enemyArray[_local2].calculatePosition();
_local2++;
};
removeEnemy();
};
};
}
public function removeEnemy(){
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, enemyLoop);
}
public function enemyHurt(){
enemyHealth = (enemyHealth - 10);
if (Main.mainClass.player.x > this.x){
this.x = (this.x - 20);
};
if (Main.mainClass.player.x < this.x){
this.x = (this.x + 20);
};
Batman.batmanClass.damageReload = 0;
if (enemyHealth > 133){
glow.color = 0xFF00;
this.filters = [glow];
glow.strength = 2;
};
if ((((enemyHealth > 77)) && ((enemyHealth < 133)))){
glow.color = 0xFF6600;
this.filters = [glow];
glow.strength = 2;
};
if ((((enemyHealth > 0)) && ((enemyHealth < 77)))){
glow.color = 0xFF0000;
this.filters = [glow];
glow.strength = 2;
};
}
function BatmanIsInRange():Boolean{
if ((((Main.mainClass.player.x > (startPoint - AttackRange))) && ((Main.mainClass.player.x < (startPoint + AttackRange))))){
return (true);
};
return (false);
}
public function calculatePosition():void{
if (arrayNumber > emptyPosition){
arrayNumber--;
};
}
public function HurtPlayer(){
if (((((((this.attackBox.hitTestObject(Main.mainClass.player)) && ((this.currentFrame == 3)))) && ((enemyDamageReload > 6)))) && (!(enemyHit)))){
hitSound.play();
Batman.batmanClass.regenTimer = 0;
Batman.batmanClass.health = (Batman.batmanClass.health - 10);
enemyDamageReload = 0;
};
}
}
}//package
Section 51
//EnemyTwo (EnemyTwo)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
public class EnemyTwo extends MovieClip {
public var enemyHealth:int;// = 100
private var PatrolTargetPos:Number;// = 0
private var arrayNumber:uint;
public var enemyHit:Boolean;
private var enemyAttackLeft:Boolean;// = false
private var enemyAttackRight:Boolean;// = false
private var PatrolRange:Number;// = 300
private var guardDieSound:Sound;
private var hitSound:Sound;
public var enemyDead:Boolean;// = false
private var startPoint:Number;
public var attackBox:MovieClip;
public var enemyDamageReload:uint;// = 0
private var glow:GlowFilter;
private var AttackRange:Number;// = 460
public static var enemyTwoClass;
private static var emptyPosition:uint;
public static var enemySpeed:uint = 4;
public function EnemyTwo(){
enemyAttackRight = false;
enemyAttackLeft = false;
guardDieSound = new GuardDieSound();
hitSound = new HitSound();
enemyDamageReload = 0;
enemyHealth = 100;
enemyDead = false;
AttackRange = 460;
PatrolRange = 300;
PatrolTargetPos = 0;
super();
enemyTwoClass = this;
enemyHit = false;
startPoint = this.x;
PatrolTargetPos = (startPoint + PatrolRange);
glow = new GlowFilter();
glow.strength = 2;
this.addEventListener(Event.ENTER_FRAME, enemyLoop, false, 0, true);
Main.enemyArray.push(this);
arrayNumber = (Main.enemyArray.length - 1);
}
function PatrolLoop(){
if (Math.abs((this.x - PatrolTargetPos)) < 5){
if (PatrolTargetPos < (startPoint + PatrolRange)){
PatrolTargetPos = (startPoint + PatrolRange);
} else {
PatrolTargetPos = (startPoint - PatrolRange);
};
};
if (PatrolTargetPos < this.x){
this.scaleX = -0.52;
this.scaleY = 0.52;
this.x = (this.x - enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if (PatrolTargetPos > this.x){
this.scaleX = 0.52;
this.scaleY = 0.52;
this.x = (this.x + enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
}
function enemyLoop(_arg1:Event){
var _local2:uint;
if (Main.mainClass.currentLevel == 3){
AttackRange = 100;
PatrolRange = 80;
};
if (((!(enemyDead)) && (!(enemyHit)))){
if (BatmanIsInRange()){
if ((((((((Main.mainClass.player.x < this.x)) && ((this.x > (startPoint - 460))))) && ((enemyAttackLeft == false)))) && ((enemyAttackRight == false)))){
this.scaleX = -0.52;
this.scaleY = 0.52;
this.x = (this.x - enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if ((((((Main.mainClass.player.x < this.x)) && ((Main.mainClass.player.x > (this.x - 80))))) && ((Batman.batmanClass.health > 1)))){
if (!enemyAttackLeft){
this.gotoAndStop(3);
enemyAttackLeft = true;
};
} else {
if (enemyAttackLeft){
this.gotoAndStop(2);
enemyAttackLeft = false;
};
};
if ((((((((Main.mainClass.player.x > this.x)) && ((this.x < (startPoint + 460))))) && ((enemyAttackLeft == false)))) && ((enemyAttackRight == false)))){
this.scaleX = 0.52;
this.scaleY = 0.52;
this.x = (this.x + enemySpeed);
if (this.currentLabel != "walking"){
this.gotoAndStop("walking");
};
};
if ((((((Main.mainClass.player.x > this.x)) && ((Main.mainClass.player.x < (this.x + 80))))) && ((Batman.batmanClass.health > 1)))){
if (!enemyAttackRight){
this.gotoAndStop(3);
enemyAttackRight = true;
};
} else {
if (enemyAttackRight){
this.gotoAndStop(2);
enemyAttackRight = false;
};
};
enemyDamageReload++;
} else {
PatrolLoop();
};
};
Batman.batmanClass.damageReload++;
if (((((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 6)))) && ((Batman.batmanClass.damageReload > 7)))) || (((((Main.mainClass.player.attackBox.hitTestObject(this)) && ((Main.mainClass.player.currentFrame == 8)))) && ((Batman.batmanClass.damageReload > 7)))))){
enemyHurt();
};
if (enemyHealth < 1){
enemyHealth = 0;
if (!enemyDead){
this.gotoAndStop(4);
enemyDead = true;
};
};
if (glow.strength > 0.1){
glow.strength = (glow.strength - 0.1);
this.filters = [glow];
};
if (glow.strength < 0.1){
this.filters = [];
};
if (enemyDead){
if (this.alpha == 1){
guardDieSound.play();
};
this.alpha = (this.alpha - 0.05);
if (this.alpha < 0.1){
this.alpha = 1;
Main.mainClass.score = (Main.mainClass.score + 300);
emptyPosition = arrayNumber;
Main.enemyArray.splice(arrayNumber, 1);
_local2 = 0;
while (_local2 < Main.enemyArray.length) {
Main.enemyArray[_local2].calculatePosition();
_local2++;
};
removeEnemy();
};
};
}
public function removeEnemy(){
this.parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, enemyLoop);
}
public function enemyHurt(){
enemyHealth = (enemyHealth - 10);
Batman.batmanClass.damageReload = 0;
if (enemyHealth > 66){
glow.color = 0xFF00;
this.filters = [glow];
glow.strength = 2;
};
if ((((enemyHealth > 33)) && ((enemyHealth < 66)))){
glow.color = 0xFF6600;
this.filters = [glow];
glow.strength = 2;
};
if ((((enemyHealth > 0)) && ((enemyHealth < 33)))){
glow.color = 0xFF0000;
this.filters = [glow];
glow.strength = 2;
};
}
function BatmanIsInRange():Boolean{
if ((((Main.mainClass.player.x > (startPoint - AttackRange))) && ((Main.mainClass.player.x < (startPoint + AttackRange))))){
return (true);
};
return (false);
}
public function calculatePosition():void{
if (arrayNumber > emptyPosition){
arrayNumber--;
};
}
public function HurtPlayer(){
if (((((((this.attackBox.hitTestObject(Main.mainClass.player)) && ((this.currentFrame == 3)))) && ((enemyDamageReload > 12)))) && (!(enemyHit)))){
hitSound.play();
Batman.batmanClass.regenTimer = 0;
Batman.batmanClass.health = (Batman.batmanClass.health - 10);
enemyDamageReload = 0;
};
}
}
}//package
Section 52
//EventOne (EventOne)
package {
import flash.display.*;
public dynamic class EventOne extends MovieClip {
}
}//package
Section 53
//Fireball (Fireball)
package {
import flash.display.*;
import flash.events.*;
public class Fireball extends MovieClip {
const MaxLifetime:int = 100;
var Speed:Number;// = 5
var Lifetime:Number;// = 100
public function Fireball(){
Speed = 5;
Lifetime = MaxLifetime;
super();
this.addEventListener(Event.ENTER_FRAME, Frame);
}
function Frame(_arg1:Event){
this.x = (this.x + Speed);
Lifetime--;
this.alpha = (Lifetime / MaxLifetime);
if (Main.mainClass.player.hitTestObject(this)){
Batman.batmanClass.health = (Batman.batmanClass.health - 5);
Batman.batmanClass.regenTimer = 0;
Lifetime = (Lifetime - 20);
};
if (Lifetime < 0){
this.removeEventListener(Event.ENTER_FRAME, Frame);
this.parent.removeChild(this);
};
}
}
}//package
Section 54
//FPSCounter (FPSCounter)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class FPSCounter extends MovieClip {
private var startTick:Number;
private var FPS:TextField;
private var numFrames:Number;
public function FPSCounter(){
numFrames = 0;
startTick = getTimer();
FPS = new TextField();
FPS.textColor = 0xFF00FF;
addChild(FPS);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event):void{
var _local2:Number;
_local2 = ((getTimer() - startTick) / 1000);
numFrames++;
if (_local2 > 1){
FPS.text = ("FPS: " + (Math.floor(((numFrames / _local2) * 10)) / 10));
startTick = getTimer();
numFrames = 0;
};
}
}
}//package
Section 55
//GameCamera (GameCamera)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class GameCamera extends MovieClip {
const FollowSpeedK:Number = 0.03;
const DeadZone:int = 10;
public var sH:Number;
public var rp:Point;
public var sW:Number;
public var myBitmapData:BitmapData;
public var bounds_obj:Object;
public var camH:Number;
public var camW:Number;
public var bmp:Bitmap;
public var oldScaleMode:String;
public static var cameraFocus;
public static var cameraClass;
public function GameCamera(){
addFrameScript(0, frame1);
cameraClass = this;
this.buttonMode = false;
this.mouseEnabled = false;
this.addEventListener(Event.ENTER_FRAME, cameraLoop, false, 0, true);
}
public function set scaleX2(_arg1:Number):void{
setProperty2("scaleX", _arg1);
}
private function MoveCamWithHudY(_arg1:Number):void{
this.y = (this.y + _arg1);
Main.mainClass.hud.y = (Main.mainClass.hud.y + _arg1);
Main.mainClass.tutorialBox.y = (Main.mainClass.tutorialBox.y + _arg1);
Main.mainClass.dimmer.y = (Main.mainClass.dimmer.y + _arg1);
if (Main.mainClass.currentLevel == 2){
Main.mainClass.levelTwo.background.y = (Main.mainClass.levelTwo.background.y + (_arg1 / 3));
};
if (Main.mainClass.currentLevel == 3){
Main.mainClass.levelThree.background.y = (Main.mainClass.levelThree.background.y + (_arg1 / 3));
};
}
private function cameraLoop(_arg1:Event):void{
if (cameraFocus.x < (this.x - DeadZone)){
MoveCamWithHud((((cameraFocus.x - this.x) - DeadZone) * 0.1));
};
if (cameraFocus.x > (this.x + DeadZone)){
MoveCamWithHud((((cameraFocus.x - this.x) + DeadZone) * 0.1));
};
if (cameraFocus.y < (this.y - DeadZone)){
MoveCamWithHudY((((cameraFocus.y - this.y) + DeadZone) * 0.1));
};
if (cameraFocus.y > (this.y + 100)){
MoveCamWithHudY((((cameraFocus.y - this.y) + DeadZone) * 0.1));
};
}
private function MoveCamWithHud(_arg1:Number):void{
this.x = (this.x + _arg1);
Main.mainClass.hud.x = (Main.mainClass.hud.x + _arg1);
Main.mainClass.tutorialBox.x = (Main.mainClass.tutorialBox.x + _arg1);
Main.mainClass.dimmer.x = (Main.mainClass.dimmer.x + _arg1);
if (Main.mainClass.currentLevel == 2){
Main.mainClass.levelTwo.background.x = (Main.mainClass.levelTwo.background.x + (_arg1 / 3));
};
if (Main.mainClass.currentLevel == 3){
Main.mainClass.levelThree.background.x = (Main.mainClass.levelThree.background.x + (_arg1 / 3));
};
}
public function set x2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x + (_arg1 - _local2.x));
}
public function get rotation2():Number{
return (parent.rotation);
}
function frame1(){
visible = false;
oldScaleMode = stage.scaleMode;
stage.scaleMode = "exactFit";
sW = stage.stageWidth;
sH = stage.stageHeight;
stage.scaleMode = oldScaleMode;
bounds_obj = this.getBounds(this);
camH = bounds_obj.height;
camW = bounds_obj.width;
rp = new Point(x, y);
addEventListener(Event.ENTER_FRAME, camControl);
addEventListener(Event.REMOVED_FROM_STAGE, reset);
myBitmapData = new BitmapData(sW, sH, true, 0);
bmp = new Bitmap(myBitmapData);
camControl();
stage.addChild(bmp);
}
public function camControl(... _args):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
parent.visible = true;
rp.x = x;
rp.y = y;
_local2 = (camH * scaleY);
_local3 = (camW * scaleX);
_local4 = (sH / _local2);
_local5 = (sW / _local3);
x2 = ((_local3 / 2) * _local5);
y2 = ((_local2 / 2) * _local4);
scaleX2 = _local5;
scaleY2 = _local4;
rotation2 = -(rotation);
myBitmapData.lock();
myBitmapData.fillRect(myBitmapData.rect, 0);
myBitmapData.unlock();
myBitmapData.draw(stage);
bmp.filters = this.filters;
bmp.transform.colorTransform = this.transform.colorTransform;
parent.visible = false;
}
public function set scaleY2(_arg1:Number):void{
setProperty2("scaleY", _arg1);
}
public function get scaleX2():Number{
return (parent.scaleX);
}
public function get x2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.x);
}
public function setProperty2(_arg1:String, _arg2:Number):void{
var _local3:Point;
var _local4:Point;
_local3 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent[_arg1] = _arg2;
_local4 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x - (_local4.x - _local3.x));
parent.y = (parent.y - (_local4.y - _local3.y));
}
public function set y2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.y = (parent.y + (_arg1 - _local2.y));
}
public function reset(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, camControl);
removeEventListener(Event.REMOVED_FROM_STAGE, reset);
stage.removeChild(bmp);
myBitmapData.dispose();
bmp = null;
parent.scaleX = 1;
parent.scaleY = 1;
parent.x = 0;
parent.y = 0;
parent.rotation = 0;
parent.visible = true;
}
public function get scaleY2():Number{
return (parent.scaleY);
}
public function removeCamera():void{
this.removeEventListener(Event.ENTER_FRAME, cameraLoop);
parent.removeChild(this);
trace("Camera Removed");
}
public function get y2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.y);
}
public function set rotation2(_arg1:Number):void{
setProperty2("rotation", _arg1);
}
}
}//package
Section 56
//GameLoop (GameLoop)
package {
import flash.media.*;
public dynamic class GameLoop extends Sound {
}
}//package
Section 57
//GameScreen (GameScreen)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class GameScreen extends MovieClip {
public var finalScoreText:TextField;
public var sender:LocalConnection;
public var playPressed:Boolean;
public var playButton:SimpleButton;
public var controlsButton:SimpleButton;
public var scarecrow:MovieClip;
public function GameScreen(){
addFrameScript(0, frame1, 2, frame3, 3, frame4);
}
function frame3(){
finalScoreText.text = Main.mainClass.score;
trace(Main.mainClass.score);
sender.send("_user", "fnPostScore", Main.mainClass.score);
}
function frame1(){
stop();
scarecrow.stop();
playPressed = false;
sender = new LocalConnection();
playButton.addEventListener(MouseEvent.CLICK, playGame, false, 0, true);
controlsButton.addEventListener(MouseEvent.CLICK, showControls, false, 0, true);
}
function frame4(){
finalScoreText.text = Main.mainClass.score;
trace(Main.mainClass.score);
sender.send("_user", "fnPostScore", Main.mainClass.score);
}
public function playGame(_arg1:Event){
scarecrow.gotoAndStop(2);
stage.addEventListener(Event.ENTER_FRAME, scarecrowIntro);
}
public function scarecrowIntro(_arg1:Event){
playPressed = true;
if (scarecrow.throwVile){
if (scarecrow.throwVile.currentFrame == scarecrow.throwVile.totalFrames){
stage.removeEventListener(Event.ENTER_FRAME, scarecrowIntro);
Main.mainClass.startGame();
};
};
}
public function showControls(_arg1:Event){
if (!playPressed){
this.gotoAndStop(2);
};
}
}
}//package
Section 58
//GuardDieSound (GuardDieSound)
package {
import flash.media.*;
public dynamic class GuardDieSound extends Sound {
}
}//package
Section 59
//HitSound (HitSound)
package {
import flash.media.*;
public dynamic class HitSound extends Sound {
}
}//package
Section 60
//Hud (Hud)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Hud extends MovieClip {
public var collectText:TextField;
public var healthMeter:MovieClip;
public var livesText:TextField;
public var scoreText:TextField;
public static var hudClass;
public function Hud(){
hudClass = this;
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
}
private function loop(_arg1:Event):void{
collectText.text = Main.mainClass.collected;
livesText.text = Main.mainClass.lives;
scoreText.text = Main.mainClass.score;
healthMeter.bar.scaleY = (Batman.batmanClass.health / 100);
}
public function removeHud():void{
this.removeEventListener(Event.ENTER_FRAME, loop);
parent.removeChild(this);
}
}
}//package
Section 61
//Input (Input)
package {
import flash.display.*;
import flash.events.*;
public class Input {
public static var mouseOffsetX:Number = 0;
private static var keyArr:Array;
public static var mouseDragX:Number = 0;
public static var mouseDragY:Number = 0;
public static var mouseOffsetY:Number = 0;
public static var ascii:Array;
public static var mouseX:Number = 0;
public static var mouseY:Number = 0;
public static var mouseOver:Boolean = false;
private static var bufferSize:int;
public static var mouse:Sprite = new Sprite();
public static var mouseDown:Boolean = false;
public static var mouseReleased:Boolean = false;
public static var lastKey:int = 0;
public static var m_stageMc:Sprite;
private static var keyState:Array;
public static var timeSinceLastKey = 0;
public static var mousePressed:Boolean = false;
private static var keyBuffer:Array;
public function Input(_arg1:Sprite){
var _local2:int;
var _local3:int;
super();
m_stageMc = _arg1;
ascii = new Array(222);
fillAscii();
keyState = new Array(222);
keyArr = new Array();
_local2 = 0;
while (_local2 < 222) {
keyState[_local2] = new int(0);
if (ascii[_local2] != undefined){
keyArr.push(_local2);
};
_local2++;
};
bufferSize = 5;
keyBuffer = new Array(bufferSize);
_local3 = 0;
while (_local3 < bufferSize) {
keyBuffer[_local3] = new Array(0, 0);
_local3++;
};
_arg1.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPress, false, 0, true);
_arg1.stage.addEventListener(KeyboardEvent.KEY_UP, keyRelease, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.MOUSE_DOWN, mousePress, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.CLICK, mouseRelease, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove, false, 0, true);
_arg1.stage.addEventListener(Event.MOUSE_LEAVE, mouseLeave, false, 0, true);
mouse.graphics.lineStyle(0.1, 0, 100);
mouse.graphics.moveTo(0, 0);
mouse.graphics.lineTo(0, 0.1);
}
public function mouseRelease(_arg1:MouseEvent){
mouseDown = false;
mouseReleased = true;
}
public function keyPress(_arg1:KeyboardEvent){
keyState[_arg1.keyCode] = Math.max(keyState[_arg1.keyCode], 1);
lastKey = _arg1.keyCode;
}
private function fillAscii(){
ascii[65] = "A";
ascii[66] = "B";
ascii[67] = "C";
ascii[68] = "D";
ascii[69] = "E";
ascii[70] = "F";
ascii[71] = "G";
ascii[72] = "H";
ascii[73] = "I";
ascii[74] = "J";
ascii[75] = "K";
ascii[76] = "L";
ascii[77] = "M";
ascii[78] = "N";
ascii[79] = "O";
ascii[80] = "P";
ascii[81] = "Q";
ascii[82] = "R";
ascii[83] = "S";
ascii[84] = "T";
ascii[85] = "U";
ascii[86] = "V";
ascii[87] = "W";
ascii[88] = "X";
ascii[89] = "Y";
ascii[90] = "Z";
ascii[48] = "0";
ascii[49] = "1";
ascii[50] = "2";
ascii[51] = "3";
ascii[52] = "4";
ascii[53] = "5";
ascii[54] = "6";
ascii[55] = "7";
ascii[56] = "8";
ascii[57] = "9";
ascii[32] = "Spacebar";
ascii[17] = "Ctrl";
ascii[16] = "Shift";
ascii[192] = "~";
ascii[38] = "up";
ascii[40] = "down";
ascii[37] = "left";
ascii[39] = "right";
ascii[96] = "Numpad 0";
ascii[97] = "Numpad 1";
ascii[98] = "Numpad 2";
ascii[99] = "Numpad 3";
ascii[100] = "Numpad 4";
ascii[101] = "Numpad 5";
ascii[102] = "Numpad 6";
ascii[103] = "Numpad 7";
ascii[104] = "Numpad 8";
ascii[105] = "Numpad 9";
ascii[111] = "Numpad /";
ascii[106] = "Numpad *";
ascii[109] = "Numpad -";
ascii[107] = "Numpad +";
ascii[110] = "Numpad .";
ascii[45] = "Insert";
ascii[46] = "Delete";
ascii[33] = "Page Up";
ascii[34] = "Page Down";
ascii[35] = "End";
ascii[36] = "Home";
ascii[112] = "F1";
ascii[113] = "F2";
ascii[114] = "F3";
ascii[115] = "F4";
ascii[116] = "F5";
ascii[117] = "F6";
ascii[118] = "F7";
ascii[119] = "F8";
ascii[188] = ",";
ascii[190] = ".";
ascii[186] = ";";
ascii[222] = "'";
ascii[219] = "[";
ascii[221] = "]";
ascii[189] = "-";
ascii[187] = "+";
ascii[220] = "\\";
ascii[191] = "/";
ascii[9] = "TAB";
ascii[8] = "Backspace";
}
public function mouseMove(_arg1:MouseEvent){
if (mouseDown != _arg1.buttonDown){
mouseDown = _arg1.buttonDown;
mouseReleased = !(_arg1.buttonDown);
mousePressed = _arg1.buttonDown;
mouseDragX = 0;
mouseDragY = 0;
};
mouseX = (_arg1.stageX - m_stageMc.x);
mouseY = (_arg1.stageY - m_stageMc.y);
mouseOffsetX = (mouseX - mouse.x);
mouseOffsetY = (mouseY - mouse.y);
if (mouseDown){
mouseDragX = (mouseDragX + mouseOffsetX);
mouseDragY = (mouseDragY + mouseOffsetY);
};
mouse.x = mouseX;
mouse.y = mouseY;
}
public function keyRelease(_arg1:KeyboardEvent){
var _local2:int;
keyState[_arg1.keyCode] = -1;
_local2 = (bufferSize - 1);
while (_local2 > 0) {
keyBuffer[_local2] = keyBuffer[(_local2 - 1)];
_local2--;
};
keyBuffer[0] = [_arg1.keyCode, 0];
}
public function mouseLeave(_arg1:Event){
mouseReleased = mouseDown;
mouseDown = false;
}
public function mousePress(_arg1:MouseEvent){
mousePressed = true;
mouseDown = true;
mouseDragX = 0;
mouseDragY = 0;
}
public static function getKeyHold(_arg1:int):int{
return (Math.max(0, keyState[_arg1]));
}
public static function update(){
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < keyArr.length) {
if (keyState[keyArr[_local1]] != 0){
var _local3 = keyState;
var _local4 = keyArr[_local1];
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
_local1++;
};
_local2 = 0;
while (_local2 < bufferSize) {
_local3 = keyBuffer[_local2];
_local4 = 1;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
_local2++;
};
mouseReleased = false;
mousePressed = false;
mouseOver = false;
}
public static function isKeyPressed(_arg1:int):Boolean{
timeSinceLastKey = 0;
return ((keyState[_arg1] == 1));
}
public static function isKeyDown(_arg1:int):Boolean{
return ((keyState[_arg1] > 0));
}
public static function getKeyString(_arg1:uint):String{
return (ascii[_arg1]);
}
public static function isKeyReleased(_arg1:int):Boolean{
return ((keyState[_arg1] == -1));
}
public static function isKeyInBuffer(_arg1:int, _arg2:int, _arg3:int){
return ((((keyBuffer[_arg2][0] == _arg1)) && ((keyBuffer[_arg2][1] <= _arg3))));
}
}
}//package
Section 62
//JumpSound (JumpSound)
package {
import flash.media.*;
public dynamic class JumpSound extends Sound {
}
}//package
Section 63
//LandSound (LandSound)
package {
import flash.media.*;
public dynamic class LandSound extends Sound {
}
}//package
Section 64
//LaughSound (LaughSound)
package {
import flash.media.*;
public dynamic class LaughSound extends Sound {
}
}//package
Section 65
//LevelFour (LevelFour)
package {
import flash.display.*;
public dynamic class LevelFour extends MovieClip {
public var platform2:Obstacle;
public var scareCrow:EnemyScarecrow;
}
}//package
Section 66
//LevelLink (LevelLink)
package {
import flash.display.*;
import flash.events.*;
public class LevelLink extends MovieClip {
public var cityLevelComplete:Boolean;// = false
public static var levelLinkClass;
public function LevelLink(){
cityLevelComplete = false;
super();
levelLinkClass = this;
this.visible = false;
this.addEventListener(Event.ENTER_FRAME, linkLoop, false, 0, true);
}
public function removeLevelLink():void{
this.removeEventListener(Event.ENTER_FRAME, linkLoop);
(parent as MovieClip).removeChild(this);
}
private function linkLoop(_arg1:Event):void{
if (this.hitTestObject(Main.mainClass.player)){
if (Main.mainClass.currentLevel == 1){
if (Main.mainClass.dimmer.alpha < 1){
Main.mainClass.dimmer.alpha = (Main.mainClass.dimmer.alpha + 0.05);
} else {
Main.mainClass.levelOne.lift.removeLift();
Main.mainClass.removeLevel(1);
};
} else {
if ((((Main.mainClass.currentLevel == 2)) && (cityLevelComplete))){
if (Main.mainClass.dimmer.alpha < 1){
Main.mainClass.dimmer.alpha = (Main.mainClass.dimmer.alpha + 0.05);
} else {
Main.mainClass.removeLevel(2);
};
} else {
if (Main.mainClass.currentLevel == 3){
if (Main.mainClass.dimmer.alpha < 1){
Main.mainClass.dimmer.alpha = (Main.mainClass.dimmer.alpha + 0.05);
} else {
Main.mainClass.removeLevel(3);
};
} else {
if (Main.mainClass.currentLevel == 4){
if (Main.mainClass.dimmer.alpha < 1){
Main.mainClass.dimmer.alpha = (Main.mainClass.dimmer.alpha + 0.05);
} else {
Main.mainClass.removeLevel(4);
};
};
};
};
};
};
}
}
}//package
Section 67
//LevelOne (LevelOne)
package {
import flash.display.*;
public dynamic class LevelOne extends MovieClip {
public var platform0:Obstacle;
public var platform1:Obstacle;
public var platform3:Obstacle;
public var platform4:Obstacle;
public var platform5:Obstacle;
public var platform6:Obstacle;
public var platform7:Obstacle;
public var platform8:Obstacle;
public var platform2:Obstacle;
public var platform9:Obstacle;
public var caveParallax:MovieClip;
public var TV:MovieClip;
public var collectable14:Collectable;
public var collectable16:Collectable;
public var collectable18:Collectable;
public var collectable19:Collectable;
public var collectable15:Collectable;
public var collectable17:Collectable;
public var collectable20:Collectable;
public var collectable21:Collectable;
public var lift:Lift;
public var collectable0:Collectable;
public var collectable1:Collectable;
public var collectable2:Collectable;
public var collectable3:Collectable;
public var collectable4:Collectable;
public var collectable5:Collectable;
public var collectable6:Collectable;
public var collectable7:Collectable;
public var Switch:BatarangSwitch;
public var bookcase:Bookshelf;
public var enemy2:EnemyTwo;
public var enemy4:EnemyOne;
public var door:Door;
public var platform10:Obstacle;
public var platform12:Obstacle;
public var platform13:Obstacle;
public var platform14:Obstacle;
public var platform15:Obstacle;
}
}//package
Section 68
//LevelThree (LevelThree)
package {
import flash.display.*;
public dynamic class LevelThree extends MovieClip {
public var platform8:Obstacle;
public var platform7:Obstacle;
public var collectable0:Collectable;
public var background:MovieClip;
public var platform2:Obstacle;
public var platform11:Obstacle;
}
}//package
Section 69
//LevelTwo (LevelTwo)
package {
import flash.display.*;
public dynamic class LevelTwo extends MovieClip {
public var platform8:Obstacle;
public var platform7:Obstacle;
public var collectable0:Collectable;
public var collectable1:Collectable;
public var background:MovieClip;
public var collectable4:Collectable;
public var collectable5:Collectable;
public var collectable6:Collectable;
public var collectable7:Collectable;
public var collectable2:Collectable;
public var collectable3:Collectable;
public var enemy4:EnemyOne;
public var scareCrow:EnemyScarecrow;
public var platform11:Obstacle;
public var platform13:Obstacle;
public var platform14:Obstacle;
public var platform15:Obstacle;
}
}//package
Section 70
//Lift (Lift)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class Lift extends MovieClip {
private var elevatorSound:Sound;
public function Lift(){
elevatorSound = new ElevatorSound();
super();
this.addEventListener(Event.ENTER_FRAME, liftLoop, false, 0, true);
}
private function liftLoop(_arg1:Event):void{
if (((this.hitTestObject(Main.mainClass.player)) && ((Main.mainClass.player.x > this.x)))){
if (!Batman.batmanClass.keysDisabled){
parent.swapChildren(this, Main.mainClass.player);
elevatorSound.play();
Batman.batmanClass.keysDisabled = true;
};
Batman.batmanClass.falling = false;
Main.mainClass.player.y = (Main.mainClass.player.y - 10);
Main.mainClass.player.x = 6040;
};
}
public function removeLift():void{
this.removeEventListener(Event.ENTER_FRAME, liftLoop);
parent.removeChild(this);
trace("Lift Removed");
}
}
}//package
Section 71
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class Main extends MovieClip {
public var speechBubble:SpeechBubble;
public var cameraProp:CameraProp;
private var currentMusic:Sound;
public var startX:Number;
public var startY:Number;
private var hudX:Number;// = 0
public var levelOne:LevelOne;
public var dimmer:Dimmer;
private var nextLevel:uint;// = 0
private var ST:SoundTransform;
private var hudY:Number;// = 0
public var levelTwo:LevelTwo;
private var scene:MovieClip;
public var batarangCollected:Boolean;// = false
public var debugMode:Boolean;// = false
public var score:uint;// = 0
private var menuLoop:Sound;
public var levelThree:LevelThree;
public var levelFour:LevelFour;
public var fpsCounter:FPSCounter;
public var player:Batman;
public var hud:Hud;
private var soundChannel:SoundChannel;
public var gameScreen:GameScreen;
public var lives:Number;// = 3
public var camera:GameCamera;
public var isGameOver:Boolean;// = false
public var collected:uint;// = 0
private var stageWidth:Number;
public var currentLevel:uint;
public var tutorialBox:TutorialBox;
private var stageHeight:Number;
public static var platformArray:Array = new Array();
public static var wallArray:Array = new Array();
public static var enemyArray:Array = new Array();
public static var collectableArray:Array = new Array();
public static var damageBoxArray:Array = new Array();
public static var scareCrowArray:Array = new Array();
public static var mainClass;
public function Main(){
var _local1:Preloader;
gameScreen = new GameScreen();
debugMode = false;
currentMusic = new GameLoop();
menuLoop = new MenuLoop();
ST = new SoundTransform(0.8);
dimmer = new Dimmer();
isGameOver = false;
nextLevel = 0;
lives = 3;
collected = 0;
score = 0;
batarangCollected = false;
hudX = 0;
hudY = 0;
super();
mainClass = this;
stageHeight = stage.stageHeight;
stageWidth = stage.stageWidth;
_local1 = new Preloader();
_local1.x = (stageWidth / 2);
_local1.y = (stageHeight / 2);
addChild(_local1);
}
private function clearCollectables():void{
while (collectableArray.length > 0) {
collectableArray.pop().removeCollectable();
};
}
private function CheckCutScene(_arg1:Event):void{
if (scene.currentFrame == scene.totalFrames){
this.removeChild(scene);
addLevel(nextLevel);
this.removeEventListener(Event.ENTER_FRAME, CheckCutScene);
};
}
private function clearPlatforms():void{
while (platformArray.length > 0) {
platformArray.pop().clearPlatform();
};
}
public function playCutScene(_arg1:Number, _arg2:Number):void{
scene.x = _arg1;
scene.y = _arg2;
this.addChild(scene);
this.addEventListener(Event.ENTER_FRAME, CheckCutScene, false, 0, true);
}
private function clearScarecrow():void{
while (scareCrowArray.length > 0) {
scareCrowArray.pop().removeScarecrow();
};
}
private function clearDamageBoxes():void{
while (damageBoxArray.length > 0) {
damageBoxArray.pop().removeDamageBox();
};
}
private function clearEnemyOne():void{
while (enemyArray.length > 0) {
enemyArray.pop().removeEnemy();
};
}
private function clearLevel():void{
clearPlatforms();
clearWalls();
clearScarecrow();
clearDamageBoxes();
clearCollectables();
clearEnemyOne();
Batman.batmanClass.removeBatman();
LevelLink.levelLinkClass.removeLevelLink();
Hud.hudClass.removeHud();
TutorialBox.tutorialClass.removeTutorialBox();
trace("Level cleared from memory");
}
public function addLevel(_arg1:uint):void{
switch (_arg1){
case 1:
levelOne = new LevelOne();
addChild(levelOne);
currentLevel = 1;
trace("LevelOne Added");
player = new Batman();
player.x = 733;
player.y = 542;
startX = 1423;
startY = 1150;
levelOne.addChild(player);
camera = new GameCamera();
GameCamera.cameraFocus = Main.mainClass.player;
camera.x = player.x;
camera.y = (player.y - 90);
addChild(camera);
tutorialBox = new TutorialBox();
tutorialBox.x = (camera.x - 330);
tutorialBox.y = (camera.y - 190);
levelOne.addChild(tutorialBox);
hud = new Hud();
hudX = (camera.x + 251);
hudY = (camera.y - 161);
hud.x = hudX;
hud.y = hudY;
addChild(hud);
dimmer.x = camera.x;
dimmer.y = camera.y;
addChild(dimmer);
dimmer.alpha = 0;
speechBubble = new SpeechBubble();
levelOne.addChild(speechBubble);
break;
case 2:
levelTwo = new LevelTwo();
addChild(levelTwo);
currentLevel = 2;
trace("LevelTwo Added");
player = new Batman();
player.x = 350;
player.y = 1910;
startX = 385;
startY = 1861;
levelTwo.addChild(player);
camera.x = player.x;
camera.y = player.y;
GameCamera.cameraFocus = Main.mainClass.player;
hud = new Hud();
hud.x = (camera.x + 251);
hud.y = (camera.y - 161);
addChild(hud);
dimmer.x = camera.x;
dimmer.y = camera.y;
addChild(dimmer);
dimmer.alpha = 0;
tutorialBox = new TutorialBox();
tutorialBox.x = (camera.x - 330);
tutorialBox.y = (camera.y - 190);
levelTwo.addChild(tutorialBox);
trace("player Added to level");
break;
case 3:
levelThree = new LevelThree();
addChild(levelThree);
currentLevel = 3;
trace("LevelThree Added");
player = new Batman();
player.x = 146;
player.y = 1900;
startX = 146;
startY = 1900;
levelThree.addChild(player);
camera.x = player.x;
camera.y = player.y;
GameCamera.cameraFocus = Main.mainClass.player;
hud = new Hud();
hud.x = (camera.x + 251);
hud.y = (camera.y - 161);
addChild(hud);
dimmer.x = camera.x;
dimmer.y = camera.y;
addChild(dimmer);
dimmer.alpha = 0;
tutorialBox = new TutorialBox();
tutorialBox.x = (camera.x - 330);
tutorialBox.y = (camera.y - 190);
levelThree.addChild(tutorialBox);
trace("player Added to level");
break;
case 4:
levelFour = new LevelFour();
addChild(levelFour);
currentLevel = 4;
trace("LevelFour Added");
player = new Batman();
player.x = 112;
player.y = 327;
startX = 112;
startY = 327;
levelFour.addChild(player);
camera.x = player.x;
camera.y = player.y;
GameCamera.cameraFocus = Main.mainClass.player;
hud = new Hud();
hud.x = (camera.x + 251);
hud.y = (camera.y - 161);
addChild(hud);
dimmer.x = camera.x;
dimmer.y = camera.y;
addChild(dimmer);
dimmer.alpha = 0;
tutorialBox = new TutorialBox();
tutorialBox.x = (camera.x - 330);
tutorialBox.y = (camera.y - 190);
levelFour.addChild(tutorialBox);
trace("player Added to level");
break;
default:
trace("Level Add Error: Level number not recognised");
};
}
public function loadMenu():void{
gameScreen.x = 0;
gameScreen.y = 0;
soundChannel = menuLoop.play(0, int.MAX_VALUE);
addChild(gameScreen);
}
public function removeLevel(_arg1:uint):void{
switch (_arg1){
case 1:
SpeechBubble.speechBubbleClass.removeSpeechBubble();
clearLevel();
removeChild(levelOne);
removeChild(dimmer);
trace("LevelOne removed");
if (!isGameOver){
scene = new CutSceneTwo();
nextLevel = 2;
camera.x = 0;
camera.y = 0;
GameCamera.cameraFocus = Main.mainClass.scene;
playCutScene(0, 0);
};
break;
case 2:
clearLevel();
removeChild(levelTwo);
removeChild(dimmer);
trace("LevelTwo removed");
if (!isGameOver){
addLevel(3);
};
break;
case 3:
clearLevel();
removeChild(levelThree);
removeChild(dimmer);
trace("LevelThree removed");
if (!isGameOver){
addLevel(4);
};
break;
case 4:
clearLevel();
removeChild(levelFour);
removeChild(dimmer);
trace("LevelFour removed");
if (!isGameOver){
gameOver("win");
};
break;
default:
trace("Level Remove Error: Level number not recognised");
};
}
public function startGame():void{
removeChild(gameScreen);
lives = 3;
collected = 0;
score = 0;
isGameOver = false;
scene = new CutSceneOne();
soundChannel.stop();
soundChannel = currentMusic.play(0, int.MAX_VALUE, ST);
nextLevel = 1;
playCutScene(344, 187.5);
}
private function clearWalls():void{
while (wallArray.length > 0) {
wallArray.pop().clearWall();
};
}
public function gameOver(_arg1:String):void{
GameCamera.cameraClass.removeCamera();
isGameOver = true;
addChild(gameScreen);
soundChannel.stop();
if (_arg1 == "win"){
trace("Game Over. Player win");
gameScreen.gotoAndStop(4);
} else {
if (_arg1 == "lose"){
removeLevel(currentLevel);
trace("Game Over. Player lose");
gameScreen.gotoAndStop(3);
};
};
}
}
}//package
Section 72
//MenuLoop (MenuLoop)
package {
import flash.media.*;
public dynamic class MenuLoop extends Sound {
}
}//package
Section 73
//Obstacle (Obstacle)
package {
import flash.display.*;
import flash.events.*;
public class Obstacle extends MovieClip {
public function Obstacle(){
this.visible = false;
if (this.width > this.height){
this.addEventListener(Event.ENTER_FRAME, platformLoop, false, 0, true);
Main.platformArray.push(this);
} else {
this.addEventListener(Event.ENTER_FRAME, wallLoop, false, 0, true);
Main.wallArray.push(this);
};
}
private function wallLoop(_arg1:Event):void{
if (Main.mainClass.player.hitTestObject(this)){
if (Main.mainClass.player.x > this.x){
if (Batman.batmanClass.sliding){
Main.mainClass.player.x = (Main.mainClass.player.x + (Main.mainClass.player.speed = 0));
} else {
Main.mainClass.player.x = (Main.mainClass.player.x + Main.mainClass.player.speed);
};
};
if (Main.mainClass.player.x < this.x){
if (Batman.batmanClass.sliding){
Main.mainClass.player.x = (Main.mainClass.player.x - (Main.mainClass.player.speed = 0));
} else {
Main.mainClass.player.x = (Main.mainClass.player.x - Main.mainClass.player.speed);
};
};
};
}
private function platformLoop(_arg1:Event):void{
if (((Main.mainClass.player.hitBox.hitTestObject(this)) && ((Main.mainClass.player.y > this.y)))){
Main.mainClass.player.y = (this.y + 2);
};
}
public function clearWall():void{
this.removeEventListener(Event.ENTER_FRAME, wallLoop);
(parent as MovieClip).removeChild(this);
}
public function clearPlatform():void{
this.removeEventListener(Event.ENTER_FRAME, platformLoop);
(parent as MovieClip).removeChild(this);
}
}
}//package
Section 74
//Preloader (Preloader)
package {
import flash.display.*;
import flash.events.*;
public class Preloader extends MovieClip {
public var loaderBar:MovieClip;
public function Preloader(){
this.addEventListener(Event.ENTER_FRAME, loading, false, 0, true);
}
private function loading(_arg1:Event):void{
var _local2:Number;
_local2 = ((loaderInfo.bytesLoaded / loaderInfo.bytesTotal) * 100);
loaderBar.scaleY = (_local2 / 100);
if (_local2 == 100){
this.removeEventListener(Event.ENTER_FRAME, loading);
parent.removeChild(this);
Main.mainClass.loadMenu();
};
}
}
}//package
Section 75
//PunchSound (PunchSound)
package {
import flash.media.*;
public dynamic class PunchSound extends Sound {
}
}//package
Section 76
//SpeechBubble (SpeechBubble)
package {
import flash.display.*;
import flash.events.*;
public class SpeechBubble extends MovieClip {
private var tvOn:Boolean;// = false
public var TvWatched:Boolean;// = false
public static var speechBubbleClass;
public function SpeechBubble(){
TvWatched = false;
tvOn = false;
super();
speechBubbleClass = this;
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
this.addEventListener(Event.ADDED_TO_STAGE, stopTV, false, 0, true);
}
private function stopTV(_arg1:Event):void{
(parent as MovieClip).TV.gotoAndStop(1);
this.removeEventListener(Event.ADDED_TO_STAGE, stopTV);
}
private function loop(_arg1:Event):void{
this.x = (Main.mainClass.player.x - 100);
this.y = (Main.mainClass.player.y - 110);
if ((((((Main.mainClass.player.x < 890)) && ((Main.mainClass.player.y < 550)))) && (!(tvOn)))){
this.gotoAndStop(1);
this.visible = true;
} else {
if ((((((Main.mainClass.player.x > 890)) && ((Main.mainClass.player.y < 575)))) || (((tvOn) && (!(TvWatched)))))){
if (!TvWatched){
if (this.visible){
(parent as MovieClip).TV.gotoAndPlay(2);
this.visible = false;
tvOn = true;
};
if ((parent as MovieClip).TV.currentFrame == (parent as MovieClip).TV.totalFrames){
(parent as MovieClip).TV.gotoAndStop(1);
TvWatched = true;
(parent as MovieClip).bookcase.moveBookShelf = true;
};
} else {
if (TvWatched){
this.gotoAndStop(4);
this.visible = true;
};
};
} else {
if ((((((Main.mainClass.player.x > 2025)) && ((Main.mainClass.player.x < 3213)))) && ((Main.mainClass.player.y < 1170)))){
this.gotoAndStop(2);
this.visible = true;
} else {
if ((((((Main.mainClass.player.x > 4200)) && ((Main.mainClass.player.x < 4525)))) && ((Main.mainClass.player.y < 1250)))){
this.gotoAndStop(3);
this.visible = true;
} else {
if ((((((((Main.mainClass.player.x < 4700)) && ((Main.mainClass.player.x > 2000)))) && ((Main.mainClass.player.y < 1500)))) && ((Main.mainClass.player.y > 1250)))){
this.gotoAndStop(6);
this.visible = true;
} else {
if ((((((((Main.mainClass.player.x < 2500)) && ((Main.mainClass.player.y < 2200)))) && ((Main.mainClass.player.y > 1800)))) && (Main.mainClass.batarangCollected))){
this.gotoAndStop(5);
this.visible = true;
} else {
this.visible = false;
};
};
};
};
};
};
}
public function removeSpeechBubble():void{
this.removeEventListener(Event.ENTER_FRAME, loop);
parent.removeChild(this);
}
}
}//package
Section 77
//TutorialBox (TutorialBox)
package {
import flash.display.*;
import flash.events.*;
public class TutorialBox extends MovieClip {
public var tutBoxTwo:MovieClip;
private var levelTwo:Boolean;// = false
public var tutBoxOne:MovieClip;
private var levelOneb:Boolean;// = false
private var levelThree:Boolean;// = false
private var levelOne:Boolean;// = false
private var levelFour:Boolean;// = false
public var tutBoxThree:MovieClip;
public static var tutorialClass;
public function TutorialBox(){
levelOne = false;
levelOneb = false;
levelTwo = false;
levelThree = false;
levelFour = false;
super();
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
tutorialClass = this;
this.gotoAndStop(1);
if (Main.mainClass.currentLevel == 1){
if ((((this.y < 550)) && (!(levelOne)))){
this.gotoAndStop(1);
levelOne = true;
};
} else {
if (Main.mainClass.currentLevel == 2){
this.gotoAndStop(3);
trace("Tut box loaded");
trace(this.x);
trace(this.y);
} else {
if (Main.mainClass.currentLevel == 3){
this.gotoAndStop(4);
} else {
if (Main.mainClass.currentLevel == 4){
this.gotoAndStop(5);
};
};
};
};
}
public function removeTutorialBox():void{
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, loop);
}
private function loop(_arg1:Event):void{
if (Main.mainClass.currentLevel == 1){
if ((((this.y > 550)) && (!(levelOneb)))){
this.gotoAndStop(2);
levelOneb = true;
};
};
}
}
}//package