Section 1
//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 2
//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 3
//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 4
//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 5
//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 6
//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 7
//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 8
//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 9
//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 10
//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 11
//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 12
//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.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
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 13
//Main (com.midasplayer.particle.Main)
package com.midasplayer.particle {
import flash.events.*;
import flash.display.*;
public class Main extends Sprite {
private var maxSize:Number;// = 29
private var numParticles:int;// = 20
private var maxXVel:Number;// = 1
private var minYVel:Number;// = -1
private var maxAlpha:Number;// = 0.02
private var maxYVel:Number;// = 1
private var particles:Array;
private var minXVel:Number;// = -1
private var minSize:Number;// = 12
private var minAlpha:Number;// = 0.01
private var emitter;
public function Main(){
particles = new Array();
super();
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function setEmitterClip(_arg1):void{
emitter = _arg1;
}
public function kill():void{
removeEventListener(Event.ENTER_FRAME, enterFrame);
var _local1:Number = 0;
while (_local1 < particles.length) {
particles[_local1].destroy();
_local1++;
};
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
private function createNewParticle():void{
var _local1:* = new Particle(spark, emitter, -10, -7, stage.stageWidth, stage.stageHeight);
_local1.setVel(randRange(minXVel, maxXVel), randRange(minYVel, maxYVel));
_local1.setSize(randRange(minSize, maxSize));
particles.push(_local1);
while (particles.length > numParticles) {
_local1 = particles.shift();
_local1.destroy();
};
var _local2:Number = 0;
while (_local2 < particles.length) {
particles[_local2].update();
_local2++;
};
}
private function enterFrame(_arg1:Event){
createNewParticle();
}
}
}//package com.midasplayer.particle
Section 14
//Particle (com.midasplayer.particle.Particle)
package com.midasplayer.particle {
import flash.display.*;
import flash.geom.*;
public class Particle {
private var _yVel:Number;
private var _xVel:Number;
private var _stageWidth:Number;
private var _stageHeight:Number;
private var _alphaDecr:Number;// = 0
private var clip:DisplayObject;
public function Particle(_arg1:Class, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
_stageWidth = _arg5;
_stageHeight = _arg6;
clip = new (_arg1);
_arg2.addChild(clip);
clip.x = _arg3;
clip.y = _arg4;
}
public function update(){
clip.x = (clip.x + _xVel);
clip.y = (clip.y + _yVel);
clip.alpha = (clip.alpha - _alphaDecr);
}
public function setSize(_arg1:Number){
clip.width = _arg1;
clip.height = _arg1;
}
public function setColour(_arg1:Number){
var _local2:ColorTransform = new ColorTransform();
_local2.color = _arg1;
clip.transform.colorTransform = _local2;
}
public function setAlphaDecr(_arg1:Number):void{
_alphaDecr = _arg1;
}
public function destroy():void{
clip.parent.removeChild(clip);
clip = null;
}
public function setVel(_arg1:Number, _arg2:Number){
_xVel = _arg1;
_yVel = _arg2;
}
}
}//package com.midasplayer.particle
Section 15
//DragonLoader (com.midasplayer.DragonLoader)
package com.midasplayer {
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import fl.transitions.*;
import flash.utils.*;
import flash.media.*;
public class DragonLoader extends MovieClip {
public var m_fireLogoClip:MovieClip;
private var oldFrameRate:int;
private var m_glimmerTween:Tween;
public var mcPlayBtn:MovieClip;
public var fireLogoHolder:MovieClip;
private var m_dragonClip:MovieClip;
private var m_bg:Sprite;
public var m_bannedSign:MovieClip;
private var m_fireLogoTween:Tween;
private var m_glimmer:MovieClip;
private var m_playBtnTween:Tween;
private var m_sndBell:Sound;
public var bannedSign:MovieClip;
public var m_playBtn:MovieClip;
public static var LAUNCH_GAME:String = "launchGame";
public function DragonLoader(){
this.x = (this.y = 0);
m_bannedSign = bannedSign;
m_bannedSign.bg.width = stage.stageWidth;
m_bannedSign.bg.height = stage.stageHeight;
m_bannedSign.alpha = 0;
m_bannedSign.addEventListener(MouseEvent.CLICK, onMainMovie);
m_bannedSign.buttonMode = true;
m_fireLogoClip = fireLogoHolder;
m_fireLogoClip.x = ((m_bannedSign.bg.width - m_fireLogoClip.width) - 90);
m_fireLogoClip.y = (((m_bannedSign.bg.height / 2) - (m_fireLogoClip.height / 2)) - 60);
m_fireLogoClip.visible = false;
m_fireLogoClip.stop();
m_dragonClip = new mcDragon();
m_dragonClip.x = (m_bannedSign.bg.width - m_dragonClip.width);
m_dragonClip.y = ((m_bannedSign.bg.height / 2) - (m_dragonClip.height / 2));
m_dragonClip.stop();
m_playBtn = mcPlayBtn;
m_playBtn.buttonMode = true;
m_playBtn.alpha = 0;
m_sndBell = new sfxBell();
}
public function destroy():void{
m_playBtn.removeEventListener(MouseEvent.ROLL_OVER, btnOver);
m_playBtn.removeEventListener(MouseEvent.ROLL_OUT, btnOut);
m_playBtn.removeEventListener(MouseEvent.MOUSE_DOWN, btnDown);
m_playBtn.removeEventListener(MouseEvent.MOUSE_UP, launchGame);
if (m_fireLogoTween != null){
m_fireLogoTween.removeEventListener(TweenEvent.MOTION_FINISH, logoInPlace);
m_fireLogoTween = null;
};
var _local1:Sprite = (this.parent.getChildByName("clickBg") as Sprite);
this.parent.removeChild(_local1);
this.parent.removeChild(this);
}
public function launchGame(_arg1:Event):void{
root.stage.frameRate = oldFrameRate;
trace(LAUNCH_GAME);
this.dispatchEvent(new Event(LAUNCH_GAME));
}
public function showBannedScreen():void{
m_bannedSign.alpha = 1;
}
public function playLoaderMovie():void{
this.addChild(m_dragonClip);
this.setChildIndex(m_dragonClip, 0);
m_dragonClip.addEventListener(Event.ENTER_FRAME, animationDone);
m_dragonClip.play();
}
private function logoVisible(_arg1:Event):void{
if (m_fireLogoClip.currentFrame == m_fireLogoClip.totalFrames){
m_fireLogoClip.removeEventListener(Event.ENTER_FRAME, logoVisible);
m_playBtnTween = new Tween(m_playBtn, "alpha", None.easeNone, 0, 1, 0.5, true);
m_glimmer = new mcGlimmer();
m_glimmer.x = (m_fireLogoClip.x - m_glimmer.width);
m_glimmer.y = (m_fireLogoClip.y + 112);
this.addChild(m_glimmer);
setTimeout(onGlimmerTmr, 1000, null);
};
}
public function init(_arg1:String, _arg2:String=""):void{
if (_arg2 != ""){
MochiBot.track(this, _arg2);
};
oldFrameRate = root.stage.frameRate;
root.stage.frameRate = 30;
if (KingAPI.banned){
showBannedScreen();
} else {
if (KingAPI.isHome){
launchGame(null);
} else {
playLoaderMovie();
};
};
}
private function btnOut(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("idle");
}
private function btnDown(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("down");
}
private function glimmerDone(_arg1:Event):void{
m_glimmerTween.removeEventListener(TweenEvent.MOTION_FINISH, glimmerDone);
this.removeChild(m_glimmer);
}
public function onMainMovie(_arg1:MouseEvent):void{
KingAPI.openLoaderMovieLink();
}
private function btnOver(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("over");
}
public function animationDone(_arg1:Event):void{
if (m_dragonClip.currentFrame == 80){
m_fireLogoClip.visible = true;
m_fireLogoClip.play();
m_fireLogoTween = new Tween(m_fireLogoClip, "x", Regular.easeOut, m_fireLogoClip.x, (((stage.width / 2) - (m_dragonClip.width / 2)) - 51), 1, true);
m_fireLogoTween.addEventListener(TweenEvent.MOTION_FINISH, logoInPlace);
};
if (m_dragonClip.currentFrame == m_dragonClip.totalFrames){
m_dragonClip.removeEventListener(Event.ENTER_FRAME, animationDone);
m_dragonClip.stop();
m_playBtn.x = ((stage.width / 2) - (m_playBtn.width / 2));
m_playBtn.y = (m_fireLogoClip.y + 210);
m_playBtn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
m_playBtn.addEventListener(MouseEvent.ROLL_OUT, btnOut);
m_playBtn.addEventListener(MouseEvent.MOUSE_DOWN, btnDown);
m_playBtn.addEventListener(MouseEvent.MOUSE_UP, launchGame);
};
}
private function logoInPlace(_arg1:Event):void{
m_fireLogoClip.addEventListener(Event.ENTER_FRAME, logoVisible);
}
private function onGlimmerTmr(_arg1:Event):void{
var _local2:Number = (m_fireLogoClip.x - m_glimmer.width);
var _local3:Number = ((m_fireLogoClip.x + m_fireLogoClip.width) - 80);
m_glimmerTween = new Tween(m_glimmer, "x", None.easeNone, _local2, _local3, 0.5, true);
m_glimmerTween.addEventListener(TweenEvent.MOTION_FINISH, glimmerDone);
m_sndBell.play();
}
}
}//package com.midasplayer
Section 16
//KingAPI (com.midasplayer.KingAPI)
package com.midasplayer {
import flash.events.*;
import flash.net.*;
import flash.external.*;
public class KingAPI {
public static const LINK_TYPE_RIGHT_CLICK:String = "rightclick";
public static const USER_TYPE_SUBSCRIPTION:int = 3;
public static const LINK_TYPE_HIGHSCORES:String = "highscores";
public static const LINK_TYPE_SIGN:String = "sign";
public static const INITIALIZED_EVENT:String = "initialized";
public static const LINK_TYPE_OTHER_GAMES:String = "other_games";
public static const USER_TYPE_REGISTERED:int = 1;
private static const SAK:String = "ggfd7sday923mdsfd8csfds34";
private static const loadHomeParametersURL:String = "http://www.king.com/servlet/FreeGameServlet?action=load";
public static const LINK_TYPE_LOADER_MOVIE:String = "loader_movie";
private static const bounceURL:String = "http://www.mygame.com/king/bounce.jsp";
public static const LINK_TYPE_PROTECT:String = "protect";
public static const LINK_TYPE_ADD_GAME:String = "add_game";
public static const USER_TYPE_GOLD:int = 2;
public static const USER_TYPE_UNREGISTERED:int = 0;
public static const HOST_BANNED_EVENT:String = "hostBanned";
private static const SK:String = "vf78hxcsjak77cxzhjkwad87s";
private static const loadCountURL:String = "http://www.mygame.com/king/loadcount.jsp";
public static const LINK_TYPE_LOADER_PROGRESS:String = "loader_progress";
private static var check:String = null;
public static var gameName:String;
public static var banned:Boolean = false;
protected static var dispatcher:EventDispatcher;
public static var isHome:Boolean = false;
private static var sessionID:String;
private static var iscore:int = 123;
public static var fromURL:String;
private static var SSK:String = "ng43ui54hy35tdsnd6f54rews";
private static function loadUrlErrorHandler(_arg1:Event):void{
trace(("Unable to load url: " + _arg1));
}
public static function resetScore():void{
iscore = 123;
check = null;
}
public static function openOfflineProtectionLink():void{
openKingPage(LINK_TYPE_PROTECT);
}
public static function init(_arg1:String, _arg2:String):void{
var so:SharedObject;
var rnd1:Number;
var rnd2:Number;
var name = _arg1;
var from = _arg2;
gameName = name;
fromURL = from;
var loadCounter:URLLoader = new URLLoader();
var reqvars:URLVariables = new URLVariables();
reqvars.game = gameName;
reqvars.from = fromURL;
try {
so = SharedObject.getLocal("sessionId");
if (so.data.sessionID == null){
rnd1 = Math.abs(Math.floor((Math.random() * 4294967295)));
rnd2 = Math.abs(Math.floor((Math.random() * 4294967295)));
so.data.sessionID = (rnd1.toString(16) + rnd2.toString(16));
so.flush();
};
sessionID = so.data.sessionID;
} catch(e:Error) {
sessionID = "error";
};
reqvars.session = sessionID;
var request:URLRequest = new URLRequest(((loadCountURL + "?") + reqvars.toString()));
loadCounter.addEventListener(Event.COMPLETE, loadCountHandler);
loadCounter.addEventListener(IOErrorEvent.IO_ERROR, loadUrlErrorHandler);
loadCounter.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loadUrlErrorHandler);
try {
loadCounter.load(request);
} catch(error:Error) {
trace(("Unable to load loadcount url: " + loadCountURL));
trace(error.message);
};
}
private static function loadHomeParametersHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
trace(("loadCounter.data" + _local2.data));
}
public static function submitInternalScore():void{
checkScore();
var _local1:int = ((iscore - 123) / 2);
submitScore(_local1);
}
public static function openOtherGamesLink():void{
openKingPage(LINK_TYPE_OTHER_GAMES);
}
public static function openKingPage(_arg1:String, _arg2:String=null):void{
var _local3:URLVariables = new URLVariables();
_local3.game = gameName;
_local3.from = fromURL;
_local3.type = _arg1;
_local3.session = sessionID;
if (_arg2 != null){
_local3.redirect = _arg2;
};
var _local4 = "_blank";
if (isHome){
_local4 = "_top";
};
navigateToURL(new URLRequest(((bounceURL + "?") + _local3.toString())), _local4);
}
private static function loadCountHandler(_arg1:Event):void{
var vars:URLVariables;
var event = _arg1;
var loadCounter:URLLoader = URLLoader(event.target);
trace(("loadCounter.data :" + loadCounter.data));
try {
vars = new URLVariables(loadCounter.data);
if (vars.h == "true"){
isHome = true;
};
if (vars.b == "true"){
banned = true;
dispatcher.dispatchEvent(new Event(HOST_BANNED_EVENT));
} else {
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
trace((("::" + vars.h) + "::"));
trace((("::" + vars.b) + "::"));
} catch(e:Error) {
trace(("Error reading data from loadcount url: " + e));
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
dispatcher = new EventDispatcher();
};
dispatcher.addEventListener(_arg1, _arg2);
}
public static function openLoaderMovieLink():void{
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
return;
};
dispatcher.removeEventListener(_arg1, _arg2);
}
public static function submitScore(_arg1:int):void{
var score = _arg1;
var hash:String = md5.encrypt(((((score + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitScore", score, hash);
} else {
openKingPage(LINK_TYPE_HIGHSCORES, ((((("game/" + gameName) + "/submit/") + score) + ":") + hash));
};
} catch(e:Error) {
trace(e);
};
}
public static function submitLevel(_arg1:int):void{
var level = _arg1;
var hash:String = md5.encrypt(((((level + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitLevel", level, hash);
};
} catch(e:Error) {
trace(e);
};
}
public static function openHighscoresLink():void{
openKingPage(LINK_TYPE_HIGHSCORES, (("game/" + gameName) + "/highscores"));
}
public static function openSignLink():void{
if (!isHome){
openKingPage(LINK_TYPE_SIGN);
};
}
public static function openRightClickLink():void{
openKingPage(LINK_TYPE_RIGHT_CLICK);
}
private static function checkScore():void{
if (check != null){
if (check != md5.encrypt(((((iscore + ":") + gameName) + ":") + SK))){
SSK = "ng41ui54hy35tdsnd6f54rews";
};
};
}
public static function addScore(_arg1:int):int{
checkScore();
var _local2:int = ((iscore - 123) / 2);
_local2 = (_local2 + _arg1);
iscore = ((_local2 * 2) + 123);
check = md5.encrypt(((((iscore + ":") + gameName) + ":") + SK));
return (_local2);
}
public static function openLoaderProgressLink():void{
openKingPage(LINK_TYPE_LOADER_PROGRESS);
}
public static function openAddToWebsiteLink():void{
openKingPage(LINK_TYPE_ADD_GAME, "website_content.jsp");
}
public static function submitAchievement(_arg1:String):void{
var achievement = _arg1;
var hash:String = md5.encrypt(((((achievement + ":") + gameName) + ":") + SAK));
try {
if (isHome){
ExternalInterface.call("submitAchievement", achievement, hash);
};
} catch(e:Error) {
trace(e);
};
}
}
}//package com.midasplayer
Section 17
//md5 (com.midasplayer.md5)
package com.midasplayer {
public class md5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
var _local3:Number = 1732584193;
var _local4:Number = -271733879;
var _local5:Number = -1732584194;
var _local6:Number = 271733878;
var _local7:Number = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Number = 0;
var _local3:Array = new Array((_arg1.length >> 2));
_local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2] = 0;
_local2++;
};
_local2 = 0;
while (_local2 < (_arg1.length * 8)) {
_local3[(_local2 >> 5)] = (_local3[(_local2 >> 5)] | ((_arg1.charCodeAt((_local2 / 8)) & 0xFF) << (_local2 % 32)));
_local2 = (_local2 + 8);
};
return (_local3);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2hex(_arg1:String):String{
var _local4:Number;
var _local2:String = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
var _local3 = "";
var _local5:Number = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local5);
_local3 = (_local3 + (_local2.charAt(((_local4 >>> 4) & 15)) + _local2.charAt((_local4 & 15))));
_local5++;
};
return (_local3);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function rstr2b64(_arg1:String):String{
var _local6:Number;
var _local7:Number;
var _local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var _local3 = "";
var _local4:Number = _arg1.length;
var _local5:Number = 0;
while (_local5 < _local4) {
_local6 = (((_arg1.charCodeAt(_local5) << 16) | (((_local5 + 1) < _local4)) ? (_arg1.charCodeAt((_local5 + 1)) << 8) : 0) | (((_local5 + 2) < _local4)) ? _arg1.charCodeAt((_local5 + 2)) : 0);
_local7 = 0;
while (_local7 < 4) {
if (((_local5 * 8) + (_local7 * 6)) > (_arg1.length * 8)){
_local3 = (_local3 + b64pad);
} else {
_local3 = (_local3 + _local2.charAt(((_local6 >>> (6 * (3 - _local7))) & 63)));
};
_local7++;
};
_local5 = (_local5 + 3);
};
return (_local3);
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
var _local4:Number = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local4:Number;
var _local5:Number;
var _local2 = "";
var _local3:Number = -1;
while (++_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
_local5 = (((_local3 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local3 + 1)) : 0;
if ((((((((0xD800 <= _local4)) && ((_local4 <= 56319)))) && ((0xDC00 <= _local5)))) && ((_local5 <= 57343)))){
_local4 = ((65536 + ((_local4 & 1023) << 10)) + (_local5 & 1023));
_local3++;
};
if (_local4 <= 127){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if (_local4 <= 2047){
_local2 = (_local2 + String.fromCharCode((192 | ((_local4 >>> 6) & 31)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 0xFFFF){
_local2 = (_local2 + String.fromCharCode((224 | ((_local4 >>> 12) & 15)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 2097151){
_local2 = (_local2 + String.fromCharCode((240 | ((_local4 >>> 18) & 7)), (128 | ((_local4 >>> 12) & 63)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
};
};
};
};
};
return (_local2);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
var _local4:Array = new Array(16);
var _local5:Array = new Array(16);
var _local6:Number = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
var _local7:Array = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local3:Number = _arg2.length;
var _local4:Array = [];
var _local9:Array = ((_arg1.length / 2) as Array);
_local5 = 0;
while (_local5 < _local9.length) {
_local9[_local5] = ((_arg1.charCodeAt((_local5 * 2)) << 8) | _arg1.charCodeAt(((_local5 * 2) + 1)));
_local5++;
};
while (_local9.length > 0) {
_local8 = [];
_local7 = 0;
_local5 = 0;
while (_local5 < _local9.length) {
_local7 = ((_local7 << 16) + _local9[_local5]);
_local6 = Math.floor((_local7 / _local3));
_local7 = (_local7 - (_local6 * _local3));
if ((((_local8.length > 0)) || ((_local6 > 0)))){
_local8[_local8.length] = _local6;
};
_local5++;
};
_local4[_local4.length] = _local7;
_local9 = _local8;
};
var _local10 = "";
_local5 = (_local4.length - 1);
while (_local5 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local4[_local5]));
_local5--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package com.midasplayer
Section 18
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 19
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 20
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 21
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 22
//bouilli_141 (squared_fla.bouilli_141)
package squared_fla {
import flash.display.*;
public dynamic class bouilli_141 extends MovieClip {
public function bouilli_141(){
addFrameScript(23, frame24);
}
function frame24(){
gotoAndPlay(0);
}
}
}//package squared_fla
Section 23
//desert_126 (squared_fla.desert_126)
package squared_fla {
import flash.display.*;
public dynamic class desert_126 extends MovieClip {
public function desert_126(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package squared_fla
Section 24
//forest_120 (squared_fla.forest_120)
package squared_fla {
import flash.display.*;
public dynamic class forest_120 extends MovieClip {
public function forest_120(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package squared_fla
Section 25
//grass_119 (squared_fla.grass_119)
package squared_fla {
import flash.display.*;
public dynamic class grass_119 extends MovieClip {
public function grass_119(){
addFrameScript(56, frame57);
}
function frame57(){
stop();
}
}
}//package squared_fla
Section 26
//ground_125 (squared_fla.ground_125)
package squared_fla {
import flash.display.*;
public dynamic class ground_125 extends MovieClip {
public function ground_125(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package squared_fla
Section 27
//hill_121 (squared_fla.hill_121)
package squared_fla {
import flash.display.*;
public dynamic class hill_121 extends MovieClip {
public function hill_121(){
addFrameScript(56, frame57);
}
function frame57(){
stop();
}
}
}//package squared_fla
Section 28
//island_127 (squared_fla.island_127)
package squared_fla {
import flash.display.*;
public dynamic class island_127 extends MovieClip {
public function island_127(){
addFrameScript(41, frame42, 56, frame57);
}
function frame42(){
stop();
}
function frame57(){
stop();
}
}
}//package squared_fla
Section 29
//lake_124 (squared_fla.lake_124)
package squared_fla {
import flash.display.*;
public dynamic class lake_124 extends MovieClip {
public function lake_124(){
addFrameScript(54, frame55);
}
function frame55(){
stop();
}
}
}//package squared_fla
Section 30
//mcFireLogo_4 (squared_fla.mcFireLogo_4)
package squared_fla {
import flash.display.*;
public dynamic class mcFireLogo_4 extends MovieClip {
public function mcFireLogo_4(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package squared_fla
Section 31
//mcPlayBtn_7 (squared_fla.mcPlayBtn_7)
package squared_fla {
import flash.display.*;
public dynamic class mcPlayBtn_7 extends MovieClip {
public function mcPlayBtn_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package squared_fla
Section 32
//mountain_122 (squared_fla.mountain_122)
package squared_fla {
import flash.display.*;
public dynamic class mountain_122 extends MovieClip {
public function mountain_122(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
}
}
}//package squared_fla
Section 33
//volcano_123 (squared_fla.volcano_123)
package squared_fla {
import flash.display.*;
public dynamic class volcano_123 extends MovieClip {
public function volcano_123(){
addFrameScript(44, frame45, 54, frame55);
}
function frame55(){
stop();
}
function frame45(){
stop();
}
}
}//package squared_fla
Section 34
//AddButton (AddButton)
package {
import flash.display.*;
public dynamic class AddButton extends MovieClip {
}
}//package
Section 35
//clicking (clicking)
package {
import flash.media.*;
public dynamic class clicking extends Sound {
}
}//package
Section 36
//Continueon (Continueon)
package {
import flash.display.*;
public dynamic class Continueon extends MovieClip {
}
}//package
Section 37
//Credits (Credits)
package {
import flash.display.*;
public dynamic class Credits extends MovieClip {
}
}//package
Section 38
//creditsMenu (creditsMenu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class creditsMenu extends MovieClip {
public var instructionsText:TextField;
public function creditsMenu(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 39
//ExpertLevelSelect (ExpertLevelSelect)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import fl.transitions.*;
import flash.utils.*;
import flash.text.*;
import flash.filters.*;
public class ExpertLevelSelect extends MovieClip {
private var clickingnoise:clicking;
private var fixx:Tween;
private var fixy:Tween;
private var zoomx:Tween;
private var removeunits:Array;
private var zoomy:Tween;
private var units:Array;
private var cols:int;
private var rows:int;
private var unit:MovieClip;
public function ExpertLevelSelect(_arg1:int){
var _local4:int;
var _local5:*;
super();
clickingnoise = new clicking();
var _local2:BlurFilter = new BlurFilter();
_local2.blurX = 3;
_local2.blurY = 3;
_local2.quality = BitmapFilterQuality.MEDIUM;
rows = _arg1;
cols = _arg1;
units = new Array();
var _local3 = 1;
while (_local3 <= cols) {
units[_local3] = new Array();
_local4 = 1;
while (_local4 <= rows) {
_local5 = new Map2();
_local5.number = ((((_local4 - 1) * 5) + _local3) + 36);
_local5.sideLength = (Mainee.HEIGHT / rows);
_local5.scaleX = (((Mainee.WIDTH - 150) / cols) / _local5.width);
_local5.scaleY = ((Mainee.HEIGHT / rows) / _local5.height);
_local5.c = _local3;
_local5.r = _local4;
_local5.x = ((_local3 - 1) * _local5.sideLength);
_local5.y = ((_local4 - 1) * _local5.sideLength);
addChild(_local5);
units[_local3][_local4] = _local5;
if (_local5.number <= Mainee.mainee.maxlevel){
units[_local3][_local4].addEventListener(MouseEvent.CLICK, clickListener);
};
if (_local5.number > Mainee.mainee.maxlevel){
_local5.filters = [_local2];
};
initializeGraphics(_local5);
_local5.numberText.text = _local5.number;
_local5.buttonMode = true;
_local4++;
};
_local3++;
};
}
public function removeAllGraphics(_arg1:MovieClip){
_arg1.lvl37.visible = false;
_arg1.lvl38.visible = false;
_arg1.lvl39.visible = false;
_arg1.lvl40.visible = false;
_arg1.lvl41.visible = false;
_arg1.lvl42.visible = false;
_arg1.lvl43.visible = false;
_arg1.lvl44.visible = false;
_arg1.lvl45.visible = false;
_arg1.lvl46.visible = false;
_arg1.lvl47.visible = false;
_arg1.lvl48.visible = false;
_arg1.lvl49.visible = false;
_arg1.lvl50.visible = false;
_arg1.lvl51.visible = false;
_arg1.lvl52.visible = false;
_arg1.lvl53.visible = false;
_arg1.lvl54.visible = false;
_arg1.lvl55.visible = false;
_arg1.lvl56.visible = false;
_arg1.lvl57.visible = false;
_arg1.lvl58.visible = false;
_arg1.lvl59.visible = false;
_arg1.lvl60.visible = false;
_arg1.lvl61.visible = false;
_arg1.still_water.visible = false;
}
public function finish(){
Mainee.mainee.curlevel = unit.number;
var _local1:* = Mainee.mainee.getGridSize();
Mainee.mainee.newLevelGrid(_local1);
Mainee.mainee.newGrid(_local1);
Mainee.mainee.removeLevelSelect();
}
public function clickListener(_arg1:MouseEvent):void{
var _local3:int;
var _local4:*;
unit = (_arg1.target.parent as MovieClip);
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
finish();
removeunits = new Array();
var _local2 = 1;
while (_local2 <= cols) {
removeunits[_local2] = new Array();
_local3 = 1;
while (_local3 <= rows) {
_local4 = units[_local2][_local3];
if (((unit.c * 10) + unit.r) != ((_local4.c * 10) + _local4.r)){
removeChild(_local4);
};
_local3++;
};
_local2++;
};
}
public function initializeGraphics(_arg1:MovieClip){
removeAllGraphics(_arg1);
if (_arg1.number < Mainee.mainee.maxlevel){
switch (_arg1.number){
case 36:
_arg1.lvl36.visible = true;
break;
case 37:
_arg1.lvl37.visible = true;
break;
case 38:
_arg1.lvl38.visible = true;
break;
case 39:
_arg1.lvl39.visible = true;
break;
case 40:
_arg1.lvl40.visible = true;
break;
case 41:
_arg1.lvl41.visible = true;
break;
case 42:
_arg1.lvl42.visible = true;
break;
case 43:
_arg1.lvl43.visible = true;
break;
case 44:
_arg1.lvl44.visible = true;
break;
case 45:
_arg1.lvl45.visible = true;
break;
case 46:
_arg1.lvl46.visible = true;
break;
case 47:
_arg1.lvl47.visible = true;
break;
case 48:
_arg1.lvl48.visible = true;
break;
case 49:
_arg1.lvl49.visible = true;
break;
case 50:
_arg1.lvl50.visible = true;
break;
case 51:
_arg1.lvl51.visible = true;
break;
case 52:
_arg1.lvl52.visible = true;
break;
case 53:
_arg1.lvl53.visible = true;
break;
case 54:
_arg1.lvl54.visible = true;
break;
case 55:
_arg1.lvl55.visible = true;
break;
case 56:
_arg1.lvl56.visible = true;
break;
case 57:
_arg1.lvl57.visible = true;
break;
case 58:
_arg1.lvl58.visible = true;
break;
case 59:
_arg1.lvl59.visible = true;
break;
case 60:
_arg1.lvl60.visible = true;
break;
case 61:
_arg1.lvl61.visible = true;
break;
};
} else {
_arg1.still_water.visible = true;
};
}
}
}//package
Section 40
//ExtremeLevelSelect (ExtremeLevelSelect)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import fl.transitions.*;
import flash.utils.*;
import flash.text.*;
import flash.filters.*;
public class ExtremeLevelSelect extends MovieClip {
private var clickingnoise:clicking;
private var fixx:Tween;
private var fixy:Tween;
private var zoomx:Tween;
private var removeunits:Array;
private var zoomy:Tween;
private var units:Array;
private var cols:int;
private var rows:int;
private var unit:MovieClip;
public function ExtremeLevelSelect(_arg1:int){
var _local4:int;
var _local5:*;
super();
clickingnoise = new clicking();
var _local2:BlurFilter = new BlurFilter();
_local2.blurX = 3;
_local2.blurY = 3;
_local2.quality = BitmapFilterQuality.MEDIUM;
rows = _arg1;
cols = _arg1;
units = new Array();
var _local3 = 1;
while (_local3 <= cols) {
units[_local3] = new Array();
_local4 = 1;
while (_local4 <= rows) {
_local5 = new Map3();
_local5.number = ((((_local4 - 1) * 3) + _local3) + 61);
_local5.sideLength = (Mainee.HEIGHT / rows);
_local5.scaleX = (((Mainee.WIDTH - 150) / cols) / _local5.width);
_local5.scaleY = ((Mainee.HEIGHT / rows) / _local5.height);
_local5.c = _local3;
_local5.r = _local4;
_local5.x = ((_local3 - 1) * _local5.sideLength);
_local5.y = ((_local4 - 1) * _local5.sideLength);
addChild(_local5);
units[_local3][_local4] = _local5;
if (_local5.number <= Mainee.mainee.maxlevel){
units[_local3][_local4].addEventListener(MouseEvent.CLICK, clickListener);
};
if (_local5.number > Mainee.mainee.maxlevel){
_local5.filters = [_local2];
};
initializeGraphics(_local5);
_local5.numberText.text = _local5.number;
_local5.buttonMode = true;
_local4++;
};
_local3++;
};
}
public function removeAllGraphics(_arg1:MovieClip){
_arg1.lvl62.visible = false;
_arg1.lvl63.visible = false;
_arg1.lvl64.visible = false;
_arg1.lvl65.visible = false;
_arg1.lvl66.visible = false;
_arg1.lvl67.visible = false;
_arg1.lvl68.visible = false;
_arg1.lvl69.visible = false;
_arg1.lvl70.visible = false;
_arg1.still_water.visible = false;
}
public function finish(){
Mainee.mainee.curlevel = unit.number;
var _local1:* = Mainee.mainee.getGridSize();
Mainee.mainee.newLevelGrid(_local1);
Mainee.mainee.newGrid(_local1);
Mainee.mainee.removeLevelSelect();
}
public function clickListener(_arg1:MouseEvent):void{
var _local3:int;
var _local4:*;
unit = (_arg1.target.parent as MovieClip);
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
finish();
removeunits = new Array();
var _local2 = 1;
while (_local2 <= cols) {
removeunits[_local2] = new Array();
_local3 = 1;
while (_local3 <= rows) {
_local4 = units[_local2][_local3];
if (((unit.c * 10) + unit.r) != ((_local4.c * 10) + _local4.r)){
removeChild(_local4);
};
_local3++;
};
_local2++;
};
}
public function initializeGraphics(_arg1:MovieClip){
removeAllGraphics(_arg1);
if (_arg1.number < Mainee.mainee.maxlevel){
switch (_arg1.number){
case 62:
_arg1.lvl62.visible = true;
break;
case 63:
_arg1.lvl63.visible = true;
break;
case 64:
_arg1.lvl64.visible = true;
break;
case 65:
_arg1.lvl65.visible = true;
break;
case 66:
_arg1.lvl66.visible = true;
break;
case 67:
_arg1.lvl67.visible = true;
break;
case 68:
_arg1.lvl68.visible = true;
break;
case 69:
_arg1.lvl69.visible = true;
break;
case 70:
_arg1.lvl70.visible = true;
break;
};
} else {
_arg1.still_water.visible = true;
};
}
}
}//package
Section 41
//Grid (Grid)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class Grid extends MovieClip {
private var timerTextmin:inText;
private var isthere:Boolean;
public var gameTimer:Timer;
public var unit:Unit;
var submitter:int;
private var possibleSolution:Array;
private var timerTextcolon:inText;
private var numberText:TextField;
private var clickingnoise:clicking;
private var levelNote:inText;
private var randomGrid:Boolean;
private var timerText:inText;
private var defaultNumberText:TextFormat;
private var levelcomplete:levelComplete;
private var kinglogo:kingLogo;
private var timerText2best:inText;
private var mainStage:Object;
private var continueon:Continueon;
public var gridremove:Boolean;
private var gridreference:Array;
private var adjacentUnits:Array;
private var removeText:TextField;
private var rows:int;
public var timerMin:int;
private var totalMoves:int;
private var timerText2:inText;
var trumpets:trump;
private var levelGrid:LevelGrid;
private var levelNumber:inText;
private var units:Array;
private var timerText2min:inText;
private var cols:int;
private var transitionArrayy:Array;
private var movesMade:Array;
private var transitionArrayx:Array;
private var timerText2colon:inText;
public function Grid(_arg1:int, _arg2:LevelGrid, _arg3:Boolean=false){
clickingnoise = new clicking();
trumpets = new trump();
rows = _arg1;
cols = _arg1;
movesMade = new Array();
totalMoves = 0;
randomGrid = _arg3;
this.levelGrid = _arg2;
buildUnit();
if (randomGrid == true){
timerText2 = new inText();
timerText2.x = 535;
timerText2.y = 0;
addChild(timerText2);
timerText2colon = new inText();
timerText2colon.x = 531;
timerText2colon.y = 0;
timerText2colon.txt.text = ":";
addChild(timerText2colon);
timerText2best = new inText();
timerText2best.x = 482.5;
timerText2best.y = 0;
timerText2best.txt.text = "Best:";
addChild(timerText2best);
timerText2min = new inText();
timerText2min.x = 521;
timerText2min.y = 0;
if (rows == 3){
if ((((Mainee.mainee.maxTimeSec3 < 10)) && ((Mainee.mainee.maxTimeSec3 > 0)))){
timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec3);
} else {
if (Mainee.mainee.maxTimeSec3 >= 10){
timerText2.txt.text = Mainee.mainee.maxTimeSec3;
} else {
if (Mainee.mainee.maxTimeSec3 == 0){
timerText2.txt.text = "00";
};
};
};
timerText2min.txt.text = Mainee.mainee.maxTimeMin3;
};
if (rows == 4){
if ((((Mainee.mainee.maxTimeSec4 < 10)) && ((Mainee.mainee.maxTimeSec4 > 0)))){
timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec4);
} else {
if (Mainee.mainee.maxTimeSec4 >= 10){
timerText2.txt.text = Mainee.mainee.maxTimeSec4;
} else {
if (Mainee.mainee.maxTimeSec4 == 0){
timerText2.txt.text = "00";
};
};
};
timerText2min.txt.text = Mainee.mainee.maxTimeMin4;
};
if (rows == 5){
if ((((Mainee.mainee.maxTimeSec5 < 10)) && ((Mainee.mainee.maxTimeSec5 > 0)))){
timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec5);
} else {
if (Mainee.mainee.maxTimeSec5 >= 10){
timerText2.txt.text = Mainee.mainee.maxTimeSec5;
} else {
if (Mainee.mainee.maxTimeSec5 == 0){
timerText2.txt.text = "00";
};
};
};
timerText2min.txt.text = Mainee.mainee.maxTimeMin5;
};
if (rows == 6){
if ((((Mainee.mainee.maxTimeSec6 < 10)) && ((Mainee.mainee.maxTimeSec6 > 0)))){
timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec6);
} else {
if (Mainee.mainee.maxTimeSec6 >= 10){
timerText2.txt.text = Mainee.mainee.maxTimeSec6;
} else {
if (Mainee.mainee.maxTimeSec6 == 0){
timerText2.txt.text = "00";
};
};
};
timerText2min.txt.text = Mainee.mainee.maxTimeMin6;
};
addChild(timerText2min);
timerText = new inText();
timerText.x = 450;
timerText.y = 0;
timerText.txt.text = "00";
addChild(timerText);
timerTextcolon = new inText();
timerTextcolon.x = 446;
timerTextcolon.y = 0;
timerTextcolon.txt.text = ":";
addChild(timerTextcolon);
timerMin = 0;
timerTextmin = new inText();
timerTextmin.x = 436;
timerTextmin.y = 0;
timerTextmin.txt.text = "0";
addChild(timerTextmin);
gameTimer = new Timer(1000);
gameTimer.addEventListener(TimerEvent.TIMER, updateTime);
gameTimer.start();
} else {
levelNote = new inText();
levelNote.x = 470;
levelNote.y = 0;
levelNote.txt.text = "Level:";
addChild(levelNote);
levelNumber = new inText();
levelNumber.x = 515;
levelNumber.y = 0;
levelNumber.txt.text = Mainee.mainee.curlevel;
addChild(levelNumber);
};
}
private function checkIsLocked(_arg1:MovieClip):Boolean{
if (_arg1.number > 8){
return (true);
};
return (false);
}
public function remove():void{
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
if (gridremove == false){
gridremove = true;
} else {
gridremove = false;
};
}
private function decreaseCount(_arg1:MovieClip):void{
if (_arg1 == null){
return;
};
_arg1.number--;
if (_arg1.number < 0){
_arg1.number = 0;
};
updateGraphic(_arg1);
_arg1.numberText.text = String(_arg1.number);
}
private function levelCompleted():void{
var _local2:int;
var _local1 = 1;
while (_local1 <= rows) {
_local2 = 1;
while (_local2 <= cols) {
units[_local1][_local2].buttonMask.removeEventListener(MouseEvent.CLICK, clickListener);
_local2++;
};
_local1++;
};
if (((!((Mainee.mainee.curlevel == 36))) || (!((Mainee.mainee.curlevel == 61))))){
continueon = new Continueon();
continueon.x = 230;
continueon.y = 218;
continueon.scaleX = 1.5;
continueon.scaleY = 1.5;
continueon.buttonMode = true;
levelcomplete = new levelComplete();
levelcomplete.x = 150;
levelcomplete.y = 175;
kinglogo = new kingLogo();
kinglogo.scaleX = 0.8;
kinglogo.scaleY = 0.8;
kinglogo.x = 80;
kinglogo.y = 212;
kinglogo.buttonMode = true;
addChild(levelcomplete);
addChild(continueon);
addChild(kinglogo);
kinglogo.addEventListener(MouseEvent.CLICK, Mainee.mainee.openSign);
continueon.addEventListener(MouseEvent.CLICK, newLevel);
} else {
levelUp();
};
}
private function updateReference():void{
var _local2:int;
gridreference = null;
gridreference = new Array();
var _local1 = 1;
while (_local1 <= cols) {
_local2 = 1;
while (_local2 <= rows) {
gridreference.push(units[_local1][_local2].number);
_local2++;
};
_local1++;
};
}
public function buildUnit(){
var _local2:int;
units = new Array();
var _local1 = 1;
while (_local1 <= cols) {
units[_local1] = new Array();
_local2 = 1;
while (_local2 <= rows) {
unit = new Unit();
unit.sideLength = (Mainee.HEIGHT / rows);
unit.scaleX = (((Mainee.WIDTH - 150) / cols) / unit.width);
unit.scaleY = ((Mainee.HEIGHT / rows) / unit.height);
unit.c = _local1;
unit.r = _local2;
unit.x = ((_local1 - 1) * unit.sideLength);
unit.y = ((_local2 - 1) * unit.sideLength);
addChild(unit);
unit.number = 0;
unit.numberText.text = unit.number;
unit.buttonMode = true;
units[_local1][_local2] = unit;
units[_local1][_local2].addEventListener(MouseEvent.CLICK, clickListener);
possibleSolution = new Array();
gridremove = false;
isthere = false;
unit.useHandCursor = true;
_local2++;
};
_local1++;
};
}
public function resetGrid():void{
var _local2:int;
possibleSolution = null;
possibleSolution = new Array();
var _local1 = 1;
while (_local1 <= cols) {
_local2 = 1;
while (_local2 <= rows) {
units[_local1][_local2].number = 0;
updateGraphic(units[_local1][_local2]);
units[_local1][_local2].numberText.text = String(units[_local1][_local2].number);
_local2++;
};
_local1++;
};
}
public function updateTime(_arg1:TimerEvent):void{
timerText.txt.text = gameTimer.currentCount.toString();
if (gameTimer.currentCount < 10){
timerText.txt.text = ("0" + gameTimer.currentCount.toString());
};
if (gameTimer.currentCount == 60){
timerText.txt.text = "00";
timerMin++;
timerTextmin.txt.text = String(timerMin);
gameTimer.reset();
gameTimer.start();
};
}
private function levelUp():void{
Mainee.mainee.levelUp();
}
private function newRandomLevel(_arg1:MouseEvent):void{
Mainee.mainee.newRandomLevelFromContinue(rows);
}
public function setLevel():void{
var _local1:* = Mainee.mainee.getGridSize();
Mainee.mainee.resetGrid(_local1);
}
private function disableAllGraphics(_arg1:MovieClip):void{
_arg1.water.visible = false;
_arg1.island.visible = false;
_arg1.desert.visible = false;
_arg1.grass.visible = false;
_arg1.ground.visible = false;
_arg1.foret.visible = false;
_arg1.hill.visible = false;
_arg1.mountain.visible = false;
_arg1.volcano.visible = false;
_arg1.lake.visible = false;
}
public function reset(_arg1:MouseEvent):void{
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
resetGrid();
}
private function newLevel(_arg1:MouseEvent):void{
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
levelUp();
continueon.removeEventListener(MouseEvent.CLICK, newLevel);
removeChild(continueon);
removeChild(levelcomplete);
removeChild(levelNumber);
}
private function updateGraphic(_arg1:MovieClip):void{
disableAllGraphics(_arg1);
switch (_arg1.number){
case 0:
_arg1.water.visible = true;
_arg1.water.gotoAndPlay(0);
break;
case 1:
_arg1.island.visible = true;
_arg1.island.gotoAndPlay(0);
break;
case 2:
_arg1.desert.visible = true;
_arg1.desert.gotoAndPlay(0);
break;
case 4:
_arg1.grass.visible = true;
_arg1.grass.gotoAndPlay(0);
break;
case 3:
_arg1.ground.visible = true;
_arg1.ground.gotoAndPlay(0);
break;
case 5:
_arg1.foret.visible = true;
_arg1.foret.gotoAndPlay(0);
break;
case 6:
_arg1.hill.visible = true;
_arg1.hill.gotoAndPlay(0);
break;
case 7:
_arg1.mountain.visible = true;
_arg1.mountain.gotoAndPlay(0);
break;
case 9:
_arg1.volcano.visible = true;
_arg1.volcano.gotoAndPlay(0);
break;
case 8:
_arg1.lake.visible = true;
_arg1.lake.gotoAndPlay(0);
break;
};
}
private function clickListener(_arg1:MouseEvent):void{
var _local3:int;
var _local4:int;
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
var _local2:MovieClip = (_arg1.target.parent as MovieClip);
if (_local2.number < 9){
if (gridremove == false){
possibleSolution.push(((_local2.c * 10) + _local2.r));
} else {
if (gridremove == true){
_local4 = 0;
while (_local4 < possibleSolution.length) {
if (((_local2.c * 10) + _local2.r) == possibleSolution[_local4]){
possibleSolution.splice(_local4, 1);
isthere = true;
break;
};
_local4++;
};
};
};
adjacentUnits = new Array();
adjacentUnits.push(_local2);
if ((((_local2.r < rows)) && (!(checkIsLocked(units[_local2.c][(_local2.r + 1)]))))){
adjacentUnits.push(units[_local2.c][(_local2.r + 1)]);
};
if ((((_local2.r > 1)) && (!(checkIsLocked(units[_local2.c][(_local2.r - 1)]))))){
adjacentUnits.push(units[_local2.c][(_local2.r - 1)]);
};
if ((((_local2.c < cols)) && (!(checkIsLocked(units[(_local2.c + 1)][_local2.r]))))){
adjacentUnits.push(units[(_local2.c + 1)][_local2.r]);
};
if ((((_local2.c > 1)) && (!(checkIsLocked(units[(_local2.c - 1)][_local2.r]))))){
adjacentUnits.push(units[(_local2.c - 1)][_local2.r]);
};
_local3 = 0;
while (_local3 < adjacentUnits.length) {
if (gridremove == false){
increaseCount(adjacentUnits[_local3]);
} else {
if (isthere == true){
decreaseCount(adjacentUnits[_local3]);
};
};
_local3++;
};
isthere = false;
movesMade[totalMoves] = adjacentUnits;
totalMoves++;
updateReference();
if (checkVictory()){
if (Mainee.mainee.ifMute == false){
trumpets.play();
};
if (randomGrid == false){
levelCompleted();
_local3 = 1;
while (_local3 <= cols) {
_local4 = 1;
while (_local4 <= cols) {
units[_local3][_local4].removeEventListener(MouseEvent.CLICK, clickListener);
_local4++;
};
_local3++;
};
} else {
if (randomGrid == true){
if (rows == 3){
if (((100 * timerMin) + gameTimer.currentCount) < ((Mainee.mainee.maxTimeMin3 * 100) + Mainee.mainee.maxTimeSec3)){
Mainee.mainee.maxTimeMin3 = timerMin;
Mainee.mainee.maxTimeSec3 = gameTimer.currentCount;
};
if (((Mainee.mainee.maxTimeMin3 * 100) + Mainee.mainee.maxTimeSec3) == 0){
Mainee.mainee.maxTimeMin3 = timerMin;
Mainee.mainee.maxTimeSec3 = gameTimer.currentCount;
};
submitter = ((timerMin * 60) + gameTimer.currentCount);
Mainee.mainee.kongregate.stats.submit("3x3 Time", submitter);
} else {
if (rows == 4){
if (((100 * timerMin) + gameTimer.currentCount) < ((Mainee.mainee.maxTimeMin4 * 100) + Mainee.mainee.maxTimeSec4)){
Mainee.mainee.maxTimeMin4 = timerMin;
Mainee.mainee.maxTimeSec4 = gameTimer.currentCount;
};
if (((Mainee.mainee.maxTimeMin4 * 100) + Mainee.mainee.maxTimeSec4) == 0){
Mainee.mainee.maxTimeMin4 = timerMin;
Mainee.mainee.maxTimeSec4 = gameTimer.currentCount;
};
submitter = ((timerMin * 60) + gameTimer.currentCount);
Mainee.mainee.kongregate.stats.submit("4x4 Time", submitter);
} else {
if (rows == 5){
if (((100 * timerMin) + gameTimer.currentCount) < ((Mainee.mainee.maxTimeMin5 * 100) + Mainee.mainee.maxTimeSec5)){
Mainee.mainee.maxTimeMin5 = timerMin;
Mainee.mainee.maxTimeSec5 = gameTimer.currentCount;
};
if (((Mainee.mainee.maxTimeMin5 * 100) + Mainee.mainee.maxTimeSec5) == 0){
Mainee.mainee.maxTimeMin5 = timerMin;
Mainee.mainee.maxTimeSec5 = gameTimer.currentCount;
};
submitter = ((timerMin * 60) + gameTimer.currentCount);
Mainee.mainee.kongregate.stats.submit("5x5 Time", submitter);
} else {
if (rows == 6){
if (((100 * timerMin) + gameTimer.currentCount) < ((Mainee.mainee.maxTimeMin6 * 100) + Mainee.mainee.maxTimeSec6)){
Mainee.mainee.maxTimeMin6 = timerMin;
Mainee.mainee.maxTimeSec6 = gameTimer.currentCount;
};
if (((Mainee.mainee.maxTimeMin6 * 100) + Mainee.mainee.maxTimeSec6) == 0){
Mainee.mainee.maxTimeMin6 = timerMin;
Mainee.mainee.maxTimeSec6 = gameTimer.currentCount;
};
submitter = ((timerMin * 60) + gameTimer.currentCount);
Mainee.mainee.kongregate.stats.submit("6x6 Time", submitter);
};
};
};
};
Mainee.mainee.updateMaxTime();
gameTimer.removeEventListener(TimerEvent.TIMER, updateTime);
gameTimer.reset();
continueon = new Continueon();
continueon.x = 230;
continueon.y = 218;
continueon.scaleX = 1.5;
continueon.scaleY = 1.5;
continueon.buttonMode = true;
levelcomplete = new levelComplete();
levelcomplete.x = 150;
levelcomplete.y = 175;
kinglogo = new kingLogo();
kinglogo.scaleX = 0.8;
kinglogo.scaleY = 0.8;
kinglogo.x = 80;
kinglogo.y = 212;
kinglogo.buttonMode = true;
addChild(levelcomplete);
addChild(continueon);
addChild(kinglogo);
kinglogo.addEventListener(MouseEvent.CLICK, Mainee.mainee.openSign);
continueon.addEventListener(MouseEvent.CLICK, newRandomLevel);
_local3 = 1;
while (_local3 <= rows) {
_local4 = 1;
while (_local4 <= cols) {
units[_local3][_local4].buttonMask.removeEventListener(MouseEvent.CLICK, clickListener);
_local4++;
};
_local3++;
};
};
};
};
return;
};
}
public function undo(_arg1:MouseEvent):void{
gridUndo();
}
private function gridUndo():void{
var _local1:int;
possibleSolution.pop();
if (totalMoves > 0){
totalMoves--;
_local1 = 0;
while (_local1 < movesMade[totalMoves].length) {
decreaseCount((movesMade[totalMoves][_local1] as MovieClip));
_local1++;
};
};
}
private function getSolution():void{
var _local1:* = levelGrid.getSolution();
}
private function checkVictory():Boolean{
var _local1:int;
var _local2:int;
while (_local2 < levelGrid.getReference().length) {
if (levelGrid.getReference()[_local2] == gridreference[_local2]){
_local1++;
};
_local2++;
};
if (_local1 == gridreference.length){
return (true);
};
return (false);
}
private function increaseCount(_arg1:MovieClip):void{
_arg1.number++;
_arg1.numberText.text = String(_arg1.number);
updateGraphic(_arg1);
}
}
}//package
Section 42
//gridframe (gridframe)
package {
import flash.display.*;
public dynamic class gridframe extends MovieClip {
}
}//package
Section 43
//Instructions (Instructions)
package {
import flash.display.*;
public dynamic class Instructions extends MovieClip {
}
}//package
Section 44
//InstructionsMenu (InstructionsMenu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class InstructionsMenu extends MovieClip {
public var instructionsText:TextField;
public function InstructionsMenu(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 45
//inText (inText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class inText extends MovieClip {
public var txt:TextField;
}
}//package
Section 46
//inText2 (inText2)
package {
import flash.display.*;
import flash.text.*;
public dynamic class inText2 extends MovieClip {
public var txt:TextField;
}
}//package
Section 47
//inText3 (inText3)
package {
import flash.display.*;
import flash.text.*;
public dynamic class inText3 extends MovieClip {
public var txt:TextField;
}
}//package
Section 48
//Intro_1 (Intro_1)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Intro_1 extends MovieClip {
public function Intro_1(){
addFrameScript(179, frame180);
}
function frame180(){
stop();
dispatchEvent(new Event("ANIMATION_COMPLETE", true, true));
}
}
}//package
Section 49
//king_preloader_mc (king_preloader_mc)
package {
import flash.events.*;
import flash.display.*;
import com.midasplayer.*;
import com.midasplayer.particle.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class king_preloader_mc extends MovieClip {
public var mcKingLoader:DragonLoader;
public var mochi:String;
public var bg:Sprite;
public var mcLoadLogoBg:MovieClip;
public var particles:Main;
public var bar:Sprite;
public var holder:Sprite;
public var game_name:String;
public function king_preloader_mc(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function preload(_arg1:Event):void{
bg = new Sprite();
bg.buttonMode = true;
bg.name = "clickBg";
bg.graphics.beginFill(0, 0);
bg.graphics.lineTo(stage.stageWidth, 0);
bg.graphics.lineTo(stage.stageWidth, stage.stageHeight);
bg.graphics.lineTo(0, stage.stageHeight);
bg.graphics.lineTo(0, 0);
bg.graphics.endFill();
bg.addEventListener(MouseEvent.CLICK, openKingPage);
this.addChildAt(bg, this.getChildIndex(mcLoadLogoBg));
mcLoadLogoBg.x = ((stage.stageWidth / 2) - (mcLoadLogoBg.width / 2));
mcLoadLogoBg.y = ((stage.stageHeight / 2) - (mcLoadLogoBg.height / 2));
bar = new Sprite();
bar.graphics.beginFill(0xFFFFFF, 0);
bar.x = (mcLoadLogoBg.x + 5);
bar.y = (mcLoadLogoBg.y + 34);
bar.graphics.drawRect(0, 0, 96, 5);
bar.graphics.endFill();
this.addChild(bar);
holder = new Sprite();
this.addChild(holder);
holder.x = bar.x;
holder.y = bar.y;
particles = new Main();
particles.setEmitterClip(holder);
this.addChild(particles);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame1(){
stop();
game_name = "";
mochi = "";
stage.scaleMode = StageScaleMode.NO_SCALE;
KingAPI.addEventListener(KingAPI.INITIALIZED_EVENT, preload);
KingAPI.addEventListener(KingAPI.HOST_BANNED_EVENT, preload);
KingAPI.init(game_name, root.loaderInfo.url);
}
function frame2(){
mcKingLoader.addEventListener(DragonLoader.LAUNCH_GAME, launchGame);
mcKingLoader.init(game_name, mochi);
}
public function onEnterFrame(_arg1:Event):void{
holder.x = (bar.x + bar.width);
if (((!((parent == null))) && (((parent as MovieClip).framesLoaded == (parent as MovieClip).totalFrames)))){
particles.kill();
this.removeChild(particles);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
bg.removeEventListener(MouseEvent.CLICK, openKingPage);
this.removeChild(bar);
if (!KingAPI.isHome){
gotoAndStop(2);
} else {
gotoAndStop(3);
};
} else {
bar.scaleX = (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal);
mcLoadLogoBg.bar.scaleX = (1 - (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal));
};
}
function frame3(){
}
public function openKingPage(_arg1:Event):void{
KingAPI.openLoaderProgressLink();
}
public function launchGame(_arg1):void{
mcKingLoader.destroy();
gotoAndStop(3);
}
}
}//package
Section 50
//kingLogo (kingLogo)
package {
import flash.display.*;
public dynamic class kingLogo extends MovieClip {
public var brandingMc:MovieClip;
}
}//package
Section 51
//LeftArrow (LeftArrow)
package {
import flash.display.*;
public dynamic class LeftArrow extends MovieClip {
}
}//package
Section 52
//levelButton (levelButton)
package {
import flash.display.*;
public dynamic class levelButton extends MovieClip {
}
}//package
Section 53
//levelComplete (levelComplete)
package {
import flash.display.*;
public dynamic class levelComplete extends MovieClip {
public function levelComplete(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package
Section 54
//LevelGrid (LevelGrid)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class LevelGrid extends MovieClip {
private var level:int;
private var MaineeStage:Object;
private var reference:Array;
private var levelunit:levelUnit;
private var rows:int;
private var levelunits:Array;
private var adjacentLevelUnits:Array;
private var solution:Array;
private var cols:int;
public function LevelGrid(_arg1:int, _arg2:int, _arg3:Boolean=false){
var _local5:int;
super();
this.level = _arg2;
rows = _arg1;
cols = _arg1;
levelunits = new Array();
var _local4 = 1;
while (_local4 <= cols) {
levelunits[_local4] = new Array();
_local5 = 1;
while (_local5 <= rows) {
levelunit = new levelUnit();
levelunit.sideLength = ((Mainee.HEIGHT - 200) / rows);
levelunit.scaleX = (((Mainee.WIDTH - 350) / cols) / levelunit.width);
levelunit.scaleY = (((Mainee.HEIGHT - 200) / rows) / levelunit.height);
levelunit.c = _local4;
levelunit.r = _local5;
levelunit.x = ((((_local4 - 1) * levelunit.sideLength) + (levelunit.width / 2)) + 430);
levelunit.y = (175 + ((((_local5 - 1) * levelunit.sideLength) + (levelunit.height / 2)) - 5));
levelunit.number = 0;
addChild(levelunit);
levelunit.numberText.text = levelunit.number;
levelunits[_local4][_local5] = levelunit;
_local5++;
};
_local4++;
};
if (_arg3 == true){
randomize();
} else {
setupLevel();
};
}
private function setupLevel(){
clearLevelUnits();
if (level == 1){
levelunits[1][1].number = 0;
levelunits[1][2].number = 1;
levelunits[1][3].number = 0;
levelunits[2][1].number = 1;
levelunits[2][2].number = 1;
levelunits[2][3].number = 1;
levelunits[3][1].number = 0;
levelunits[3][2].number = 1;
levelunits[3][3].number = 0;
};
if (level == 2){
levelunits[1][1].number = 0;
levelunits[1][2].number = 0;
levelunits[1][3].number = 0;
levelunits[2][1].number = 0;
levelunits[2][2].number = 1;
levelunits[2][3].number = 0;
levelunits[3][1].number = 1;
levelunits[3][2].number = 1;
levelunits[3][3].number = 1;
};
if (level == 3){
levelunits[1][1].number = 0;
levelunits[1][2].number = 0;
levelunits[1][3].number = 0;
levelunits[2][1].number = 0;
levelunits[2][2].number = 0;
levelunits[2][3].number = 1;
levelunits[3][1].number = 0;
levelunits[3][2].number = 1;
levelunits[3][3].number = 1;
};
if (level == 4){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 0;
levelunits[2][1].number = 2;
levelunits[2][2].number = 1;
levelunits[2][3].number = 2;
levelunits[3][1].number = 0;
levelunits[3][2].number = 2;
levelunits[3][3].number = 1;
};
if (level == 5){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 1;
levelunits[2][1].number = 2;
levelunits[2][2].number = 0;
levelunits[2][3].number = 2;
levelunits[3][1].number = 1;
levelunits[3][2].number = 2;
levelunits[3][3].number = 1;
};
if (level == 6){
levelunits[1][1].number = 1;
levelunits[1][2].number = 3;
levelunits[1][3].number = 1;
levelunits[2][1].number = 3;
levelunits[2][2].number = 1;
levelunits[2][3].number = 3;
levelunits[3][1].number = 1;
levelunits[3][2].number = 3;
levelunits[3][3].number = 1;
};
if (level == 7){
levelunits[1][1].number = 2;
levelunits[1][2].number = 1;
levelunits[1][3].number = 2;
levelunits[2][1].number = 1;
levelunits[2][2].number = 4;
levelunits[2][3].number = 1;
levelunits[3][1].number = 2;
levelunits[3][2].number = 1;
levelunits[3][3].number = 2;
};
if (level == 8){
levelunits[1][1].number = 3;
levelunits[1][2].number = 4;
levelunits[1][3].number = 3;
levelunits[2][1].number = 4;
levelunits[2][2].number = 5;
levelunits[2][3].number = 4;
levelunits[3][1].number = 3;
levelunits[3][2].number = 4;
levelunits[3][3].number = 3;
};
if (level == 9){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 2;
levelunits[3][1].number = 1;
levelunits[3][2].number = 1;
levelunits[3][3].number = 1;
};
if (level == 10){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[2][1].number = 2;
levelunits[2][2].number = 1;
levelunits[2][3].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 1;
levelunits[3][3].number = 1;
};
if (level == 11){
levelunits[1][1].number = 3;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 4;
levelunits[2][3].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 2;
levelunits[3][3].number = 3;
};
if (level == 12){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 2;
};
if (level == 13){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[2][1].number = 1;
levelunits[2][2].number = 0;
levelunits[2][3].number = 0;
levelunits[2][4].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 0;
levelunits[3][3].number = 0;
levelunits[3][4].number = 1;
levelunits[4][1].number = 1;
levelunits[4][2].number = 1;
levelunits[4][3].number = 1;
levelunits[4][4].number = 1;
};
if (level == 14){
levelunits[1][1].number = 3;
levelunits[1][2].number = 3;
levelunits[1][3].number = 1;
levelunits[1][4].number = 0;
levelunits[2][1].number = 3;
levelunits[2][2].number = 3;
levelunits[2][3].number = 2;
levelunits[2][4].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 2;
levelunits[3][3].number = 3;
levelunits[3][4].number = 3;
levelunits[4][1].number = 0;
levelunits[4][2].number = 1;
levelunits[4][3].number = 3;
levelunits[4][4].number = 3;
};
if (level == 15){
levelunits[1][1].number = 1;
levelunits[1][2].number = 4;
levelunits[1][3].number = 4;
levelunits[1][4].number = 1;
levelunits[2][1].number = 4;
levelunits[2][2].number = 9;
levelunits[2][3].number = 9;
levelunits[2][4].number = 4;
levelunits[3][1].number = 4;
levelunits[3][2].number = 9;
levelunits[3][3].number = 9;
levelunits[3][4].number = 4;
levelunits[4][1].number = 1;
levelunits[4][2].number = 4;
levelunits[4][3].number = 4;
levelunits[4][4].number = 1;
};
if (level == 16){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 2;
levelunits[2][1].number = 3;
levelunits[2][2].number = 5;
levelunits[2][3].number = 5;
levelunits[2][4].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 5;
levelunits[3][3].number = 5;
levelunits[3][4].number = 3;
levelunits[4][1].number = 2;
levelunits[4][2].number = 3;
levelunits[4][3].number = 3;
levelunits[4][4].number = 2;
};
if (level == 17){
levelunits[1][1].number = 3;
levelunits[1][2].number = 4;
levelunits[1][3].number = 4;
levelunits[1][4].number = 3;
levelunits[2][1].number = 4;
levelunits[2][2].number = 5;
levelunits[2][3].number = 5;
levelunits[2][4].number = 4;
levelunits[3][1].number = 4;
levelunits[3][2].number = 5;
levelunits[3][3].number = 5;
levelunits[3][4].number = 4;
levelunits[4][1].number = 3;
levelunits[4][2].number = 4;
levelunits[4][3].number = 4;
levelunits[4][4].number = 3;
};
if (level == 18){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[2][1].number = 2;
levelunits[2][2].number = 1;
levelunits[2][3].number = 2;
levelunits[2][4].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 2;
levelunits[3][3].number = 1;
levelunits[3][4].number = 2;
levelunits[4][1].number = 1;
levelunits[4][2].number = 1;
levelunits[4][3].number = 2;
levelunits[4][4].number = 1;
};
if (level == 19){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[2][4].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 2;
levelunits[3][3].number = 2;
levelunits[3][4].number = 2;
levelunits[4][1].number = 2;
levelunits[4][2].number = 2;
levelunits[4][3].number = 2;
levelunits[4][4].number = 2;
};
if (level == 20){
levelunits[1][1].number = 2;
levelunits[1][2].number = 1;
levelunits[1][3].number = 2;
levelunits[1][4].number = 0;
levelunits[2][1].number = 1;
levelunits[2][2].number = 4;
levelunits[2][3].number = 1;
levelunits[2][4].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 1;
levelunits[3][3].number = 4;
levelunits[3][4].number = 1;
levelunits[4][1].number = 0;
levelunits[4][2].number = 2;
levelunits[4][3].number = 1;
levelunits[4][4].number = 2;
};
if (level == 21){
levelunits[1][1].number = 3;
levelunits[1][2].number = 6;
levelunits[1][3].number = 3;
levelunits[1][4].number = 0;
levelunits[2][1].number = 3;
levelunits[2][2].number = 6;
levelunits[2][3].number = 6;
levelunits[2][4].number = 0;
levelunits[3][1].number = 0;
levelunits[3][2].number = 6;
levelunits[3][3].number = 6;
levelunits[3][4].number = 3;
levelunits[4][1].number = 0;
levelunits[4][2].number = 3;
levelunits[4][3].number = 6;
levelunits[4][4].number = 3;
};
if (level == 22){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 1;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 3;
levelunits[3][4].number = 2;
levelunits[4][1].number = 1;
levelunits[4][2].number = 2;
levelunits[4][3].number = 2;
levelunits[4][4].number = 1;
};
if (level == 23){
levelunits[1][1].number = 3;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[2][4].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 2;
levelunits[3][3].number = 2;
levelunits[3][4].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 3;
levelunits[4][3].number = 3;
levelunits[4][4].number = 3;
};
if (level == 24){
levelunits[1][1].number = 1;
levelunits[1][2].number = 3;
levelunits[1][3].number = 1;
levelunits[1][4].number = 2;
levelunits[2][1].number = 3;
levelunits[2][2].number = 1;
levelunits[2][3].number = 4;
levelunits[2][4].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 4;
levelunits[3][3].number = 1;
levelunits[3][4].number = 3;
levelunits[4][1].number = 2;
levelunits[4][2].number = 1;
levelunits[4][3].number = 3;
levelunits[4][4].number = 1;
};
if (level == 25){
levelunits[1][1].number = 2;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 2;
levelunits[2][1].number = 3;
levelunits[2][2].number = 1;
levelunits[2][3].number = 1;
levelunits[2][4].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 1;
levelunits[3][3].number = 1;
levelunits[3][4].number = 3;
levelunits[4][1].number = 2;
levelunits[4][2].number = 1;
levelunits[4][3].number = 1;
levelunits[4][4].number = 2;
};
if (level == 26){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 3;
levelunits[1][4].number = 0;
levelunits[2][1].number = 0;
levelunits[2][2].number = 3;
levelunits[2][3].number = 4;
levelunits[2][4].number = 2;
levelunits[3][1].number = 0;
levelunits[3][2].number = 3;
levelunits[3][3].number = 4;
levelunits[3][4].number = 2;
levelunits[4][1].number = 1;
levelunits[4][2].number = 1;
levelunits[4][3].number = 3;
levelunits[4][4].number = 0;
};
if (level == 27){
levelunits[1][1].number = 0;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[1][5].number = 0;
levelunits[2][1].number = 1;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 3;
levelunits[3][3].number = 4;
levelunits[3][4].number = 3;
levelunits[3][5].number = 1;
levelunits[4][1].number = 1;
levelunits[4][2].number = 3;
levelunits[4][3].number = 3;
levelunits[4][4].number = 3;
levelunits[4][5].number = 1;
levelunits[5][1].number = 0;
levelunits[5][2].number = 1;
levelunits[5][3].number = 1;
levelunits[5][4].number = 1;
levelunits[5][5].number = 0;
};
if (level == 28){
levelunits[1][1].number = 1;
levelunits[1][2].number = 3;
levelunits[1][3].number = 1;
levelunits[1][4].number = 3;
levelunits[1][5].number = 1;
levelunits[2][1].number = 3;
levelunits[2][2].number = 4;
levelunits[2][3].number = 6;
levelunits[2][4].number = 4;
levelunits[2][5].number = 3;
levelunits[3][1].number = 1;
levelunits[3][2].number = 6;
levelunits[3][3].number = 5;
levelunits[3][4].number = 6;
levelunits[3][5].number = 1;
levelunits[4][1].number = 3;
levelunits[4][2].number = 4;
levelunits[4][3].number = 6;
levelunits[4][4].number = 4;
levelunits[4][5].number = 3;
levelunits[5][1].number = 1;
levelunits[5][2].number = 3;
levelunits[5][3].number = 1;
levelunits[5][4].number = 3;
levelunits[5][5].number = 1;
};
if (level == 29){
levelunits[1][1].number = 3;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 3;
levelunits[1][5].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 2;
levelunits[2][3].number = 1;
levelunits[2][4].number = 2;
levelunits[2][5].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 1;
levelunits[3][3].number = 0;
levelunits[3][4].number = 1;
levelunits[3][5].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 2;
levelunits[4][3].number = 1;
levelunits[4][4].number = 2;
levelunits[4][5].number = 3;
levelunits[5][1].number = 3;
levelunits[5][2].number = 3;
levelunits[5][3].number = 3;
levelunits[5][4].number = 3;
levelunits[5][5].number = 3;
};
if (level == 30){
levelunits[1][1].number = 2;
levelunits[1][2].number = 1;
levelunits[1][3].number = 2;
levelunits[1][4].number = 1;
levelunits[1][5].number = 2;
levelunits[2][1].number = 1;
levelunits[2][2].number = 2;
levelunits[2][3].number = 1;
levelunits[2][4].number = 2;
levelunits[2][5].number = 1;
levelunits[3][1].number = 2;
levelunits[3][2].number = 1;
levelunits[3][3].number = 1;
levelunits[3][4].number = 1;
levelunits[3][5].number = 2;
levelunits[4][1].number = 1;
levelunits[4][2].number = 2;
levelunits[4][3].number = 1;
levelunits[4][4].number = 2;
levelunits[4][5].number = 1;
levelunits[5][1].number = 2;
levelunits[5][2].number = 1;
levelunits[5][3].number = 2;
levelunits[5][4].number = 1;
levelunits[5][5].number = 2;
};
if (level == 31){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 3;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[2][4].number = 2;
levelunits[2][5].number = 2;
levelunits[3][1].number = 3;
levelunits[3][2].number = 2;
levelunits[3][3].number = 1;
levelunits[3][4].number = 2;
levelunits[3][5].number = 3;
levelunits[4][1].number = 2;
levelunits[4][2].number = 2;
levelunits[4][3].number = 2;
levelunits[4][4].number = 2;
levelunits[4][5].number = 2;
levelunits[5][1].number = 2;
levelunits[5][2].number = 2;
levelunits[5][3].number = 3;
levelunits[5][4].number = 2;
levelunits[5][5].number = 2;
};
if (level == 32){
levelunits[1][1].number = 0;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[1][5].number = 0;
levelunits[2][1].number = 1;
levelunits[2][2].number = 3;
levelunits[2][3].number = 7;
levelunits[2][4].number = 3;
levelunits[2][5].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 7;
levelunits[3][3].number = 8;
levelunits[3][4].number = 7;
levelunits[3][5].number = 1;
levelunits[4][1].number = 1;
levelunits[4][2].number = 3;
levelunits[4][3].number = 7;
levelunits[4][4].number = 3;
levelunits[4][5].number = 1;
levelunits[5][1].number = 0;
levelunits[5][2].number = 1;
levelunits[5][3].number = 1;
levelunits[5][4].number = 1;
levelunits[5][5].number = 0;
};
if (level == 33){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[1][5].number = 1;
levelunits[2][1].number = 1;
levelunits[2][2].number = 2;
levelunits[2][3].number = 1;
levelunits[2][4].number = 2;
levelunits[2][5].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 1;
levelunits[3][3].number = 4;
levelunits[3][4].number = 1;
levelunits[3][5].number = 1;
levelunits[4][1].number = 1;
levelunits[4][2].number = 2;
levelunits[4][3].number = 1;
levelunits[4][4].number = 2;
levelunits[4][5].number = 1;
levelunits[5][1].number = 1;
levelunits[5][2].number = 1;
levelunits[5][3].number = 1;
levelunits[5][4].number = 1;
levelunits[5][5].number = 1;
};
if (level == 34){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 1;
levelunits[3][4].number = 3;
levelunits[3][5].number = 2;
levelunits[4][1].number = 2;
levelunits[4][2].number = 3;
levelunits[4][3].number = 3;
levelunits[4][4].number = 3;
levelunits[4][5].number = 2;
levelunits[5][1].number = 2;
levelunits[5][2].number = 2;
levelunits[5][3].number = 2;
levelunits[5][4].number = 2;
levelunits[5][5].number = 2;
};
if (level == 35){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[1][5].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 1;
levelunits[2][3].number = 2;
levelunits[2][4].number = 2;
levelunits[2][5].number = 1;
levelunits[3][1].number = 1;
levelunits[3][2].number = 2;
levelunits[3][3].number = 1;
levelunits[3][4].number = 2;
levelunits[3][5].number = 1;
levelunits[4][1].number = 1;
levelunits[4][2].number = 2;
levelunits[4][3].number = 2;
levelunits[4][4].number = 1;
levelunits[4][5].number = 2;
levelunits[5][1].number = 2;
levelunits[5][2].number = 1;
levelunits[5][3].number = 1;
levelunits[5][4].number = 2;
levelunits[5][5].number = 1;
};
if (level == 36){
levelunits[1][1].number = 0;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[1][5].number = 0;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 9;
levelunits[2][4].number = 3;
levelunits[2][5].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 9;
levelunits[3][3].number = 9;
levelunits[3][4].number = 9;
levelunits[3][5].number = 2;
levelunits[4][1].number = 2;
levelunits[4][2].number = 3;
levelunits[4][3].number = 9;
levelunits[4][4].number = 3;
levelunits[4][5].number = 2;
levelunits[5][1].number = 0;
levelunits[5][2].number = 2;
levelunits[5][3].number = 2;
levelunits[5][4].number = 2;
levelunits[5][5].number = 0;
};
if (level == 37){
levelunits[1][1].number = 3;
levelunits[1][2].number = 1;
levelunits[1][3].number = 2;
levelunits[1][4].number = 1;
levelunits[2][1].number = 4;
levelunits[2][2].number = 3;
levelunits[2][3].number = 1;
levelunits[2][4].number = 4;
levelunits[3][1].number = 4;
levelunits[3][2].number = 2;
levelunits[3][3].number = 3;
levelunits[3][4].number = 2;
levelunits[4][1].number = 3;
levelunits[4][2].number = 2;
levelunits[4][3].number = 1;
levelunits[4][4].number = 2;
};
if (level == 38){
levelunits[1][1].number = 0;
levelunits[1][2].number = 0;
levelunits[1][3].number = 3;
levelunits[1][4].number = 3;
levelunits[2][1].number = 0;
levelunits[2][2].number = 4;
levelunits[2][3].number = 2;
levelunits[2][4].number = 4;
levelunits[3][1].number = 4;
levelunits[3][2].number = 3;
levelunits[3][3].number = 5;
levelunits[3][4].number = 2;
levelunits[4][1].number = 1;
levelunits[4][2].number = 5;
levelunits[4][3].number = 2;
levelunits[4][4].number = 2;
};
if (level == 39){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 3;
levelunits[1][4].number = 0;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 2;
levelunits[2][4].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 2;
levelunits[3][3].number = 6;
levelunits[3][4].number = 1;
levelunits[4][1].number = 4;
levelunits[4][2].number = 6;
levelunits[4][3].number = 4;
levelunits[4][4].number = 4;
};
if (level == 44){
levelunits[1][1].number = 3;
levelunits[1][2].number = 2;
levelunits[1][3].number = 3;
levelunits[1][4].number = 2;
levelunits[2][1].number = 4;
levelunits[2][2].number = 6;
levelunits[2][3].number = 4;
levelunits[2][4].number = 4;
levelunits[3][1].number = 5;
levelunits[3][2].number = 4;
levelunits[3][3].number = 6;
levelunits[3][4].number = 3;
levelunits[4][1].number = 2;
levelunits[4][2].number = 4;
levelunits[4][3].number = 3;
levelunits[4][4].number = 3;
};
if (level == 41){
levelunits[1][1].number = 0;
levelunits[1][2].number = 2;
levelunits[1][3].number = 1;
levelunits[1][4].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 1;
levelunits[2][3].number = 6;
levelunits[2][4].number = 2;
levelunits[3][1].number = 3;
levelunits[3][2].number = 5;
levelunits[3][3].number = 2;
levelunits[3][4].number = 6;
levelunits[4][1].number = 3;
levelunits[4][2].number = 1;
levelunits[4][3].number = 4;
levelunits[4][4].number = 2;
};
if (level == 42){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 1;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[3][1].number = 1;
levelunits[3][2].number = 3;
levelunits[3][3].number = 3;
levelunits[3][4].number = 2;
levelunits[4][1].number = 2;
levelunits[4][2].number = 2;
levelunits[4][3].number = 2;
levelunits[4][4].number = 1;
};
if (level == 43){
levelunits[1][1].number = 0;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 5;
levelunits[2][4].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 5;
levelunits[3][3].number = 3;
levelunits[3][4].number = 4;
levelunits[4][1].number = 2;
levelunits[4][2].number = 2;
levelunits[4][3].number = 4;
levelunits[4][4].number = 2;
};
if (level == 40){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 2;
levelunits[2][1].number = 1;
levelunits[2][2].number = 3;
levelunits[2][3].number = 2;
levelunits[2][4].number = 2;
levelunits[3][1].number = 3;
levelunits[3][2].number = 3;
levelunits[3][3].number = 3;
levelunits[3][4].number = 2;
levelunits[4][1].number = 1;
levelunits[4][2].number = 3;
levelunits[4][3].number = 1;
levelunits[4][4].number = 1;
};
if (level == 45){
levelunits[1][1].number = 1;
levelunits[1][2].number = 4;
levelunits[1][3].number = 2;
levelunits[1][4].number = 3;
levelunits[2][1].number = 4;
levelunits[2][2].number = 3;
levelunits[2][3].number = 6;
levelunits[2][4].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 7;
levelunits[3][3].number = 4;
levelunits[3][4].number = 6;
levelunits[4][1].number = 3;
levelunits[4][2].number = 3;
levelunits[4][3].number = 5;
levelunits[4][4].number = 3;
};
if (level == 46){
levelunits[1][1].number = 1;
levelunits[1][2].number = 0;
levelunits[1][3].number = 2;
levelunits[1][4].number = 0;
levelunits[1][5].number = 3;
levelunits[2][1].number = 1;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 6;
levelunits[2][5].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 1;
levelunits[3][3].number = 4;
levelunits[3][4].number = 3;
levelunits[3][5].number = 4;
levelunits[4][1].number = 2;
levelunits[4][2].number = 2;
levelunits[4][3].number = 4;
levelunits[4][4].number = 4;
levelunits[4][5].number = 1;
levelunits[5][1].number = 2;
levelunits[5][2].number = 2;
levelunits[5][3].number = 4;
levelunits[5][4].number = 5;
levelunits[5][5].number = 2;
};
if (level == 47){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 3;
levelunits[1][4].number = 4;
levelunits[1][5].number = 3;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 4;
levelunits[2][4].number = 4;
levelunits[2][5].number = 3;
levelunits[3][1].number = 1;
levelunits[3][2].number = 3;
levelunits[3][3].number = 6;
levelunits[3][4].number = 4;
levelunits[3][5].number = 4;
levelunits[4][1].number = 1;
levelunits[4][2].number = 3;
levelunits[4][3].number = 5;
levelunits[4][4].number = 5;
levelunits[4][5].number = 3;
levelunits[5][1].number = 0;
levelunits[5][2].number = 2;
levelunits[5][3].number = 3;
levelunits[5][4].number = 2;
levelunits[5][5].number = 2;
};
if (level == 48){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 4;
levelunits[1][5].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 5;
levelunits[3][1].number = 3;
levelunits[3][2].number = 4;
levelunits[3][3].number = 1;
levelunits[3][4].number = 5;
levelunits[3][5].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 3;
levelunits[4][3].number = 5;
levelunits[4][4].number = 3;
levelunits[4][5].number = 5;
levelunits[5][1].number = 0;
levelunits[5][2].number = 3;
levelunits[5][3].number = 1;
levelunits[5][4].number = 4;
levelunits[5][5].number = 2;
};
if (level == 49){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[1][5].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 5;
levelunits[2][5].number = 2;
levelunits[3][1].number = 4;
levelunits[3][2].number = 2;
levelunits[3][3].number = 4;
levelunits[3][4].number = 3;
levelunits[3][5].number = 6;
levelunits[4][1].number = 2;
levelunits[4][2].number = 5;
levelunits[4][3].number = 2;
levelunits[4][4].number = 6;
levelunits[4][5].number = 2;
levelunits[5][1].number = 4;
levelunits[5][2].number = 2;
levelunits[5][3].number = 4;
levelunits[5][4].number = 1;
levelunits[5][5].number = 3;
};
if (level == 50){
levelunits[1][1].number = 1;
levelunits[1][2].number = 4;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[1][5].number = 1;
levelunits[2][1].number = 3;
levelunits[2][2].number = 3;
levelunits[2][3].number = 5;
levelunits[2][4].number = 2;
levelunits[2][5].number = 3;
levelunits[3][1].number = 2;
levelunits[3][2].number = 5;
levelunits[3][3].number = 2;
levelunits[3][4].number = 4;
levelunits[3][5].number = 3;
levelunits[4][1].number = 4;
levelunits[4][2].number = 3;
levelunits[4][3].number = 5;
levelunits[4][4].number = 4;
levelunits[4][5].number = 3;
levelunits[5][1].number = 2;
levelunits[5][2].number = 3;
levelunits[5][3].number = 3;
levelunits[5][4].number = 3;
levelunits[5][5].number = 2;
};
if (level == 51){
levelunits[1][1].number = 3;
levelunits[1][2].number = 2;
levelunits[1][3].number = 4;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 4;
levelunits[2][3].number = 3;
levelunits[2][4].number = 4;
levelunits[2][5].number = 3;
levelunits[3][1].number = 2;
levelunits[3][2].number = 4;
levelunits[3][3].number = 2;
levelunits[3][4].number = 4;
levelunits[3][5].number = 2;
levelunits[4][1].number = 5;
levelunits[4][2].number = 2;
levelunits[4][3].number = 4;
levelunits[4][4].number = 3;
levelunits[4][5].number = 2;
levelunits[5][1].number = 2;
levelunits[5][2].number = 4;
levelunits[5][3].number = 2;
levelunits[5][4].number = 3;
levelunits[5][5].number = 2;
};
if (level == 52){
levelunits[1][1].number = 2;
levelunits[1][2].number = 2;
levelunits[1][3].number = 3;
levelunits[1][4].number = 3;
levelunits[1][5].number = 2;
levelunits[2][1].number = 3;
levelunits[2][2].number = 5;
levelunits[2][3].number = 4;
levelunits[2][4].number = 5;
levelunits[2][5].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 4;
levelunits[3][3].number = 4;
levelunits[3][4].number = 5;
levelunits[3][5].number = 3;
levelunits[4][1].number = 4;
levelunits[4][2].number = 4;
levelunits[4][3].number = 5;
levelunits[4][4].number = 5;
levelunits[4][5].number = 4;
levelunits[5][1].number = 2;
levelunits[5][2].number = 4;
levelunits[5][3].number = 2;
levelunits[5][4].number = 4;
levelunits[5][5].number = 2;
};
if (level == 53){
levelunits[1][1].number = 2;
levelunits[1][2].number = 5;
levelunits[1][3].number = 3;
levelunits[1][4].number = 5;
levelunits[1][5].number = 3;
levelunits[2][1].number = 4;
levelunits[2][2].number = 3;
levelunits[2][3].number = 5;
levelunits[2][4].number = 4;
levelunits[2][5].number = 5;
levelunits[3][1].number = 4;
levelunits[3][2].number = 5;
levelunits[3][3].number = 5;
levelunits[3][4].number = 7;
levelunits[3][5].number = 4;
levelunits[4][1].number = 3;
levelunits[4][2].number = 4;
levelunits[4][3].number = 6;
levelunits[4][4].number = 4;
levelunits[4][5].number = 5;
levelunits[5][1].number = 2;
levelunits[5][2].number = 3;
levelunits[5][3].number = 3;
levelunits[5][4].number = 5;
levelunits[5][5].number = 1;
};
if (level == 54){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 3;
levelunits[1][5].number = 5;
levelunits[1][6].number = 5;
levelunits[2][1].number = 1;
levelunits[2][2].number = 4;
levelunits[2][3].number = 2;
levelunits[2][4].number = 4;
levelunits[2][5].number = 3;
levelunits[2][6].number = 3;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 5;
levelunits[3][4].number = 3;
levelunits[3][5].number = 4;
levelunits[3][6].number = 2;
levelunits[4][1].number = 2;
levelunits[4][2].number = 3;
levelunits[4][3].number = 1;
levelunits[4][4].number = 3;
levelunits[4][5].number = 3;
levelunits[4][6].number = 2;
levelunits[5][1].number = 1;
levelunits[5][2].number = 1;
levelunits[5][3].number = 1;
levelunits[5][4].number = 4;
levelunits[5][5].number = 2;
levelunits[5][6].number = 3;
levelunits[6][1].number = 0;
levelunits[6][2].number = 1;
levelunits[6][3].number = 3;
levelunits[6][4].number = 3;
levelunits[6][5].number = 4;
levelunits[6][6].number = 0;
};
if (level == 55){
levelunits[1][1].number = 2;
levelunits[1][2].number = 1;
levelunits[1][3].number = 3;
levelunits[1][4].number = 2;
levelunits[1][5].number = 4;
levelunits[1][6].number = 3;
levelunits[2][1].number = 1;
levelunits[2][2].number = 5;
levelunits[2][3].number = 2;
levelunits[2][4].number = 5;
levelunits[2][5].number = 3;
levelunits[2][6].number = 5;
levelunits[3][1].number = 5;
levelunits[3][2].number = 3;
levelunits[3][3].number = 7;
levelunits[3][4].number = 3;
levelunits[3][5].number = 6;
levelunits[3][6].number = 4;
levelunits[4][1].number = 2;
levelunits[4][2].number = 7;
levelunits[4][3].number = 2;
levelunits[4][4].number = 6;
levelunits[4][5].number = 2;
levelunits[4][6].number = 4;
levelunits[5][1].number = 4;
levelunits[5][2].number = 2;
levelunits[5][3].number = 5;
levelunits[5][4].number = 2;
levelunits[5][5].number = 4;
levelunits[5][6].number = 2;
levelunits[6][1].number = 0;
levelunits[6][2].number = 2;
levelunits[6][3].number = 0;
levelunits[6][4].number = 3;
levelunits[6][5].number = 2;
levelunits[6][6].number = 2;
};
if (level == 56){
levelunits[1][1].number = 1;
levelunits[1][2].number = 1;
levelunits[1][3].number = 1;
levelunits[1][4].number = 1;
levelunits[1][5].number = 2;
levelunits[1][6].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 4;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 4;
levelunits[2][6].number = 3;
levelunits[3][1].number = 4;
levelunits[3][2].number = 5;
levelunits[3][3].number = 5;
levelunits[3][4].number = 3;
levelunits[3][5].number = 3;
levelunits[3][6].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 5;
levelunits[4][3].number = 1;
levelunits[4][4].number = 1;
levelunits[4][5].number = 3;
levelunits[4][6].number = 2;
levelunits[5][1].number = 4;
levelunits[5][2].number = 4;
levelunits[5][3].number = 4;
levelunits[5][4].number = 1;
levelunits[5][5].number = 1;
levelunits[5][6].number = 2;
levelunits[6][1].number = 2;
levelunits[6][2].number = 4;
levelunits[6][3].number = 3;
levelunits[6][4].number = 3;
levelunits[6][5].number = 2;
levelunits[6][6].number = 1;
};
if (level == 58){
levelunits[1][1].number = 1;
levelunits[1][2].number = 2;
levelunits[1][3].number = 2;
levelunits[1][4].number = 1;
levelunits[1][5].number = 3;
levelunits[1][6].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[2][4].number = 2;
levelunits[2][5].number = 2;
levelunits[2][6].number = 4;
levelunits[3][1].number = 1;
levelunits[3][2].number = 3;
levelunits[3][3].number = 1;
levelunits[3][4].number = 1;
levelunits[3][5].number = 2;
levelunits[3][6].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 1;
levelunits[4][3].number = 3;
levelunits[4][4].number = 2;
levelunits[4][5].number = 2;
levelunits[4][6].number = 2;
levelunits[5][1].number = 4;
levelunits[5][2].number = 7;
levelunits[5][3].number = 5;
levelunits[5][4].number = 5;
levelunits[5][5].number = 4;
levelunits[5][6].number = 2;
levelunits[6][1].number = 5;
levelunits[6][2].number = 4;
levelunits[6][3].number = 4;
levelunits[6][4].number = 3;
levelunits[6][5].number = 2;
levelunits[6][6].number = 1;
};
if (level == 57){
levelunits[1][1].number = 1;
levelunits[1][2].number = 5;
levelunits[1][3].number = 2;
levelunits[1][4].number = 4;
levelunits[1][5].number = 3;
levelunits[1][6].number = 3;
levelunits[2][1].number = 4;
levelunits[2][2].number = 3;
levelunits[2][3].number = 6;
levelunits[2][4].number = 2;
levelunits[2][5].number = 5;
levelunits[2][6].number = 4;
levelunits[3][1].number = 2;
levelunits[3][2].number = 5;
levelunits[3][3].number = 2;
levelunits[3][4].number = 4;
levelunits[3][5].number = 4;
levelunits[3][6].number = 4;
levelunits[4][1].number = 1;
levelunits[4][2].number = 4;
levelunits[4][3].number = 2;
levelunits[4][4].number = 3;
levelunits[4][5].number = 5;
levelunits[4][6].number = 4;
levelunits[5][1].number = 4;
levelunits[5][2].number = 3;
levelunits[5][3].number = 6;
levelunits[5][4].number = 3;
levelunits[5][5].number = 5;
levelunits[5][6].number = 3;
levelunits[6][1].number = 1;
levelunits[6][2].number = 6;
levelunits[6][3].number = 2;
levelunits[6][4].number = 4;
levelunits[6][5].number = 2;
levelunits[6][6].number = 2;
};
if (level == 59){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[1][6].number = 3;
levelunits[2][1].number = 2;
levelunits[2][2].number = 3;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 5;
levelunits[2][6].number = 3;
levelunits[3][1].number = 1;
levelunits[3][2].number = 4;
levelunits[3][3].number = 3;
levelunits[3][4].number = 3;
levelunits[3][5].number = 3;
levelunits[3][6].number = 3;
levelunits[4][1].number = 2;
levelunits[4][2].number = 3;
levelunits[4][3].number = 3;
levelunits[4][4].number = 5;
levelunits[4][5].number = 2;
levelunits[4][6].number = 3;
levelunits[5][1].number = 2;
levelunits[5][2].number = 2;
levelunits[5][3].number = 5;
levelunits[5][4].number = 2;
levelunits[5][5].number = 5;
levelunits[5][6].number = 3;
levelunits[6][1].number = 1;
levelunits[6][2].number = 3;
levelunits[6][3].number = 1;
levelunits[6][4].number = 4;
levelunits[6][5].number = 2;
levelunits[6][6].number = 3;
};
if (level == 60){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 3;
levelunits[1][5].number = 3;
levelunits[1][6].number = 4;
levelunits[2][1].number = 3;
levelunits[2][2].number = 4;
levelunits[2][3].number = 3;
levelunits[2][4].number = 4;
levelunits[2][5].number = 6;
levelunits[2][6].number = 3;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 4;
levelunits[3][4].number = 3;
levelunits[3][5].number = 4;
levelunits[3][6].number = 4;
levelunits[4][1].number = 3;
levelunits[4][2].number = 2;
levelunits[4][3].number = 2;
levelunits[4][4].number = 5;
levelunits[4][5].number = 2;
levelunits[4][6].number = 2;
levelunits[5][1].number = 2;
levelunits[5][2].number = 4;
levelunits[5][3].number = 4;
levelunits[5][4].number = 2;
levelunits[5][5].number = 4;
levelunits[5][6].number = 3;
levelunits[6][1].number = 4;
levelunits[6][2].number = 4;
levelunits[6][3].number = 3;
levelunits[6][4].number = 4;
levelunits[6][5].number = 2;
levelunits[6][6].number = 3;
};
if (level == 61){
levelunits[1][1].number = 0;
levelunits[1][2].number = 2;
levelunits[1][3].number = 0;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[1][6].number = 2;
levelunits[2][1].number = 2;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[2][4].number = 0;
levelunits[2][5].number = 2;
levelunits[2][6].number = 2;
levelunits[3][1].number = 0;
levelunits[3][2].number = 2;
levelunits[3][3].number = 0;
levelunits[3][4].number = 0;
levelunits[3][5].number = 2;
levelunits[3][6].number = 4;
levelunits[4][1].number = 0;
levelunits[4][2].number = 2;
levelunits[4][3].number = 0;
levelunits[4][4].number = 0;
levelunits[4][5].number = 2;
levelunits[4][6].number = 4;
levelunits[5][1].number = 2;
levelunits[5][2].number = 2;
levelunits[5][3].number = 2;
levelunits[5][4].number = 0;
levelunits[5][5].number = 2;
levelunits[5][6].number = 2;
levelunits[6][1].number = 0;
levelunits[6][2].number = 2;
levelunits[6][3].number = 0;
levelunits[6][4].number = 2;
levelunits[6][5].number = 2;
levelunits[6][6].number = 2;
};
if (level == 62){
levelunits[1][1].number = 1;
levelunits[1][2].number = 4;
levelunits[1][3].number = 2;
levelunits[1][4].number = 3;
levelunits[1][5].number = 5;
levelunits[1][6].number = 3;
levelunits[1][7].number = 4;
levelunits[2][1].number = 5;
levelunits[2][2].number = 2;
levelunits[2][3].number = 5;
levelunits[2][4].number = 4;
levelunits[2][5].number = 3;
levelunits[2][6].number = 5;
levelunits[2][7].number = 4;
levelunits[3][1].number = 2;
levelunits[3][2].number = 6;
levelunits[3][3].number = 2;
levelunits[3][4].number = 2;
levelunits[3][5].number = 4;
levelunits[3][6].number = 2;
levelunits[3][7].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 3;
levelunits[4][3].number = 4;
levelunits[4][4].number = 3;
levelunits[4][5].number = 3;
levelunits[4][6].number = 2;
levelunits[4][7].number = 4;
levelunits[5][1].number = 3;
levelunits[5][2].number = 3;
levelunits[5][3].number = 3;
levelunits[5][4].number = 3;
levelunits[5][5].number = 4;
levelunits[5][6].number = 3;
levelunits[5][7].number = 3;
levelunits[6][1].number = 2;
levelunits[6][2].number = 4;
levelunits[6][3].number = 3;
levelunits[6][4].number = 2;
levelunits[6][5].number = 3;
levelunits[6][6].number = 4;
levelunits[6][7].number = 3;
levelunits[7][1].number = 3;
levelunits[7][2].number = 2;
levelunits[7][3].number = 2;
levelunits[7][4].number = 2;
levelunits[7][5].number = 3;
levelunits[7][6].number = 2;
levelunits[7][7].number = 3;
};
if (level == 63){
levelunits[1][1].number = 3;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 4;
levelunits[1][5].number = 3;
levelunits[1][6].number = 4;
levelunits[1][7].number = 5;
levelunits[2][1].number = 2;
levelunits[2][2].number = 5;
levelunits[2][3].number = 4;
levelunits[2][4].number = 3;
levelunits[2][5].number = 4;
levelunits[2][6].number = 5;
levelunits[2][7].number = 3;
levelunits[3][1].number = 3;
levelunits[3][2].number = 2;
levelunits[3][3].number = 3;
levelunits[3][4].number = 5;
levelunits[3][5].number = 2;
levelunits[3][6].number = 2;
levelunits[3][7].number = 5;
levelunits[4][1].number = 3;
levelunits[4][2].number = 2;
levelunits[4][3].number = 4;
levelunits[4][4].number = 2;
levelunits[4][5].number = 4;
levelunits[4][6].number = 4;
levelunits[4][7].number = 2;
levelunits[5][1].number = 3;
levelunits[5][2].number = 5;
levelunits[5][3].number = 2;
levelunits[5][4].number = 6;
levelunits[5][5].number = 3;
levelunits[5][6].number = 3;
levelunits[5][7].number = 4;
levelunits[6][1].number = 3;
levelunits[6][2].number = 2;
levelunits[6][3].number = 4;
levelunits[6][4].number = 3;
levelunits[6][5].number = 5;
levelunits[6][6].number = 5;
levelunits[6][7].number = 3;
levelunits[7][1].number = 2;
levelunits[7][2].number = 3;
levelunits[7][3].number = 4;
levelunits[7][4].number = 4;
levelunits[7][5].number = 4;
levelunits[7][6].number = 4;
levelunits[7][7].number = 3;
};
if (level == 64){
levelunits[1][1].number = 2;
levelunits[1][2].number = 4;
levelunits[1][3].number = 3;
levelunits[1][4].number = 3;
levelunits[1][5].number = 4;
levelunits[1][6].number = 4;
levelunits[1][7].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 4;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 3;
levelunits[2][6].number = 5;
levelunits[2][7].number = 4;
levelunits[3][1].number = 4;
levelunits[3][2].number = 5;
levelunits[3][3].number = 5;
levelunits[3][4].number = 3;
levelunits[3][5].number = 4;
levelunits[3][6].number = 4;
levelunits[3][7].number = 4;
levelunits[4][1].number = 2;
levelunits[4][2].number = 6;
levelunits[4][3].number = 3;
levelunits[4][4].number = 4;
levelunits[4][5].number = 5;
levelunits[4][6].number = 4;
levelunits[4][7].number = 5;
levelunits[5][1].number = 4;
levelunits[5][2].number = 2;
levelunits[5][3].number = 4;
levelunits[5][4].number = 4;
levelunits[5][5].number = 3;
levelunits[5][6].number = 7;
levelunits[5][7].number = 3;
levelunits[6][1].number = 2;
levelunits[6][2].number = 5;
levelunits[6][3].number = 3;
levelunits[6][4].number = 3;
levelunits[6][5].number = 5;
levelunits[6][6].number = 3;
levelunits[6][7].number = 5;
levelunits[7][1].number = 3;
levelunits[7][2].number = 3;
levelunits[7][3].number = 4;
levelunits[7][4].number = 3;
levelunits[7][5].number = 2;
levelunits[7][6].number = 4;
levelunits[7][7].number = 2;
};
if (level == 65){
levelunits[1][1].number = 4;
levelunits[1][2].number = 4;
levelunits[1][3].number = 5;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[1][6].number = 5;
levelunits[1][7].number = 2;
levelunits[1][8].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 7;
levelunits[2][3].number = 4;
levelunits[2][4].number = 3;
levelunits[2][5].number = 4;
levelunits[2][6].number = 3;
levelunits[2][7].number = 7;
levelunits[2][8].number = 2;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 3;
levelunits[3][4].number = 2;
levelunits[3][5].number = 4;
levelunits[3][6].number = 5;
levelunits[3][7].number = 2;
levelunits[3][8].number = 5;
levelunits[4][1].number = 3;
levelunits[4][2].number = 2;
levelunits[4][3].number = 3;
levelunits[4][4].number = 4;
levelunits[4][5].number = 3;
levelunits[4][6].number = 3;
levelunits[4][7].number = 4;
levelunits[4][8].number = 2;
levelunits[5][1].number = 1;
levelunits[5][2].number = 5;
levelunits[5][3].number = 2;
levelunits[5][4].number = 3;
levelunits[5][5].number = 6;
levelunits[5][6].number = 2;
levelunits[5][7].number = 5;
levelunits[5][8].number = 3;
levelunits[6][1].number = 3;
levelunits[6][2].number = 1;
levelunits[6][3].number = 5;
levelunits[6][4].number = 4;
levelunits[6][5].number = 3;
levelunits[6][6].number = 7;
levelunits[6][7].number = 3;
levelunits[6][8].number = 5;
levelunits[7][1].number = 2;
levelunits[7][2].number = 4;
levelunits[7][3].number = 3;
levelunits[7][4].number = 3;
levelunits[7][5].number = 6;
levelunits[7][6].number = 2;
levelunits[7][7].number = 8;
levelunits[7][8].number = 3;
levelunits[8][1].number = 2;
levelunits[8][2].number = 2;
levelunits[8][3].number = 3;
levelunits[8][4].number = 3;
levelunits[8][5].number = 2;
levelunits[8][6].number = 6;
levelunits[8][7].number = 3;
levelunits[8][8].number = 5;
};
if (level == 66){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 3;
levelunits[1][4].number = 6;
levelunits[1][5].number = 3;
levelunits[1][6].number = 6;
levelunits[1][7].number = 4;
levelunits[1][8].number = 5;
levelunits[2][1].number = 3;
levelunits[2][2].number = 3;
levelunits[2][3].number = 5;
levelunits[2][4].number = 3;
levelunits[2][5].number = 6;
levelunits[2][6].number = 3;
levelunits[2][7].number = 6;
levelunits[2][8].number = 3;
levelunits[3][1].number = 2;
levelunits[3][2].number = 2;
levelunits[3][3].number = 2;
levelunits[3][4].number = 4;
levelunits[3][5].number = 2;
levelunits[3][6].number = 3;
levelunits[3][7].number = 2;
levelunits[3][8].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 3;
levelunits[4][3].number = 4;
levelunits[4][4].number = 5;
levelunits[4][5].number = 3;
levelunits[4][6].number = 3;
levelunits[4][7].number = 3;
levelunits[4][8].number = 5;
levelunits[5][1].number = 2;
levelunits[5][2].number = 4;
levelunits[5][3].number = 4;
levelunits[5][4].number = 3;
levelunits[5][5].number = 3;
levelunits[5][6].number = 2;
levelunits[5][7].number = 5;
levelunits[5][8].number = 3;
levelunits[6][1].number = 4;
levelunits[6][2].number = 3;
levelunits[6][3].number = 5;
levelunits[6][4].number = 4;
levelunits[6][5].number = 5;
levelunits[6][6].number = 4;
levelunits[6][7].number = 5;
levelunits[6][8].number = 3;
levelunits[7][1].number = 3;
levelunits[7][2].number = 5;
levelunits[7][3].number = 4;
levelunits[7][4].number = 5;
levelunits[7][5].number = 3;
levelunits[7][6].number = 5;
levelunits[7][7].number = 4;
levelunits[7][8].number = 3;
levelunits[8][1].number = 2;
levelunits[8][2].number = 2;
levelunits[8][3].number = 3;
levelunits[8][4].number = 2;
levelunits[8][5].number = 3;
levelunits[8][6].number = 2;
levelunits[8][7].number = 4;
levelunits[8][8].number = 2;
};
if (level == 67){
levelunits[1][1].number = 4;
levelunits[1][2].number = 5;
levelunits[1][3].number = 5;
levelunits[1][4].number = 4;
levelunits[1][5].number = 3;
levelunits[1][6].number = 3;
levelunits[1][7].number = 5;
levelunits[1][8].number = 3;
levelunits[2][1].number = 2;
levelunits[2][2].number = 5;
levelunits[2][3].number = 4;
levelunits[2][4].number = 2;
levelunits[2][5].number = 3;
levelunits[2][6].number = 4;
levelunits[2][7].number = 4;
levelunits[2][8].number = 4;
levelunits[3][1].number = 4;
levelunits[3][2].number = 4;
levelunits[3][3].number = 4;
levelunits[3][4].number = 5;
levelunits[3][5].number = 4;
levelunits[3][6].number = 5;
levelunits[3][7].number = 5;
levelunits[3][8].number = 4;
levelunits[4][1].number = 3;
levelunits[4][2].number = 6;
levelunits[4][3].number = 4;
levelunits[4][4].number = 4;
levelunits[4][5].number = 6;
levelunits[4][6].number = 4;
levelunits[4][7].number = 5;
levelunits[4][8].number = 4;
levelunits[5][1].number = 3;
levelunits[5][2].number = 3;
levelunits[5][3].number = 4;
levelunits[5][4].number = 3;
levelunits[5][5].number = 4;
levelunits[5][6].number = 4;
levelunits[5][7].number = 3;
levelunits[5][8].number = 4;
levelunits[6][1].number = 2;
levelunits[6][2].number = 4;
levelunits[6][3].number = 3;
levelunits[6][4].number = 3;
levelunits[6][5].number = 4;
levelunits[6][6].number = 3;
levelunits[6][7].number = 5;
levelunits[6][8].number = 3;
levelunits[7][1].number = 3;
levelunits[7][2].number = 5;
levelunits[7][3].number = 6;
levelunits[7][4].number = 3;
levelunits[7][5].number = 4;
levelunits[7][6].number = 6;
levelunits[7][7].number = 4;
levelunits[7][8].number = 5;
levelunits[8][1].number = 1;
levelunits[8][2].number = 3;
levelunits[8][3].number = 3;
levelunits[8][4].number = 2;
levelunits[8][5].number = 3;
levelunits[8][6].number = 3;
levelunits[8][7].number = 4;
levelunits[8][8].number = 2;
};
if (level == 68){
levelunits[1][1].number = 2;
levelunits[1][2].number = 3;
levelunits[1][3].number = 2;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[1][6].number = 2;
levelunits[1][7].number = 3;
levelunits[1][8].number = 3;
levelunits[1][9].number = 2;
levelunits[2][1].number = 3;
levelunits[2][2].number = 2;
levelunits[2][3].number = 3;
levelunits[2][4].number = 2;
levelunits[2][5].number = 3;
levelunits[2][6].number = 3;
levelunits[2][7].number = 3;
levelunits[2][8].number = 3;
levelunits[2][9].number = 3;
levelunits[3][1].number = 2;
levelunits[3][2].number = 3;
levelunits[3][3].number = 2;
levelunits[3][4].number = 3;
levelunits[3][5].number = 3;
levelunits[3][6].number = 2;
levelunits[3][7].number = 2;
levelunits[3][8].number = 2;
levelunits[3][9].number = 3;
levelunits[4][1].number = 3;
levelunits[4][2].number = 2;
levelunits[4][3].number = 3;
levelunits[4][4].number = 3;
levelunits[4][5].number = 3;
levelunits[4][6].number = 3;
levelunits[4][7].number = 3;
levelunits[4][8].number = 3;
levelunits[4][9].number = 3;
levelunits[5][1].number = 2;
levelunits[5][2].number = 3;
levelunits[5][3].number = 2;
levelunits[5][4].number = 2;
levelunits[5][5].number = 2;
levelunits[5][6].number = 3;
levelunits[5][7].number = 3;
levelunits[5][8].number = 2;
levelunits[5][9].number = 3;
levelunits[6][1].number = 3;
levelunits[6][2].number = 2;
levelunits[6][3].number = 3;
levelunits[6][4].number = 2;
levelunits[6][5].number = 2;
levelunits[6][6].number = 2;
levelunits[6][7].number = 3;
levelunits[6][8].number = 2;
levelunits[6][9].number = 2;
levelunits[7][1].number = 2;
levelunits[7][2].number = 3;
levelunits[7][3].number = 3;
levelunits[7][4].number = 2;
levelunits[7][5].number = 3;
levelunits[7][6].number = 2;
levelunits[7][7].number = 3;
levelunits[7][8].number = 2;
levelunits[7][9].number = 3;
levelunits[8][1].number = 3;
levelunits[8][2].number = 2;
levelunits[8][3].number = 2;
levelunits[8][4].number = 3;
levelunits[8][5].number = 2;
levelunits[8][6].number = 3;
levelunits[8][7].number = 2;
levelunits[8][8].number = 2;
levelunits[8][9].number = 3;
levelunits[9][1].number = 2;
levelunits[9][2].number = 3;
levelunits[9][3].number = 2;
levelunits[9][4].number = 2;
levelunits[9][5].number = 2;
levelunits[9][6].number = 2;
levelunits[9][7].number = 2;
levelunits[9][8].number = 3;
levelunits[9][9].number = 2;
};
if (level == 69){
levelunits[1][1].number = 3;
levelunits[1][2].number = 2;
levelunits[1][3].number = 3;
levelunits[1][4].number = 2;
levelunits[1][5].number = 2;
levelunits[1][6].number = 4;
levelunits[1][7].number = 3;
levelunits[1][8].number = 3;
levelunits[1][9].number = 3;
levelunits[2][1].number = 3;
levelunits[2][2].number = 6;
levelunits[2][3].number = 3;
levelunits[2][4].number = 3;
levelunits[2][5].number = 4;
levelunits[2][6].number = 2;
levelunits[2][7].number = 4;
levelunits[2][8].number = 4;
levelunits[2][9].number = 2;
levelunits[3][1].number = 4;
levelunits[3][2].number = 4;
levelunits[3][3].number = 5;
levelunits[3][4].number = 4;
levelunits[3][5].number = 3;
levelunits[3][6].number = 5;
levelunits[3][7].number = 3;
levelunits[3][8].number = 4;
levelunits[3][9].number = 4;
levelunits[4][1].number = 2;
levelunits[4][2].number = 5;
levelunits[4][3].number = 4;
levelunits[4][4].number = 5;
levelunits[4][5].number = 5;
levelunits[4][6].number = 4;
levelunits[4][7].number = 5;
levelunits[4][8].number = 4;
levelunits[4][9].number = 5;
levelunits[5][1].number = 3;
levelunits[5][2].number = 3;
levelunits[5][3].number = 4;
levelunits[5][4].number = 3;
levelunits[5][5].number = 4;
levelunits[5][6].number = 4;
levelunits[5][7].number = 3;
levelunits[5][8].number = 5;
levelunits[5][9].number = 3;
levelunits[6][1].number = 2;
levelunits[6][2].number = 5;
levelunits[6][3].number = 2;
levelunits[6][4].number = 2;
levelunits[6][5].number = 3;
levelunits[6][6].number = 2;
levelunits[6][7].number = 2;
levelunits[6][8].number = 3;
levelunits[6][9].number = 3;
levelunits[7][1].number = 3;
levelunits[7][2].number = 2;
levelunits[7][3].number = 3;
levelunits[7][4].number = 2;
levelunits[7][5].number = 3;
levelunits[7][6].number = 3;
levelunits[7][7].number = 4;
levelunits[7][8].number = 3;
levelunits[7][9].number = 3;
levelunits[8][1].number = 3;
levelunits[8][2].number = 3;
levelunits[8][3].number = 3;
levelunits[8][4].number = 1;
levelunits[8][5].number = 4;
levelunits[8][6].number = 2;
levelunits[8][7].number = 3;
levelunits[8][8].number = 4;
levelunits[8][9].number = 3;
levelunits[9][1].number = 3;
levelunits[9][2].number = 4;
levelunits[9][3].number = 3;
levelunits[9][4].number = 4;
levelunits[9][5].number = 2;
levelunits[9][6].number = 4;
levelunits[9][7].number = 3;
levelunits[9][8].number = 4;
levelunits[9][9].number = 3;
};
if (level == 70){
levelunits[1][1].number = 0;
levelunits[1][2].number = 2;
levelunits[1][3].number = 0;
levelunits[1][4].number = 0;
levelunits[1][5].number = 2;
levelunits[1][6].number = 2;
levelunits[1][7].number = 4;
levelunits[1][8].number = 0;
levelunits[1][9].number = 0;
levelunits[2][1].number = 2;
levelunits[2][2].number = 2;
levelunits[2][3].number = 2;
levelunits[2][4].number = 0;
levelunits[2][5].number = 0;
levelunits[2][6].number = 4;
levelunits[2][7].number = 2;
levelunits[2][8].number = 4;
levelunits[2][9].number = 0;
levelunits[3][1].number = 0;
levelunits[3][2].number = 2;
levelunits[3][3].number = 0;
levelunits[3][4].number = 0;
levelunits[3][5].number = 0;
levelunits[3][6].number = 0;
levelunits[3][7].number = 4;
levelunits[3][8].number = 4;
levelunits[3][9].number = 3;
levelunits[4][1].number = 0;
levelunits[4][2].number = 0;
levelunits[4][3].number = 0;
levelunits[4][4].number = 2;
levelunits[4][5].number = 0;
levelunits[4][6].number = 0;
levelunits[4][7].number = 2;
levelunits[4][8].number = 7;
levelunits[4][9].number = 5;
levelunits[5][1].number = 0;
levelunits[5][2].number = 0;
levelunits[5][3].number = 2;
levelunits[5][4].number = 2;
levelunits[5][5].number = 2;
levelunits[5][6].number = 0;
levelunits[5][7].number = 2;
levelunits[5][8].number = 8;
levelunits[5][9].number = 6;
levelunits[6][1].number = 0;
levelunits[6][2].number = 0;
levelunits[6][3].number = 0;
levelunits[6][4].number = 2;
levelunits[6][5].number = 0;
levelunits[6][6].number = 0;
levelunits[6][7].number = 2;
levelunits[6][8].number = 7;
levelunits[6][9].number = 5;
levelunits[7][1].number = 0;
levelunits[7][2].number = 2;
levelunits[7][3].number = 0;
levelunits[7][4].number = 0;
levelunits[7][5].number = 0;
levelunits[7][6].number = 0;
levelunits[7][7].number = 4;
levelunits[7][8].number = 4;
levelunits[7][9].number = 3;
levelunits[8][1].number = 2;
levelunits[8][2].number = 2;
levelunits[8][3].number = 2;
levelunits[8][4].number = 0;
levelunits[8][5].number = 0;
levelunits[8][6].number = 4;
levelunits[8][7].number = 2;
levelunits[8][8].number = 4;
levelunits[8][9].number = 0;
levelunits[9][1].number = 0;
levelunits[9][2].number = 2;
levelunits[9][3].number = 0;
levelunits[9][4].number = 0;
levelunits[9][5].number = 2;
levelunits[9][6].number = 2;
levelunits[9][7].number = 4;
levelunits[9][8].number = 0;
levelunits[9][9].number = 0;
};
pushLevelUnits();
}
private function pushLevelUnits():void{
var _local1:int;
var _local2:int;
reference = new Array();
_local1 = 1;
while (_local1 <= cols) {
_local2 = 1;
while (_local2 <= rows) {
reference.push(levelunits[_local1][_local2].number);
levelunits[_local1][_local2].numberText.text = levelunits[_local1][_local2].number;
updateGraphic(levelunits[_local1][_local2]);
_local2++;
};
_local1++;
};
}
public function getLevel():int{
return (level);
}
public function newLevel(_arg1:int){
this.level = _arg1;
setupLevel();
}
public function getReference():Array{
return (reference);
}
private function disableAllGraphics(_arg1:MovieClip):void{
_arg1.still_water.visible = false;
_arg1.still_island.visible = false;
_arg1.still_desert.visible = false;
_arg1.still_grass.visible = false;
_arg1.still_ground.visible = false;
_arg1.still_forest.visible = false;
_arg1.still_hill.visible = false;
_arg1.still_mountain.visible = false;
_arg1.still_volcano.visible = false;
_arg1.still_lake.visible = false;
}
private function updateGraphic(_arg1:MovieClip):void{
disableAllGraphics(_arg1);
switch (_arg1.number){
case 0:
_arg1.still_water.visible = true;
break;
case 1:
_arg1.still_island.visible = true;
break;
case 2:
_arg1.still_desert.visible = true;
break;
case 4:
_arg1.still_grass.visible = true;
break;
case 3:
_arg1.still_ground.visible = true;
break;
case 5:
_arg1.still_forest.visible = true;
break;
case 6:
_arg1.still_hill.visible = true;
break;
case 7:
_arg1.still_mountain.visible = true;
break;
case 8:
_arg1.still_volcano.visible = true;
break;
case 9:
_arg1.still_lake.visible = true;
break;
};
}
public function getSolution():Array{
return (solution);
}
public function randomize():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
clearLevelUnits();
solution = new Array();
_local1 = 1;
while (_local1 <= Math.pow(cols, 1.7)) {
_local2 = Math.floor(((Math.random() * rows) + 1));
_local3 = Math.floor(((Math.random() * cols) + 1));
levelunit = levelunits[_local2][_local3];
solution.push(((levelunit.c * 10) + levelunit.r));
adjacentLevelUnits = new Array();
adjacentLevelUnits.push(levelunit);
if (levelunit.r < rows){
adjacentLevelUnits.push(levelunits[levelunit.c][(levelunit.r + 1)]);
};
if (levelunit.r > 1){
adjacentLevelUnits.push(levelunits[levelunit.c][(levelunit.r - 1)]);
};
if (levelunit.c < cols){
adjacentLevelUnits.push(levelunits[(levelunit.c + 1)][levelunit.r]);
};
if (levelunit.c > 1){
adjacentLevelUnits.push(levelunits[(levelunit.c - 1)][levelunit.r]);
};
_local4 = 0;
while (_local4 < adjacentLevelUnits.length) {
increaseCount(adjacentLevelUnits[_local4]);
_local4++;
};
_local1++;
};
}
private function increaseCount(_arg1:MovieClip):void{
_arg1.number++;
pushLevelUnits();
}
private function clearLevelUnits():void{
var _local1:int;
var _local2:int;
_local1 = 1;
while (_local1 <= cols) {
_local2 = 1;
while (_local2 <= rows) {
levelunits[_local1][_local2].number = 0;
_local2++;
};
_local1++;
};
}
}
}//package
Section 55
//LevelSelect (LevelSelect)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import fl.transitions.*;
import flash.utils.*;
import flash.text.*;
import flash.filters.*;
public class LevelSelect extends MovieClip {
private var clickingnoise:clicking;
private var fixx:Tween;
private var fixy:Tween;
private var zoomx:Tween;
private var removeunits:Array;
private var zoomy:Tween;
private var units:Array;
private var cols:int;
private var rows:int;
private var unit:MovieClip;
public function LevelSelect(_arg1:int){
var _local4:int;
var _local5:*;
super();
clickingnoise = new clicking();
var _local2:BlurFilter = new BlurFilter();
_local2.blurX = 3;
_local2.blurY = 3;
_local2.quality = BitmapFilterQuality.MEDIUM;
rows = _arg1;
cols = _arg1;
units = new Array();
var _local3 = 1;
while (_local3 <= cols) {
units[_local3] = new Array();
_local4 = 1;
while (_local4 <= rows) {
_local5 = new Map();
_local5.number = (((_local4 - 1) * 6) + _local3);
_local5.sideLength = (Mainee.HEIGHT / rows);
_local5.scaleX = (((Mainee.WIDTH - 150) / cols) / _local5.width);
_local5.scaleY = ((Mainee.HEIGHT / rows) / _local5.height);
_local5.c = _local3;
_local5.r = _local4;
_local5.x = ((_local3 - 1) * _local5.sideLength);
_local5.y = ((_local4 - 1) * _local5.sideLength);
addChild(_local5);
units[_local3][_local4] = _local5;
_local5.lvl1.visible = false;
if (_local5.number <= Mainee.mainee.maxlevel){
units[_local3][_local4].addEventListener(MouseEvent.CLICK, clickListener);
};
if (_local5.number > Mainee.mainee.maxlevel){
_local5.filters = [_local2];
};
initializeGraphics(_local5);
_local5.numberText.text = _local5.number;
_local5.buttonMode = true;
_local5.useHandCursor = true;
_local4++;
};
_local3++;
};
}
public function removeAllGraphics(_arg1:MovieClip){
_arg1.lvl1.visible = false;
_arg1.lvl2.visible = false;
_arg1.lvl3.visible = false;
_arg1.lvl4.visible = false;
_arg1.lvl5.visible = false;
_arg1.lvl6.visible = false;
_arg1.lvl7.visible = false;
_arg1.lvl8.visible = false;
_arg1.lvl9.visible = false;
_arg1.lvl10.visible = false;
_arg1.lvl11.visible = false;
_arg1.lvl12.visible = false;
_arg1.lvl13.visible = false;
_arg1.lvl14.visible = false;
_arg1.lvl15.visible = false;
_arg1.lvl16.visible = false;
_arg1.lvl17.visible = false;
_arg1.lvl18.visible = false;
_arg1.lvl19.visible = false;
_arg1.lvl20.visible = false;
_arg1.lvl21.visible = false;
_arg1.lvl22.visible = false;
_arg1.lvl23.visible = false;
_arg1.lvl24.visible = false;
_arg1.lvl25.visible = false;
_arg1.lvl26.visible = false;
_arg1.lvl27.visible = false;
_arg1.lvl28.visible = false;
_arg1.lvl29.visible = false;
_arg1.lvl30.visible = false;
_arg1.lvl31.visible = false;
_arg1.lvl32.visible = false;
_arg1.lvl33.visible = false;
_arg1.lvl34.visible = false;
_arg1.lvl35.visible = false;
_arg1.lvl36.visible = false;
_arg1.still_water.visible = false;
}
public function finish(){
Mainee.mainee.curlevel = unit.number;
var _local1:* = Mainee.mainee.getGridSize();
Mainee.mainee.newLevelGrid(_local1);
Mainee.mainee.newGrid(_local1);
Mainee.mainee.removeLevelSelect();
}
public function clickListener(_arg1:MouseEvent):void{
var _local3:int;
var _local4:*;
unit = (_arg1.target.parent as MovieClip);
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
finish();
removeunits = new Array();
var _local2 = 1;
while (_local2 <= cols) {
removeunits[_local2] = new Array();
_local3 = 1;
while (_local3 <= rows) {
_local4 = units[_local2][_local3];
if (((unit.c * 10) + unit.r) != ((_local4.c * 10) + _local4.r)){
removeChild(_local4);
};
_local3++;
};
_local2++;
};
}
public function initializeGraphics(_arg1:MovieClip){
removeAllGraphics(_arg1);
if (_arg1.number < Mainee.mainee.maxlevel){
switch (_arg1.number){
case 1:
_arg1.lvl1.visible = true;
break;
case 2:
_arg1.lvl2.visible = true;
break;
case 3:
_arg1.lvl3.visible = true;
break;
case 4:
_arg1.lvl4.visible = true;
break;
case 5:
_arg1.lvl5.visible = true;
break;
case 6:
_arg1.lvl6.visible = true;
break;
case 7:
_arg1.lvl7.visible = true;
break;
case 8:
_arg1.lvl8.visible = true;
break;
case 9:
_arg1.lvl9.visible = true;
break;
case 10:
_arg1.lvl10.visible = true;
break;
case 11:
_arg1.lvl11.visible = true;
break;
case 12:
_arg1.lvl12.visible = true;
break;
case 13:
_arg1.lvl13.visible = true;
break;
case 14:
_arg1.lvl14.visible = true;
break;
case 15:
_arg1.lvl15.visible = true;
break;
case 16:
_arg1.lvl16.visible = true;
break;
case 17:
_arg1.lvl17.visible = true;
break;
case 18:
_arg1.lvl18.visible = true;
break;
case 19:
_arg1.lvl19.visible = true;
break;
case 20:
_arg1.lvl20.visible = true;
break;
case 21:
_arg1.lvl21.visible = true;
break;
case 22:
_arg1.lvl22.visible = true;
break;
case 23:
_arg1.lvl23.visible = true;
break;
case 24:
_arg1.lvl24.visible = true;
break;
case 25:
_arg1.lvl25.visible = true;
break;
case 26:
_arg1.lvl26.visible = true;
break;
case 27:
_arg1.lvl27.visible = true;
break;
case 28:
_arg1.lvl28.visible = true;
break;
case 29:
_arg1.lvl29.visible = true;
break;
case 30:
_arg1.lvl30.visible = true;
break;
case 31:
_arg1.lvl31.visible = true;
break;
case 32:
_arg1.lvl32.visible = true;
break;
case 33:
_arg1.lvl33.visible = true;
break;
case 34:
_arg1.lvl34.visible = true;
break;
case 35:
_arg1.lvl35.visible = true;
break;
case 36:
_arg1.lvl36.visible = true;
break;
};
} else {
_arg1.still_water.visible = true;
};
}
}
}//package
Section 56
//levelUnit (levelUnit)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelUnit extends MovieClip {
public var still_water:MovieClip;
public var still_mountain:MovieClip;
public var still_ground:MovieClip;
public var still_lake:MovieClip;
public var still_desert:MovieClip;
public var bestTime:TextField;
public var still_forest:MovieClip;
public var numberText:TextField;
public var still_island:MovieClip;
public var still_grass:MovieClip;
public var still_volcano:MovieClip;
public var still_hill:MovieClip;
}
}//package
Section 57
//libGlow (libGlow)
package {
import flash.display.*;
public dynamic class libGlow extends MovieClip {
}
}//package
Section 58
//Mainee (Mainee)
package {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.*;
import com.midasplayer.*;
import com.midasplayer.particle.*;
import flash.utils.*;
import flash.media.*;
import flash.filters.*;
import flash.net.*;
public class Mainee extends MovieClip {
private var clickingnoise:clicking;
public var mcLoadLogoBg:MovieClip;
var maxTimeMin3:int;
public var bar:Sprite;
var maxTimeMin5:int;
var maxTimeMin6:int;
var expertlevelselect:ExpertLevelSelect;
var mute:Mute;
var maxTimeMin4:int;
var walkthru:Walkthru;
var scene1:Intro_1;
var scene3:Screen3;
var scene2:Screen2;
var tutSeen:Boolean;
var leveler:inText3;
var addButton:AddButton;
var randombool:Boolean;
var pausePosition:int;
var expert:Boolean;
public var curlevel:int;
public var bg:Sprite;
var grid:Grid;
var reset:Reset;
var menubutton:menuButton;
private var myGlow:GlowFilter;
var extremelevelselect:ExtremeLevelSelect;
var backSound:SoundChannel;
var rightarrow:RightArrow;
var leftarrow:LeftArrow;
var moreGames:MoreGames;
var save:SharedObject;
var randomselect:RandomSelect;
var backgroundSound:Sound;
var levelselect:LevelSelect;
var remove:Remove;
var tutBG1:TutBG1;
var credits:Credits;
var debug_txt;
public var maxlevel:int;
var instructionsMenu:InstructionsMenu;
var instructions:Instructions;
public var holder:Sprite;
public var particles:Main;
var levelbutton:levelButton;
public var game_name:String;
private var extreme:Boolean;
public var mcKingLoader:DragonLoader;
public var mochi:String;
var expertleveler:inText3;
var kinglogo:kingLogo;
var levelgrid:LevelGrid;
var ifMute:Boolean;
var kongregate:KongregateAPI;
var menubg:Menu_BG;
var maxTimeSec3:int;
var maxTimeSec4:int;
var maxTimeSec5:int;
var maxTimeSec6:int;
var creditsmenu:creditsMenu;
public static const WIDTH = 550;
public static const HEIGHT = 400;
public static var mainee;
public function Mainee(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
stop();
mainee = this;
save = SharedObject.getLocal("squareSave");
kongregate = new KongregateAPI();
this.addChild(kongregate);
var _local1:Object = LoaderInfo(root.loaderInfo).parameters;
var _local2:String = ((_local1.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
debug_txt.text = ("API path: " + _local2);
var _local3:URLRequest = new URLRequest(_local2);
var _local4:Loader = new Loader();
_local4.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_local4.load(_local3);
this.addChild(_local4);
}
private function instructionsSelect(_arg1:MouseEvent){
if (ifMute == false){
clickingnoise.play();
};
instructions.removeEventListener(MouseEvent.CLICK, instructionsSelect);
levelbutton.removeEventListener(MouseEvent.CLICK, startTheLevelGame);
credits.removeEventListener(MouseEvent.CLICK, creditsSelect);
addButton.removeEventListener(MouseEvent.CLICK, addGames);
moreGames.removeEventListener(MouseEvent.CLICK, moreGames2);
walkthru.removeEventListener(MouseEvent.CLICK, walkthrough);
removeChild(instructions);
removeChild(levelbutton);
removeChild(credits);
removeChild(addButton);
removeChild(walkthru);
removeChild(moreGames);
instructionsMenu = new InstructionsMenu();
instructionsMenu.x = 0;
instructionsMenu.y = 0;
addChild(instructionsMenu);
menubutton = new menuButton();
menubutton.buttonMode = true;
menubutton.x = 480;
menubutton.y = 350;
addChild(menubutton);
menubutton.addEventListener(MouseEvent.CLICK, returnToMenuFromInstructions);
}
public function newGrid(_arg1, _arg2=false):void{
grid = new Grid(_arg1, levelgrid, _arg2);
addChild(grid);
reset = new Reset();
walkthru = new Walkthru();
walkthru.x = 530;
walkthru.y = 385;
walkthru.scaleX = 0.75;
walkthru.scaleY = 0.75;
addChild(walkthru);
walkthru.addEventListener(MouseEvent.CLICK, walkthrough);
remove = new Remove();
menubutton = new menuButton();
reset.buttonMode = true;
walkthru.buttonMode = true;
reset.x = 500;
reset.y = 100;
remove.buttonMode = true;
remove.x = 500;
remove.y = 50;
menubutton.buttonMode = true;
menubutton.x = 500;
menubutton.y = 140;
addChild(reset);
addChild(remove);
addChild(menubutton);
remove.addEventListener(MouseEvent.CLICK, removes);
menubutton.addEventListener(MouseEvent.CLICK, returnToMenu);
reset.addEventListener(MouseEvent.CLICK, grid.reset);
}
public function preload(_arg1:Event):void{
bg = new Sprite();
bg.buttonMode = true;
bg.name = "clickBg";
bg.graphics.beginFill(0, 0);
bg.graphics.lineTo(stage.stageWidth, 0);
bg.graphics.lineTo(stage.stageWidth, stage.stageHeight);
bg.graphics.lineTo(0, stage.stageHeight);
bg.graphics.lineTo(0, 0);
bg.graphics.endFill();
bg.addEventListener(MouseEvent.CLICK, openKingPage);
this.addChildAt(bg, this.getChildIndex(mcLoadLogoBg));
mcLoadLogoBg.x = ((stage.stageWidth / 2) - (mcLoadLogoBg.width / 2));
mcLoadLogoBg.y = ((stage.stageHeight / 2) - (mcLoadLogoBg.height / 2));
bar = new Sprite();
bar.graphics.beginFill(0xFFFFFF, 0);
bar.x = (mcLoadLogoBg.x + 5);
bar.y = (mcLoadLogoBg.y + 34);
bar.graphics.drawRect(0, 0, 96, 5);
bar.graphics.endFill();
this.addChild(bar);
holder = new Sprite();
this.addChild(holder);
holder.x = bar.x;
holder.y = bar.y;
particles = new Main();
particles.setEmitterClip(holder);
this.addChild(particles);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function nextScene2(_arg1:Event){
scene1.removeEventListener("ANIMATION_COMPLETE", nextScene2);
removeChild(scene1);
scene2 = new Screen2();
scene2.addEventListener("ANIMATION_COMPLETE", lastScene);
this.addChildAt(scene2, 0);
}
private function unmuteMusic(_arg1:MouseEvent){
ifMute = false;
backSound = backgroundSound.play(pausePosition, 100);
mute.cross.visible = false;
mute.addEventListener(MouseEvent.CLICK, muteMusic);
mute.removeEventListener(MouseEvent.CLICK, unmuteMusic);
}
public function openKingPage(_arg1:Event):void{
KingAPI.openLoaderProgressLink();
}
private function creditsSelect(_arg1:MouseEvent){
if (ifMute == false){
clickingnoise.play();
};
instructions.removeEventListener(MouseEvent.CLICK, instructionsSelect);
levelbutton.removeEventListener(MouseEvent.CLICK, startTheLevelGame);
credits.removeEventListener(MouseEvent.CLICK, creditsSelect);
addButton.removeEventListener(MouseEvent.CLICK, addGames);
moreGames.removeEventListener(MouseEvent.CLICK, moreGames2);
walkthru.removeEventListener(MouseEvent.CLICK, walkthrough);
removeChild(instructions);
removeChild(levelbutton);
removeChild(credits);
removeChild(addButton);
removeChild(walkthru);
removeChild(moreGames);
creditsmenu = new creditsMenu();
creditsmenu.x = 0;
creditsmenu.y = 0;
addChild(creditsmenu);
menubutton = new menuButton();
menubutton.buttonMode = true;
menubutton.x = 480;
menubutton.y = 350;
addChild(menubutton);
menubutton.addEventListener(MouseEvent.CLICK, returnToMenuFromCredits);
}
public function openSign(_arg1:MouseEvent){
KingAPI.openSignLink();
}
public function launchGame(_arg1):void{
mcKingLoader.destroy();
gotoAndStop(3);
}
public function moreGames2(_arg1:MouseEvent){
KingAPI.openOtherGamesLink();
}
function loadComplete(_arg1:Event):void{
kongregate = _arg1.target.content;
kongregate.services.connect();
debug_txt.appendText(("\n" + kongregate.services));
debug_txt.appendText(("\n" + kongregate.user));
debug_txt.appendText(("\n" + kongregate.scores));
debug_txt.appendText(("\n" + kongregate.stats));
}
private function returnToMenuFromInstructions(_arg1:MouseEvent):void{
if (ifMute == false){
clickingnoise.play();
};
removeChild(instructionsMenu);
removeChild(menubutton);
menubutton.removeEventListener(MouseEvent.CLICK, returnToMenuFromInstructions);
initialize();
}
function frame1(){
stop();
game_name = "squared-up";
mochi = "";
stage.scaleMode = StageScaleMode.NO_SCALE;
KingAPI.addEventListener(KingAPI.INITIALIZED_EVENT, preload);
KingAPI.addEventListener(KingAPI.HOST_BANNED_EVENT, preload);
KingAPI.init(game_name, root.loaderInfo.url);
}
function frame2(){
mcKingLoader.addEventListener(DragonLoader.LAUNCH_GAME, launchGame);
mcKingLoader.init(game_name, mochi);
}
public function updateMaxTime(){
save.data.bestTimeSec3 = maxTimeSec3;
save.data.bestTimeSec4 = maxTimeSec4;
save.data.bestTimeSec5 = maxTimeSec5;
save.data.bestTimeSec6 = maxTimeSec6;
save.data.bestTimeMin3 = maxTimeMin3;
save.data.bestTimeMin4 = maxTimeMin4;
save.data.bestTimeMin5 = maxTimeMin5;
save.data.bestTimeMin6 = maxTimeMin6;
save.flush();
}
public function resetGrid(_arg1):void{
clearGrids();
newLevelGrid(_arg1);
newGrid(_arg1);
}
public function removes(_arg1:MouseEvent){
var _local2:* = new BevelFilter();
grid.remove();
if (grid.gridremove == true){
remove.filters = [_local2];
} else {
remove.filters = [];
};
}
private function returnToMenuFromCredits(_arg1:MouseEvent):void{
if (ifMute == false){
clickingnoise.play();
};
removeChild(creditsmenu);
removeChild(menubutton);
menubutton.removeEventListener(MouseEvent.CLICK, returnToMenuFromCredits);
initialize();
}
private function updateMaxLevel(){
save.data.level = maxlevel;
save.flush();
KingAPI.submitLevel(maxlevel);
kongregate.stats.submit("Level", (maxlevel - 1));
}
public function removeLevelSelect():void{
removeChild(leveler);
removeChild(leftarrow);
removeChild(rightarrow);
leftarrow.removeEventListener(MouseEvent.CLICK, swapDown);
rightarrow.removeEventListener(MouseEvent.CLICK, swapUp);
if (expert == true){
removeChild(expertlevelselect);
} else {
if (extreme == true){
removeChild(extremelevelselect);
} else {
removeChild(levelselect);
};
};
removeChild(randomselect);
}
public function levelUp():void{
curlevel++;
if ((((((curlevel == 37)) || ((curlevel == 62)))) || ((curlevel == 71)))){
if (curlevel > maxlevel){
maxlevel = curlevel;
};
updateMaxLevel();
scene3 = new Screen3();
addChild(scene3);
scene3.addEventListener("ANIMATION_COMPLETE", endScene3);
} else {
if (curlevel > maxlevel){
maxlevel = curlevel;
};
grid.setLevel();
levelgrid.newLevel(curlevel);
updateMaxLevel();
};
}
public function newLevelGrid(_arg1, _arg2=false):void{
levelgrid = new LevelGrid(_arg1, curlevel, _arg2);
addChild(levelgrid);
}
private function runTut(){
tutBG1 = new TutBG1();
addChildAt(tutBG1, 0);
tutBG1.addEventListener("ANIMATION_COMPLETE", tut7);
this.stage.frameRate = 25;
}
public function initialize(){
menubg = new Menu_BG();
this.addChildAt(menubg, 0);
kinglogo = new kingLogo();
kinglogo.x = 610;
kinglogo.y = 25;
kinglogo.scaleX = 0.5;
kinglogo.scaleY = 0.5;
kinglogo.addEventListener(MouseEvent.CLICK, openSign);
kinglogo.buttonMode = true;
addChild(kinglogo);
instructions = new Instructions();
instructions.x = 500;
instructions.y = 320;
addChild(instructions);
levelbutton = new levelButton();
levelbutton.x = 550;
levelbutton.y = 375;
addChild(levelbutton);
addButton = new AddButton();
addButton.x = 200;
addButton.y = 375;
addChild(addButton);
addButton.addEventListener(MouseEvent.CLICK, addGames);
moreGames = new MoreGames();
moreGames.x = 130;
moreGames.y = 280;
addChild(moreGames);
moreGames.addEventListener(MouseEvent.CLICK, moreGames2);
walkthru = new Walkthru();
walkthru.x = 363;
walkthru.y = 375;
addChild(walkthru);
walkthru.addEventListener(MouseEvent.CLICK, walkthrough);
credits = new Credits();
credits.x = 470;
credits.y = 30;
instructions.buttonMode = true;
addButton.buttonMode = true;
moreGames.buttonMode = true;
walkthru.buttonMode = true;
credits.buttonMode = true;
levelbutton.buttonMode = true;
addChild(credits);
credits.addEventListener(MouseEvent.CLICK, creditsSelect);
curlevel = 1;
mainee = this;
instructions.addEventListener(MouseEvent.CLICK, instructionsSelect);
levelbutton.addEventListener(MouseEvent.CLICK, startTheLevelGame);
myGlow = new GlowFilter();
myGlow.inner = true;
myGlow.color = 0;
myGlow.blurX = 0.5;
myGlow.blurY = 0.5;
}
private function swapUp(_arg1:MouseEvent){
if (ifMute == false){
clickingnoise.play();
};
if (expert == true){
removeChild(expertlevelselect);
expert = false;
extreme = true;
extremelevelselect = new ExtremeLevelSelect(3);
addChild(extremelevelselect);
leveler.txt.text = "Extreme Levels";
} else {
if (extreme == true){
extreme = false;
expert = false;
removeChild(extremelevelselect);
levelselect = new LevelSelect(6);
addChild(levelselect);
leveler.txt.text = "Easy Levels";
} else {
expert = true;
extreme = false;
removeChild(levelselect);
expertlevelselect = new ExpertLevelSelect(5);
leveler.txt.text = "Expert Levels";
addChild(expertlevelselect);
};
};
}
private function lastScene(_arg1:Event){
scene2.removeEventListener("ANIMATION_COMPLETE", lastScene);
removeChild(scene2);
runTut();
}
private function muteMusic(_arg1:MouseEvent){
pausePosition = backSound.position;
backSound.stop();
ifMute = true;
mute.cross.visible = true;
mute.removeEventListener(MouseEvent.CLICK, muteMusic);
mute.addEventListener(MouseEvent.CLICK, unmuteMusic);
}
function frame3(){
Mainee.mainee.playScenes();
}
private function tut7(_arg1:Event){
removeChild(tutBG1);
tutBG1.removeEventListener("ANIMATION_COMPLETE", tut7);
beginto();
(tutSeen == true);
save.data.seenTutYet = 1;
save.flush();
this.stage.frameRate = 45;
}
public function addGames(_arg1:MouseEvent){
KingAPI.openAddToWebsiteLink();
}
private function startTheLevelGame(_arg1:MouseEvent){
if (ifMute == false){
clickingnoise.play();
};
expert = false;
levelbutton.removeEventListener(MouseEvent.CLICK, startTheLevelGame);
instructions.removeEventListener(MouseEvent.CLICK, instructionsSelect);
addButton.removeEventListener(MouseEvent.CLICK, addGames);
moreGames.removeEventListener(MouseEvent.CLICK, moreGames2);
walkthru.removeEventListener(MouseEvent.CLICK, walkthrough);
removeChild(instructions);
removeChild(levelbutton);
removeChild(credits);
removeChild(addButton);
removeChild(walkthru);
removeChild(moreGames);
levelselect = new LevelSelect(6);
randomselect = new RandomSelect(2);
addChild(randomselect);
addChild(levelselect);
leveler = new inText3();
leveler.x = 486;
leveler.y = 25;
leveler.txt.text = "Easy Levels";
addChild(leveler);
rightarrow = new RightArrow();
addChild(rightarrow);
rightarrow.x = 557;
rightarrow.y = 25;
rightarrow.buttonMode = true;
rightarrow.addEventListener(MouseEvent.CLICK, swapUp);
leftarrow = new LeftArrow();
addChild(leftarrow);
leftarrow.buttonMode = true;
leftarrow.x = 417;
leftarrow.y = 25;
leftarrow.scaleX = 0.25;
leftarrow.scaleY = 0.25;
rightarrow.scaleX = 0.25;
rightarrow.scaleY = 0.25;
leftarrow.addEventListener(MouseEvent.CLICK, swapDown);
}
public function clearGrids():void{
removeChild(grid);
removeChild(levelgrid);
removeChild(reset);
removeChild(remove);
removeChild(menubutton);
removeChild(walkthru);
}
public function onEnterFrame(_arg1:Event):void{
holder.x = (bar.x + bar.width);
if (framesLoaded == totalFrames){
particles.kill();
this.removeChild(particles);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
bg.removeEventListener(MouseEvent.CLICK, openKingPage);
this.removeChild(bar);
if (!KingAPI.isHome){
gotoAndStop(2);
} else {
gotoAndStop(3);
};
} else {
bar.scaleX = (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal);
mcLoadLogoBg.bar.scaleX = (1 - (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal));
};
}
public function returnToMenu2():void{
removeChild(walkthru);
walkthru.removeEventListener(MouseEvent.CLICK, walkthrough);
if (randombool == true){
grid.gameTimer.removeEventListener(TimerEvent.TIMER, grid.updateTime);
randombool = false;
};
removeChild(grid);
removeChild(levelgrid);
curlevel = 1;
instructions = new Instructions();
instructions.x = 500;
instructions.y = 320;
addChild(instructions);
levelbutton = new levelButton();
levelbutton.x = 550;
levelbutton.y = 375;
addChild(levelbutton);
addButton = new AddButton();
addButton.x = 200;
addButton.y = 375;
addChild(addButton);
addButton.addEventListener(MouseEvent.CLICK, addGames);
moreGames = new MoreGames();
moreGames.x = 130;
moreGames.y = 280;
addChild(moreGames);
moreGames.addEventListener(MouseEvent.CLICK, moreGames2);
walkthru = new Walkthru();
walkthru.x = 363;
walkthru.y = 375;
addChild(walkthru);
walkthru.addEventListener(MouseEvent.CLICK, walkthrough);
credits = new Credits();
credits.x = 470;
credits.y = 30;
instructions.buttonMode = true;
addButton.buttonMode = true;
moreGames.buttonMode = true;
walkthru.buttonMode = true;
credits.buttonMode = true;
levelbutton.buttonMode = true;
addChild(credits);
credits.addEventListener(MouseEvent.CLICK, creditsSelect);
instructions.addEventListener(MouseEvent.CLICK, instructionsSelect);
levelbutton.addEventListener(MouseEvent.CLICK, startTheLevelGame);
removeChild(reset);
removeChild(remove);
removeChild(menubutton);
}
public function newRandomLevel(_arg1):void{
newLevelGrid(_arg1, true);
newGrid(_arg1, true);
randombool = true;
}
public function getLevel():int{
return (curlevel);
}
public function returnToMenu(_arg1:MouseEvent):void{
if (ifMute == false){
clickingnoise.play();
};
returnToMenu2();
}
public function newRandomLevelFromContinue(_arg1):void{
clearGrids();
newRandomLevel(_arg1);
}
public function playScenes(){
scene1 = new Intro_1();
this.addChildAt(scene1, 0);
scene1.addEventListener("ANIMATION_COMPLETE", nextScene2);
}
private function swapDown(_arg1:MouseEvent){
if (ifMute == false){
clickingnoise.play();
};
if (expert == true){
expert = false;
extreme = false;
removeChild(expertlevelselect);
levelselect = new LevelSelect(6);
addChild(levelselect);
leveler.txt.text = "Easy Levels";
} else {
if (extreme == true){
expert = true;
extreme = false;
removeChild(extremelevelselect);
expertlevelselect = new ExpertLevelSelect(5);
leveler.txt.text = "Expert Levels";
addChild(expertlevelselect);
} else {
removeChild(levelselect);
expert = false;
extreme = true;
extremelevelselect = new ExtremeLevelSelect(3);
addChild(extremelevelselect);
leveler.txt.text = "Extreme Levels";
};
};
}
public function walkthrough(_arg1:MouseEvent){
KingAPI.openSignLink();
}
public function getGridSize():int{
if (curlevel <= 12){
return (3);
};
if ((((curlevel >= 13)) && ((curlevel <= 26)))){
return (4);
};
if ((((curlevel >= 27)) && ((curlevel <= 36)))){
return (5);
};
if ((((curlevel >= 37)) && ((curlevel <= 45)))){
return (4);
};
if ((((curlevel >= 46)) && ((curlevel <= 53)))){
return (5);
};
if ((((curlevel >= 54)) && ((curlevel <= 61)))){
return (6);
};
if ((((curlevel >= 62)) && ((curlevel <= 64)))){
return (7);
};
if ((((curlevel >= 65)) && ((curlevel <= 67)))){
return (8);
};
if ((((curlevel >= 68)) && ((curlevel <= 70)))){
return (9);
};
return (2);
}
private function endScene3(_arg1:Event){
scene3.removeEventListener("ANIMATION_COMPLETE", endScene3);
removeChild(scene3);
returnToMenu2();
}
public function beginto():void{
expert = false;
extreme = false;
maxlevel = 1;
clickingnoise = new clicking();
ifMute = false;
if (save.data.seenTutYet != null){
tutSeen = true;
} else {
tutSeen = false;
};
if (save.data.level != null){
maxlevel = save.data.level;
};
if (save.data.bestTimeSec3 != null){
maxTimeSec3 = save.data.bestTimeSec3;
maxTimeMin3 = save.data.bestTimeMin3;
} else {
maxTimeSec3 = 0;
maxTimeMin3 = 0;
};
if (save.data.bestTimeSec4 != null){
maxTimeSec4 = save.data.bestTimeSec4;
maxTimeMin4 = save.data.bestTimeMin4;
} else {
maxTimeSec4 = 0;
maxTimeMin4 = 0;
};
if (save.data.bestTimeSec5 != null){
maxTimeSec5 = save.data.bestTimeSec5;
maxTimeMin5 = save.data.bestTimeMin5;
} else {
maxTimeSec5 = 0;
maxTimeMin5 = 0;
};
if (save.data.bestTimeSec6 != null){
maxTimeSec6 = save.data.bestTimeSec6;
maxTimeMin6 = save.data.bestTimeMin6;
} else {
maxTimeSec6 = 0;
maxTimeMin6 = 0;
};
updateMaxLevel();
backgroundSound = new two();
backSound = backgroundSound.play(0, 100);
initialize();
mute = new Mute();
mute.x = 630;
mute.y = 380;
mute.scaleX = 0.2;
mute.scaleY = 0.2;
addChild(mute);
mute.buttonMode = true;
mute.cross.visible = false;
mute.addEventListener(MouseEvent.CLICK, muteMusic);
}
}
}//package
Section 59
//Map (Map)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Map extends MovieClip {
public var lvl32:MovieClip;
public var lvl34:MovieClip;
public var lvl36:MovieClip;
public var lvl31:MovieClip;
public var lvl33:MovieClip;
public var lvl35:MovieClip;
public var numberText:TextField;
public var still_water:MovieClip;
public var lvl10:MovieClip;
public var lvl11:MovieClip;
public var lvl12:MovieClip;
public var lvl13:MovieClip;
public var lvl14:MovieClip;
public var lvl16:MovieClip;
public var lvl15:MovieClip;
public var lvl18:MovieClip;
public var lvl3:MovieClip;
public var lvl4:MovieClip;
public var lvl5:MovieClip;
public var lvl6:MovieClip;
public var lvl7:MovieClip;
public var lvl8:MovieClip;
public var lvl9:MovieClip;
public var lvl19:MovieClip;
public var lvl1:MovieClip;
public var lvl20:MovieClip;
public var lvl21:MovieClip;
public var lvl22:MovieClip;
public var lvl23:MovieClip;
public var lvl24:MovieClip;
public var lvl25:MovieClip;
public var lvl26:MovieClip;
public var lvl27:MovieClip;
public var lvl28:MovieClip;
public var lvl29:MovieClip;
public var lvl17:MovieClip;
public var lvl2:MovieClip;
public var lvl30:MovieClip;
}
}//package
Section 60
//Map2 (Map2)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Map2 extends MovieClip {
public var lvl37:MovieClip;
public var lvl38:MovieClip;
public var lvl39:MovieClip;
public var numberText:TextField;
public var lvl40:MovieClip;
public var lvl41:MovieClip;
public var lvl42:MovieClip;
public var lvl43:MovieClip;
public var lvl44:MovieClip;
public var lvl45:MovieClip;
public var lvl46:MovieClip;
public var lvl47:MovieClip;
public var lvl48:MovieClip;
public var lvl49:MovieClip;
public var lvl50:MovieClip;
public var lvl51:MovieClip;
public var lvl52:MovieClip;
public var lvl53:MovieClip;
public var lvl54:MovieClip;
public var lvl55:MovieClip;
public var lvl56:MovieClip;
public var lvl58:MovieClip;
public var still_water:MovieClip;
public var lvl57:MovieClip;
public var lvl59:MovieClip;
public var lvl60:MovieClip;
public var lvl61:MovieClip;
}
}//package
Section 61
//Map3 (Map3)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Map3 extends MovieClip {
public var still_water:MovieClip;
public var lvl65:MovieClip;
public var lvl67:MovieClip;
public var lvl66:MovieClip;
public var lvl68:MovieClip;
public var lvl69:MovieClip;
public var numberText:TextField;
public var lvl64:MovieClip;
public var lvl70:MovieClip;
public var lvl62:MovieClip;
public var lvl63:MovieClip;
}
}//package
Section 62
//mcDragon (mcDragon)
package {
import flash.display.*;
public dynamic class mcDragon extends MovieClip {
}
}//package
Section 63
//mcGlimmer (mcGlimmer)
package {
import flash.display.*;
public dynamic class mcGlimmer extends MovieClip {
}
}//package
Section 64
//Menu_BG (Menu_BG)
package {
import flash.display.*;
public dynamic class Menu_BG extends MovieClip {
}
}//package
Section 65
//menuButton (menuButton)
package {
import flash.display.*;
public dynamic class menuButton extends MovieClip {
}
}//package
Section 66
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 67
//MoreGames (MoreGames)
package {
import flash.display.*;
public dynamic class MoreGames extends MovieClip {
}
}//package
Section 68
//Mute (Mute)
package {
import flash.display.*;
public dynamic class Mute extends MovieClip {
public var cross:MovieClip;
}
}//package
Section 69
//Outline (Outline)
package {
import flash.display.*;
public dynamic class Outline extends MovieClip {
}
}//package
Section 70
//randomButton (randomButton)
package {
import flash.display.*;
import flash.text.*;
public dynamic class randomButton extends MovieClip {
public var randomText:TextField;
}
}//package
Section 71
//RandomNotifier (RandomNotifier)
package {
import flash.display.*;
public dynamic class RandomNotifier extends MovieClip {
}
}//package
Section 72
//RandomSelect (RandomSelect)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class RandomSelect extends MovieClip {
private var timerText2:inText2;
private var timerText2min:inText2;
private var rows:int;
private var randomNotifier:RandomNotifier;
private var levelunits:Array;
private var cols:int;
private var clickingnoise:clicking;
private var timerText2best:inText2;
private var timerText2colon:inText2;
public function RandomSelect(_arg1:int){
var _local3:int;
var _local4:*;
super();
clickingnoise = new clicking();
randomNotifier = new RandomNotifier();
addChild(randomNotifier);
randomNotifier.x = 525;
randomNotifier.y = 140;
rows = _arg1;
cols = _arg1;
levelunits = new Array();
var _local2 = 1;
while (_local2 <= cols) {
levelunits[_local2] = new Array();
_local3 = 1;
while (_local3 <= rows) {
_local4 = new levelUnit();
_local4.sideLength = ((Mainee.HEIGHT - 200) / rows);
_local4.scaleX = (((Mainee.WIDTH - 350) / cols) / _local4.width);
_local4.scaleY = (((Mainee.HEIGHT - 200) / rows) / _local4.height);
_local4.c = _local2;
_local4.r = _local3;
_local4.x = ((((_local2 - 1) * _local4.sideLength) + (_local4.width / 2)) + 430);
_local4.y = (175 + ((((_local3 - 1) * _local4.sideLength) + (_local4.height / 2)) - 5));
addChild(_local4);
_local4.number = ((_local4.r * cols) + _local4.c);
_local4.numberText.text = _local4.number;
levelunits[_local2][_local3] = _local4;
levelunits[_local2][_local3].addEventListener(MouseEvent.CLICK, clickListener);
updateGraphic(_local4);
bestTime(_local4);
_local4.buttonMode = true;
_local4.useHandCursor = true;
_local3++;
};
_local2++;
};
}
private function clickListener(_arg1:MouseEvent):void{
if (Mainee.mainee.ifMute == false){
clickingnoise.play();
};
removeChild(randomNotifier);
var _local2:MovieClip = (_arg1.target.parent as MovieClip);
Mainee.mainee.newRandomLevel(_local2.number);
Mainee.mainee.removeLevelSelect();
}
private function updateGraphic(_arg1:MovieClip):void{
disableAllGraphics(_arg1);
switch (_arg1.number){
case 0:
_arg1.still_water.visible = true;
break;
case 1:
_arg1.still_island.visible = true;
break;
case 2:
_arg1.still_desert.visible = true;
break;
case 4:
_arg1.still_grass.visible = true;
break;
case 3:
_arg1.still_ground.visible = true;
break;
case 5:
_arg1.still_forest.visible = true;
break;
case 6:
_arg1.still_hill.visible = true;
break;
case 7:
_arg1.still_mountain.visible = true;
break;
case 8:
_arg1.still_volcano.visible = true;
break;
case 9:
_arg1.still_lake.visible = true;
break;
case 10:
_arg1.still_lake.visible = true;
break;
case 11:
_arg1.still_lake.visible = true;
break;
case 12:
_arg1.still_lake.visible = true;
break;
};
}
private function bestTime(_arg1:MovieClip){
_arg1.timerText2 = new inText2();
_arg1.timerText2.mouseEnabled = false;
_arg1.timerText2.x = (_arg1.x + 7.5);
_arg1.timerText2.y = (_arg1.y - 50);
addChild(_arg1.timerText2);
_arg1.timerText2colon = new inText2();
_arg1.timerText2colon.mouseEnabled = false;
_arg1.timerText2colon.x = (_arg1.x + 3.5);
_arg1.timerText2colon.y = (_arg1.y - 50);
_arg1.timerText2colon.txt.text = ":";
addChild(_arg1.timerText2colon);
_arg1.timerText2best = new inText2();
_arg1.timerText2best.mouseEnabled = false;
_arg1.timerText2best.x = (_arg1.x - 35);
_arg1.timerText2best.y = (_arg1.y - 50);
_arg1.timerText2best.txt.text = "Best:";
addChild(_arg1.timerText2best);
_arg1.timerText2min = new inText2();
_arg1.timerText2min.mouseEnabled = false;
_arg1.timerText2min.x = (_arg1.x - 4);
_arg1.timerText2min.y = (_arg1.y - 50);
if (_arg1.number == 3){
if ((((Mainee.mainee.maxTimeSec3 < 10)) && ((Mainee.mainee.maxTimeSec3 > 0)))){
_arg1.timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec3);
} else {
if (Mainee.mainee.maxTimeSec3 >= 10){
_arg1.timerText2.txt.text = Mainee.mainee.maxTimeSec3;
} else {
if (Mainee.mainee.maxTimeSec3 == 0){
_arg1.timerText2.txt.text = "00";
};
};
};
_arg1.timerText2min.txt.text = Mainee.mainee.maxTimeMin3;
};
if (_arg1.number == 4){
if ((((Mainee.mainee.maxTimeSec4 < 10)) && ((Mainee.mainee.maxTimeSec4 > 0)))){
_arg1.timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec4);
} else {
if (Mainee.mainee.maxTimeSec4 >= 10){
_arg1.timerText2.txt.text = Mainee.mainee.maxTimeSec4;
} else {
if (Mainee.mainee.maxTimeSec4 == 0){
_arg1.timerText2.txt.text = "00";
};
};
};
_arg1.timerText2min.txt.text = Mainee.mainee.maxTimeMin4;
};
if (_arg1.number == 5){
if ((((Mainee.mainee.maxTimeSec5 < 10)) && ((Mainee.mainee.maxTimeSec5 > 0)))){
_arg1.timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec5);
} else {
if (Mainee.mainee.maxTimeSec5 >= 10){
_arg1.timerText2.txt.text = Mainee.mainee.maxTimeSec5;
} else {
if (Mainee.mainee.maxTimeSec5 == 0){
_arg1.timerText2.txt.text = "00";
};
};
};
_arg1.timerText2min.txt.text = Mainee.mainee.maxTimeMin5;
};
if (_arg1.number == 6){
if ((((Mainee.mainee.maxTimeSec6 < 10)) && ((Mainee.mainee.maxTimeSec6 > 0)))){
_arg1.timerText2.txt.text = ("0" + Mainee.mainee.maxTimeSec6);
} else {
if (Mainee.mainee.maxTimeSec6 >= 10){
_arg1.timerText2.txt.text = Mainee.mainee.maxTimeSec6;
} else {
if (Mainee.mainee.maxTimeSec6 == 0){
_arg1.timerText2.txt.text = "00";
};
};
};
_arg1.timerText2min.txt.text = Mainee.mainee.maxTimeMin6;
};
addChild(_arg1.timerText2min);
}
private function disableAllGraphics(_arg1:MovieClip):void{
_arg1.still_water.visible = false;
_arg1.still_island.visible = false;
_arg1.still_desert.visible = false;
_arg1.still_grass.visible = false;
_arg1.still_ground.visible = false;
_arg1.still_forest.visible = false;
_arg1.still_hill.visible = false;
_arg1.still_mountain.visible = false;
_arg1.still_volcano.visible = false;
_arg1.still_lake.visible = false;
}
}
}//package
Section 73
//Remove (Remove)
package {
import flash.display.*;
public dynamic class Remove extends MovieClip {
}
}//package
Section 74
//Reset (Reset)
package {
import flash.display.*;
public dynamic class Reset extends MovieClip {
}
}//package
Section 75
//RightArrow (RightArrow)
package {
import flash.display.*;
public dynamic class RightArrow extends MovieClip {
}
}//package
Section 76
//Screen2 (Screen2)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class Screen2 extends MovieClip {
public var theTimer:Timer;
public function Screen2(){
addFrameScript(179, frame180);
}
function frame180(){
stop();
theTimer = new Timer(1000);
theTimer.addEventListener(TimerEvent.TIMER, timerNx);
theTimer.start();
}
public function timerNx(_arg1:TimerEvent):void{
dispatchEvent(new Event("ANIMATION_COMPLETE", true, true));
}
}
}//package
Section 77
//Screen3 (Screen3)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Screen3 extends MovieClip {
public function Screen3(){
addFrameScript(179, frame180);
}
function frame180(){
dispatchEvent(new Event("ANIMATION_COMPLETE", true, true));
}
}
}//package
Section 78
//sfxBell (sfxBell)
package {
import flash.media.*;
public dynamic class sfxBell extends Sound {
}
}//package
Section 79
//spark (spark)
package {
import flash.display.*;
public dynamic class spark extends MovieClip {
public function spark(){
addFrameScript(22, frame23);
}
function frame23(){
gotoAndStop("loop");
}
}
}//package
Section 80
//trump (trump)
package {
import flash.media.*;
public dynamic class trump extends Sound {
}
}//package
Section 81
//TutBG1 (TutBG1)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.external.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TutBG1 extends MovieClip {
public var theTimer:Timer;
public var Text:MovieClip;
public function TutBG1(){
addFrameScript(0, frame1, 69, frame70, 139, frame140, 210, frame211, 280, frame281, 350, frame351, 420, frame421, 519, frame520);
}
function frame140(){
Text.Text.text = "Click on a square to increase its number...";
}
function frame351(){
Text.Text.text = "Red squares show where the numbers will grow.";
}
function frame1(){
Text.Text.text = "Welcome to the Squared Up tutorial!";
}
function frame211(){
Text.Text.text = "And the numbers in its adjacent squares!";
}
function frame421(){
Text.Text.text = "That's it! Good luck!";
}
function frame70(){
Text.Text.text = "This game is very simple yet very challenging!";
}
public function timerNx(_arg1:TimerEvent):void{
dispatchEvent(new Event("ANIMATION_COMPLETE", true, true));
}
function frame520(){
stop();
theTimer = new Timer(1000);
theTimer.addEventListener(TimerEvent.TIMER, timerNx);
theTimer.start();
}
function frame281(){
Text.Text.text = "Try to match the solution on the right!";
}
}
}//package
Section 82
//two (two)
package {
import flash.media.*;
public dynamic class two extends Sound {
}
}//package
Section 83
//Unit (Unit)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Unit extends MovieClip {
public var hill:MovieClip;
public var ground:MovieClip;
public var mountain:MovieClip;
public var lake:MovieClip;
public var desert:MovieClip;
public var numberText:TextField;
public var water:MovieClip;
public var island:MovieClip;
public var volcano:MovieClip;
public var grass:MovieClip;
public var foret:MovieClip;
public var buttonMask:MovieClip;
}
}//package
Section 84
//Walkthru (Walkthru)
package {
import flash.display.*;
public dynamic class Walkthru extends MovieClip {
}
}//package