Section 1
//animEatLowerDemo_15 (alphabeteater_fla.animEatLowerDemo_15)
package alphabeteater_fla {
import flash.display.*;
public dynamic class animEatLowerDemo_15 extends MovieClip {
public var lvltxt_mc:MovieClip;
}
}//package alphabeteater_fla
Section 2
//animGameBg_25 (alphabeteater_fla.animGameBg_25)
package alphabeteater_fla {
import flash.display.*;
public dynamic class animGameBg_25 extends MovieClip {
public var lvlTxt_mc:MovieClip;
}
}//package alphabeteater_fla
Section 3
//animGameOver_30 (alphabeteater_fla.animGameOver_30)
package alphabeteater_fla {
import flash.display.*;
public dynamic class animGameOver_30 extends MovieClip {
public function animGameOver_30(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package alphabeteater_fla
Section 4
//artChar_20 (alphabeteater_fla.artChar_20)
package alphabeteater_fla {
import flash.display.*;
public dynamic class artChar_20 extends MovieClip {
public var lvltxt_mc:MovieClip;
public function artChar_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.buttonMode = true;
}
}
}//package alphabeteater_fla
Section 5
//MainTimeline (alphabeteater_fla.MainTimeline)
package alphabeteater_fla {
import flash.events.*;
import flash.display.*;
import geom.*;
import flash.media.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import flash.utils.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var keyBoardMode:Boolean;
public var coordinateGenerator:Number;
public var menu_mc:MovieClip;
public var score:Number;
public var amtToLvl:Number;
public var againBtn:btnAgain;
public var charLvl:Number;
public var menuTint:ColorMatrix;
public var gameBg_mc:MovieClip;
public var stageTint:ColorMatrix;
public var amtEaten:Number;
public var char_mc:MovingChar_AE;
public var myMenu:ContextMenu;
public var stats_mc:MovieClip;
public var menuItem1:ContextMenuItem;
public var enemyColorLvl:Number;
public var menuItem2:ContextMenuItem;
public var enemyLvl:Number;
public var enemyCreator:Timer;
public var load_mc:MovieClip;
public var mcEnemy:MovingEnemy_AE;
public var bgSoundIsOn:Boolean;
public var gameIsOver:Boolean;
public var amtEatenTotal:Number;
public var gamePaused:Boolean;
public var bgSound:Sound;
public var colorLvl:Number;
public var artBG:MovieClip;
public var mouseMode:Boolean;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function removeAllListeners():void{
stage.removeEventListener(Event.ENTER_FRAME, runEnterFrameFunctions);
enemyCreator.stop();
}
public function selectSite(_arg1:ContextMenuEvent):void{
var _local2:URLRequest;
if (_arg1.target == menuItem1){
_local2 = new URLRequest("http://www.mrsunstudios.com");
} else {
if (_arg1.target == menuItem2){
_local2 = new URLRequest("http://www.heliongames.com");
};
};
navigateToURL(_local2, "_blank");
}
function frame2(){
}
function frame3(){
stop();
keyBoardMode = false;
mouseMode = true;
menu_mc.filters = [new ColorMatrixFilter(menuTint)];
if (!bgSoundIsOn){
bgSound = new sdBg();
bgSound.play(0, 1000);
bgSoundIsOn = true;
};
}
function frame4(){
gameIsOver = false;
gamePaused = false;
beginGame();
}
function frame5(){
againBtn.addEventListener(MouseEvent.CLICK, playAgain);
}
function frame1(){
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
menuItem1 = new ContextMenuItem("Mr Sun Studios");
menuItem1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, selectSite);
myMenu.customItems.push(menuItem1);
menuItem2 = new ContextMenuItem("Helion Games");
menuItem2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, selectSite);
myMenu.customItems.push(menuItem2);
this.contextMenu = myMenu;
menuTint = new ColorMatrix();
menuTint.adjustColor(0, 0, 0, Math.ceil(((Math.random() * 360) - 180)));
load_mc.filters = [new ColorMatrixFilter(menuTint)];
artBG.filters = [new ColorMatrixFilter(menuTint)];
bgSoundIsOn = false;
}
public function beginGame():void{
charLvl = 1;
enemyCreator = new Timer(400, 12);
score = 0;
amtToLvl = 1.2;
amtEaten = 0;
amtEatenTotal = 0;
colorLvl = 1;
enemyColorLvl = 1;
stageTint = new ColorMatrix();
stage.addEventListener(Event.ENTER_FRAME, runEnterFrameFunctions);
stage.addEventListener(KeyboardEvent.KEY_UP, pauseGame);
enemyCreator.addEventListener(TimerEvent.TIMER, createEnemy);
enemyCreator.start();
}
public function playAgain(_arg1:MouseEvent):void{
gotoAndStop("menu");
}
public function addAllListeners():void{
stage.addEventListener(Event.ENTER_FRAME, runEnterFrameFunctions);
enemyCreator.start();
}
public function pauseGame(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 80){
if (gamePaused){
addAllListeners();
gamePaused = false;
} else {
removeAllListeners();
gamePaused = true;
};
};
if (_arg1.keyCode == 67){
if (((!(keyBoardMode)) && (mouseMode))){
keyBoardMode = true;
mouseMode = false;
} else {
keyBoardMode = false;
mouseMode = true;
};
};
}
public function runEnterFrameFunctions(_arg1:Event):void{
updateCharLvl();
updateStats();
checkIfWithinBounds();
}
public function updateStats():void{
stats_mc.score_txt.text = ("Score: " + score);
stats_mc.eaten_txt.text = ("Eaten: " + amtEatenTotal);
stats_mc.frameRate_txt.text = stage.frameRate;
if (gameIsOver){
removeAllListeners();
stage.removeEventListener(KeyboardEvent.KEY_UP, pauseGame);
removeChild(stats_mc);
gotoAndStop("game_over");
};
}
public function PL_LOADING(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
load_mc.gotoAndStop(_local2);
if (_local2 == 100){
gotoAndStop("menu");
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, PL_LOADING);
};
}
public function updateCharLvl():void{
if (amtEaten >= amtToLvl){
if (charLvl < 26){
amtEaten = (amtEaten - amtToLvl);
amtToLvl = (amtToLvl + 0.2);
char_mc.gotoAndPlay("lvl_up");
charLvl++;
} else {
colorLvl++;
charLvl = 1;
amtEaten = (amtEaten - amtToLvl);
amtToLvl = (amtToLvl + 0.2);
char_mc.gotoAndPlay("lvl_up");
stageTint = new ColorMatrix();
if (colorLvl == 2){
stageTint.adjustColor(0, 0, 0, -60);
} else {
if (colorLvl == 3){
stageTint.adjustColor(0, 0, 0, -120);
} else {
if (colorLvl == 4){
stageTint.adjustColor(0, 0, 0, -180);
} else {
if (colorLvl == 5){
stageTint.adjustColor(0, 0, 0, 120);
} else {
if (colorLvl == 6){
stageTint.adjustColor(0, 0, 0, 60);
};
};
};
};
};
gameBg_mc.filters = [new ColorMatrixFilter(stageTint)];
char_mc.filters = [new ColorMatrixFilter(stageTint)];
stats_mc.filters = [new ColorMatrixFilter(stageTint)];
};
};
stats_mc.lvlStat_mc.maskedBox_mc.scaleY = (amtEaten / amtToLvl);
stats_mc.lvlStat_mc.gotoAndStop(charLvl);
char_mc.lvltxt_mc.gotoAndStop(charLvl);
gameBg_mc.lvlTxt_mc.gotoAndStop(charLvl);
}
public function checkIfWithinBounds():void{
if (!gameIsOver){
if (char_mc.x < (char_mc.width / -2)){
char_mc.x = stage.stageWidth;
} else {
if (char_mc.x > stage.stageWidth){
char_mc.x = (char_mc.width / -2);
};
};
if (char_mc.y < (char_mc.height / -2)){
char_mc.y = stage.stageHeight;
} else {
if (char_mc.y > stage.stageHeight){
char_mc.y = (char_mc.height / -2);
};
};
};
}
public function createEnemy(_arg1:TimerEvent):void{
mcEnemy = new MovingEnemy_AE();
addChild(mcEnemy);
}
}
}//package alphabeteater_fla
Section 6
//mcCredits_21 (alphabeteater_fla.mcCredits_21)
package alphabeteater_fla {
import flash.events.*;
import flash.display.*;
public dynamic class mcCredits_21 extends MovieClip {
public var backToMenu_btn:btnBackToMenu;
public function mcCredits_21(){
addFrameScript(0, frame1);
}
public function backToMenu(_arg1:MouseEvent):void{
this.x = -600;
this.y = -600;
}
function frame1(){
stop();
backToMenu_btn.addEventListener(MouseEvent.CLICK, backToMenu);
}
}
}//package alphabeteater_fla
Section 7
//mcInstructions_14 (alphabeteater_fla.mcInstructions_14)
package alphabeteater_fla {
import flash.events.*;
import flash.display.*;
public dynamic class mcInstructions_14 extends MovieClip {
public var next_btn:btnNextPrev;
public var prev_btn:btnNextPrev;
public var backToMenu_btn:btnBackToMenu;
public var lvltxt_mc:MovieClip;
public function mcInstructions_14(){
addFrameScript(0, frame1, 1, frame2);
}
public function prevBtn(_arg1:MouseEvent):void{
prevFrame();
}
public function backToMenu(_arg1:MouseEvent):void{
this.x = -600;
this.y = -600;
}
public function nextBtn(_arg1:MouseEvent):void{
nextFrame();
}
function frame1(){
stop();
backToMenu_btn.addEventListener(MouseEvent.CLICK, backToMenu);
next_btn.addEventListener(MouseEvent.CLICK, nextBtn);
}
function frame2(){
prev_btn.addEventListener(MouseEvent.CLICK, prevBtn);
}
}
}//package alphabeteater_fla
Section 8
//mcMenu_8 (alphabeteater_fla.mcMenu_8)
package alphabeteater_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class mcMenu_8 extends MovieClip {
public var options_btn:btnOptions;
public var credits_btn:btnCredits;
public var credits_mc:MovieClip;
public var instructions_mc:MovieClip;
public var gamemode_mc:mcGameMode;
public var instructions_btn:btnInstructions;
public var website_btn:btnWebsite;
public var play_btn:btnPlayGame;
public var options_mc:MovieClip;
public function mcMenu_8(){
addFrameScript(28, frame29);
}
public function moveInstruct(_arg1:MouseEvent):void{
instructions_mc.x = 0;
instructions_mc.y = 0;
}
public function navigateToSite(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.mrsunstudios.com");
navigateToURL(_local2, "_blank");
}
function frame29(){
stop();
play_btn.x = 135;
instructions_btn.x = 118;
options_btn.x = 118;
credits_btn.x = 118;
website_btn.x = 118;
play_btn.addEventListener(MouseEvent.CLICK, playGame);
instructions_btn.addEventListener(MouseEvent.CLICK, moveInstruct);
options_btn.addEventListener(MouseEvent.CLICK, moveOptions);
credits_btn.addEventListener(MouseEvent.CLICK, moveCredits);
website_btn.addEventListener(MouseEvent.CLICK, navigateToSite);
}
public function playGame(_arg1:MouseEvent):void{
gamemode_mc.x = 0;
gamemode_mc.y = 0;
}
public function moveCredits(_arg1:MouseEvent):void{
credits_mc.x = 0;
credits_mc.y = 0;
}
public function moveOptions(_arg1:MouseEvent):void{
options_mc.x = 0;
options_mc.y = 0;
}
}
}//package alphabeteater_fla
Section 9
//mcOptions_19 (alphabeteater_fla.mcOptions_19)
package alphabeteater_fla {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import flash.utils.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class mcOptions_19 extends MovieClip {
public var qH_btn:MovieClip;
public var qL_btn:MovieClip;
public var backToMenu_btn:btnBackToMenu;
public var qM_btn:MovieClip;
public function mcOptions_19(){
addFrameScript(0, frame1);
}
public function togHighQ(_arg1:MouseEvent):void{
stage.quality = StageQuality.HIGH;
}
public function backToMenu(_arg1:MouseEvent):void{
this.x = -600;
this.y = -600;
}
function frame1(){
stop();
qL_btn.lvltxt_mc.gotoAndStop(12);
qM_btn.lvltxt_mc.gotoAndStop(13);
qH_btn.lvltxt_mc.gotoAndStop(8);
qL_btn.addEventListener(MouseEvent.CLICK, togLowQ);
qM_btn.addEventListener(MouseEvent.CLICK, togMedQ);
qH_btn.addEventListener(MouseEvent.CLICK, togHighQ);
backToMenu_btn.addEventListener(MouseEvent.CLICK, backToMenu);
}
public function togMedQ(_arg1:MouseEvent):void{
stage.quality = StageQuality.MEDIUM;
}
public function togLowQ(_arg1:MouseEvent):void{
stage.quality = StageQuality.LOW;
}
}
}//package alphabeteater_fla
Section 10
//mcStatCharLvl_28 (alphabeteater_fla.mcStatCharLvl_28)
package alphabeteater_fla {
import flash.display.*;
public dynamic class mcStatCharLvl_28 extends MovieClip {
public var maskedBox_mc:MovieClip;
public function mcStatCharLvl_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package alphabeteater_fla
Section 11
//mcStats_27 (alphabeteater_fla.mcStats_27)
package alphabeteater_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcStats_27 extends MovieClip {
public var frameRate_txt:TextField;
public var eaten_txt:TextField;
public var score_txt:TextField;
public var lvlStat_mc:MovieClip;
}
}//package alphabeteater_fla
Section 12
//txtLvl_6 (alphabeteater_fla.txtLvl_6)
package alphabeteater_fla {
import flash.display.*;
public dynamic class txtLvl_6 extends MovieClip {
public function txtLvl_6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package alphabeteater_fla
Section 13
//txtLvlLow_26 (alphabeteater_fla.txtLvlLow_26)
package alphabeteater_fla {
import flash.display.*;
public dynamic class txtLvlLow_26 extends MovieClip {
public function txtLvlLow_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package alphabeteater_fla
Section 14
//EasyButton1 (btn.EasyButton1)
package btn {
import flash.events.*;
import flash.display.*;
import geom.*;
import flash.filters.*;
public class EasyButton1 extends MovieClip {
private var overTint:ColorMatrix;
public function EasyButton1(){
this.stop();
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, rollover_btn);
this.addEventListener(MouseEvent.MOUSE_OUT, rollout_btn);
this.addEventListener(MouseEvent.MOUSE_DOWN, clickdown_btn);
this.addEventListener(MouseEvent.CLICK, clickup_btn);
overTint = new ColorMatrix();
}
private function clickup_btn(_arg1:MouseEvent){
this.gotoAndStop("normal");
}
private function rollout_btn(_arg1:MouseEvent){
this.gotoAndStop("normal");
overTint.adjustColor(-50, 0, 0, 0);
this.filters = [new ColorMatrixFilter(overTint)];
}
private function clickdown_btn(_arg1:MouseEvent){
this.gotoAndStop("down");
}
private function rollover_btn(_arg1:MouseEvent){
this.gotoAndPlay("over");
overTint.adjustColor(50, 0, 0, 0);
this.filters = [new ColorMatrixFilter(overTint)];
}
}
}//package btn
Section 15
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 16
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 17
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 18
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 19
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 20
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 21
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 22
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 23
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 24
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 25
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 26
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.services.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.utils.*;
import flash.errors.*;
import flash.net.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 27
//ColorMatrix (geom.ColorMatrix)
package geom {
public dynamic class ColorMatrix extends Array {
private static const IDENTITY_MATRIX:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
private static const LENGTH:Number = IDENTITY_MATRIX.length;
private static const DELTA_INDEX:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
public function ColorMatrix(_arg1:Array=null){
_arg1 = fixMatrix(_arg1);
copyMatrix(((_arg1.length)==LENGTH) ? _arg1 : IDENTITY_MATRIX);
}
public function adjustBrightness(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
multiplyMatrix([1, 0, 0, 0, _arg1, 0, 1, 0, 0, _arg1, 0, 0, 1, 0, _arg1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
protected function multiplyMatrix(_arg1:Array):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:Number;
var _local6:Number;
_local2 = [];
_local3 = 0;
while (_local3 < 5) {
_local4 = 0;
while (_local4 < 5) {
_local2[_local4] = this[(_local4 + (_local3 * 5))];
_local4++;
};
_local4 = 0;
while (_local4 < 5) {
_local5 = 0;
_local6 = 0;
while (_local6 < 5) {
_local5 = (_local5 + (_arg1[(_local4 + (_local6 * 5))] * _local2[_local6]));
_local6++;
};
this[(_local4 + (_local3 * 5))] = _local5;
_local4++;
};
_local3++;
};
}
public function adjustSaturation(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
_local2 = (1 + ((_arg1)>0) ? ((3 * _arg1) / 100) : (_arg1 / 100));
_local3 = 0.3086;
_local4 = 0.6094;
_local5 = 0.082;
multiplyMatrix([((_local3 * (1 - _local2)) + _local2), (_local4 * (1 - _local2)), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), ((_local4 * (1 - _local2)) + _local2), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), (_local4 * (1 - _local2)), ((_local5 * (1 - _local2)) + _local2), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function reset():void{
var _local1:uint;
_local1 = 0;
while (_local1 < LENGTH) {
this[_local1] = IDENTITY_MATRIX[_local1];
_local1++;
};
}
public function adjustColor(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
adjustHue(_arg4);
adjustContrast(_arg2);
adjustBrightness(_arg1);
adjustSaturation(_arg3);
}
public function clone():ColorMatrix{
return (new ColorMatrix(this));
}
public function toArray():Array{
return (slice(0, 20));
}
protected function cleanValue(_arg1:Number, _arg2:Number):Number{
return (Math.min(_arg2, Math.max(-(_arg2), _arg1)));
}
public function adjustHue(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_arg1 = ((cleanValue(_arg1, 180) / 180) * Math.PI);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = 0.213;
_local5 = 0.715;
_local6 = 0.072;
multiplyMatrix([((_local4 + (_local2 * (1 - _local4))) + (_local3 * -(_local4))), ((_local5 + (_local2 * -(_local5))) + (_local3 * -(_local5))), ((_local6 + (_local2 * -(_local6))) + (_local3 * (1 - _local6))), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * 0.143)), ((_local5 + (_local2 * (1 - _local5))) + (_local3 * 0.14)), ((_local6 + (_local2 * -(_local6))) + (_local3 * -0.283)), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * -((1 - _local4)))), ((_local5 + (_local2 * -(_local5))) + (_local3 * _local5)), ((_local6 + (_local2 * (1 - _local6))) + (_local3 * _local6)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function concat(_arg1:Array):void{
_arg1 = fixMatrix(_arg1);
if (_arg1.length != LENGTH){
return;
};
multiplyMatrix(_arg1);
}
protected function copyMatrix(_arg1:Array):void{
var _local2:Number;
var _local3:uint;
_local2 = LENGTH;
_local3 = 0;
while (_local3 < _local2) {
this[_local3] = _arg1[_local3];
_local3++;
};
}
protected function fixMatrix(_arg1:Array=null):Array{
if (_arg1 == null){
return (IDENTITY_MATRIX);
};
if ((_arg1 is ColorMatrix)){
_arg1 = _arg1.slice(0);
};
if (_arg1.length < LENGTH){
_arg1 = _arg1.slice(0, _arg1.length).concat(IDENTITY_MATRIX.slice(_arg1.length, LENGTH));
} else {
if (_arg1.length > LENGTH){
_arg1 = _arg1.slice(0, LENGTH);
};
};
return (_arg1);
}
public function adjustContrast(_arg1:Number):void{
var _local2:Number;
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
if (_arg1 < 0){
_local2 = (127 + ((_arg1 / 100) * 127));
} else {
_local2 = (_arg1 % 1);
if (_local2 == 0){
_local2 = DELTA_INDEX[_arg1];
} else {
_local2 = ((DELTA_INDEX[(_arg1 << 0)] * (1 - _local2)) + (DELTA_INDEX[((_arg1 << 0) + 1)] * _local2));
};
_local2 = ((_local2 * 127) + 127);
};
multiplyMatrix([(_local2 / 127), 0, 0, 0, (0.5 * (127 - _local2)), 0, (_local2 / 127), 0, 0, (0.5 * (127 - _local2)), 0, 0, (_local2 / 127), 0, (0.5 * (127 - _local2)), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function toString():String{
return ((("ColorMatrix [ " + this.join(" , ")) + " ]"));
}
}
}//package geom
Section 28
//artKeyBoard (artKeyBoard)
package {
import btn.*;
public dynamic class artKeyBoard extends EasyButton1 {
}
}//package
Section 29
//artMouse (artMouse)
package {
import btn.*;
public dynamic class artMouse extends EasyButton1 {
}
}//package
Section 30
//btnAgain (btnAgain)
package {
import btn.*;
public dynamic class btnAgain extends EasyButton1 {
public function btnAgain(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 31
//btnBackToMenu (btnBackToMenu)
package {
import btn.*;
public dynamic class btnBackToMenu extends EasyButton1 {
public function btnBackToMenu(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 32
//btnCredits (btnCredits)
package {
import btn.*;
public dynamic class btnCredits extends EasyButton1 {
public function btnCredits(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 33
//btnInstructions (btnInstructions)
package {
import btn.*;
public dynamic class btnInstructions extends EasyButton1 {
public function btnInstructions(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 34
//btnNextPrev (btnNextPrev)
package {
import btn.*;
public dynamic class btnNextPrev extends EasyButton1 {
public function btnNextPrev(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package
Section 35
//btnOptions (btnOptions)
package {
import btn.*;
public dynamic class btnOptions extends EasyButton1 {
public function btnOptions(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 36
//btnPlayGame (btnPlayGame)
package {
import btn.*;
public dynamic class btnPlayGame extends EasyButton1 {
public function btnPlayGame(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 37
//btnWebsite (btnWebsite)
package {
import btn.*;
public dynamic class btnWebsite extends EasyButton1 {
public function btnWebsite(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 38
//eatSd (eatSd)
package {
import flash.media.*;
public dynamic class eatSd extends Sound {
}
}//package
Section 39
//mcGameMode (mcGameMode)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import flash.utils.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class mcGameMode extends MovieClip {
public var keyboard_btn:artKeyBoard;
public var backToMenu_btn:btnBackToMenu;
public var mouse_btn:artMouse;
public function mcGameMode(){
addFrameScript(0, frame1);
}
public function selectMouse(_arg1:MouseEvent):void{
MovieClip(this.parent.parent).keyBoardMode = false;
playGame();
}
public function selectKeyboard(_arg1:MouseEvent):void{
MovieClip(this.parent.parent).keyBoardMode = true;
playGame();
}
public function backToMenu(_arg1:MouseEvent):void{
this.x = -600;
this.y = -600;
}
function frame1(){
stop();
backToMenu_btn.addEventListener(MouseEvent.CLICK, backToMenu);
mouse_btn.addEventListener(MouseEvent.CLICK, selectMouse);
keyboard_btn.addEventListener(MouseEvent.CLICK, selectKeyboard);
mouse_btn.buttonMode = true;
keyboard_btn.buttonMode = true;
}
public function playGame():void{
MovieClip(this.parent.parent).gotoAndStop("game");
}
}
}//package
Section 40
//MovingChar_AE (MovingChar_AE)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
import flash.text.*;
public class MovingChar_AE extends MovieClip {
private var moveRightNow:Boolean;
private var moveSpeedX:Number;
private var moveSpeedY:Number;
private var moveSpeedLeft:Number;// = 0
private var codeKeyDown:Number;
private var moveSpeedUp:Number;// = 0
private var moveLeftNow:Boolean;
private var xDist:Number;
private var ySpeed:Number;
private var codeKeyUp:Number;
public var lvltxt_mc:MovieClip;
private var moveSpeedMax:Number;// = 7
private var xSpeed:Number;
private var moveDownNow:Boolean;
private var moveIncr:Number;// = 1
private var moveSpeedRight:Number;// = 0
private var moveSpeedDown:Number;// = 0
private var angle:Number;
private var yDist:Number;
private var thisParent;
private var moveUpNow:Boolean;
public function MovingChar_AE(){
moveSpeedLeft = 0;
moveSpeedUp = 0;
moveSpeedDown = 0;
moveSpeedRight = 0;
moveSpeedMax = 7;
moveIncr = 1;
super();
addFrameScript(0, frame1, 11, frame12, 25, frame26);
this.addEventListener(Event.ADDED, beginCode);
}
private function makeMoveTrue(_arg1:KeyboardEvent):void{
codeKeyDown = _arg1.keyCode;
if ((((codeKeyDown == Keyboard.LEFT)) || ((codeKeyDown == 65)))){
moveLeftNow = true;
};
if ((((codeKeyDown == Keyboard.UP)) || ((codeKeyDown == 87)))){
moveUpNow = true;
};
if ((((codeKeyDown == Keyboard.RIGHT)) || ((codeKeyDown == 68)))){
moveRightNow = true;
};
if ((((codeKeyDown == Keyboard.DOWN)) || ((codeKeyDown == 83)))){
moveDownNow = true;
};
}
private function updateControlMode(_arg1:Event):void{
if (thisParent.keyBoardMode){
stage.addEventListener(KeyboardEvent.KEY_DOWN, makeMoveTrue);
stage.addEventListener(KeyboardEvent.KEY_UP, makeMoveFalse);
this.addEventListener(Event.ENTER_FRAME, enterFrameFunct);
stage.removeEventListener(Event.ENTER_FRAME, detectMouse);
} else {
if (thisParent.mouseMode){
stage.addEventListener(Event.ENTER_FRAME, detectMouse);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, makeMoveTrue);
stage.removeEventListener(KeyboardEvent.KEY_UP, makeMoveFalse);
this.removeEventListener(Event.ENTER_FRAME, enterFrameFunct);
};
};
}
private function removeListeners():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, makeMoveTrue);
stage.removeEventListener(KeyboardEvent.KEY_UP, makeMoveFalse);
this.removeEventListener(Event.ENTER_FRAME, enterFrameFunct);
this.removeEventListener(Event.ENTER_FRAME, updateControlMode);
}
private function beginCode(_arg1:Event):void{
thisParent = _arg1.currentTarget.parent;
if (thisParent.keyBoardMode){
stage.addEventListener(KeyboardEvent.KEY_DOWN, makeMoveTrue);
stage.addEventListener(KeyboardEvent.KEY_UP, makeMoveFalse);
this.addEventListener(Event.ENTER_FRAME, enterFrameFunct);
} else {
if (thisParent.mouseMode){
stage.addEventListener(Event.ENTER_FRAME, detectMouse);
};
};
this.addEventListener(Event.ENTER_FRAME, updateControlMode);
}
function frame12(){
gotoAndStop("norm");
}
function frame1(){
stop();
}
function frame26(){
gotoAndStop("norm");
}
private function makeMoveFalse(_arg1:KeyboardEvent):void{
codeKeyUp = _arg1.keyCode;
if ((((codeKeyUp == Keyboard.LEFT)) || ((codeKeyUp == 65)))){
moveLeftNow = false;
};
if ((((codeKeyUp == Keyboard.UP)) || ((codeKeyUp == 87)))){
moveUpNow = false;
};
if ((((codeKeyUp == Keyboard.RIGHT)) || ((codeKeyUp == 68)))){
moveRightNow = false;
};
if ((((codeKeyUp == Keyboard.DOWN)) || ((codeKeyUp == 83)))){
moveDownNow = false;
};
}
private function stopChar():void{
if (!moveLeftNow){
if (moveSpeedLeft > 0){
moveSpeedLeft = (moveSpeedLeft - moveIncr);
};
this.x = (this.x - moveSpeedLeft);
};
if (!moveUpNow){
if (moveSpeedUp > 0){
moveSpeedUp = (moveSpeedUp - moveIncr);
};
this.y = (this.y - moveSpeedUp);
};
if (!moveRightNow){
if (moveSpeedRight > 0){
moveSpeedRight = (moveSpeedRight - moveIncr);
};
this.x = (this.x + moveSpeedRight);
};
if (!moveDownNow){
if (moveSpeedDown > 0){
moveSpeedDown = (moveSpeedDown - moveIncr);
};
this.y = (this.y + moveSpeedDown);
};
}
private function enterFrameFunct(_arg1:Event):void{
if (!thisParent.gamePaused){
moveChar();
stopChar();
killChar();
};
}
private function detectMouse(_arg1:Event):void{
yDist = (thisParent.mouseY - this.y);
xDist = (thisParent.mouseX - this.x);
angle = Math.atan2(yDist, xDist);
ySpeed = (Math.sin(angle) * moveSpeedMax);
xSpeed = (Math.cos(angle) * moveSpeedMax);
if (!thisParent.gamePaused){
if ((((mouseX < -5)) || ((mouseX > 5)))){
this.x = (this.x + xSpeed);
};
if ((((mouseY < -5)) || ((mouseY > 5)))){
this.y = (this.y + ySpeed);
};
};
}
private function moveChar():void{
if (moveLeftNow){
if (moveSpeedLeft < moveSpeedMax){
moveSpeedLeft = (moveSpeedLeft + moveIncr);
};
this.x = (this.x - moveSpeedLeft);
};
if (moveUpNow){
if (moveSpeedUp < moveSpeedMax){
moveSpeedUp = (moveSpeedUp + moveIncr);
};
this.y = (this.y - moveSpeedUp);
};
if (moveRightNow){
if (moveSpeedRight < moveSpeedMax){
moveSpeedRight = (moveSpeedRight + moveIncr);
};
this.x = (this.x + moveSpeedRight);
};
if (moveDownNow){
if (moveSpeedDown < moveSpeedMax){
moveSpeedDown = (moveSpeedDown + moveIncr);
};
this.y = (this.y + moveSpeedDown);
};
}
private function killChar():void{
if (((thisParent.gameIsOver) && (thisParent.keyBoardMode))){
removeListeners();
this.parent.removeChild(this);
} else {
if (((thisParent.gameIsOver) && (thisParent.mouseMode))){
removeMouseListeners();
this.parent.removeChild(this);
};
};
}
private function removeMouseListeners():void{
stage.removeEventListener(Event.ENTER_FRAME, detectMouse);
this.removeEventListener(Event.ENTER_FRAME, updateControlMode);
}
}
}//package
Section 41
//MovingEnemy_AE (MovingEnemy_AE)
package {
import flash.events.*;
import flash.display.*;
import geom.*;
import flash.geom.*;
import flash.text.*;
import flash.filters.*;
public class MovingEnemy_AE extends MovieClip {
private var moveDir:Number;
private var distFromCharX:Number;
private var distFromCharY:Number;
private var coordinateGenerator:Number;
private var colorWarn:ColorTransform;
private var enemyLvl:Number;
private var thisTint:ColorMatrix;
private var colorLvl:Number;
private var thisParent;
private var moveSpeed:Number;
public function MovingEnemy_AE(){
moveSpeed = Math.ceil(((Math.random() * 2) + 3));
colorWarn = new ColorTransform();
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, beginCode);
}
private function removeListeners():void{
this.removeEventListener(Event.ENTER_FRAME, enterFrameFunct);
}
private function beginCode(_arg1:Event):void{
thisParent = _arg1.currentTarget.parent;
this.addEventListener(Event.ENTER_FRAME, enterFrameFunct);
findLvl();
placeEnemy();
this.gotoAndStop(enemyLvl);
thisTint = new ColorMatrix();
if (colorLvl == 2){
thisTint.adjustColor(0, 0, 0, -60);
} else {
if (colorLvl == 3){
thisTint.adjustColor(0, 0, 0, -120);
} else {
if (colorLvl == 4){
thisTint.adjustColor(0, 0, 0, -180);
} else {
if (colorLvl == 5){
thisTint.adjustColor(0, 0, 0, 120);
} else {
if (colorLvl == 6){
thisTint.adjustColor(0, 0, 0, 60);
};
};
};
};
};
this.filters = [new ColorMatrixFilter(thisTint)];
if (this.x >= 620){
moveDir = 1;
} else {
if (this.y >= 520){
moveDir = 2;
} else {
if (this.x <= -40){
moveDir = 3;
} else {
if (this.y <= -40){
moveDir = 4;
} else {
moveDir = Math.ceil((Math.random() * 4));
};
};
};
};
}
private function moveEnemy():void{
if (moveDir == 1){
this.x = (this.x - moveSpeed);
} else {
if (moveDir == 2){
this.y = (this.y - moveSpeed);
} else {
if (moveDir == 3){
this.x = (this.x + moveSpeed);
} else {
if (moveDir == 4){
this.y = (this.y + moveSpeed);
};
};
};
};
this.transform.colorTransform = colorWarn;
}
private function distActions():void{
distFromCharX = Math.abs((this.x - thisParent.char_mc.x));
distFromCharY = Math.abs((this.y - thisParent.char_mc.y));
if (colorLvl > thisParent.colorLvl){
if ((((distFromCharX < 100)) && ((distFromCharY < 100)))){
colorWarn.redOffset = (200 - (((distFromCharX + distFromCharY) / 2) * 2));
} else {
colorWarn.redOffset = 0;
};
} else {
if ((((enemyLvl > thisParent.charLvl)) && ((colorLvl == thisParent.colorLvl)))){
if ((((distFromCharX < 100)) && ((distFromCharY < 100)))){
colorWarn.redOffset = (200 - (((distFromCharX + distFromCharY) / 2) * 2));
} else {
colorWarn.redOffset = 0;
};
};
};
}
function frame1(){
stop();
}
private function resetEnemy():void{
findLvl();
placeEnemy();
this.gotoAndStop(enemyLvl);
thisTint = new ColorMatrix();
if (colorLvl == 2){
thisTint.adjustColor(0, 0, 0, -60);
} else {
if (colorLvl == 3){
thisTint.adjustColor(0, 0, 0, -120);
} else {
if (colorLvl == 4){
thisTint.adjustColor(0, 0, 0, -180);
} else {
if (colorLvl == 5){
thisTint.adjustColor(0, 0, 0, 120);
} else {
if (colorLvl == 6){
thisTint.adjustColor(0, 0, 0, 60);
};
};
};
};
};
this.filters = [new ColorMatrixFilter(thisTint)];
if (this.x >= 620){
moveDir = 1;
} else {
if (this.y >= 520){
moveDir = 2;
} else {
if (this.x <= -40){
moveDir = 3;
} else {
if (this.y <= -40){
moveDir = 4;
} else {
moveDir = Math.ceil((Math.random() * 4));
};
};
};
};
colorWarn.redOffset = 0;
}
private function findLvl():void{
if (Math.random() < 0.5){
enemyLvl = (thisParent.charLvl - Math.ceil((Math.random() * 7)));
if ((((enemyLvl < 1)) && ((thisParent.colorLvl > 1)))){
enemyLvl = (26 + enemyLvl);
colorLvl = (thisParent.colorLvl - 1);
} else {
if (enemyLvl < 1){
enemyLvl = 1;
colorLvl = thisParent.colorLvl;
};
};
} else {
enemyLvl = (thisParent.charLvl + Math.ceil((Math.random() * 3)));
colorLvl = thisParent.colorLvl;
if (enemyLvl > 26){
enemyLvl = (enemyLvl - 26);
colorLvl = (thisParent.colorLvl + 1);
};
};
}
private function enterFrameFunct(_arg1:Event):void{
if (!thisParent.gamePaused){
if (!thisParent.gameIsOver){
moveEnemy();
killEnemy();
distActions();
} else {
removeListeners();
this.parent.removeChild(this);
};
};
}
private function placeEnemy():void{
coordinateGenerator = Math.random();
if (coordinateGenerator < 0.25){
this.x = 620;
this.y = Math.ceil((Math.random() * stage.stageHeight));
} else {
if (coordinateGenerator < 0.5){
this.x = Math.ceil((Math.random() * stage.stageWidth));
this.y = 520;
} else {
if (coordinateGenerator < 0.75){
this.x = -40;
this.y = Math.ceil((Math.random() * stage.stageHeight));
} else {
this.x = Math.ceil((Math.random() * stage.stageWidth));
this.y = -40;
};
};
};
}
private function killEnemy():void{
if (this.hitTestObject(thisParent.char_mc)){
if ((((enemyLvl <= thisParent.charLvl)) && ((colorLvl <= thisParent.colorLvl)))){
thisParent.score = (thisParent.score + ((5 + (enemyLvl * 5)) + ((colorLvl - 1) * 130)));
thisParent.amtEaten++;
thisParent.amtEatenTotal++;
thisParent.char_mc.gotoAndPlay("eat");
resetEnemy();
} else {
if ((((enemyLvl >= thisParent.charLvl)) && ((colorLvl < thisParent.colorLvl)))){
thisParent.score = (thisParent.score + ((5 + (enemyLvl * 5)) + ((colorLvl - 1) * 130)));
thisParent.amtEaten++;
thisParent.amtEatenTotal++;
thisParent.char_mc.gotoAndPlay("eat");
resetEnemy();
} else {
thisParent.gameIsOver = true;
};
};
};
if ((((moveDir == 1)) && ((this.x <= -40)))){
resetEnemy();
} else {
if ((((moveDir == 2)) && ((this.y <= -40)))){
resetEnemy();
} else {
if ((((moveDir == 3)) && ((this.x >= 620)))){
resetEnemy();
} else {
if ((((moveDir == 4)) && ((this.y >= 520)))){
resetEnemy();
};
};
};
};
}
}
}//package
Section 42
//sdBg (sdBg)
package {
import flash.media.*;
public dynamic class sdBg extends Sound {
}
}//package