Section 1
//Main (com.midasplayer.particle.Main)
package com.midasplayer.particle {
import flash.display.*;
import flash.events.*;
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 2
//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 3
//DragonLoader (com.midasplayer.DragonLoader)
package com.midasplayer {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.transitions.*;
import fl.transitions.easing.*;
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;
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_fireLogoClip.stop();
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.gotoAndStop(1);
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 4
//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{
}
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) {
};
}
private static function loadHomeParametersHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
}
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);
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));
};
} catch(e:Error) {
};
}
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) {
};
}
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) {
};
}
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) {
};
}
}
}//package com.midasplayer
Section 5
//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 6
//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 7
//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 8
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
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 9
//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 10
//animationsInside_178 (game_fla.animationsInside_178)
package game_fla {
import flash.display.*;
public dynamic class animationsInside_178 extends MovieClip {
public var animationInside:MovieClip;
public function animationsInside_178(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 11
//bonusIndicators_123 (game_fla.bonusIndicators_123)
package game_fla {
import flash.display.*;
public dynamic class bonusIndicators_123 extends MovieClip {
public var movie:MovieClip;
public function bonusIndicators_123(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 12
//bonusInside1_124 (game_fla.bonusInside1_124)
package game_fla {
import flash.display.*;
public dynamic class bonusInside1_124 extends MovieClip {
public function bonusInside1_124(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 13
//bonusInside2_126 (game_fla.bonusInside2_126)
package game_fla {
import flash.display.*;
public dynamic class bonusInside2_126 extends MovieClip {
public function bonusInside2_126(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 14
//bonusInside3_127 (game_fla.bonusInside3_127)
package game_fla {
import flash.display.*;
public dynamic class bonusInside3_127 extends MovieClip {
public function bonusInside3_127(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 15
//ChaosRacer_221 (game_fla.ChaosRacer_221)
package game_fla {
import flash.display.*;
public dynamic class ChaosRacer_221 extends MovieClip {
public function ChaosRacer_221(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package game_fla
Section 16
//checkBox_198 (game_fla.checkBox_198)
package game_fla {
import flash.display.*;
public dynamic class checkBox_198 extends MovieClip {
public function checkBox_198(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 17
//face_199 (game_fla.face_199)
package game_fla {
import flash.display.*;
public dynamic class face_199 extends MovieClip {
public function face_199(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 18
//goAwayInside_60 (game_fla.goAwayInside_60)
package game_fla {
import flash.display.*;
public dynamic class goAwayInside_60 extends MovieClip {
public function goAwayInside_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 19
//ico_bridge_44 (game_fla.ico_bridge_44)
package game_fla {
import flash.display.*;
public dynamic class ico_bridge_44 extends MovieClip {
public function ico_bridge_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 20
//ico_jumper_51 (game_fla.ico_jumper_51)
package game_fla {
import flash.display.*;
public dynamic class ico_jumper_51 extends MovieClip {
public function ico_jumper_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 21
//ico_portal_55 (game_fla.ico_portal_55)
package game_fla {
import flash.display.*;
public dynamic class ico_portal_55 extends MovieClip {
public function ico_portal_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 22
//ico_trash_58 (game_fla.ico_trash_58)
package game_fla {
import flash.display.*;
public dynamic class ico_trash_58 extends MovieClip {
public function ico_trash_58(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 23
//ico_wall_49 (game_fla.ico_wall_49)
package game_fla {
import flash.display.*;
public dynamic class ico_wall_49 extends MovieClip {
public function ico_wall_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 24
//ico_wind_53 (game_fla.ico_wind_53)
package game_fla {
import flash.display.*;
public dynamic class ico_wind_53 extends MovieClip {
public function ico_wind_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 25
//mcFireLogo_7 (game_fla.mcFireLogo_7)
package game_fla {
import flash.display.*;
public dynamic class mcFireLogo_7 extends MovieClip {
public function mcFireLogo_7(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package game_fla
Section 26
//mcPlayBtn_10 (game_fla.mcPlayBtn_10)
package game_fla {
import flash.display.*;
public dynamic class mcPlayBtn_10 extends MovieClip {
public function mcPlayBtn_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 27
//nut_23 (game_fla.nut_23)
package game_fla {
import flash.display.*;
public dynamic class nut_23 extends MovieClip {
public function nut_23(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 28
//popUp_46 (game_fla.popUp_46)
package game_fla {
import flash.display.*;
public dynamic class popUp_46 extends MovieClip {
public var popUpInside:MovieClip;
public function popUp_46(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
}
}//package game_fla
Section 29
//popUpInside_47 (game_fla.popUpInside_47)
package game_fla {
import flash.display.*;
public dynamic class popUpInside_47 extends MovieClip {
public function popUpInside_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 30
//sndtrack_238 (game_fla.sndtrack_238)
package game_fla {
import flash.display.*;
public dynamic class sndtrack_238 extends MovieClip {
public function sndtrack_238(){
addFrameScript(1725, frame1726);
}
function frame1726(){
stop();
}
}
}//package game_fla
Section 31
//soundMcInside_83 (game_fla.soundMcInside_83)
package game_fla {
import flash.display.*;
public dynamic class soundMcInside_83 extends MovieClip {
public function soundMcInside_83(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 32
//soundsMc_82 (game_fla.soundsMc_82)
package game_fla {
import flash.display.*;
public dynamic class soundsMc_82 extends MovieClip {
public var soundMcInside:MovieClip;
public function soundsMc_82(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 33
//star1Inside_97 (game_fla.star1Inside_97)
package game_fla {
import flash.display.*;
public dynamic class star1Inside_97 extends MovieClip {
public function star1Inside_97(){
addFrameScript(40, frame41);
}
function frame41(){
if (Math.floor((Math.random() * 10)) < 5){
gotoAndPlay(1);
};
}
}
}//package game_fla
Section 34
//star2Inside_99 (game_fla.star2Inside_99)
package game_fla {
import flash.display.*;
public dynamic class star2Inside_99 extends MovieClip {
public function star2Inside_99(){
addFrameScript(40, frame41);
}
function frame41(){
if (Math.floor((Math.random() * 10)) < 5){
gotoAndPlay(1);
};
}
}
}//package game_fla
Section 35
//starInside_101 (game_fla.starInside_101)
package game_fla {
import flash.display.*;
public dynamic class starInside_101 extends MovieClip {
public function starInside_101(){
addFrameScript(40, frame41);
}
function frame41(){
if (Math.floor((Math.random() * 10)) < 5){
gotoAndPlay(1);
};
}
}
}//package game_fla
Section 36
//Symbol1_17 (game_fla.Symbol1_17)
package game_fla {
import flash.display.*;
public dynamic class Symbol1_17 extends MovieClip {
public function Symbol1_17(){
addFrameScript(59, frame60, 119, frame120);
}
function frame120(){
gotoAndPlay("anylevel");
}
function frame60(){
gotoAndPlay("anykey");
}
}
}//package game_fla
Section 37
//undo_tool_57 (game_fla.undo_tool_57)
package game_fla {
import flash.display.*;
public dynamic class undo_tool_57 extends MovieClip {
public function undo_tool_57(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game_fla
Section 38
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "4.0.0.4410";
}
}//package mx.core
Section 39
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 40
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 41
//Channel (src._ModPlayer.Channel)
package src._ModPlayer {
public class Channel {
public var note:Array;
public function Channel():void{
}
}
}//package src._ModPlayer
Section 42
//ChanState (src._ModPlayer.ChanState)
package src._ModPlayer {
public class ChanState {
public var csp:int;
public var cslooplen:int;
public var cutsample:Boolean;
public var tremolopos:int;
public var arpeggiotick:int;
public var cutsampleticks:int;
public var slidevolume:Boolean;
public var rvolume:int;
public var retriggersample:Boolean;
public var csmp:Sample;
public var arpeggiosemi1:int;
public var tremolospeed:int;
public var arpeggiosemi2:int;
public var delaynoteticks:int;
public var vibratowave:int;
public var slideperiodval:int;
public var retriggersamplectr:int;
public var slidevolumeval:int;
public var slideperiod:Boolean;
public var vibratopos:int;
public var cvolume:int;
public var tremolowave:int;
public var retriggersampleticks:int;
public var lastnoteperiod:int;
public var tremolo:Boolean;
public var cslength:int;
public var arpeggionote:int;
public var cperiod:int;
public var cspinc:int;
public var vibratospeed:int;
public var slidetonotetarget:int;
public var vibratodepth:int;
public var delaynote:Boolean;
public var slidetonote:Boolean;
public var tremolodepth:int;
public var vibrato:Boolean;
public var arpeggio:Boolean;
public function ChanState():void{
}
}
}//package src._ModPlayer
Section 43
//Note (src._ModPlayer.Note)
package src._ModPlayer {
public class Note {
public var peridx:int;
public var period:int;
public var sample:Sample;
public var command:int;
public var cmdarg:int;
public function Note():void{
}
}
}//package src._ModPlayer
Section 44
//Pattern (src._ModPlayer.Pattern)
package src._ModPlayer {
public class Pattern {
public var channel:Array;
public function Pattern():void{
}
}
}//package src._ModPlayer
Section 45
//Sample (src._ModPlayer.Sample)
package src._ModPlayer {
public class Sample {
public var fine:int;
public var length:int;
public var looplen:int;
public var wave:Array;
public var volume:int;
public var loopstart:int;
public function Sample():void{
}
}
}//package src._ModPlayer
Section 46
//Boot (src.flash.Boot)
package src.flash {
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public dynamic class Boot extends MovieClip {
protected static var lastError:Error;
protected static var tf:TextField;
public static var skip_constructor:Boolean = false;
protected static var lines:Array;
public function Boot(_arg1:MovieClip=null):void{
var aproto:*;
var cca:*;
var c:MovieClip;
var mc = _arg1;
if (!Boot.skip_constructor){
super();
aproto = Array.prototype;
aproto.copy = function (){
return (this.slice());
};
aproto.insert = function (_arg1, _arg2):void{
this.splice(_arg1, 0, _arg2);
};
aproto.remove = function (_arg1):Boolean{
var _local2:int = this.indexOf(_arg1);
if (_local2 == -1){
return (false);
};
this.splice(_local2, 1);
return (true);
};
aproto.iterator = function (){
var cur:int;
var arr:Array;
cur = 0;
arr = this;
return ({hasNext:function ():Boolean{
return ((cur < arr.length));
}, next:function (){
return (arr[cur++]);
}});
};
aproto.setPropertyIsEnumerable("copy", false);
aproto.setPropertyIsEnumerable("insert", false);
aproto.setPropertyIsEnumerable("remove", false);
aproto.setPropertyIsEnumerable("iterator", false);
cca = String.prototype.charCodeAt;
String.prototype.charCodeAt = function (_arg1){
var _local2:* = cca.call(this, _arg1);
if (isNaN(_local2)){
return (null);
};
return (_local2);
};
Boot.lines = new Array();
c = ((mc == null)) ? this : mc;
Lib.current = c;
try {
if (((!((c.stage == null))) && ((c.stage.align == "")))){
c.stage.align = "TOP_LEFT";
//unresolved jump
};
} catch(e) {
};
if (Boot.init != null){
init();
};
};
}
public static function __trace(_arg1, _arg2):void{
var _local3:TextField = getTrace();
var _local4:String = ((_arg2 == null)) ? "(null)" : ((_arg2.fileName + ":") + _arg2.lineNumber);
Boot.lines = lines.concat(((_local4 + ": ") + __string_rec(_arg1, "")).split("\n"));
_local3.text = lines.join("\n");
var _local5:Stage = Lib.current.stage;
if (_local5 == null){
return;
};
while ((((lines.length > 1)) && ((_local3.height > _local5.stageHeight)))) {
lines.shift();
_local3.text = lines.join("\n");
};
}
public static function __string_rec(_arg1, _arg2:String):String{
var k:Array;
var s:String;
var first:Boolean;
var _g1:int;
var _g:int;
var i:int;
var key:String;
var s2:String;
var i2:*;
var first2:Boolean;
var a:Array;
var _g12:int;
var _g2:int;
var i1:int;
var v = _arg1;
var str = _arg2;
var cname:String = getQualifiedClassName(v);
switch (cname){
case "Object":
k = function ():Array{
var _local1:*;
var _local2:*;
_local1 = new Array();
for (_local2 in v) {
_local1.push(_local2);
};
return (_local1);
}();
s = "{";
first = true;
_g1 = 0;
_g = k.length;
while (_g1 < _g) {
_g1 = (_g1 + 1);
i = _g1;
key = k[i];
if (first){
first = false;
} else {
s = (s + ",");
};
s = (s + (((" " + key) + " : ") + __string_rec(v[key], str)));
};
if (!first){
s = (s + " ");
};
s = (s + "}");
return (s);
case "Array":
s2 = "[";
first2 = true;
a = v;
_g12 = 0;
_g2 = a.length;
while (_g12 < _g2) {
_g12 = (_g12 + 1);
i1 = _g12;
if (first2){
first2 = false;
} else {
s2 = (s2 + ",");
};
s2 = (s2 + __string_rec(a[i1], str));
};
return ((s2 + "]"));
default:
switch (typeof(v)){
case "function":
return ("<function>");
};
break;
};
return (new String(v));
}
public static function __instanceof(_arg1, _arg2):Boolean{
var v = _arg1;
var t = _arg2;
try {
if (t == Object){
return (true);
};
return ((v is t));
} catch(e) {
};
return (false);
}
public static function getTrace():TextField{
var _local2:TextFormat;
var _local1:MovieClip = Lib.current;
if (Boot.tf == null){
Boot.tf = new TextField();
_local2 = tf.getTextFormat();
_local2.font = "_sans";
tf.defaultTextFormat = _local2;
tf.selectable = false;
tf.width = ((_local1.stage == null)) ? 800 : _local1.stage.stageWidth;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.mouseEnabled = false;
};
_local1.addChild(tf);
return (tf);
}
private static function init():void{
Math["NaN"] = Number.NaN;
Math["NEGATIVE_INFINITY"] = Number.NEGATIVE_INFINITY;
Math["POSITIVE_INFINITY"] = Number.POSITIVE_INFINITY;
Math["isFinite"] = function (_arg1:Number):Boolean{
return (isFinite(_arg1));
};
Math["isNaN"] = function (_arg1:Number):Boolean{
return (isNaN(_arg1));
};
}
public static function __clear_trace():void{
if (Boot.tf == null){
return;
};
Lib.current.removeChild(tf);
Boot.tf = null;
Boot.lines = new Array();
}
protected static function __unprotect__(_arg1:String):String{
return (_arg1);
}
public static function enum_to_string(_arg1):String{
if (_arg1.params == null){
return (_arg1.tag);
};
return ((((_arg1.tag + "(") + _arg1.params.join(",")) + ")"));
}
public static function __set_trace_color(_arg1:uint):void{
getTrace().textColor = _arg1;
}
}
}//package src.flash
Section 47
//Lib (src.flash.Lib)
package src.flash {
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class Lib {
public static var current:MovieClip;
public static function trace(_arg1):void{
}
public static function fscommand(_arg1:String, _arg2:String=null):void{
fscommand(_arg1, ((_arg2 == null)) ? "" : _arg2);
}
public static function _as(_arg1, _arg2:Class){
return ((_arg1 as _arg2));
}
public static function getURL(_arg1:URLRequest, _arg2:String=null):void{
var _local3:Function = navigateToURL;
if (_arg2 == null){
_local3(_arg1);
} else {
_local3(_arg1, _arg2);
};
}
public static function eval(_arg1:String){
var p:Array;
var fields:Array;
var f:String;
var path = _arg1;
p = path.split(".");
fields = new Array();
var o:* = null;
while (p.length > 0) {
try {
o = getDefinitionByName(p.join("."));
} catch(e) {
fields.unshift(p.pop());
};
if (o != null){
break;
};
};
var _g:int;
while (_g < fields.length) {
f = fields[_g];
_g = (_g + 1);
if (o == null){
return (null);
};
o = o[f];
};
return (o);
}
public static function attach(_arg1:String):MovieClip{
var _local2:* = (getDefinitionByName(_arg1) as Class);
return (new (_local2));
}
public static function _getTimer():int{
return (getTimer());
}
}
}//package src.flash
Section 48
//Log (src.haxe.Log)
package src.haxe {
import src.flash.*;
public class Log {
public static var setColor:Function = function (_arg1:int):void{
Boot.__set_trace_color(_arg1);
};
public static var trace:Function = function (_arg1, _arg2=null):void{
Boot.__trace(_arg1, _arg2);
};
public static var clear:Function = function ():void{
Boot.__clear_trace();
};
}
}//package src.haxe
Section 49
//Timer (src.haxe.Timer)
package src.haxe {
import flash.utils.*;
import src.flash.*;
public class Timer {
protected var id;
public var run:Function;
public function Timer(_arg1:int):void{
var me:Timer;
var time_ms = _arg1;
run = function ():void{
};
super();
if (!Boot.skip_constructor){
me = this;
this.id = setInterval(function ():void{
me.run();
}, time_ms);
};
}
public function stop():void{
if (this.id == null){
return;
};
clearInterval(this.id);
this.id = null;
}
public static function delay(_arg1:Function, _arg2:int):void{
var t:Timer;
var f = _arg1;
var time_ms = _arg2;
t = new Timer(time_ms);
t.run = function ():void{
t.stop();
f();
};
}
public static function stamp():Number{
return ((Lib._getTimer() / 1000));
}
}
}//package src.haxe
Section 50
//AbstractCollection (src.org.cove.ape.AbstractCollection)
package src.org.cove.ape {
import flash.display.*;
import flash.utils.*;
public class AbstractCollection {
private var _sprite:Sprite;
private var _particles:Array;
private var _isParented:Boolean;
private var _constraints:Array;
public function AbstractCollection(){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractCollection"){
throw (new ArgumentError("AbstractCollection can't be instantiated directly"));
};
_isParented = false;
_particles = new Array();
_constraints = new Array();
}
public function removeConstraint(_arg1:AbstractConstraint):void{
var _local2:int = constraints.indexOf(_arg1);
if (_local2 == -1){
return;
};
constraints.splice(_local2, 1);
_arg1.cleanup();
}
public function getAll():Array{
return (particles.concat(constraints));
}
function checkCollisionsVsCollection(_arg1:AbstractCollection):void{
var _local5:AbstractParticle;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:AbstractParticle;
var _local10:SpringConstraint;
var _local11:SpringConstraint;
var _local12:int;
var _local2:int = _particles.length;
var _local3:int;
while (_local3 < _local2) {
_local5 = _particles[_local3];
if (!_local5.collidable){
} else {
_local6 = _arg1.particles.length;
_local7 = 0;
while (_local7 < _local6) {
_local9 = _arg1.particles[_local7];
if (_local9.collidable){
CollisionDetector.test(_local5, _local9);
};
_local7++;
};
_local8 = _arg1.constraints.length;
_local7 = 0;
while (_local7 < _local8) {
_local10 = _arg1.constraints[_local7];
if (((_local10.collidable) && (!(_local10.isConnectedTo(_local5))))){
_local10.scp.updatePosition();
CollisionDetector.test(_local5, _local10.scp);
};
_local7++;
};
};
_local3++;
};
var _local4:int = _constraints.length;
_local3 = 0;
while (_local3 < _local4) {
_local11 = _constraints[_local3];
if (!_local11.collidable){
} else {
_local6 = _arg1.particles.length;
_local12 = 0;
while (_local12 < _local6) {
_local9 = _arg1.particles[_local12];
if (((_local9.collidable) && (!(_local11.isConnectedTo(_local9))))){
_local11.scp.updatePosition();
CollisionDetector.test(_local9, _local11.scp);
};
_local12++;
};
};
_local3++;
};
}
public function get sprite():Sprite{
if (_sprite != null){
return (_sprite);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_sprite = new Sprite();
APEngine.container.addChild(_sprite);
return (_sprite);
}
function checkInternalCollisions():void{
var _local3:AbstractParticle;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:AbstractParticle;
var _local8:SpringConstraint;
var _local1:int = _particles.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _particles[_local2];
if (!_local3.collidable){
} else {
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local7 = _particles[_local4];
if (_local7.collidable){
CollisionDetector.test(_local3, _local7);
};
_local4++;
};
_local5 = _constraints.length;
_local6 = 0;
while (_local6 < _local5) {
_local8 = _constraints[_local6];
if (((_local8.collidable) && (!(_local8.isConnectedTo(_local3))))){
_local8.scp.updatePosition();
CollisionDetector.test(_local3, _local8.scp);
};
_local6++;
};
};
_local2++;
};
}
public function addParticle(_arg1:AbstractParticle):void{
particles.push(_arg1);
if (isParented){
_arg1.init();
};
}
public function init():void{
var _local1:int;
while (_local1 < particles.length) {
particles[_local1].init();
_local1++;
};
_local1 = 0;
while (_local1 < constraints.length) {
constraints[_local1].init();
_local1++;
};
}
function satisfyConstraints():void{
var _local3:AbstractConstraint;
var _local1:int = _constraints.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _constraints[_local2];
_local3.resolve();
_local2++;
};
}
function get isParented():Boolean{
return (_isParented);
}
public function paint():void{
var _local1:AbstractParticle;
var _local4:SpringConstraint;
var _local2:int = _particles.length;
var _local3:int;
while (_local3 < _local2) {
_local1 = _particles[_local3];
if (((!(_local1.fixed)) || (_local1.alwaysRepaint))){
_local1.paint();
};
_local3++;
};
_local2 = _constraints.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _constraints[_local3];
if (((!(_local4.fixed)) || (_local4.alwaysRepaint))){
_local4.paint();
};
_local3++;
};
}
public function addConstraint(_arg1:AbstractConstraint):void{
constraints.push(_arg1);
if (isParented){
_arg1.init();
};
}
function set isParented(_arg1:Boolean):void{
_isParented = _arg1;
}
public function removeParticle(_arg1:AbstractParticle):void{
var _local2:int = particles.indexOf(_arg1);
if (_local2 == -1){
return;
};
particles.splice(_local2, 1);
_arg1.cleanup();
}
public function cleanup():void{
var _local1:int;
while (_local1 < particles.length) {
particles[_local1].cleanup();
_local1++;
};
_local1 = 0;
while (_local1 < constraints.length) {
constraints[_local1].cleanup();
_local1++;
};
}
public function get particles():Array{
return (_particles);
}
function integrate(_arg1:Number):void{
var _local4:AbstractParticle;
var _local2:int = _particles.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _particles[_local3];
_local4.update(_arg1);
_local3++;
};
}
public function get constraints():Array{
return (_constraints);
}
}
}//package src.org.cove.ape
Section 51
//AbstractConstraint (src.org.cove.ape.AbstractConstraint)
package src.org.cove.ape {
import flash.utils.*;
public class AbstractConstraint extends AbstractItem {
private var _stiffness:Number;
public function AbstractConstraint(_arg1:Number){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractConstraint"){
throw (new ArgumentError("AbstractConstraint can't be instantiated directly"));
};
this.stiffness = _arg1;
setStyle();
}
function resolve():void{
}
public function set stiffness(_arg1:Number):void{
_stiffness = _arg1;
}
public function get stiffness():Number{
return (_stiffness);
}
}
}//package src.org.cove.ape
Section 52
//AbstractItem (src.org.cove.ape.AbstractItem)
package src.org.cove.ape {
import flash.display.*;
public class AbstractItem {
var lineAlpha:Number;
var lineColor:uint;
var displayObjectOffset:Vector;
var lineThickness:Number;
var displayObject:DisplayObject;
var fillAlpha:Number;
private var _sprite:Sprite;
var fillColor:uint;
private var _visible:Boolean;
private var _alwaysRepaint:Boolean;
var displayObjectRotation:Number;
public function AbstractItem(){
_visible = true;
_alwaysRepaint = false;
}
public function setLine(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1):void{
lineThickness = _arg1;
lineColor = _arg2;
lineAlpha = _arg3;
}
public function set visible(_arg1:Boolean):void{
_visible = _arg1;
sprite.visible = _arg1;
}
public function loadSprite(_arg1:String):void{
}
public function setFill(_arg1:uint=0xFFFFFF, _arg2:Number=1):void{
fillColor = _arg1;
fillAlpha = _arg2;
}
public function init():void{
}
public function get sprite():Sprite{
if (_sprite != null){
return (_sprite);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_sprite = new Sprite();
APEngine.container.addChild(_sprite);
return (_sprite);
}
public function paint():void{
}
public function cleanup():void{
sprite.graphics.clear();
var _local1:int;
while (_local1 < sprite.numChildren) {
sprite.removeChildAt(_local1);
_local1++;
};
}
public function setStyle(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:uint=0xFFFFFF, _arg5:Number=1):void{
setLine(_arg1, _arg2, _arg3);
setFill(_arg4, _arg5);
}
public function addToSprite(_arg1:Sprite):void{
sprite.addChild(_arg1);
}
public function get visible():Boolean{
return (_visible);
}
final public function set alwaysRepaint(_arg1:Boolean):void{
_alwaysRepaint = _arg1;
}
final public function get alwaysRepaint():Boolean{
return (_alwaysRepaint);
}
}
}//package src.org.cove.ape
Section 53
//AbstractParticle (src.org.cove.ape.AbstractParticle)
package src.org.cove.ape {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class AbstractParticle extends AbstractItem {
private var _collidable:Boolean;
private var _center:Vector;
private var collision:Collision;
var prev:Vector;
private var _kfr:Number;
var interval:Interval;
private var _invMass:Number;
var curr:Vector;
private var _mass:Number;
private var temp:Vector;
private var _friction:Number;
var samp:Vector;
private var _multisample:int;
private var _fixed:Boolean;
private var forces:Vector;
public function AbstractParticle(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:Number){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractParticle"){
throw (new ArgumentError("AbstractParticle can't be instantiated directly"));
};
interval = new Interval(0, 0);
curr = new Vector(_arg1, _arg2);
prev = new Vector(_arg1, _arg2);
samp = new Vector();
temp = new Vector();
fixed = _arg3;
forces = new Vector();
collision = new Collision(new Vector(), new Vector());
collidable = true;
this.mass = _arg4;
this.elasticity = _arg5;
this.friction = _arg6;
setStyle();
_center = new Vector();
_multisample = 0;
}
function get invMass():Number{
return ((fixed) ? 0 : _invMass);
}
public function get px():Number{
return (curr.x);
}
public function get py():Number{
return (curr.y);
}
public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
displayObject = _arg1;
displayObjectRotation = _arg4;
displayObjectOffset = new Vector(_arg2, _arg3);
}
public function get point():Point{
return (new Point(curr.x, curr.y));
}
public function set py(_arg1:Number):void{
curr.y = _arg1;
prev.y = _arg1;
}
function getComponents(_arg1:Vector):Collision{
var _local2:Vector = velocity;
var _local3:Number = _arg1.dot(_local2);
collision.vn = _arg1.mult(_local3);
collision.vt = _local2.minus(collision.vn);
return (collision);
}
public function get mass():Number{
return (_mass);
}
public function set px(_arg1:Number):void{
curr.x = _arg1;
prev.x = _arg1;
}
function initDisplay():void{
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
sprite.addChild(displayObject);
}
public function get multisample():int{
return (_multisample);
}
public function get position():Vector{
return (new Vector(curr.x, curr.y));
}
function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
curr.plusEquals(_arg1);
velocity = _arg2;
}
public function get elasticity():Number{
return (_kfr);
}
public function set velocity(_arg1:Vector):void{
prev = curr.minus(_arg1);
}
public function addMasslessForce(_arg1:Vector):void{
forces.plusEquals(_arg1);
}
public function set collidable(_arg1:Boolean):void{
_collidable = _arg1;
}
public function set multisample(_arg1:int):void{
_multisample = _arg1;
}
public function addForce(_arg1:Vector):void{
forces.plusEquals(_arg1.mult(invMass));
}
public function set position(_arg1:Vector):void{
curr.copy(_arg1);
prev.copy(_arg1);
}
public function get center():Vector{
_center.setTo(px, py);
return (_center);
}
public function update(_arg1:Number):void{
if (fixed){
return;
};
addForce(APEngine.force);
addMasslessForce(APEngine.masslessForce);
temp.copy(curr);
var _local2:Vector = velocity.plus(forces.multEquals(_arg1));
curr.plusEquals(_local2.multEquals(APEngine.damping));
prev.copy(temp);
forces.setTo(0, 0);
}
public function get velocity():Vector{
return (curr.minus(prev));
}
public function get collidable():Boolean{
return (_collidable);
}
public function set mass(_arg1:Number):void{
if (_arg1 <= 0){
throw (new ArgumentError("mass may not be set <= 0"));
};
_mass = _arg1;
_invMass = (1 / _mass);
}
public function set fixed(_arg1:Boolean):void{
_fixed = _arg1;
}
public function set elasticity(_arg1:Number):void{
_kfr = _arg1;
}
public function set friction(_arg1:Number):void{
if ((((_arg1 < 0)) || ((_arg1 > 1)))){
throw (new ArgumentError("Legal friction must be >= 0 and <=1"));
};
_friction = _arg1;
}
public function get friction():Number{
return (_friction);
}
public function get fixed():Boolean{
return (_fixed);
}
}
}//package src.org.cove.ape
Section 54
//APEngine (src.org.cove.ape.APEngine)
package src.org.cove.ape {
import flash.display.*;
public final class APEngine {
private static var _container:DisplayObjectContainer;
private static var _damping:Number;
private static var _constraintCollisionCycles:int;
private static var groups:Array;
static var masslessForce:Vector;
private static var _constraintCycles:int;
static var force:Vector;
private static var timeStep:Number;
private static var numGroups:int;
public static function get container():DisplayObjectContainer{
return (_container);
}
public static function get constraintCollisionCycles():int{
return (_constraintCollisionCycles);
}
public static function set damping(_arg1:Number):void{
_damping = _arg1;
}
public static function step():void{
integrate();
var _local1:int;
while (_local1 < _constraintCycles) {
satisfyConstraints();
_local1++;
};
var _local2:int;
while (_local2 < _constraintCollisionCycles) {
satisfyConstraints();
checkCollisions();
_local2++;
};
}
public static function init(_arg1:Number=0.25):void{
timeStep = (_arg1 * _arg1);
numGroups = 0;
groups = new Array();
force = new Vector(0, 0);
masslessForce = new Vector(0, 0);
damping = 1;
_constraintCycles = 0;
_constraintCollisionCycles = 1;
groups = [];
numGroups = 0;
}
public static function get constraintCycles():int{
return (_constraintCycles);
}
public static function set constraintCollisionCycles(_arg1:int):void{
_constraintCollisionCycles = _arg1;
}
public static function set constraintCycles(_arg1:int):void{
_constraintCycles = _arg1;
}
public static function addForce(_arg1:Vector):void{
force.plusEquals(_arg1);
}
public static function get damping():Number{
return (_damping);
}
public static function set container(_arg1:DisplayObjectContainer):void{
_container = _arg1;
}
public static function addGroup(_arg1:Group):void{
groups.push(_arg1);
_arg1.isParented = true;
numGroups++;
_arg1.init();
}
public static function removeGroup(_arg1:Group):void{
var _local2:int = groups.indexOf(_arg1);
if (_local2 == -1){
return;
};
groups.splice(_local2, 1);
_arg1.isParented = false;
numGroups--;
_arg1.cleanup();
}
public static function paint():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.paint();
_local1++;
};
}
private static function checkCollisions():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.checkCollisions();
_local1++;
};
}
private static function integrate():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.integrate(timeStep);
_local1++;
};
}
private static function satisfyConstraints():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.satisfyConstraints();
_local1++;
};
}
public static function addMasslessForce(_arg1:Vector):void{
masslessForce.plusEquals(_arg1);
}
}
}//package src.org.cove.ape
Section 55
//CircleParticle (src.org.cove.ape.CircleParticle)
package src.org.cove.ape {
public class CircleParticle extends AbstractParticle {
private var _radius:Number;
public function CircleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0){
super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7);
_radius = _arg3;
}
override public function init():void{
cleanup();
if (displayObject != null){
initDisplay();
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawCircle(0, 0, radius);
sprite.graphics.endFill();
};
paint();
}
public function set radius(_arg1:Number):void{
_radius = _arg1;
}
function getProjection(_arg1:Vector):Interval{
var _local2:Number = samp.dot(_arg1);
interval.min = (_local2 - _radius);
interval.max = (_local2 + _radius);
return (interval);
}
function getIntervalY():Interval{
interval.min = (curr.y - _radius);
interval.max = (curr.y + _radius);
return (interval);
}
public function get radius():Number{
return (_radius);
}
function getIntervalX():Interval{
interval.min = (curr.x - _radius);
interval.max = (curr.x + _radius);
return (interval);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
}
}
}//package src.org.cove.ape
Section 56
//Collision (src.org.cove.ape.Collision)
package src.org.cove.ape {
import src.org.cove.ape.*;
final class Collision {
var vn:Vector;
var vt:Vector;
function Collision(_arg1:Vector, _arg2:Vector){
this.vn = _arg1;
this.vt = _arg2;
}
}
}//package src.org.cove.ape
Section 57
//CollisionDetector (src.org.cove.ape.CollisionDetector)
package src.org.cove.ape {
import src.org.cove.ape.*;
final class CollisionDetector {
private static function testOBBvsCircle(_arg1:RectangleParticle, _arg2:CircleParticle):Boolean{
var _local3:Vector;
var _local8:Vector;
var _local9:Number;
var _local10:Vector;
var _local11:Number;
var _local4:Number = Number.POSITIVE_INFINITY;
var _local5:Array = new Array(2);
var _local6:int;
while (_local6 < 2) {
_local8 = _arg1.axes[_local6];
_local9 = testIntervals(_arg1.getProjection(_local8), _arg2.getProjection(_local8));
if (_local9 == 0){
return (false);
};
if (Math.abs(_local9) < Math.abs(_local4)){
_local3 = _local8;
_local4 = _local9;
};
_local5[_local6] = _local9;
_local6++;
};
var _local7:Number = _arg2.radius;
if ((((Math.abs(_local5[0]) < _local7)) && ((Math.abs(_local5[1]) < _local7)))){
_local10 = closestVertexOnOBB(_arg2.samp, _arg1);
_local3 = _local10.minus(_arg2.samp);
_local11 = _local3.magnitude();
_local4 = (_local7 - _local11);
if (_local4 > 0){
_local3.divEquals(_local11);
} else {
return (false);
};
};
CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local3, _local4);
return (true);
}
static function test(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
if (((_arg1.fixed) && (_arg2.fixed))){
return;
};
if ((((_arg1.multisample == 0)) && ((_arg2.multisample == 0)))){
normVsNorm(_arg1, _arg2);
} else {
if ((((_arg1.multisample > 0)) && ((_arg2.multisample == 0)))){
sampVsNorm(_arg1, _arg2);
} else {
if ((((_arg2.multisample > 0)) && ((_arg1.multisample == 0)))){
sampVsNorm(_arg2, _arg1);
} else {
if (_arg1.multisample == _arg2.multisample){
sampVsSamp(_arg1, _arg2);
} else {
normVsNorm(_arg1, _arg2);
};
};
};
};
}
private static function testIntervals(_arg1:Interval, _arg2:Interval):Number{
if (_arg1.max < _arg2.min){
return (0);
};
if (_arg2.max < _arg1.min){
return (0);
};
var _local3:Number = (_arg2.max - _arg1.min);
var _local4:Number = (_arg2.min - _arg1.max);
return (((Math.abs(_local3))<Math.abs(_local4)) ? _local3 : _local4);
}
private static function normVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
_arg1.samp.copy(_arg1.curr);
_arg2.samp.copy(_arg2.curr);
testTypes(_arg1, _arg2);
}
private static function testCirclevsCircle(_arg1:CircleParticle, _arg2:CircleParticle):Boolean{
var _local3:Number = testIntervals(_arg1.getIntervalX(), _arg2.getIntervalX());
if (_local3 == 0){
return (false);
};
var _local4:Number = testIntervals(_arg1.getIntervalY(), _arg2.getIntervalY());
if (_local4 == 0){
return (false);
};
var _local5:Vector = _arg1.samp.minus(_arg2.samp);
var _local6:Number = _local5.magnitude();
var _local7:Number = ((_arg1.radius + _arg2.radius) - _local6);
if (_local7 > 0){
_local5.divEquals(_local6);
CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local5, _local7);
return (true);
};
return (false);
}
private static function testTypes(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{
if ((((_arg1 is RectangleParticle)) && ((_arg2 is RectangleParticle)))){
return (testOBBvsOBB((_arg1 as RectangleParticle), (_arg2 as RectangleParticle)));
};
if ((((_arg1 is CircleParticle)) && ((_arg2 is CircleParticle)))){
return (testCirclevsCircle((_arg1 as CircleParticle), (_arg2 as CircleParticle)));
};
if ((((_arg1 is RectangleParticle)) && ((_arg2 is CircleParticle)))){
return (testOBBvsCircle((_arg1 as RectangleParticle), (_arg2 as CircleParticle)));
};
if ((((_arg1 is CircleParticle)) && ((_arg2 is RectangleParticle)))){
return (testOBBvsCircle((_arg2 as RectangleParticle), (_arg1 as CircleParticle)));
};
return (false);
}
private static function sampVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
var _local3:Number = (1 / (_arg1.multisample + 1));
var _local4:Number = _local3;
_arg2.samp.copy(_arg2.curr);
var _local5:int;
while (_local5 <= _arg1.multisample) {
_arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y))));
if (testTypes(_arg1, _arg2)){
return;
};
_local4 = (_local4 + _local3);
_local5++;
};
}
private static function closestVertexOnOBB(_arg1:Vector, _arg2:RectangleParticle):Vector{
var _local6:Number;
var _local3:Vector = _arg1.minus(_arg2.samp);
var _local4:Vector = new Vector(_arg2.samp.x, _arg2.samp.y);
var _local5:int;
while (_local5 < 2) {
_local6 = _local3.dot(_arg2.axes[_local5]);
if (_local6 >= 0){
_local6 = _arg2.extents[_local5];
} else {
if (_local6 < 0){
_local6 = -(_arg2.extents[_local5]);
};
};
_local4.plusEquals(_arg2.axes[_local5].mult(_local6));
_local5++;
};
return (_local4);
}
private static function testOBBvsOBB(_arg1:RectangleParticle, _arg2:RectangleParticle):Boolean{
var _local3:Vector;
var _local6:Vector;
var _local7:Number;
var _local8:Vector;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Boolean;
var _local4:Number = Number.POSITIVE_INFINITY;
var _local5:int;
while (_local5 < 2) {
_local6 = _arg1.axes[_local5];
_local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6));
if (_local7 == 0){
return (false);
};
_local8 = _arg2.axes[_local5];
_local9 = testIntervals(_arg1.getProjection(_local8), _arg2.getProjection(_local8));
if (_local9 == 0){
return (false);
};
_local10 = Math.abs(_local7);
_local11 = Math.abs(_local9);
if ((((_local10 < Math.abs(_local4))) || ((_local11 < Math.abs(_local4))))){
_local12 = (_local10 < _local11);
_local3 = (_local12) ? _local6 : _local8;
_local4 = (_local12) ? _local7 : _local9;
};
_local5++;
};
CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local3, _local4);
return (true);
}
private static function sampVsSamp(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
var _local3:Number = (1 / (_arg1.multisample + 1));
var _local4:Number = _local3;
var _local5:int;
while (_local5 <= _arg1.multisample) {
_arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y))));
_arg2.samp.setTo((_arg2.prev.x + (_local4 * (_arg2.curr.x - _arg2.prev.x))), (_arg2.prev.y + (_local4 * (_arg2.curr.y - _arg2.prev.y))));
if (testTypes(_arg1, _arg2)){
return;
};
_local4 = (_local4 + _local3);
_local5++;
};
}
}
}//package src.org.cove.ape
Section 58
//CollisionResolver (src.org.cove.ape.CollisionResolver)
package src.org.cove.ape {
import src.org.cove.ape.*;
final class CollisionResolver {
static function resolveParticleParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Vector, _arg4:Number):void{
_arg1.curr.copy(_arg1.samp);
_arg2.curr.copy(_arg2.samp);
var _local5:Vector = _arg3.mult(_arg4);
var _local6:Number = (_arg1.elasticity + _arg2.elasticity);
var _local7:Number = (_arg1.invMass + _arg2.invMass);
var _local8:Number = clamp((1 - (_arg1.friction + _arg2.friction)), 0, 1);
var _local9:Collision = _arg1.getComponents(_arg3);
var _local10:Collision = _arg2.getComponents(_arg3);
var _local11:Vector = _local10.vn.mult(((_local6 + 1) * _arg1.invMass)).plus(_local9.vn.mult((_arg2.invMass - (_local6 * _arg1.invMass)))).divEquals(_local7);
var _local12:Vector = _local9.vn.mult(((_local6 + 1) * _arg2.invMass)).plus(_local10.vn.mult((_arg1.invMass - (_local6 * _arg2.invMass)))).divEquals(_local7);
_local9.vt.multEquals(_local8);
_local10.vt.multEquals(_local8);
var _local13:Vector = _local5.mult((_arg1.invMass / _local7));
var _local14:Vector = _local5.mult((-(_arg2.invMass) / _local7));
_local11.plusEquals(_local9.vt);
_local12.plusEquals(_local10.vt);
if (!_arg1.fixed){
_arg1.resolveCollision(_local13, _local11, _arg3, _arg4, -1, _arg2);
};
if (!_arg2.fixed){
_arg2.resolveCollision(_local14, _local12, _arg3, _arg4, 1, _arg1);
};
}
static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 > _arg3){
return (_arg3);
};
if (_arg1 < _arg2){
return (_arg2);
};
return (_arg1);
}
}
}//package src.org.cove.ape
Section 59
//Composite (src.org.cove.ape.Composite)
package src.org.cove.ape {
public class Composite extends AbstractCollection {
private var delta:Vector;
public function Composite(){
delta = new Vector();
}
public function rotateByAngle(_arg1:Number, _arg2:Vector):void{
var _local3:Number = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY);
rotateByRadian(_local3, _arg2);
}
public function rotateByRadian(_arg1:Number, _arg2:Vector):void{
var _local3:AbstractParticle;
var _local7:Number;
var _local8:Number;
var _local4:Array = particles;
var _local5:int = _local4.length;
var _local6:int;
while (_local6 < _local5) {
_local3 = _local4[_local6];
_local7 = _local3.center.distance(_arg2);
_local8 = (getRelativeAngle(_arg2, _local3.center) + _arg1);
_local3.px = ((Math.cos(_local8) * _local7) + _arg2.x);
_local3.py = ((Math.sin(_local8) * _local7) + _arg2.y);
_local6++;
};
}
public function get fixed():Boolean{
var _local1:int;
while (_local1 < particles.length) {
if (!particles[_local1].fixed){
return (false);
};
_local1++;
};
return (true);
}
private function getRelativeAngle(_arg1:Vector, _arg2:Vector):Number{
delta.setTo((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
return (Math.atan2(delta.y, delta.x));
}
public function set fixed(_arg1:Boolean):void{
var _local2:int;
while (_local2 < particles.length) {
particles[_local2].fixed = _arg1;
_local2++;
};
}
}
}//package src.org.cove.ape
Section 60
//Group (src.org.cove.ape.Group)
package src.org.cove.ape {
public class Group extends AbstractCollection {
private var _composites:Array;
private var _collisionList:Array;
private var _collideInternal:Boolean;
public function Group(_arg1:Boolean=false){
_composites = new Array();
_collisionList = new Array();
this.collideInternal = _arg1;
}
public function addCollidableList(_arg1:Array):void{
var _local3:Group;
var _local2:int;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
collisionList.push(_local3);
_local2++;
};
}
function checkCollisions():void{
var _local3:Group;
if (collideInternal){
checkCollisionGroupInternal();
};
var _local1:int = collisionList.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = collisionList[_local2];
checkCollisionVsGroup(_local3);
_local2++;
};
}
public function removeComposite(_arg1:Composite):void{
var _local2:int = composites.indexOf(_arg1);
if (_local2 == -1){
return;
};
composites.splice(_local2, 1);
_arg1.isParented = false;
_arg1.cleanup();
}
override public function cleanup():void{
super.cleanup();
var _local1:int;
while (_local1 < composites.length) {
composites[_local1].cleanup();
_local1++;
};
}
public function removeCollidable(_arg1:Group):void{
var _local2:int = collisionList.indexOf(_arg1);
if (_local2 == -1){
return;
};
collisionList.splice(_local2, 1);
}
public function addComposite(_arg1:Composite):void{
composites.push(_arg1);
_arg1.isParented = true;
if (isParented){
_arg1.init();
};
}
public function addCollidable(_arg1:Group):void{
collisionList.push(_arg1);
}
override function integrate(_arg1:Number):void{
var _local4:Composite;
super.integrate(_arg1);
var _local2:int = _composites.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _composites[_local3];
_local4.integrate(_arg1);
_local3++;
};
}
public function get composites():Array{
return (_composites);
}
override public function init():void{
super.init();
var _local1:int;
while (_local1 < composites.length) {
composites[_local1].init();
_local1++;
};
}
override public function getAll():Array{
return (particles.concat(constraints).concat(composites));
}
public function get collisionList():Array{
return (_collisionList);
}
private function checkCollisionGroupInternal():void{
var _local3:Composite;
var _local4:int;
var _local5:Composite;
checkInternalCollisions();
var _local1:int = _composites.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.checkCollisionsVsCollection(this);
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local5 = _composites[_local4];
_local3.checkCollisionsVsCollection(_local5);
_local4++;
};
_local2++;
};
}
override function satisfyConstraints():void{
var _local3:Composite;
super.satisfyConstraints();
var _local1:int = _composites.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.satisfyConstraints();
_local2++;
};
}
public function get collideInternal():Boolean{
return (_collideInternal);
}
public function set collideInternal(_arg1:Boolean):void{
_collideInternal = _arg1;
}
override public function paint():void{
var _local3:Composite;
super.paint();
var _local1:int = _composites.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.paint();
_local2++;
};
}
private function checkCollisionVsGroup(_arg1:Group):void{
var _local5:Composite;
var _local6:int;
var _local7:Composite;
checkCollisionsVsCollection(_arg1);
var _local2:int = _composites.length;
var _local3:int = _arg1.composites.length;
var _local4:int;
while (_local4 < _local2) {
_local5 = _composites[_local4];
_local5.checkCollisionsVsCollection(_arg1);
_local6 = 0;
while (_local6 < _local3) {
_local7 = _arg1.composites[_local6];
_local5.checkCollisionsVsCollection(_local7);
_local6++;
};
_local4++;
};
_local6 = 0;
while (_local6 < _local3) {
_local7 = _arg1.composites[_local6];
checkCollisionsVsCollection(_local7);
_local6++;
};
}
}
}//package src.org.cove.ape
Section 61
//Interval (src.org.cove.ape.Interval)
package src.org.cove.ape {
final class Interval {
var min:Number;
var max:Number;
function Interval(_arg1:Number, _arg2:Number){
this.min = _arg1;
this.max = _arg2;
}
function toString():String{
return (((min + " : ") + max));
}
}
}//package src.org.cove.ape
Section 62
//MathUtil (src.org.cove.ape.MathUtil)
package src.org.cove.ape {
final class MathUtil {
static var ONE_EIGHTY_OVER_PI:Number = 57.2957795130823;
static var PI_OVER_ONE_EIGHTY:Number = 0.0174532925199433;
static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 < _arg2){
return (_arg2);
};
if (_arg1 > _arg3){
return (_arg3);
};
return (_arg1);
}
static function sign(_arg1:Number):int{
if (_arg1 < 0){
return (-1);
};
return (1);
}
}
}//package src.org.cove.ape
Section 63
//RectangleParticle (src.org.cove.ape.RectangleParticle)
package src.org.cove.ape {
public class RectangleParticle extends AbstractParticle {
private var _axes:Array;
private var _radian:Number;
private var _extents:Array;
public function RectangleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0.3, _arg9:Number=0){
super(_arg1, _arg2, _arg6, _arg7, _arg8, _arg9);
_extents = new Array((_arg3 / 2), (_arg4 / 2));
_axes = new Array(new Vector(0, 0), new Vector(0, 0));
radian = _arg5;
}
public function get radian():Number{
return (_radian);
}
public function set radian(_arg1:Number):void{
_radian = _arg1;
setAxes(_arg1);
}
function get axes():Array{
return (_axes);
}
public function set angle(_arg1:Number):void{
radian = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY);
}
function get extents():Array{
return (_extents);
}
public function set width(_arg1:Number):void{
_extents[0] = (_arg1 / 2);
}
public function get width():Number{
return ((_extents[0] * 2));
}
public function set height(_arg1:Number):void{
_extents[1] = (_arg1 / 2);
}
override public function init():void{
var _local1:Number;
var _local2:Number;
cleanup();
if (displayObject != null){
initDisplay();
} else {
_local1 = (extents[0] * 2);
_local2 = (extents[1] * 2);
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawRect((-(_local1) / 2), (-(_local2) / 2), _local1, _local2);
sprite.graphics.endFill();
};
paint();
}
public function get height():Number{
return ((_extents[1] * 2));
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
function getProjection(_arg1:Vector):Interval{
var _local2:Number = ((extents[0] * Math.abs(_arg1.dot(axes[0]))) + (extents[1] * Math.abs(_arg1.dot(axes[1]))));
var _local3:Number = samp.dot(_arg1);
interval.min = (_local3 - _local2);
interval.max = (_local3 + _local2);
return (interval);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
sprite.rotation = angle;
}
private function setAxes(_arg1:Number):void{
var _local2:Number = Math.sin(_arg1);
var _local3:Number = Math.cos(_arg1);
axes[0].x = _local3;
axes[0].y = _local2;
axes[1].x = -(_local2);
axes[1].y = _local3;
}
}
}//package src.org.cove.ape
Section 64
//RimParticle (src.org.cove.ape.RimParticle)
package src.org.cove.ape {
import src.org.cove.ape.*;
class RimParticle {
private var maxTorque:Number;
var curr:Vector;
var prev:Vector;
private var av:Number;
private var wr:Number;
private var sp:Number;
function RimParticle(_arg1:Number, _arg2:Number){
curr = new Vector(_arg1, 0);
prev = new Vector(0, 0);
sp = 0;
av = 0;
maxTorque = _arg2;
wr = _arg1;
}
function get speed():Number{
return (sp);
}
function update(_arg1:Number):void{
sp = Math.max(-(maxTorque), Math.min(maxTorque, (sp + av)));
var _local2:Number = -(curr.y);
var _local3:Number = curr.x;
var _local4:Number = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local2 = (_local2 / _local4);
_local3 = (_local3 / _local4);
curr.x = (curr.x + (sp * _local2));
curr.y = (curr.y + (sp * _local3));
var _local5:Number = prev.x;
var _local6:Number = prev.y;
var _local7:Number = (prev.x = curr.x);
var _local8:Number = (prev.y = curr.y);
curr.x = (curr.x + (APEngine.damping * (_local7 - _local5)));
curr.y = (curr.y + (APEngine.damping * (_local8 - _local6)));
var _local9:Number = Math.sqrt(((curr.x * curr.x) + (curr.y * curr.y)));
var _local10:Number = ((_local9 - wr) / _local9);
curr.x = (curr.x - (curr.x * _local10));
curr.y = (curr.y - (curr.y * _local10));
}
function set speed(_arg1:Number):void{
sp = _arg1;
}
function set angularVelocity(_arg1:Number):void{
av = _arg1;
}
function get angularVelocity():Number{
return (av);
}
}
}//package src.org.cove.ape
Section 65
//SpringConstraint (src.org.cove.ape.SpringConstraint)
package src.org.cove.ape {
import flash.display.*;
public class SpringConstraint extends AbstractConstraint {
private var _collidable:Boolean;
private var p1:AbstractParticle;
private var p2:AbstractParticle;
private var _scp:SpringConstraintParticle;
private var _restLength:Number;
public function SpringConstraint(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Number=0.5, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=1, _arg7:Boolean=false){
super(_arg3);
this.p1 = _arg1;
this.p2 = _arg2;
checkParticlesLocation();
_restLength = currLength;
setCollidable(_arg4, _arg5, _arg6, _arg7);
}
public function get fixed():Boolean{
return (((p1.fixed) && (p2.fixed)));
}
public function get rectScale():Number{
return (scp.rectScale);
}
public function set rectScale(_arg1:Number):void{
if (scp == null){
return;
};
scp.rectScale = _arg1;
}
public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
if (collidable){
scp.setDisplay(_arg1, _arg2, _arg3, _arg4);
} else {
displayObject = _arg1;
displayObjectRotation = _arg4;
displayObjectOffset = new Vector(_arg2, _arg3);
};
}
override public function init():void{
cleanup();
if (collidable){
scp.init();
} else {
if (displayObject != null){
initDisplay();
};
};
paint();
}
function initDisplay():void{
if (collidable){
scp.initDisplay();
} else {
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
sprite.addChild(displayObject);
};
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
public function get center():Vector{
return (p1.curr.plus(p2.curr).divEquals(2));
}
public function set rectHeight(_arg1:Number):void{
if (scp == null){
return;
};
scp.rectHeight = _arg1;
}
public function get restLength():Number{
return (_restLength);
}
override public function paint():void{
var _local1:Vector;
if (collidable){
scp.paint();
} else {
if (displayObject != null){
_local1 = center;
sprite.x = _local1.x;
sprite.y = _local1.y;
sprite.rotation = angle;
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.moveTo(p1.px, p1.py);
sprite.graphics.lineTo(p2.px, p2.py);
};
};
}
function get scp():SpringConstraintParticle{
return (_scp);
}
public function get collidable():Boolean{
return (_collidable);
}
public function setCollidable(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
_collidable = _arg1;
_scp = null;
if (_collidable){
_scp = new SpringConstraintParticle(p1, p2, this, _arg2, _arg3, _arg4);
};
}
public function isConnectedTo(_arg1:AbstractParticle):Boolean{
return ((((_arg1 == p1)) || ((_arg1 == p2))));
}
public function get rectHeight():Number{
return (scp.rectHeight);
}
override function resolve():void{
if (((p1.fixed) && (p2.fixed))){
return;
};
var _local1:Number = currLength;
var _local2:Number = ((_local1 - restLength) / (_local1 * (p1.invMass + p2.invMass)));
var _local3:Vector = delta.mult((_local2 * stiffness));
p1.curr.minusEquals(_local3.mult(p1.invMass));
p2.curr.plusEquals(_local3.mult(p2.invMass));
}
public function set fixedEndLimit(_arg1:Number):void{
if (scp == null){
return;
};
scp.fixedEndLimit = _arg1;
}
public function get radian():Number{
var _local1:Vector = delta;
return (Math.atan2(_local1.y, _local1.x));
}
public function set restLength(_arg1:Number):void{
if (_arg1 <= 0){
throw (new ArgumentError("restLength must be greater than 0"));
};
_restLength = _arg1;
}
public function get currLength():Number{
return (p1.curr.distance(p2.curr));
}
public function get fixedEndLimit():Number{
return (scp.fixedEndLimit);
}
private function checkParticlesLocation():void{
if ((((p1.curr.x == p2.curr.x)) && ((p1.curr.y == p2.curr.y)))){
p2.curr.x = (p2.curr.x + 0.0001);
};
}
function get delta():Vector{
return (p1.curr.minus(p2.curr));
}
}
}//package src.org.cove.ape
Section 66
//SpringConstraintParticle (src.org.cove.ape.SpringConstraintParticle)
package src.org.cove.ape {
import flash.display.*;
import src.org.cove.ape.*;
class SpringConstraintParticle extends RectangleParticle {
private var p1:AbstractParticle;
private var lambda:Vector;
private var p2:AbstractParticle;
private var _rectHeight:Number;
private var avgVelocity:Vector;
private var rca:Vector;
private var rcb:Vector;
private var _rectScale:Number;
private var parent:SpringConstraint;
private var scaleToLength:Boolean;
private var s:Number;
private var _fixedEndLimit:Number;
function SpringConstraintParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:SpringConstraint, _arg4:Number, _arg5:Number, _arg6:Boolean){
super(0, 0, 0, 0, 0, false);
this.p1 = _arg1;
this.p2 = _arg2;
lambda = new Vector(0, 0);
avgVelocity = new Vector(0, 0);
parent = _arg3;
this.rectScale = _arg5;
this.rectHeight = _arg4;
this.scaleToLength = _arg6;
fixedEndLimit = 0;
rca = new Vector();
rcb = new Vector();
}
private function setCorners(_arg1:RectangleParticle, _arg2:int):void{
var _local3:Number = _arg1.curr.x;
var _local4:Number = _arg1.curr.y;
var _local5:Array = _arg1.axes;
var _local6:Array = _arg1.extents;
var _local7:Number = (_local5[0].x * _local6[0]);
var _local8:Number = (_local5[0].y * _local6[0]);
var _local9:Number = (_local5[1].x * _local6[1]);
var _local10:Number = (_local5[1].y * _local6[1]);
var _local11:Number = (_local7 - _local9);
var _local12:Number = (_local8 - _local10);
var _local13:Number = (_local7 + _local9);
var _local14:Number = (_local8 + _local10);
if (_arg2 == 0){
rca.x = (_local3 - _local13);
rca.y = (_local4 - _local14);
rcb.x = (_local3 + _local11);
rcb.y = (_local4 + _local12);
} else {
if (_arg2 == 1){
rca.x = (_local3 + _local11);
rca.y = (_local4 + _local12);
rcb.x = (_local3 + _local13);
rcb.y = (_local4 + _local14);
} else {
if (_arg2 == 2){
rca.x = (_local3 + _local13);
rca.y = (_local4 + _local14);
rcb.x = (_local3 - _local11);
rcb.y = (_local4 - _local12);
} else {
if (_arg2 == 3){
rca.x = (_local3 - _local11);
rca.y = (_local4 - _local12);
rcb.x = (_local3 - _local13);
rcb.y = (_local4 - _local14);
};
};
};
};
}
override function get invMass():Number{
if (((p1.fixed) && (p2.fixed))){
return (0);
};
return ((1 / ((p1.mass + p2.mass) / 2)));
}
function get rectScale():Number{
return (_rectScale);
}
function set rectScale(_arg1:Number):void{
_rectScale = _arg1;
}
override public function get friction():Number{
return (((p1.friction + p2.friction) / 2));
}
override public function init():void{
var _local1:Sprite;
var _local2:Number;
var _local3:Number;
if (displayObject != null){
initDisplay();
} else {
_local1 = new Sprite();
parent.sprite.addChild(_local1);
_local1.name = "inner";
_local2 = (parent.currLength * rectScale);
_local3 = rectHeight;
_local1.graphics.clear();
_local1.graphics.lineStyle(parent.lineThickness, parent.lineColor, parent.lineAlpha);
_local1.graphics.beginFill(parent.fillColor, parent.fillAlpha);
_local1.graphics.drawRect((-(_local2) / 2), (-(_local3) / 2), _local2, _local3);
_local1.graphics.endFill();
};
paint();
}
override function initDisplay():void{
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
var _local1:Sprite = new Sprite();
_local1.name = "inner";
_local1.addChild(displayObject);
parent.sprite.addChild(_local1);
}
function set rectHeight(_arg1:Number):void{
_rectHeight = _arg1;
}
function updatePosition():void{
var _local1:Vector = parent.center;
curr.setTo(_local1.x, _local1.y);
width = (scaleToLength) ? (parent.currLength * rectScale) : (parent.restLength * rectScale);
height = rectHeight;
radian = parent.radian;
}
override public function get velocity():Vector{
var _local1:Vector = p1.velocity;
var _local2:Vector = p2.velocity;
avgVelocity.setTo(((_local1.x + _local2.x) / 2), ((_local1.y + _local2.y) / 2));
return (avgVelocity);
}
override public function paint():void{
var _local1:Vector = parent.center;
var _local2:Sprite = parent.sprite;
if (scaleToLength){
_local2.getChildByName("inner").width = (parent.currLength * rectScale);
} else {
if (displayObject != null){
_local2.getChildByName("inner").width = (parent.restLength * rectScale);
};
};
_local2.x = _local1.x;
_local2.y = _local1.y;
_local2.rotation = parent.angle;
}
private function getContactPointParam(_arg1:AbstractParticle):Number{
var _local2:Number;
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:int;
var _local7:Number;
if ((_arg1 is CircleParticle)){
_local2 = closestParamPoint(_arg1.curr);
} else {
if ((_arg1 is RectangleParticle)){
_local4 = new Array(4);
_local5 = Number.POSITIVE_INFINITY;
_local6 = 0;
while (_local6 < 4) {
setCorners((_arg1 as RectangleParticle), _local6);
_local7 = closestPtSegmentSegment();
if (_local7 < _local5){
_local5 = _local7;
_local3 = _local6;
_local4[_local6] = s;
};
_local6++;
};
_local2 = _local4[_local3];
};
};
return (_local2);
}
function set fixedEndLimit(_arg1:Number):void{
_fixedEndLimit = _arg1;
}
private function closestPtSegmentSegment():Number{
var _local8:Number;
var _local1:Vector = p1.curr;
var _local2:Vector = p2.curr;
var _local3:Vector = rca;
var _local4:Vector = rcb;
var _local5:Vector = _local2.minus(_local1);
var _local6:Vector = _local4.minus(_local3);
var _local7:Vector = _local1.minus(_local3);
var _local9:Number = _local5.dot(_local5);
var _local10:Number = _local6.dot(_local6);
var _local11:Number = _local6.dot(_local7);
var _local12:Number = _local5.dot(_local7);
var _local13:Number = _local5.dot(_local6);
var _local14:Number = ((_local9 * _local10) - (_local13 * _local13));
if (_local14 != 0){
s = MathUtil.clamp((((_local13 * _local11) - (_local12 * _local10)) / _local14), 0, 1);
} else {
s = 0.5;
};
_local8 = (((_local13 * s) + _local11) / _local10);
if (_local8 < 0){
_local8 = 0;
s = MathUtil.clamp((-(_local12) / _local9), 0, 1);
} else {
if (_local8 > 0){
_local8 = 1;
s = MathUtil.clamp(((_local13 - _local12) / _local9), 0, 1);
};
};
var _local15:Vector = _local1.plus(_local5.mult(s));
var _local16:Vector = _local3.plus(_local6.mult(_local8));
var _local17:Vector = _local15.minus(_local16);
return (_local15.minus(_local16).dot(_local17));
}
override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
var _local10:Number;
var _local11:AbstractParticle;
var _local7:Number = getContactPointParam(_arg6);
var _local8:Number = (1 - _local7);
var _local9:Number = _local7;
if (p1.fixed){
if (_local9 <= fixedEndLimit){
return;
};
lambda.setTo((_arg1.x / _local9), (_arg1.y / _local9));
p2.curr.plusEquals(lambda);
p2.velocity = _arg2;
} else {
if (p2.fixed){
if (_local8 <= fixedEndLimit){
return;
};
lambda.setTo((_arg1.x / _local8), (_arg1.y / _local8));
p1.curr.plusEquals(lambda);
p1.velocity = _arg2;
} else {
_local10 = ((_local8 * _local8) + (_local9 * _local9));
if (_local10 == 0){
return;
};
lambda.setTo((_arg1.x / _local10), (_arg1.y / _local10));
p1.curr.plusEquals(lambda.mult(_local8));
p2.curr.plusEquals(lambda.mult(_local9));
if (_local7 == 0.5){
p1.velocity = _arg2;
p2.velocity = _arg2;
} else {
_local11 = ((_local7)<0.5) ? p1 : p2;
_local11.velocity = _arg2;
};
};
};
}
function get rectHeight():Number{
return (_rectHeight);
}
function get fixedEndLimit():Number{
return (_fixedEndLimit);
}
override public function get elasticity():Number{
return (((p1.elasticity + p2.elasticity) / 2));
}
override public function get mass():Number{
return (((p1.mass + p2.mass) / 2));
}
private function closestParamPoint(_arg1:Vector):Number{
var _local2:Vector = p2.curr.minus(p1.curr);
var _local3:Number = (_local2.dot(_arg1.minus(p1.curr)) / _local2.dot(_local2));
return (MathUtil.clamp(_local3, 0, 1));
}
}
}//package src.org.cove.ape
Section 67
//Vector (src.org.cove.ape.Vector)
package src.org.cove.ape {
public class Vector {
public var x:Number;
public var y:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function cross(_arg1:Vector):Number{
return (((x * _arg1.y) - (y * _arg1.x)));
}
public function magnitude():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function divEquals(_arg1:Number):Vector{
if (_arg1 == 0){
_arg1 = 0.0001;
};
x = (x / _arg1);
y = (y / _arg1);
return (this);
}
public function times(_arg1:Vector):Vector{
return (new Vector((x * _arg1.x), (y * _arg1.y)));
}
public function plusEquals(_arg1:Vector):Vector{
x = (x + _arg1.x);
y = (y + _arg1.y);
return (this);
}
public function dot(_arg1:Vector):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function toString():String{
return (((x + " : ") + y));
}
public function normalize():Vector{
var _local1:Number = magnitude();
if (_local1 == 0){
_local1 = 0.0001;
};
return (mult((1 / _local1)));
}
public function minusEquals(_arg1:Vector):Vector{
x = (x - _arg1.x);
y = (y - _arg1.y);
return (this);
}
public function copy(_arg1:Vector):void{
x = _arg1.x;
y = _arg1.y;
}
public function multEquals(_arg1:Number):Vector{
x = (x * _arg1);
y = (y * _arg1);
return (this);
}
public function minus(_arg1:Vector):Vector{
return (new Vector((x - _arg1.x), (y - _arg1.y)));
}
public function plus(_arg1:Vector):Vector{
return (new Vector((x + _arg1.x), (y + _arg1.y)));
}
public function distance(_arg1:Vector):Number{
var _local2:Vector = this.minus(_arg1);
return (_local2.magnitude());
}
public function setTo(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
public function mult(_arg1:Number):Vector{
return (new Vector((x * _arg1), (y * _arg1)));
}
}
}//package src.org.cove.ape
Section 68
//WheelParticle (src.org.cove.ape.WheelParticle)
package src.org.cove.ape {
public class WheelParticle extends CircleParticle {
private var tan:Vector;
private var normSlip:Vector;
private var orientation:Vector;
private var _traction:Number;
private var rp:RimParticle;
public function WheelParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0, _arg8:Number=1){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
tan = new Vector(0, 0);
normSlip = new Vector(0, 0);
rp = new RimParticle(_arg3, 2);
this.traction = _arg8;
orientation = new Vector();
}
public function set angularVelocity(_arg1:Number):void{
rp.angularVelocity = _arg1;
}
public function get speed():Number{
return (rp.speed);
}
public function set traction(_arg1:Number):void{
_traction = (1 - _arg1);
}
override public function update(_arg1:Number):void{
super.update(_arg1);
rp.update(_arg1);
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
private function resolve(_arg1:Vector):void{
tan.setTo(-(rp.curr.y), rp.curr.x);
tan = tan.normalize();
var _local2:Vector = tan.mult(rp.speed);
var _local3:Vector = velocity.plusEquals(_local2);
var _local4:Number = _local3.cross(_arg1);
tan.multEquals(_local4);
rp.prev.copy(rp.curr.minus(tan));
var _local5:Number = ((1 - _traction) * rp.speed);
normSlip.setTo((_local5 * _arg1.y), (_local5 * _arg1.x));
curr.plusEquals(normSlip);
rp.speed = (rp.speed * _traction);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
sprite.rotation = angle;
}
public function set speed(_arg1:Number):void{
rp.speed = _arg1;
}
public function get traction():Number{
return ((1 - _traction));
}
override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
super.resolveCollision(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
resolve(_arg3.mult(MathUtil.sign((_arg4 * _arg5))));
}
override public function init():void{
cleanup();
if (displayObject != null){
initDisplay();
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawCircle(0, 0, radius);
sprite.graphics.endFill();
sprite.graphics.moveTo(-(radius), 0);
sprite.graphics.lineTo(radius, 0);
sprite.graphics.moveTo(0, -(radius));
sprite.graphics.lineTo(0, radius);
};
paint();
}
public function get radian():Number{
orientation.setTo(rp.curr.x, rp.curr.y);
return ((Math.atan2(orientation.y, orientation.x) + Math.PI));
}
public function get angularVelocity():Number{
return (rp.angularVelocity);
}
}
}//package src.org.cove.ape
Section 69
//BonusGameProvider (src.BonusGameProvider)
package src {
import flash.display.*;
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
import flash.utils.*;
import fl.transitions.*;
import com.midasplayer.*;
import fl.transitions.easing.*;
public class BonusGameProvider {
private var carX:Number;// = 300
private var carY:Number;// = 200
private var apeContainer:Sprite;
private var restoreBonusGameData:Function;
private var levelIsFrozen:Boolean;// = false
private var stageObj:Stage;
private var smokeTimer:uint;
private var bonusLevelTimer:Timer;
public var soundProvider:SoundProvider;
private var logo:Logo;
private var physicRect:RectangleParticle;
private var twX:Tween;
private var twY:Tween;
private var playground:Sprite;
private var carMoveEnabled:Boolean;// = true
private var car:Car;
private var curBonusNum:Number;
private var secondsInLevel:Number;// = 0
private var hOnBonusGameComplete:Function;
private var rect:MovieClip;
private var bonusTimer:BonusTimer;
private var walls:Group;
private var back:GameLevels;
private var smoke:Sprite;
private var moveTimer:uint;
private var wndProvider:WindowProvider;
private var isPaused:Boolean;// = false
public function BonusGameProvider(_arg1:Stage, _arg2:Function, _arg3, _arg4):void{
restoreBonusGameData = _arg4;
stageObj = _arg1;
wndProvider = _arg3;
hOnBonusGameComplete = _arg2;
soundProvider = new SoundProvider();
}
private function initAPEngine():void{
APEngine.init(0.2);
apeContainer = playground;
APEngine.container = apeContainer;
APEngine.addMasslessForce(new Vector(0, (3 * GameDataProvider.GRAVITY_K)));
APEngine.constraintCollisionCycles = 2;
APEngine.constraintCycles = 2;
walls = new Group();
APEngine.addGroup(walls);
}
private function startBonusGame():void{
addLogo();
rect = new bonusRectangle();
rect.width = GameDataProvider.BONUS_RECTANGLE_WIDTH;
rect.height = GameDataProvider.BONUS_RECTANGLE_HEIGHT;
rect.x = (stageObj.stageWidth / 2);
rect.y = (stageObj.stageHeight / 2);
stageObj.addChild(rect);
physicRect = new RectangleParticle((stageObj.stageWidth / 2), (stageObj.stageHeight / 2), rect.width, rect.height, 0, true);
physicRect.setStyle(0, 0, 0, 0, 0);
walls.addParticle(physicRect);
car = new Car(-1, carX, carY, this);
APEngine.addGroup(car);
createBonusGameEHandlers();
SoundProvider.setQuietMode(false);
}
private function moveToNextPoint(_arg1=null):void{
GameDataProvider.RECT_MOVE_SPEED = (GameDataProvider.RECT_MOVE_SPEED + GameDataProvider.BONUS_DIFICULTY);
twX.stop();
twY.stop();
twX = null;
twY = null;
var _local2:Point = new Point();
_local2.x = ((((Math.sin(((Math.random() * 6.28) + 0.01)) + 1) * 0.5) * (stageObj.stageWidth - 200)) + 100);
_local2.y = ((((Math.cos(((Math.random() * 6.28) + 0.01)) + 1) * 0.5) * (stageObj.stageHeight - 200)) + 200);
var _local3:Number = Math.abs((rect.x - _local2.x));
var _local4:Number = Math.abs((rect.y - _local2.y));
var _local5:Number = (_local3 / GameDataProvider.RECT_MOVE_SPEED);
var _local6:Number = (_local4 / GameDataProvider.RECT_MOVE_SPEED);
twY = new Tween(rect, "y", None.easeNone, rect.y, _local2.y, _local6, true);
twX = new Tween(rect, "x", None.easeNone, rect.x, _local2.x, _local5, true);
moveTimer = setTimeout(moveToNextPoint, (((_local5 > _local6)) ? _local5 : _local6 * 1000), null);
}
private function run(_arg1:Event):void{
if (levelIsFrozen){
return;
};
if (car.center.y > (stageObj.stageHeight * 2)){
levelIsFrozen = true;
stopBonusGame();
};
var _local2:* = (back.bird.x - car.center.x);
var _local3:* = (back.bird.y - car.center.y);
back.bird.eyes.x = (-(_local2) / 200);
back.bird.eyes.y = (-(_local3) / 200);
if (back.bird.eyes.x > 1.5){
back.bird.eyes.x = 1.5;
} else {
if (back.bird.eyes.x < -1.5){
back.bird.eyes.x = -1.5;
};
};
if (back.bird.eyes.y > 1.5){
back.bird.eyes.y = 1.5;
} else {
if (back.bird.eyes.y < -1.5){
back.bird.eyes.y = -1.5;
};
};
if (!isPaused){
APEngine.step();
APEngine.paint();
};
var _local4:* = ((rect.width / 2) - (car.center.x - (rect.x - (rect.width / 2))));
_local4 = (_local4 * 1.25);
rect.rotation = (-(_local4) / 8);
physicRect.radian = GameDataProvider.ANGLE_TO_RADIAN(rect.rotation);
physicRect.px = rect.x;
physicRect.py = rect.y;
}
private function initCollidableLists():void{
walls.addCollidableList(new Array(car));
}
private function hOnTimer(_arg1:TimerEvent):void{
secondsInLevel++;
bonusTimer.scoreTxt.text = secondsInLevel.toString();
}
private function stopBonusGame():void{
wndProvider.showQuestionWindow("\nWant to replay?", restartBonusGame, preFinishBonusGame);
bonusLevelTimer.stop();
}
public function createBonusGame(_arg1:Number):void{
stageObj.frameRate = GameDataProvider.BONUS_FRAMERATE;
curBonusNum = _arg1;
createBonusGameGraphics();
}
private function clearCollidables():void{
walls.removeCollidable(car);
}
private function hKeyDown(_arg1:KeyboardEvent):void{
if (levelIsFrozen){
return;
};
switch (_arg1.keyCode){
case 39:
if (!carMoveEnabled){
return;
};
car.speed = (car.speed - ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
addSmoke();
break;
case 37:
if (!carMoveEnabled){
return;
};
car.speed = (car.speed + ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
addSmoke();
break;
case 38:
if (!carMoveEnabled){
return;
};
car.jumpAll(GameDataProvider.CAR_JUMP_HEIGHT);
break;
case 65:
if (!carMoveEnabled){
return;
};
car.speed = (car.speed + ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
addSmoke();
break;
case 68:
if (!carMoveEnabled){
return;
};
car.speed = (car.speed - ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
addSmoke();
break;
case 69:
if (!carMoveEnabled){
return;
};
car.jumpForwardWheel(GameDataProvider.CAR_HALF_JUMP_HEIGHT);
break;
case 87:
if (!carMoveEnabled){
return;
};
car.jumpAll(GameDataProvider.CAR_JUMP_HEIGHT);
break;
case 81:
if (!carMoveEnabled){
return;
};
car.jumpBackWheel(GameDataProvider.CAR_HALF_JUMP_HEIGHT);
break;
};
}
private function removeBonusGameGraphics():void{
removeLogo();
stageObj.removeChild(playground);
playground.removeChild(back);
playground.removeChild(smoke);
stageObj.removeChild(rect);
stageObj.removeChild(bonusTimer);
}
private function preFinishBonusGame():void{
wndProvider.showBonusLevelStatisticWindow(finishBonusGame, secondsInLevel);
GameDataProvider.BONUS = (GameDataProvider.BONUS + secondsInLevel);
}
private function addSmoke():void{
var _local1:*;
soundProvider.stopIdleSound();
soundProvider.playDriveSound();
if (smokeTimer > GameDataProvider.CAR_SMOKE_DELAY){
GameDataProvider.DRIVE++;
_local1 = new Bloomer();
_local1.x = (((car.center.x - (GameDataProvider.CAR_SMOKE_SPREAD * 0.5)) + (Math.random() * GameDataProvider.CAR_SMOKE_SPREAD)) + (30 * GameAccounter.currentCarOrientation));
_local1.y = (car.center.y - 10);
_local1.gotoAndPlay((int((Math.abs(car.speed) * 5)) + 1));
_local1.cacheAsBitmap = true;
smoke.addChild(_local1);
if (smoke.numChildren > GameDataProvider.CAR_SMOKE_TRAILS){
delete ??getglobalscope
[smoke.getChildAt(0)];
smoke.removeChildAt(0);
};
smokeTimer = 0;
} else {
smokeTimer++;
};
}
private function startMoveRect():void{
bonusLevelTimer.start();
var _local1:Point = new Point(0, 0);
_local1.x = Math.floor((Math.random() * stageObj.stageWidth));
_local1.y = Math.floor((Math.random() * stageObj.stageHeight));
var _local2:Number = (Math.abs((rect.x - _local1.x)) / GameDataProvider.RECT_MOVE_SPEED);
var _local3:Number = (Math.abs((rect.y - _local1.y)) / GameDataProvider.RECT_MOVE_SPEED);
twY = new Tween(rect, "y", Regular.easeIn, rect.y, _local1.y, _local3, true);
twX = new Tween(rect, "x", Regular.easeIn, rect.x, _local1.x, _local2, true);
moveTimer = setTimeout(moveToNextPoint, (((_local2 > _local3)) ? _local2 : _local3 * 1000), null);
}
private function createBonusGameGraphics():void{
playground = new Sprite();
stageObj.addChild(playground);
bonusTimer = new BonusTimer();
bonusTimer.x = ((stageObj.stageWidth / 2) - (bonusTimer.width / 2));
bonusTimer.y = 5;
bonusTimer.scoreTxt.text = secondsInLevel.toString();
stageObj.addChild(bonusTimer);
back = new GameLevels();
back.gotoAndStop(("bonus" + curBonusNum));
playground.addChild(back);
smoke = new Sprite();
playground.addChild(smoke);
initAPEngine();
wndProvider.showInformWindow("Stay on earth! don't fall!", startBonusGame);
levelIsFrozen = false;
secondsInLevel = 0;
}
private function createBonusGameEHandlers():void{
stageObj.addEventListener(KeyboardEvent.KEY_DOWN, hKeyDown, false, 0, true);
stageObj.addEventListener(KeyboardEvent.KEY_UP, hKeyUp, false, 0, true);
stageObj.addEventListener(Event.ENTER_FRAME, run, false, 0, true);
bonusLevelTimer = new Timer(1000, 0);
bonusLevelTimer.addEventListener("timer", hOnTimer);
initCollidableLists();
startMoveRect();
}
private function hKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 65:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
case 68:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
case 39:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
case 37:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
};
}
private function restartBonusGame():void{
secondsInLevel = 0;
restoreBonusGameData();
levelIsFrozen = false;
removeBonusGameGraphics();
removeBonusGameEHandlers();
createBonusGameGraphics();
}
private function finishBonusGame():void{
removeBonusGameEHandlers();
removeBonusGameGraphics();
hOnBonusGameComplete();
}
private function removeLogo():void{
if (logo != null){
stageObj.removeChild(logo);
logo.removeEventListener(MouseEvent.CLICK, hOnLogoClick);
logo = null;
};
}
private function addLogo():void{
logo = new Logo();
logo.x = 76;
logo.y = 562;
logo.buttonMode = true;
logo.mouseChildren = false;
logo.addEventListener(MouseEvent.CLICK, hOnLogoClick);
stageObj.addChild(logo);
}
private function removeBonusGameEHandlers():void{
stageObj.removeEventListener(KeyboardEvent.KEY_DOWN, hKeyDown);
stageObj.removeEventListener(KeyboardEvent.KEY_UP, hKeyUp);
stageObj.removeEventListener(Event.ENTER_FRAME, run);
bonusLevelTimer.stop();
bonusLevelTimer.removeEventListener("timer", hOnTimer);
clearTimeout(moveTimer);
clearCollidables();
APEngine.removeGroup(walls);
}
private function hOnLogoClick(_arg1:MouseEvent):void{
KingAPI.openSignLink();
}
}
}//package src
Section 70
//Bridge (src.Bridge)
package src {
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
public class Bridge extends Tool {
public function Bridge(_arg1:LevelProvider, _arg2:Point=null, _arg3:Point=null, _arg4:Number=8){
type = GameDataProvider.BRIDGE_TOOL;
super(_arg1, _arg2, _arg3, GameDataProvider.BRIDGE_PARTICLE_SIZE);
toolID = 1;
}
override public function initInstrument():void{
var _local15:Tex_Bridge;
super.initInstrument();
type = GameDataProvider.BRIDGE_TOOL;
var _local1:Number = start.x;
var _local2:Number = start.y;
var _local3:Number = ((end.x - start.x) / (4 + 1));
var _local4:Number = ((end.y - start.y) / (4 + 1));
_local1 = (_local1 + _local3);
_local2 = (_local2 + _local4);
var _local5:CircleParticle = new CircleParticle(_local1, _local2, particleSize);
_local5.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
addParticle(_local5);
_local1 = (_local1 + _local3);
_local2 = (_local2 + _local4);
var _local6:CircleParticle = new CircleParticle(_local1, _local2, particleSize);
_local6.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
addParticle(_local6);
_local1 = (_local1 + _local3);
_local2 = (_local2 + _local4);
var _local7:CircleParticle = new CircleParticle(_local1, _local2, particleSize);
_local7.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
addParticle(_local7);
_local1 = (_local1 + _local3);
_local2 = (_local2 + _local4);
var _local8:CircleParticle = new CircleParticle(_local1, _local2, particleSize);
_local8.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
addParticle(_local8);
_local1 = (_local1 + _local3);
_local2 = (_local2 + _local4);
var _local9:SpringConstraint = new SpringConstraint(particleA, _local5, 1, true, GameDataProvider.BRIDGE_THICKNESS, 1);
_local9.fixedEndLimit = 0.25;
_local9.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
var _local10:SpringConstraint = new SpringConstraint(_local5, _local6, 1, true, GameDataProvider.BRIDGE_THICKNESS, 1);
_local10.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
var _local11:SpringConstraint = new SpringConstraint(_local6, _local7, 1, true, GameDataProvider.BRIDGE_THICKNESS, 1);
_local11.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
var _local12:SpringConstraint = new SpringConstraint(_local7, _local8, 1, true, GameDataProvider.BRIDGE_THICKNESS, 1);
_local12.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
var _local13:SpringConstraint = new SpringConstraint(_local8, particleB, 1, true, GameDataProvider.BRIDGE_THICKNESS, 1);
_local13.fixedEndLimit = 0.25;
_local13.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
var _local14:Array = [];
i = 0;
while (i < 5) {
_local15 = new Tex_Bridge();
_local15.addEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
_local15.scaleX = 1;
_local15.cacheAsBitmap = true;
_local14.push(_local15);
i++;
};
i = 0;
_local9.setDisplay(_local14[i++]);
_local10.setDisplay(_local14[i++]);
_local11.setDisplay(_local14[i++]);
_local12.setDisplay(_local14[i++]);
_local13.setDisplay(_local14[i++]);
addConstraint(_local9);
addConstraint(_local10);
addConstraint(_local11);
addConstraint(_local12);
addConstraint(_local13);
}
}
}//package src
Section 71
//Car (src.Car)
package src {
import flash.display.*;
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
import flash.utils.*;
public class Car extends Group {
private var col:uint;// = 0
public var posX:Number;// = 0
public var posY:Number;// = 0
private var dy:Number;
public var carBody:MovieClip;
private var dx:Number;
private var bodyConstraint;
private var jumpIsLocked:Boolean;
private var creator;
private var startX:Number;// = 0
private var startY:Number;// = 0
private var teleTimer:Number;
public var wheel1:MovieClip;
private var jumpBackWheelTimer:Timer;
private var jumpForwardWheelTimer:Timer;
public var wheel2:MovieClip;
private var _speed:Number;
private var wheel1Mass:Number;// = 1
private var wheel2Mass:Number;// = 1
private var forwardTop;
private var bodyArr:Array;
private var wheelParticleA:WheelParticle;
private var wheelParticleB:WheelParticle;
private var jumpAllTimer:Timer;
private var jumpHeight:Number;
public var carIsHiden:Boolean;// = true
public function Car(_arg1:int=1, _arg2:int=0, _arg3:int=0, _arg4=null){
var _local19:int;
var _local20:*;
var _local21:SpringConstraint;
var _local22:SpringConstraint;
super();
var _local5:* = GameDataProvider.CAR_DEBUG;
var _local6:* = GameDataProvider.CAR_FRAME_PARTICLE_MASS;
var _local7:* = GameDataProvider.CAR_SCALE;
var _local8:* = GameDataProvider.CAR_HARDNESS;
var _local9:* = ((GameDataProvider.CAR_WX * _local7) * _arg1);
var _local10:* = ((GameDataProvider.CAR_DX * _local7) * _arg1);
var _local11:* = (GameDataProvider.CAR_DY * _local7);
collideInternal = false;
creator = _arg4;
jumpIsLocked = false;
jumpHeight = 0;
jumpAllTimer = new Timer(5, 10);
jumpAllTimer.addEventListener("timer", hJumpAll);
jumpAllTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hJumpAllFinish);
jumpForwardWheelTimer = new Timer(5, 10);
jumpForwardWheelTimer.addEventListener("timer", hJumpForwardWheel);
jumpForwardWheelTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hJumpForwardFinish);
jumpBackWheelTimer = new Timer(5, 10);
jumpBackWheelTimer.addEventListener("timer", hJumpBackWheel);
jumpBackWheelTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hJumpBackFinish);
startX = (_arg2 + (Math.abs(_local10) * 2));
startY = _arg3;
bodyArr = new Array();
var _local12:* = new CircleParticle((startX - _local10), startY, GameDataProvider.CAR_FRAME_THICKNESS, false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
_local12.setStyle(0, col, _local5, col, _local5);
addParticle(_local12);
bodyArr.push(_local12);
var _local13:* = new CircleParticle((startX - _local10), (startY - _local11), GameDataProvider.CAR_FRAME_THICKNESS, false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
_local13.setStyle(0, col, _local5, col, _local5);
addParticle(_local13);
bodyArr.push(_local13);
forwardTop = new CircleParticle((startX - (_local10 * 0.2)), (startY - (_local11 * 2)), GameDataProvider.CAR_FRAME_THICKNESS, false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
forwardTop.setStyle(0, col, _local5, col, _local5);
addParticle(forwardTop);
bodyArr.push(forwardTop);
var _local14:* = new CircleParticle((startX + _local9), (startY - (_local11 * 2)), GameDataProvider.CAR_FRAME_THICKNESS, false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
_local14.setStyle(0, col, _local5, col, _local5);
addParticle(_local14);
bodyArr.push(_local14);
var _local15:* = new CircleParticle((startX + _local10), (startY - _local11), GameDataProvider.CAR_FRAME_THICKNESS, false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
_local15.setStyle(0, col, _local5, col, _local5);
addParticle(_local15);
bodyArr.push(_local15);
var _local16:* = new CircleParticle((startX + _local10), startY, GameDataProvider.CAR_FRAME_THICKNESS, false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
_local16.setStyle(0, col, _local5, col, _local5);
addParticle(_local16);
bodyArr.push(_local16);
var _local17:* = new CircleParticle(startX, startY, (GameDataProvider.CAR_FRAME_THICKNESS * 0.5), false, _local6, GameDataProvider.CAR_FRAME_PARTICLE_ELASTICITY, GameDataProvider.CAR_FRAME_PARTICLE_FRICTION);
_local17.setStyle(0, col, _local5, col, _local5);
addParticle(_local17);
bodyArr.push(_local17);
var _local18:int;
while (_local18 < bodyArr.length) {
_local19 = 0;
while (_local19 < bodyArr.length) {
if (_local19 > _local18){
_local20 = _local8;
_local21 = new SpringConstraint(bodyArr[_local19], bodyArr[_local18], _local20, ((((_local19 == (_local18 + 1))) || ((((_local19 == (bodyArr.length - 1))) && ((_local18 == 0)))))) ? true : false, GameDataProvider.CAR_FRAME_THICKNESS, 0.8);
_local21.setStyle(0, col, _local5, col, _local5);
addConstraint(_local21);
if ((((bodyArr[_local18] == _local12)) && ((bodyArr[_local19] == _local16)))){
carBody = new Body();
carBody.cacheAsBitmap = true;
if (_arg1 < 0){
carBody.scaleY = (carBody.scaleY * _arg1);
};
_local21.setDisplay(carBody, -10, (-10 * _arg1), 0);
bodyConstraint = _local21;
};
};
_local19++;
};
_local18++;
};
wheelParticleA = new WheelParticle((startX + _local9), startY, GameDataProvider.CAR_WR, false, GameDataProvider.CAR_WHEEL_MASS);
wheelParticleA.setStyle(0, col, 0, col, 0);
wheel1 = new Wheel1();
wheel1.width = (wheel1.height = (GameDataProvider.CAR_WR * 2));
wheelParticleA.setDisplay(wheel1);
wheelParticleB = new WheelParticle((startX - _local9), startY, GameDataProvider.CAR_WR, false, GameDataProvider.CAR_WHEEL_MASS);
wheelParticleB.setStyle(0, col, 0, col, 0);
wheelParticleA.elasticity = GameDataProvider.CAR_WHEEL_ELASTICITY;
wheelParticleB.elasticity = GameDataProvider.CAR_WHEEL_ELASTICITY;
wheelParticleA.friction = GameDataProvider.CAR_WHEEL_FRICTION;
wheelParticleB.friction = GameDataProvider.CAR_WHEEL_FRICTION;
wheel2 = new Wheel1();
wheel2.width = (wheel2.height = (GameDataProvider.CAR_WR * 2));
wheel2.cacheAsBitmap = (wheel1.cacheAsBitmap = true);
addParticle(wheelParticleA);
addParticle(wheelParticleB);
bodyArr.push(wheelParticleB);
bodyArr.push(wheelParticleA);
_local18 = (bodyArr.length - 2);
while (_local18 < bodyArr.length) {
_local19 = 0;
while (_local19 < (bodyArr.length - 2)) {
_local20 = GameDataProvider.CAR_RESSORES_HARDNESS;
if ((((bodyArr[_local18] == forwardTop)) || ((bodyArr[_local18] == _local14)))){
_local20 = _local8;
};
_local22 = new SpringConstraint(bodyArr[_local19], bodyArr[_local18], _local20, false, 2);
_local22.setStyle(0, col, _local5, col, _local5);
addConstraint(_local22);
_local19++;
};
_local18++;
};
wheelParticleB.setDisplay(wheel2);
wheelParticleB.sprite.cacheAsBitmap = true;
}
public function remove():void{
jumpAllTimer.removeEventListener("timer", hJumpAll);
jumpAllTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, hJumpAllFinish);
jumpForwardWheelTimer.removeEventListener("timer", hJumpForwardWheel);
jumpForwardWheelTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, hJumpForwardFinish);
jumpBackWheelTimer.removeEventListener("timer", hJumpBackWheel);
jumpBackWheelTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, hJumpBackFinish);
jumpForwardWheelTimer.stop();
jumpBackWheelTimer.stop();
cleanup();
carBody = null;
wheel1 = null;
wheel2 = null;
APEngine.removeGroup(this);
}
private function hJumpAllFinish(_arg1:TimerEvent):void{
jumpAllTimer = new Timer(10, 10);
jumpAllTimer.addEventListener("timer", hJumpAll);
jumpAllTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hJumpAllFinish);
jumpHeight = 0;
setTimeout(enableJumps, 1000);
}
public function set speed(_arg1:Number):void{
wheelParticleA.angularVelocity = _arg1;
wheelParticleB.angularVelocity = _arg1;
}
private function hJumpAll(_arg1:TimerEvent):void{
jump(GameDataProvider.CAR_JUMP_ACCEL);
}
public function jumpAll(_arg1:Number):void{
jumpHeight = _arg1;
if (!jumpIsLocked){
jumpIsLocked = true;
jumpAllTimer.start();
};
}
private function hJumpBackWheel(_arg1:TimerEvent):void{
wheelParticleB.addForce(new Vector(0, (-(GameDataProvider.CAR_JUMP_ACCEL) * 1.2)));
}
public function addMassLessForce(_arg1:Vector):void{
var _local2:* = 0;
while (_local2 < particles.length) {
particles[_local2].addMasslessForce(_arg1);
_local2++;
};
}
public function jumpBackWheel(_arg1:Number):void{
jumpHeight = _arg1;
if (!jumpIsLocked){
jumpIsLocked = true;
jumpForwardWheelTimer.start();
};
}
public function get body():MovieClip{
return (carBody);
}
public function jump(_arg1:Number):void{
wheelParticleA.addForce(new Vector(0, -(_arg1)));
wheelParticleB.addForce(new Vector(0, -(_arg1)));
}
public function setVisibilityTo(_arg1:Boolean):void{
var _local2:Array = particles;
wheelParticleA.visible = _arg1;
wheelParticleB.visible = _arg1;
carBody.visible = _arg1;
carIsHiden = !(_arg1);
}
private function hJumpBackFinish(_arg1:TimerEvent):void{
jumpBackWheelTimer = new Timer(10, 10);
jumpBackWheelTimer.addEventListener("timer", hJumpBackWheel);
jumpBackWheelTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hJumpBackFinish);
jumpHeight = 0;
setTimeout(enableJumps, 1000);
}
public function checkWreck():void{
if ((((((wheelParticleB.px < wheelParticleA.px)) && ((forwardTop.py > center.y)))) || ((((wheelParticleB.px > wheelParticleA.px)) && ((forwardTop.py < center.y)))))){
};
}
public function get speed():Number{
return (((wheelParticleA.angularVelocity + wheelParticleB.angularVelocity) * 0.5));
}
private function enableJumps():void{
jumpIsLocked = false;
}
public function teleportAt(_arg1:Number, _arg2:Number):void{
this.dx = _arg1;
this.dy = _arg2;
carBody.play();
wheel1.play();
wheel2.play();
teleTimer = setTimeout(teleporting, 100);
}
private function hJumpForwardFinish(_arg1:TimerEvent):void{
jumpForwardWheelTimer = new Timer(10, 10);
jumpForwardWheelTimer.addEventListener("timer", hJumpForwardWheel);
jumpForwardWheelTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hJumpForwardFinish);
jumpHeight = 0;
setTimeout(enableJumps, 1000);
}
public function get center():Point{
return (new Point(((wheelParticleA.px + wheelParticleB.px) * 0.5), ((wheelParticleA.py + wheelParticleB.py) * 0.5)));
}
public function teleporting():void{
if (carBody.currentFrame < GameDataProvider.CAR_TELEPORT_FADE_FRAMES){
if (carBody.currentFrame == 1){
carBody.play();
wheel1.play();
wheel2.play();
};
teleTimer = setTimeout(teleporting, 100);
} else {
changePosition(dx, dy);
clearTimeout(teleTimer);
};
}
public function jumpForwardWheel(_arg1:Number):void{
jumpHeight = _arg1;
if (!jumpIsLocked){
jumpIsLocked = true;
jumpBackWheelTimer.start();
};
}
public function moveLeft():void{
changePosition(-(GameDataProvider.MM2_CAR_X_VEL), 0);
}
public function changePosition(_arg1:Number, _arg2:Number):void{
var _local3:Vector;
var _local4:Array = particles;
var _local5:* = wheelParticleA.angularVelocity;
var _local6:* = wheelParticleB.angularVelocity;
var _local7:int;
while (_local7 < _local4.length) {
_local3 = _local4[_local7].velocity;
_local4[_local7].px = (_local4[_local7].px + _arg1);
_local4[_local7].py = (_local4[_local7].py + _arg2);
_local4[_local7].velocity = _local3;
_local7++;
};
posX = (posX + _arg1);
posY = (posY + _arg2);
wheelParticleA.angularVelocity = _local5;
wheelParticleB.angularVelocity = _local6;
}
private function hJumpForwardWheel(_arg1:TimerEvent):void{
wheelParticleA.addForce(new Vector(0, (-(GameDataProvider.CAR_JUMP_ACCEL) * 1.2)));
}
}
}//package src
Section 72
//carFinish (src.carFinish)
package src {
import flash.display.*;
import flash.events.*;
public class carFinish extends MovieClip {
public var elasticity:Number;// = 0.1
public var friction:Number;// = 0
public function carFinish():void{
addFrameScript(0, frame1);
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
gotoAndStop(1);
LevelProvider.levelFinish = this;
}
function frame1(){
stop();
}
}
}//package src
Section 73
//carStart (src.carStart)
package src {
import flash.display.*;
public class carStart extends MovieClip {
public var elasticity:Number;// = 0.1
public var friction:Number;// = 0
public function carStart():void{
LevelProvider.levelStart = this;
}
}
}//package src
Section 74
//Cloud (src.Cloud)
package src {
import flash.display.*;
import src.org.cove.ape.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class Cloud extends MovieClip {
private var tw:Tween;
public var xVel:Number;
private var velK:Number;
private var maxX:Number;// = 800
private var maxY:Number;// = 666
public static var clouds:Array = [];
public function Cloud(){
addFrameScript(0, frame1);
cacheAsBitmap = true;
super();
var _local1:* = (y / maxY);
scaleX = (scaleY = ((1 - _local1) * 0.5));
gotoAndStop((int((Math.random() * totalFrames)) + 1));
}
function frame1(){
stop();
}
public function initCloud(_arg1:Number):void{
gotoAndStop((int((Math.random() * totalFrames)) + 1));
maxX = (GameDataProvider.STAGE_RIGHT_BOUNDARY + width);
tw = new Tween(this, "x", None.easeNone, _arg1, -(width), Math.abs(velK));
tw.addEventListener(TweenEvent.MOTION_FINISH, hFinishMovement);
tw.start();
}
private function hFinishMovement(_arg1:TweenEvent){
_arg1.target.removeEventListener(TweenEvent.MOTION_FINISH, hFinishMovement);
initCloud(maxX);
}
}
}//package src
Section 75
//DynSound (src.DynSound)
package src {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class DynSound {
protected static function writeTagInfo(_arg1:ByteArray, _arg2:int, _arg3:int):void{
if (_arg3 >= 63){
_arg1.writeShort(((_arg2 << 6) | 63));
_arg1.writeInt(_arg3);
} else {
_arg1.writeShort(((_arg2 << 6) | _arg3));
};
}
public static function playSound(_arg1:ByteArray, _arg2:Boolean):Loader{
var swf:ByteArray;
var ldr:Loader;
var wave = _arg1;
var repeat = _arg2;
swf = new ByteArray();
swf.endian = Endian.LITTLE_ENDIAN;
swf.writeByte(70);
swf.writeByte(87);
swf.writeByte(83);
swf.writeByte(7);
swf.writeUnsignedInt(0);
swf.writeByte(120);
swf.writeByte(0);
swf.writeByte(5);
swf.writeByte(95);
swf.writeByte(0);
swf.writeByte(0);
swf.writeByte(15);
swf.writeByte(160);
swf.writeByte(0);
swf.writeByte(0);
swf.writeByte(12);
swf.writeShort(1);
writeTagInfo(swf, 14, (7 + wave.length));
swf.writeShort(1);
swf.writeByte(60);
swf.writeUnsignedInt(wave.length);
swf.writeBytes(wave);
writeTagInfo(swf, 15, 3);
swf.writeShort(1);
if (repeat){
swf.writeByte(4);
swf.writeShort(0xFFFF);
} else {
swf.writeByte(0);
};
writeTagInfo(swf, 0, 0);
swf.position = 4;
swf.writeUnsignedInt(swf.length);
swf.position = 0;
ldr = new Loader();
ldr.loadBytes(swf);
ldr.addEventListener(Event.COMPLETE, function (_arg1):void{
swf.length = 0;
});
return (ldr);
}
}
}//package src
Section 76
//EdgeDragger (src.EdgeDragger)
package src {
import flash.display.*;
public class EdgeDragger extends MovieClip {
public var target:Object;
public var end:Boolean;
public function EdgeDragger(_arg1:Tool, _arg2:Boolean=false){
addFrameScript(0, frame1);
this.target = _arg1;
this.end = _arg2;
init();
}
public function init():void{
}
function frame1(){
stop();
}
}
}//package src
Section 77
//Game (src.Game)
package src {
import flash.display.*;
import flash.events.*;
import src.org.cove.ape.*;
import flash.utils.*;
import flash.net.*;
import com.midasplayer.*;
import com.midasplayer.particle.*;
public class Game extends MovieClip {
private var wndProvider:WindowProvider;
private var currentBonusNum:Number;// = 0
private var mySO:SharedObject;
public var mcLoadLogoBg:MovieClip;
public var bar:Sprite;
private var levelProvider:LevelProvider;
private var bytesLoadedNum:Number;
private var outroEasy:OutroEasy;
private var bonusProvider:BonusGameProvider;
public var holder:Sprite;
private var bytesTotalNum:Number;
private var isSkipped:Boolean;// = false
public var particles:Main;
private var clearCheatString:Timer;
private var mainMenuBack:MainMenuBack;
public var mcKingLoader:DragonLoader;
public var mochi:String;
private var cheatString:String;// = ""
public var bg:Sprite;
public var game_name:String;
private var gameAccounter:GameAccounter;
private var currentLevelData:XMLList;
private var bonusIsPlayed:Boolean;// = true
private var levelsMap:LevelsMap;
private var currentBonusData:XMLList;
private var currentLevelNum:Number;// = 0
public function Game(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
tabEnabled = false;
tabChildren = false;
stage.addEventListener(Event.ENTER_FRAME, hOnEnterFrame);
}
private function removeIntroEvents():void{
stage.removeEventListener(MouseEvent.CLICK, hAnimationSkip);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hAnimationSkip);
}
private function hOnMapLevelOver(_arg1:MouseEvent):void{
_arg1.currentTarget.gotoAndStop(2);
}
private function hTrainingStartChoosen():void{
currentLevelNum = -1;
gameAccounter.clearScores();
gameAccounter.gameMode = GameDataProvider.GM_ACTION;
removeChild(mainMenuBack);
processNextLevel();
SoundProvider.playBonusMusic();
}
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 hOnMapClick(_arg1):void{
startNextLevel();
}
private function hAnimationSkip(_arg1):void{
loadFromLocal();
isSkipped = true;
mainMenuBack.gotoAndPlay("skip");
stage.removeEventListener(MouseEvent.CLICK, hAnimationSkip);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hAnimationSkip);
wndProvider.showChooseGameModeWindow(hGameStartChoosen, hTrainingStartChoosen);
}
public function initNativeEnterFrame():void{
stage.addEventListener(Event.ENTER_FRAME, hOnEnterFrame);
}
private function hGameStartChoosen():void{
bonusIsPlayed = true;
SoundProvider.bonus = true;
SoundProvider.playGameMusic();
SoundProvider.setQuietMode(false);
gameAccounter.gameMode = GameDataProvider.GM_STRATEGIC;
if (checkForSavedGame()){
wndProvider.showQuestionWindow("Do you want to continue saved game?", continueSavedGame, startNewGame);
} else {
removeChild(mainMenuBack);
gameAccounter.clearScores();
currentLevelNum = 0;
currentBonusNum = 0;
processNextLevel();
SoundProvider.setQuietMode(true);
};
}
private function onLoaderProgress(_arg1:ProgressEvent):void{
bytesTotalNum = _arg1.bytesTotal;
bytesLoadedNum = _arg1.bytesLoaded;
}
private function processNextLevel(_arg1:Boolean=false):void{
if (currentLevelNum >= GameDataProvider.LEVELS_NUM){
stage.removeEventListener(MouseEvent.CLICK, hOnMapClick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick);
gameOver();
return;
};
if (_arg1){
startNextLevel();
return;
};
if (levelsMap == null){
levelsMap = new LevelsMap();
levelsMap.cacheAsBitmap = true;
addChild(levelsMap);
};
if (currentLevelNum > 0){
saveOnLocal();
};
initLevelsMap();
}
private function stageLoaded(_arg1:Event):void{
play();
}
private function hOnMapBonusOver(_arg1:MouseEvent):void{
_arg1.currentTarget.bonusInside.bonus.gotoAndStop(2);
}
private function saveOnLocal():void{
mySO = SharedObject.getLocal("userData");
mySO.data.curlev = currentLevelNum;
mySO.data.diff = GameDataProvider.CURRENT_DIFFICULTY_LEVEL;
mySO.data.sound = GameDataProvider.SOUNDS_OFF;
mySO.data.score = gameAccounter.currentScore;
mySO.data.star = GameDataProvider.GOLDEN_STARS;
mySO.data.star1 = GameDataProvider.SILVER_STARS;
mySO.data.star2 = GameDataProvider.GLASS_STARS;
mySO.data.jump = GameDataProvider.JUMPS;
mySO.data.anti = GameDataProvider.ANTIGRAV;
mySO.data.slow = GameDataProvider.SLOW;
mySO.data.drive = GameDataProvider.DRIVE;
mySO.data.bonus = GameDataProvider.BONUS;
mySO.data.econom = GameDataProvider.ECONOM;
mySO.data.easy = GameDataProvider.EASY;
mySO.data.hard = GameDataProvider.HARD;
mySO.data.impos = GameDataProvider.IMPOS;
mySO.flush();
}
private function disableCheatListener():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hOnKeyDown);
clearCheatString.stop();
clearCheatString.removeEventListener("timer", hClearCheatString);
clearCheatString = null;
}
private function continueSavedGame():void{
removeChild(mainMenuBack);
processNextLevel();
SoundProvider.setQuietMode(true);
}
private function initLevelData():XMLList{
currentLevelData = GameDataProvider.LEVELS_DATA[("level" + currentLevelNum)][("difficulty" + GameDataProvider.CURRENT_DIFFICULTY_LEVEL)];
bonusIsPlayed = false;
GameDataProvider.LEVEL_TIME = Number(currentLevelData.levelTime);
GameAccounter.currentLevelName = String(currentLevelData.name);
GameAccounter.currentWallNum = ((Number(currentLevelData.levelWalls))>0) ? Number(currentLevelData.levelWalls) : 0;
GameAccounter.currentBridgeNum = ((Number(currentLevelData.levelBridges))>0) ? Number(currentLevelData.levelBridges) : 0;
GameAccounter.currentJumperNum = ((Number(currentLevelData.levelJumpers))>0) ? Number(currentLevelData.levelJumpers) : 0;
GameAccounter.currentTeleportNum = ((Number(currentLevelData.levelTeleports))>0) ? Number(currentLevelData.levelTeleports) : 0;
GameAccounter.currentWindNum = ((Number(currentLevelData.levelWinds))>0) ? Number(currentLevelData.levelWinds) : 0;
if (currentLevelData.carOriented != null){
GameAccounter.currentCarOrientation = Number(currentLevelData.carOriented);
} else {
GameAccounter.currentCarOrientation = 1;
};
return (XMLList(currentLevelData.special));
}
public function openKingPage(_arg1:Event):void{
KingAPI.openLoaderProgressLink();
}
private function showStatistics():void{
stage.removeEventListener(MouseEvent.CLICK, hOnMapClick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick);
if (levelsMap != null){
removeChild(levelsMap);
levelsMap = null;
};
if (outroEasy != null){
stage.removeChild(outroEasy);
};
levelProvider.wndProvider.showStatisticsWindow(reInitMainMenu);
}
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);
gotoAndStop(2);
} else {
bar.scaleX = (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal);
mcLoadLogoBg.bar.scaleX = (1 - (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal));
};
}
private function loadFromLocal():void{
mySO = SharedObject.getLocal("userData");
if (mySO.data.curlev > 0){
gameAccounter.gameScore = mySO.data.score;
GameDataProvider.CURRENT_DIFFICULTY_LEVEL = mySO.data.diff;
GameDataProvider.GOLDEN_STARS = mySO.data.star;
GameDataProvider.SILVER_STARS = mySO.data.star1;
GameDataProvider.GLASS_STARS = mySO.data.star2;
GameDataProvider.JUMPS = mySO.data.jump;
GameDataProvider.ANTIGRAV = mySO.data.anti;
GameDataProvider.SLOW = mySO.data.slow;
GameDataProvider.DRIVE = mySO.data.drive;
GameDataProvider.BONUS = mySO.data.bonus;
GameDataProvider.ECONOM = mySO.data.econom;
GameDataProvider.EASY = mySO.data.easy;
GameDataProvider.HARD = mySO.data.hard;
GameDataProvider.IMPOS = mySO.data.impos;
currentLevelNum = mySO.data.curlev;
currentBonusNum = Math.floor((currentLevelNum / GameDataProvider.BONUS_FRIQUENCY));
bonusIsPlayed = true;
};
}
private function hOnKeyDown(_arg1:KeyboardEvent):void{
cheatString = (cheatString + _arg1.keyCode);
if (cheatString.toString() == GameDataProvider.CHEAT_CODE.toString()){
wndProvider.gameModeWnd.cheatIndicator.gotoAndPlay(2);
GameDataProvider.IS_CHEATED = true;
};
clearCheatString.stop();
clearCheatString.start();
}
private function hOnEnterFrame(_arg1:Event):void{
if (currentFrame == 3){
stage.frameRate = GameDataProvider.SLOW_FRAMERATE;
SoundProvider.setQuietMode(false);
stage.removeEventListener(Event.ENTER_FRAME, hOnEnterFrame);
mainMenuBack = new MainMenuBack();
mainMenuBack.cacheAsBitmap = true;
gameAccounter = new GameAccounter();
levelProvider = new LevelProvider(this.stage, processNextLevel, gameOver, gameAccounter, reInitMainMenu, restartCurrentLevel);
wndProvider = new WindowProvider(stage, gameAccounter, levelProvider.frozeLevel, levelProvider.unfrozeLevel);
bonusProvider = new BonusGameProvider(this.stage, processNextLevel, wndProvider, initBonusGameData);
isSkipped = false;
stage.addEventListener(MouseEvent.CLICK, hAnimationSkip, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, hAnimationSkip, false, 0, true);
addChild(mainMenuBack);
setTimeout(initMainMenu, 12000);
setTimeout(removeIntroEvents, 6000);
};
}
private function hClearCheatString(_arg1:TimerEvent):void{
cheatString = "";
}
private function restartCurrentLevel():void{
currentLevelNum--;
processNextLevel(true);
}
private function reInitMainMenu():void{
SoundProvider.stopMusic();
isSkipped = false;
stage.addEventListener(MouseEvent.CLICK, hAnimationSkip, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, hAnimationSkip, false, 0, true);
stage.frameRate = GameDataProvider.SLOW_FRAMERATE;
SoundProvider.stopMusic();
addChild(mainMenuBack);
mainMenuBack.gotoAndPlay(1);
setTimeout(initMainMenu, 12000);
setTimeout(removeIntroEvents, 6000);
enableCheatListener();
}
private function hOnMapBonusOut(_arg1:MouseEvent):void{
_arg1.currentTarget.bonusInside.bonus.gotoAndStop(1);
}
public function launchGame(_arg1):void{
mcKingLoader.destroy();
gotoAndStop(3);
}
private function hOnMapLevelOut(_arg1:MouseEvent):void{
_arg1.currentTarget.gotoAndStop(1);
}
private function hOnMapLevelDown(_arg1:MouseEvent):void{
currentLevelNum = (_arg1.currentTarget.levelNum - 1);
startNextLevel();
}
private function initBonusGameData():void{
currentBonusData = GameDataProvider.LEVELS_DATA[("bonus" + currentBonusNum)][("difficulty" + GameDataProvider.CURRENT_DIFFICULTY_LEVEL)];
GameDataProvider.BONUS_DIFICULTY = ((Number(currentBonusData.hardness))>0) ? Number(currentBonusData.hardness) : 1;
GameDataProvider.RECT_MOVE_SPEED = ((Number(currentBonusData.rectMoveSpeed))>0) ? Number(currentBonusData.rectMoveSpeed) : 1;
GameDataProvider.BONUS_RECTANGLE_HEIGHT = ((Number(currentBonusData.rectangleHeight))>0) ? Number(currentBonusData.rectangleHeight) : 100;
GameDataProvider.BONUS_RECTANGLE_WIDTH = ((Number(currentBonusData.rectangleWidth))>0) ? Number(currentBonusData.rectangleWidth) : 100;
GameDataProvider.COST_OF_A_SECOND = ((Number(currentBonusData.costOfASecond))>0) ? Number(currentBonusData.costOfASecond) : 10;
}
private function hOnLogoOut(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.CLICK, hOnMapClick);
stage.addEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick);
}
private function removeFromLocal():void{
mySO = SharedObject.getLocal("userData");
mySO.clear();
}
private function startNextLevel():void{
var _local1:Number;
var _local2:Number;
var _local3:XMLList;
levelsMap.map.removeEventListener(MouseEvent.MOUSE_OVER, hOnLogoOver);
levelsMap.map.removeEventListener(MouseEvent.MOUSE_OUT, hOnLogoOut);
levelsMap.map.removeEventListener(MouseEvent.CLICK, hOnLogoClick);
stage.removeEventListener(MouseEvent.CLICK, hOnMapClick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick);
if (levelsMap != null){
if (GameDataProvider.IS_CHEATED){
_local1 = 1;
while (_local1 <= GameDataProvider.LEVELS_NUM) {
if (levelsMap.map[("level" + _local1)] != null){
levelsMap.map[("level" + _local1)].removeEventListener(MouseEvent.MOUSE_OVER, hOnMapLevelOver);
levelsMap.map[("level" + _local1)].removeEventListener(MouseEvent.MOUSE_OUT, hOnMapLevelOut);
levelsMap.map[("level" + _local1)].removeEventListener(MouseEvent.MOUSE_DOWN, hOnMapLevelDown);
};
_local1++;
};
_local2 = 1;
while (_local2 <= 5) {
if (levelsMap.map[("bonus" + _local2)] != null){
levelsMap.map[("bonus" + _local2)].removeEventListener(MouseEvent.MOUSE_OVER, hOnMapBonusOver);
levelsMap.map[("bonus" + _local2)].removeEventListener(MouseEvent.MOUSE_OUT, hOnMapBonusOut);
levelsMap.map[("bonus" + _local2)].removeEventListener(MouseEvent.MOUSE_DOWN, hOnMapBonusDown);
};
_local2++;
};
};
removeChild(levelsMap);
levelsMap = null;
};
currentLevelNum++;
GameDataProvider.POINTS_IN_CURRENT_LEVEL = 0;
if ((((((currentLevelNum - 1) / GameDataProvider.BONUS_FRIQUENCY) == Math.floor(((currentLevelNum - 1) / GameDataProvider.BONUS_FRIQUENCY)))) && (!(bonusIsPlayed)))){
currentLevelNum--;
currentBonusNum++;
bonusIsPlayed = true;
initBonusGameData();
bonusProvider.createBonusGame(currentBonusNum);
SoundProvider.playBonusMusic();
SoundProvider.setQuietMode(false);
} else {
_local3 = initLevelData();
levelProvider.initLevel(currentLevelNum, _local3);
bonusIsPlayed = false;
SoundProvider.playGameMusic();
};
}
private function enableCheatListener():void{
if (clearCheatString == null){
stage.addEventListener(KeyboardEvent.KEY_DOWN, hOnKeyDown);
clearCheatString = new Timer(3000, 99999);
clearCheatString.addEventListener("timer", hClearCheatString);
clearCheatString.start();
cheatString = "";
};
}
function frame2(){
mcKingLoader.addEventListener(DragonLoader.LAUNCH_GAME, launchGame);
mcKingLoader.init(game_name, mochi);
}
private function gameOver():void{
SoundProvider.stopMusic();
SoundProvider.setQuietMode(false);
stage.frameRate = GameDataProvider.SLOW_FRAMERATE;
outroEasy = new OutroEasy();
stage.addChild(outroEasy);
outroEasy.gotoAndPlay(2);
setTimeout(showStatistics, 15000);
}
private function initMainMenu():void{
if (isSkipped){
return;
};
loadFromLocal();
if (!isSkipped){
stage.removeEventListener(MouseEvent.CLICK, hAnimationSkip);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hAnimationSkip);
wndProvider.showChooseGameModeWindow(hGameStartChoosen, hTrainingStartChoosen);
};
enableCheatListener();
}
private function initLevelsMap():void{
var _local3:Number;
var _local4:Number;
if (GameDataProvider.IS_CHEATED){
levelsMap.map.any.gotoAndPlay("anylevel");
_local3 = 1;
while (_local3 <= GameDataProvider.LEVELS_NUM) {
if (levelsMap.map[("level" + _local3)] != null){
levelsMap.map[("level" + _local3)].mouseChildren = false;
levelsMap.map[("level" + _local3)].gotoAndStop(1);
levelsMap.map[("level" + _local3)].levelNum = _local3;
levelsMap.map[("level" + _local3)].addEventListener(MouseEvent.MOUSE_OVER, hOnMapLevelOver);
levelsMap.map[("level" + _local3)].addEventListener(MouseEvent.MOUSE_OUT, hOnMapLevelOut);
levelsMap.map[("level" + _local3)].addEventListener(MouseEvent.MOUSE_DOWN, hOnMapLevelDown);
};
_local3++;
};
_local4 = 1;
while (_local4 <= 4) {
if (levelsMap.map[("bonus" + _local4)] != null){
levelsMap.map[("bonus" + _local4)].mouseChildren = false;
levelsMap.map[("bonus" + _local4)].bonusInside.bonus.gotoAndStop(1);
levelsMap.map[("bonus" + _local4)].bonusNum = _local4;
levelsMap.map[("bonus" + _local4)].addEventListener(MouseEvent.MOUSE_OVER, hOnMapBonusOver);
levelsMap.map[("bonus" + _local4)].addEventListener(MouseEvent.MOUSE_OUT, hOnMapBonusOut);
levelsMap.map[("bonus" + _local4)].addEventListener(MouseEvent.MOUSE_DOWN, hOnMapBonusDown);
};
_local4++;
};
return;
};
var _local1:* = currentBonusNum;
while (_local1 > 0) {
if (levelsMap.map[("bonus" + _local1)] != null){
levelsMap.map[("bonus" + _local1)].bonusInside.bonus.gotoAndStop(3);
};
_local1--;
};
var _local2:* = currentLevelNum;
while (_local2 > 0) {
if (levelsMap.map[("level" + _local2)] != null){
levelsMap.map[("level" + _local2)].gotoAndStop(3);
};
_local2--;
};
if (((((currentLevelNum / GameDataProvider.BONUS_FRIQUENCY) == Math.floor((currentLevelNum / GameDataProvider.BONUS_FRIQUENCY)))) && (!(bonusIsPlayed)))){
if (levelsMap.map[("bonus" + (currentBonusNum + 1))] != null){
levelsMap.map[("bonus" + (currentBonusNum + 1))].bonusInside.bonus.gotoAndStop(2);
};
} else {
if (levelsMap.map[("level" + (currentLevelNum + 1))] != null){
levelsMap.map[("level" + (currentLevelNum + 1))].gotoAndStop(2);
};
};
levelsMap.map.logo.buttonMode = true;
levelsMap.map.logo.addEventListener(MouseEvent.CLICK, hOnLogoClick);
levelsMap.map.logo.addEventListener(MouseEvent.MOUSE_OVER, hOnLogoOver);
levelsMap.map.logo.addEventListener(MouseEvent.MOUSE_OUT, hOnLogoOut);
stage.addEventListener(MouseEvent.CLICK, hOnMapClick, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick, false, 0, true);
}
private function getPointsForSavedTools():void{
}
private function hOnMapBonusDown(_arg1:MouseEvent):void{
currentBonusNum = (_arg1.currentTarget.bonusNum - 1);
currentLevelNum--;
currentBonusNum++;
bonusIsPlayed = true;
stage.removeEventListener(MouseEvent.CLICK, hOnMapClick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick);
var _local2:Number = 1;
while (_local2 <= GameDataProvider.LEVELS_NUM) {
if (levelsMap.map[("level" + _local2)] != null){
levelsMap.map[("level" + _local2)].removeEventListener(MouseEvent.MOUSE_OVER, hOnMapLevelOver);
levelsMap.map[("level" + _local2)].removeEventListener(MouseEvent.MOUSE_OUT, hOnMapLevelOut);
levelsMap.map[("level" + _local2)].removeEventListener(MouseEvent.MOUSE_DOWN, hOnMapLevelDown);
};
_local2++;
};
var _local3:Number = 1;
while (_local3 <= 5) {
if (levelsMap.map[("bonus" + _local3)] != null){
levelsMap.map[("bonus" + _local3)].removeEventListener(MouseEvent.MOUSE_OVER, hOnMapBonusOver);
levelsMap.map[("bonus" + _local3)].removeEventListener(MouseEvent.MOUSE_OUT, hOnMapBonusOut);
levelsMap.map[("bonus" + _local3)].removeEventListener(MouseEvent.MOUSE_DOWN, hOnMapBonusDown);
};
_local3++;
};
removeChild(levelsMap);
levelsMap = null;
initBonusGameData();
bonusProvider.createBonusGame(currentBonusNum);
SoundProvider.playBonusMusic();
SoundProvider.setQuietMode(false);
}
function frame1(){
stop();
game_name = "chaos-racer";
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 frame3(){
}
private function checkForSavedGame():Boolean{
if (GameDataProvider.IS_CHEATED){
return (false);
};
mySO = SharedObject.getLocal("userData");
if ((((mySO.data.curlev > 0)) && ((mySO.data.curlev <= GameDataProvider.LEVELS_NUM)))){
return (true);
};
return (false);
}
private function replayGame():void{
currentLevelNum = 0;
currentBonusNum = 0;
bonusIsPlayed = true;
gameAccounter.clearScores();
processNextLevel();
}
private function hOnLogoOver(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.CLICK, hOnMapClick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, hOnMapClick);
}
private function hOnLogoClick(_arg1:MouseEvent):void{
KingAPI.openSignLink();
}
private function startNewGame():void{
removeChild(mainMenuBack);
removeFromLocal();
GameDataProvider.CURRENT_DIFFICULTY_LEVEL = 1;
gameAccounter.clearScores();
currentLevelNum = 0;
currentBonusNum = 0;
processNextLevel();
SoundProvider.setQuietMode(true);
}
}
}//package src
Section 78
//GameAccounter (src.GameAccounter)
package src {
public class GameAccounter {
private var currentGameScore:Number;
public var gameMode:uint;
private var updateScorePanel:Function;
public static var currentTeleportNum:Number;
public static var currentWallNum:Number;
public static var currentBridgeNum:Number;
public static var currentWindNum:Number;
public static var currentJumperNum:Number;
public static var currentCarOrientation:Number;
public static var currentLevelName:String;
public function GameAccounter():void{
currentGameScore = 0;
currentBridgeNum = 0;
currentWallNum = 0;
currentJumperNum = 0;
currentTeleportNum = 0;
currentWindNum = 0;
currentCarOrientation = 1;
currentLevelName = "";
}
public function setScoreUpdater(_arg1:Function):void{
updateScorePanel = _arg1;
}
public function addAllScores():void{
addScore((GameDataProvider.BRIDGE_TOOL_SAVED_COST * currentBridgeNum));
addScore((GameDataProvider.JUMPER_TOOL_SAVED_COST * currentJumperNum));
addScore((GameDataProvider.TELEPORT_TOOL_SAVED_COST * currentTeleportNum));
addScore((GameDataProvider.WALL_TOOL_SAVED_COST * currentWallNum));
addScore((GameDataProvider.WIND_TOOL_SAVED_COST * currentWindNum));
}
public function removeScore(_arg1:Number):void{
currentGameScore = (currentGameScore - _arg1);
}
public function set gameScore(_arg1:Number):void{
currentGameScore = _arg1;
}
public function addScore(_arg1:Number):void{
currentGameScore = (currentGameScore + _arg1);
GameDataProvider.POINTS_IN_CURRENT_LEVEL = (GameDataProvider.POINTS_IN_CURRENT_LEVEL + _arg1);
updateScorePanel();
}
public function get currentScore():Number{
return (currentGameScore);
}
public function clearScores():void{
currentGameScore = 0;
}
}
}//package src
Section 79
//GameDataProvider (src.GameDataProvider)
package src {
import flash.display.*;
import src.org.cove.ape.*;
import flash.geom.*;
public class GameDataProvider {
public static const BONUS_FRIQUENCY:Number = 4;
public static const TOOL_BAR_DEFAULT_Y:Number = 590;
public static const DEFAULT_MUSIC_VOLUME = 1;
public static const DEF_CAR_SPEED:Number = -0.06;
public static const WIND_PARTICLE_SIZE:Number = 10;
public static const TRAINING_CAR_START_X:Number = 200;
public static const TRAINING_CAR_START_Y:Number = 300;
public static const BRIDGE_THICKNESS:Number = 15;
public static const MM2_WALL_X_VEL = 1.6;
public static const PLUS_TO_GRAVITY:Number = 8;
public static const TELEPORT_TOOL:String = "TELEPORT";
public static const JUMPER_PARTICLE_SIZE:Number = 10;
public static const WIND_DISTANCE_DECREMENT:Number = 0.01;
public static const COLOR_A:uint = 3359795;
public static const COLOR_B:uint = 3368618;
public static const COLOR_C:uint = 11189179;
public static const COLOR_D:uint = 6724010;
public static const COLOR_E:uint = 7833719;
public static const WIND_EFFECT_WIDTH:Number = 60;
public static const STAR1_SCORE:Number = 300;
public static const CAR_JUMP_HEIGHT:Number = 5;
public static const CAR_FRAME_PARTICLE_ELASTICITY = 0.2;
public static const STAGE_BOTTOM_BOUNDARY = 600;
public static const CAR_TELEPORT_FADE_FRAMES:uint = 10;
public static const CAR_MAX_FRICTION = 1;
public static const DOUBLE_CLICK_DELAY:Number = 15;
public static const CAR_FRAME_THICKNESS = 10;
public static const CAR_WHEEL_ELASTICITY = 0.2;
public static const MIN_DIST_TO_MOVE:Number = 100;
public static const MIN_WALL_LENGTH:Number = 30;
public static const CAR_SMOKE_DELAY = 1;
public static const QUESTION_WINDOW:String = "QUESTION";
public static const DRIVE_VOLUME_MULTIPLIER = 0.5;
public static const LEVEL_STATISTICS_WINDOW:String = "STATISTICS";
public static const GRAVITY_K:Number = 1.6;
public static const CLOUD_XDEL = 40000;
public static const MM2_WALL_BOTTOM_LIMIT = 800;
public static const LEVELS_DATA:XML = <game>
<level1>
<difficulty1>
<name>Level 1: Silent Welcome</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>10</levelTime>
</difficulty1>
<difficulty2>
<name>Level 1: Silent Welcome</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>10</levelTime>
</difficulty2>
<difficulty3>
<name>Level 1: Silent Welcome</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>10</levelTime>
</difficulty3>
</level1>
<level2>
<difficulty1>
<name>Level 2: Jump 2 Climb</name>
<levelWalls>0</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty1>
<difficulty2>
<name>Level 2: Jump 2 Climb</name>
<levelWalls>0</levelWalls>
<levelBridges></levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty2>
<difficulty3>
<name>Level 2: Jump 2 Climb</name>
<levelWalls>0</levelWalls>
<levelBridges></levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty3>
</level2>
<level3>
<difficulty1>
<name>Level 3: Spring Field</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>15</levelTime>
</difficulty1>
<difficulty2>
<name>Level 3: Spring Field</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>2</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>15</levelTime>
</difficulty2>
<difficulty3>
<name>Level 3: Spring Field</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>15</levelTime>
</difficulty3>
</level3>
<level4>
<difficulty1>
<name>Level 4: The Farseer</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>10</levelTime>
</difficulty1>
<difficulty2>
<name>Level 4: The Farseer</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>10</levelTime>
</difficulty2>
<difficulty3>
<name>Level 4: The Farseer</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>10</levelTime>
<special>
<antiGrav1>
<px>300</px>
<py>500</py>
<duration>4000</duration>
</antiGrav1>
</special>
</difficulty3>
</level4>
<level5>
<difficulty1>
<name>Level 5: Near Beyond</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>1</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
<special>
<megaJump1>
<px>100</px>
<py>300</py>
<duration>10000</duration>
</megaJump1>
</special>
</difficulty1>
<difficulty2>
<name>Level 5: Near Beyond</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>1</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty2>
<difficulty3>
<name>Level 5: Near Beyond</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty3>
</level5>
<level6>
<difficulty1>
<name>Level 6: Upside Down</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty1>
<difficulty2>
<name>Level 6: Upside Down</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty2>
<difficulty3>
<name>Level 6: Upside Down</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty3>
</level6>
<level7>
<difficulty1>
<name>Level 7: Tothem of Filth</name>
<levelWalls>1</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty1>
<difficulty2>
<name>Level 7: Tothem of Filth</name>
<levelWalls>0</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty2>
<difficulty3>
<name>Level 7: Tothem of Filth</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
<special>
<megaJump1>
<px>200</px>
<py>500</py>
<duration>20000</duration>
</megaJump1>
<slower1>
<px>180</px>
<py>480</py>
<duration>20000</duration>
</slower1>
</special>
</difficulty3>
</level7>
<level8>
<difficulty1>
<name>Level 8: Something in the Air</name>
<levelWalls>0</levelWalls>
<levelBridges>2</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>1</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty1>
<difficulty2>
<name>Level 8: Something in the Air</name>
<levelWalls>0</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>15</levelTime>
</difficulty2>
<difficulty3>
<name>Level 8: Something in the Air</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>15</levelTime>
</difficulty3>
</level8>
<level9>
<difficulty1>
<name>Level 9: Enter the Tower of Trials</name>
<levelWalls>1</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>35</levelTime>
</difficulty1>
<difficulty2>
<name>Level 9: Enter the Tower of Trials</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty2>
<difficulty3>
<name>Level 9: Enter the Tower of Trials</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty3>
</level9>
<level10>
<difficulty1>
<name>Level 10: Sigma - Trial of Speed</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty1>
<difficulty2>
<name>Level 10: Sigma - Trial of Speed</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty2>
<difficulty3>
<name>Level 10: Sigma - Trial of Speed</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty3>
</level10>
<level11>
<difficulty1>
<name>Level 11: Abbyss - Trial of Accuracy</name>
<levelWalls>2</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty1>
<difficulty2>
<name>Level 11: Abbyss - Trial of Accuracy</name>
<levelWalls>2</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>5</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty2>
<difficulty3>
<name>Level 11: Abbyss - Trial of Accuracy</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>15</levelTime>
<special>
<antiGrav1>
<px>250</px>
<py>500</py>
<duration>13000</duration>
</antiGrav1>
</special>
</difficulty3>
</level11>
<level12>
<difficulty1>
<name>Level 12: Coil - Trial of Sanity</name>
<levelWalls>1</levelWalls>
<levelBridges>3</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>40</levelTime>
<special>
<antiGrav1>
<px>750</px>
<py>550</py>
<duration>10000</duration>
</antiGrav1>
</special>
</difficulty1>
<difficulty2>
<name>Level 12: Coil - Trial of Sanity</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>35</levelTime>
</difficulty2>
<difficulty3>
<name>Level 12: Coil - Trial of Sanity</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty3>
</level12>
<level13>
<difficulty1>
<name>Level 13: Gate of Emptiness</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>1</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty1>
<difficulty2>
<name>Level 13: Gate of Emptiness</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty2>
<difficulty3>
<name>Level 13: Gate of Emptiness</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
<special>
<megaJump1>
<px>650</px>
<py>550</py>
<duration>2000</duration>
</megaJump1>
<antiGrav1>
<px>150</px>
<py>450</py>
<duration>2000</duration>
</antiGrav1>
</special>
</difficulty3>
</level13>
<level14>
<difficulty1>
<name>Level 14: Gate of Despair</name>
<levelWalls>2</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>2</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty1>
<difficulty2>
<name>Level 14: Gate of Despair</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
<special>
<megaJump1>
<px>150</px>
<py>350</py>
<duration>2000</duration>
</megaJump1>
<slower1>
<px>650</px>
<py>350</py>
<duration>5000</duration>
</slower1>
</special>
</difficulty2>
<difficulty3>
<name>Level 14: Gate of Despair</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
<special>
<megaJump1>
<px>650</px>
<py>400</py>
<duration>20000</duration>
</megaJump1>
</special>
</difficulty3>
</level14>
<level15>
<difficulty1>
<name>Level 15: The Hand Gate</name>
<levelWalls>3</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty1>
<difficulty2>
<name>Level 15: The Hand Gate</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
</difficulty2>
<difficulty3>
<name>Level 15: The Hand Gate</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
<special>
<antiGrav1>
<px>100</px>
<py>350</py>
<duration>5000</duration>
</antiGrav1>
<megaJump1>
<px>250</px>
<py>350</py>
<duration>5000</duration>
</megaJump1>
</special>
</difficulty3>
</level15>
<level16>
<difficulty1>
<name>Level 16: The Guardian-Gate</name>
<levelWalls>3</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>40</levelTime>
</difficulty1>
<difficulty2>
<name>Level 16: The Guardian-Gate</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>1</levelWinds>
<levelJumpers>2</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>35</levelTime>
</difficulty2>
<difficulty3>
<name>Level 16: The Guardian-Gate</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
<special>
<antiGrav1>
<px>50</px>
<py>150</py>
<duration>5000</duration>
</antiGrav1>
<megaJump1>
<px>50</px>
<py>100</py>
<duration>5000</duration>
</megaJump1>
<slower1>
<px>50</px>
<py>50</py>
<duration>5000</duration>
</slower1>
</special>
</difficulty3>
</level16>
<level17>
<difficulty1>
<name>Level 17: First Steps</name>
<levelWalls>1</levelWalls>
<levelBridges>1</levelBridges>
<levelWinds>2</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>40</levelTime>
</difficulty1>
<difficulty2>
<name>Level 17: First Steps</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>35</levelTime>
</difficulty2>
<difficulty3>
<name>Level 17: First Steps</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
<special>
<megaJump1>
<px>150</px>
<py>500</py>
<duration>40000</duration>
</megaJump1>
</special>
</difficulty3>
</level17>
<level18>
<difficulty1>
<name>Level 18: Vertical Slalom</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty1>
<difficulty2>
<name>Level 18: Vertical Slalom</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>1</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty2>
<difficulty3>
<name>Level 18: Vertical Slalom</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
</difficulty3>
</level18>
<level19>
<difficulty1>
<name>Level 19: Chaotic Alpinism</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>1</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
<special>
<antiGrav1>
<px>300</px>
<py>500</py>
<duration>10000</duration>
</antiGrav1>
<antiGrav2>
<px>580</px>
<py>180</py>
<duration>10000</duration>
</antiGrav2>
</special>
</difficulty1>
<difficulty2>
<name>Level 19: Chaotic Alpinism</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>25</levelTime>
<special>
<antiGrav1>
<px>250</px>
<py>500</py>
<duration>10000</duration>
</antiGrav1>
<megaJump1>
<px>300</px>
<py>500</py>
<duration>40000</duration>
</megaJump1>
<slower1>
<px>350</px>
<py>500</py>
<duration>30000</duration>
</slower1>
</special>
</difficulty2>
<difficulty3>
<name>Level 19: Chaotic Alpinism</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>20</levelTime>
<special>
<antiGrav1>
<px>250</px>
<py>500</py>
<duration>10000</duration>
</antiGrav1>
<slower1>
<px>350</px>
<py>500</py>
<duration>30000</duration>
</slower1>
</special>
</difficulty3>
</level19>
<level20>
<difficulty1>
<name>Level 20: Enter the Void</name>
<levelWalls>1</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>40</levelTime>
</difficulty1>
<difficulty2>
<name>Level 20: Enter the Void</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>35</levelTime>
</difficulty2>
<difficulty3>
<name>Level 20: Enter the Void</name>
<levelWalls>0</levelWalls>
<levelBridges>0</levelBridges>
<levelWinds>0</levelWinds>
<levelJumpers>0</levelJumpers>
<levelTeleports>0</levelTeleports>
<carOriented>-1</carOriented>
<levelTime>30</levelTime>
</difficulty3>
</level20>
<bonus1>
<difficulty1>
<hardness>2</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>400</rectangleWidth>
<costOfASecond>10</costOfASecond>
</difficulty1>
<difficulty2>
<hardness>2</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>300</rectangleWidth>
<costOfASecond>20</costOfASecond>
</difficulty2>
<difficulty3>
<hardness>2</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>200</rectangleWidth>
<costOfASecond>30</costOfASecond>
</difficulty3>
</bonus1>
<bonus2>
<difficulty1>
<hardness>3</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>400</rectangleWidth>
<costOfASecond>20</costOfASecond>
</difficulty1>
<difficulty2>
<hardness>3</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>300</rectangleWidth>
<costOfASecond>30</costOfASecond>
</difficulty2>
<difficulty3>
<hardness>3</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>200</rectangleWidth>
<costOfASecond>40</costOfASecond>
</difficulty3>
</bonus2>
<bonus3>
<difficulty1>
<hardness>4</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>400</rectangleWidth>
<costOfASecond>30</costOfASecond>
</difficulty1>
<difficulty2>
<hardness>4</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>300</rectangleWidth>
<costOfASecond>40</costOfASecond>
</difficulty2>
<difficulty3>
<hardness>4</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>200</rectangleWidth>
<costOfASecond>50</costOfASecond>
</difficulty3>
</bonus3>
<bonus4>
<difficulty1>
<hardness>5</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>400</rectangleWidth>
<costOfASecond>40</costOfASecond>
</difficulty1>
<difficulty2>
<hardness>5</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>300</rectangleWidth>
<costOfASecond>50</costOfASecond>
</difficulty2>
<difficulty3>
<hardness>5</hardness>
<rectMoveSpeed>60</rectMoveSpeed>
<rectangleHeight>100</rectangleHeight>
<rectangleWidth>200</rectangleWidth>
<costOfASecond>60</costOfASecond>
</difficulty3>
</bonus4>
</game>
;
public static const CAR_ACCEL = 0.618;
public static const STAGE_RIGHT_BOUNDARY = 800;
public static const LEVELS_NUM:Number = 20;
public static const TELEPORT_TOOL_SAVED_COST:Number = 50;
public static const BRIDGE_TOOL:String = "BRIDGE";
public static const CAR_POWER:Number = 0.5;
public static const CAR_FRAME_PARTICLE_FRICTION = 0.1;
public static const CAR_FRAME_PARTICLE_MASS = 0.04;
public static const MM2_WALL_RIGHT_LIMIT = 1000;
public static const JUMPER_TOOL_SAVED_COST:Number = 25;
public static const TOOL_NAME:Array = [0, "Bridge", "Wall", "Jumper", "Fan", "Teleporter", "Clear Stage", "Restart", "Exit"];
public static const DOWN_CAR_BORDER:Number = 1000;
public static const CAR_SCALE = 0.33;
public static const CAR_SMOKE_TRAILS = 10;
public static const STAR3_SCORE:Number = 100;
public static const JUMPER_ACCEL:Number = 25;
public static const WALL_TOOL:String = "WALL";
public static const SLOW_FRAMERATE:Number = 30;
public static const NEED_FOR_AWARD_1:Number = 200;
public static const NEED_FOR_AWARD_2:Number = 20;
public static const NEED_FOR_AWARD_3:Number = 5;
public static const NEED_FOR_AWARD_4:Number = 1500;
public static const BRIDGE_TOOL_SAVED_COST:Number = 20;
public static const DEFAULT_VOLUME = 0.5;
public static const NEED_FOR_AWARD_5:Number = 10;
public static const CAR_DX = 140;
public static const CAR_DY = 50;
public static const CAR_WHEEL_MASS = 0.15;
public static const CAR_SMOKE_SPREAD = 15;
public static const MIN_BRIDGE_LENGTH:Number = 50;
public static const CAR_JUMP_MEGA:Number = 5;
public static const TOOL_RADIUS:Array = [0, 200, 160, 0, 0, 250];
public static const MM2_WALL_FRICTION = 0;
public static const WALL_THICKNESS:Number = 20;
public static const GM_STRATEGIC = 1;
public static const DEFAULT_FRAMERATE:Number = 55;
public static const WALL_TOOL_SAVED_COST:Number = 10;
public static const CAR_WR = 20;
public static const MM2_WALL_LEFT_LIMIT = 100;
public static const CAR_WX = 95;
public static const WALL_ELASTICITY:Number = 0.2;
public static const MM2_CAR_X_VEL = 1.6;
public static const CAR_WHEEL_FRICTION = 0.001;
public static const BONUS_FRAMERATE:Number = 45;
public static const WIND_TOOL:String = "WIND";
public static const WIND_TOOL_SAVED_COST:Number = 35;
public static const CAR_HALF_JUMP_HEIGHT:Number = 3;
public static const INFORM_WINDOW:String = "INFORM";
public static const PANNEL_HIDDEN_Y:Number = 700;
public static const STAR2_SCORE:Number = 200;
public static const GM_ACTION = 2;
public static const CAR_RESSORES_HARDNESS = 0.1;
public static const ENGINE_VOLUME = 0.3;
public static const CAR_JUMP_DEFAULT:Number = 3;
public static const HELP_WND_FRAMERATE:Number = 25;
public static const DEF_TOOL_RADIUS:Number = 150;
public static const MM2_WALL_START_SIZE = 250;
public static const WALL_FRICTION:Number = 0;
public static const WIND_ACCEL:Number = 5;
public static const HUD_ALPHA = 1;
public static const BRIDGE_PARTICLE_SIZE:Number = 6;
public static const MM2_WALL_ACCEL = 2;
public static const CAR_HARDNESS = 0.79;
public static const CAR_DEBUG = 0;
public static const MM2_MASSLESS_FORCE:Vector = new Vector(-15, 0);
public static const CHEAT_CODE:String = "6772696584657676";
public static const JUMPER_TOOL:String = "JUMPER";
public static var SLOW:Number = 0;
public static var CURRENT_DIFFICULTY_LEVEL:Number = 1;
public static var EASY:Number = 0;
public static var COST_OF_A_SECOND:Number = 10;
public static var BONUS_RECTANGLE_HEIGHT:Number = 100;
public static var BONUS_RECTANGLE_WIDTH:Number = 100;
public static var IS_CHEATED:Boolean = false;
public static var SILVER_STARS:Number = 0;
public static var IMPOS:Number = 0;
public static var PANNEL_IS_HIDDEN:Boolean = false;
public static var ANTIGRAV:Number = 0;
public static var LEVEL_TIME:Number = 0;
public static var BONUS_DIFICULTY:Number = 2;
public static var HARD:Number = 0;
public static var CAR_JUMP_ACCEL = 3;
public static var POINTS_IN_CURRENT_LEVEL:Number = 0;
public static var DRIVE:Number = 0;
public static var RECT_MOVE_SPEED:Number = 20;
public static var GOLDEN_STARS:Number = 0;
public static var ECONOM:Number = 0;
public static var GLASS_STARS:Number = 0;
public static var SAVED_LEVEL_TIME:Number = 0;
public static var SOUNDS_OFF:Boolean = false;
public static var JUMPS:Number = 0;
public static var COST_OF_SECOND:Number = 5;
public static var BONUS:Number = 0;
public static function DISTANCE(_arg1:Point, _arg2:Point):Number{
return (Math.sqrt((((_arg2.x - _arg1.x) * (_arg2.x - _arg1.x)) + ((_arg2.y - _arg1.y) * (_arg2.y - _arg1.y)))));
}
public static function ANGLE(_arg1:Point, _arg2:Point):Number{
return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x)));
}
public static function checkForCollision(_arg1:DisplayObject, _arg2:MovieClip, _arg3:MovieClip, _arg4:Number=225):Rectangle{
var _local5:Rectangle = _arg2.getBounds(_arg1);
var _local6:Rectangle = _arg3.getBounds(_arg1);
if ((((((_local5.right < _local6.left)) || ((_local6.right < _local5.left)))) || ((((_local5.bottom < _local6.top)) || ((_local6.bottom < _local5.top)))))){
return (null);
};
var _local7:* = Math.max(_local5.left, _local6.left);
var _local8:* = Math.min(_local5.right, _local6.right);
var _local9:* = Math.max(_local5.top, _local6.top);
var _local10:* = Math.min(_local5.bottom, _local6.bottom);
var _local11:Rectangle = new Rectangle(_local7, _local9, (_local8 - _local7), (_local10 - _local9));
var _local12:BitmapData = new BitmapData((int(_local11.width) + 1), (int(_local11.height) + 1), false);
var _local13:Matrix = _arg2.transform.concatenatedMatrix;
_arg2.transform.concatenatedMatrix.tx = (_local13.tx - _local11.left);
_local13.ty = (_local13.ty - _local11.top);
_local12.draw(_arg2, _local13, new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, _arg4));
_local13 = _arg3.transform.concatenatedMatrix;
_arg3.transform.concatenatedMatrix.tx = (_local13.tx - _local11.left);
_local13.ty = (_local13.ty - _local11.top);
_local12.draw(_arg3, _local13, new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, _arg4), "difference");
var _local14:Rectangle = _local12.getColorBoundsRect(4294967295, 4278255615);
if (_local14.width == 0){
return (null);
};
_local14.x = (_local14.x + _local11.left);
_local14.y = (_local14.y + _local11.top);
return (_local14);
}
public static function ANGLE_TO_RADIAN(_arg1:Number):Number{
return (((Math.PI / 180) * _arg1));
}
}
}//package src
Section 80
//HighSpeedElement (src.HighSpeedElement)
package src {
import flash.display.*;
import flash.events.*;
public class HighSpeedElement extends MovieClip {
public var elasticity:Number;// = 0.1
public var friction:Number;// = 0
public function HighSpeedElement():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.levelRectangles.push(this);
}
}
}//package src
Section 81
//IndicatorsProvider (src.IndicatorsProvider)
package src {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class IndicatorsProvider {
private var antiGravTimer:Timer;
private var animationFPS:Number;// = 100
private var gravDuration:Number;// = 0
private var stageObj:Stage;
private var jumpDuration:Number;// = 0
private var megaJumpTimer:Timer;
private var slowerDuration:Number;// = 0
private var slowerTimer:Timer;
private var indicatorsMc:MovieClip;
public function IndicatorsProvider(_arg1:Stage):void{
stageObj = _arg1;
}
private function hOnSlowerAnimation(_arg1:TimerEvent):void{
var _local2:Number = (slowerTimer.currentCount * animationFPS);
var _local3:* = (_local2 / slowerDuration);
var _local4:Number = Math.floor((_local3 * indicatorsMc.slower.movie.totalFrames));
indicatorsMc.slower.movie.gotoAndStop(_local4);
}
private function createIndicatorAnimation(_arg1:Object):void{
var _local2:* = Math.floor((_arg1.duration * 0.9));
switch (_arg1.name){
case "megaJump":
jumpDuration = _local2;
if (megaJumpTimer != null){
megaJumpTimer.stop();
megaJumpTimer.removeEventListener("timer", hOnMegaJumpAnimation);
megaJumpTimer = null;
};
megaJumpTimer = new Timer(animationFPS, Math.floor((_local2 / animationFPS)));
megaJumpTimer.addEventListener("timer", hOnMegaJumpAnimation);
megaJumpTimer.start();
break;
case "slower":
slowerDuration = _local2;
if (slowerTimer != null){
slowerTimer.stop();
slowerTimer.removeEventListener("timer", hOnSlowerAnimation);
slowerTimer = null;
};
slowerTimer = new Timer(animationFPS, Math.floor((_local2 / animationFPS)));
slowerTimer.addEventListener("timer", hOnSlowerAnimation);
slowerTimer.start();
break;
case "antiGrav":
gravDuration = _local2;
if (antiGravTimer != null){
antiGravTimer.stop();
antiGravTimer.removeEventListener("timer", hOnAntiGravAnimation);
antiGravTimer = null;
};
antiGravTimer = new Timer(animationFPS, Math.floor((_local2 / animationFPS)));
antiGravTimer.addEventListener("timer", hOnAntiGravAnimation);
antiGravTimer.start();
break;
};
}
public function addSpecialIndicator(_arg1:Object):void{
createIndicatorAnimation(_arg1);
}
public function stopAnimations():void{
if (megaJumpTimer != null){
megaJumpTimer.stop();
megaJumpTimer.removeEventListener("timer", hOnMegaJumpAnimation);
megaJumpTimer = null;
};
if (slowerTimer != null){
slowerTimer.stop();
slowerTimer.removeEventListener("timer", hOnSlowerAnimation);
slowerTimer = null;
};
if (antiGravTimer != null){
antiGravTimer.stop();
antiGravTimer.removeEventListener("timer", hOnAntiGravAnimation);
antiGravTimer = null;
};
if (indicatorsMc != null){
indicatorsMc.antiGrav.movie.gotoAndStop(1);
indicatorsMc.slower.movie.gotoAndStop(1);
indicatorsMc.megaJump.movie.gotoAndStop(1);
};
}
private function hOnAntiGravAnimation(_arg1:TimerEvent):void{
var _local2:Number = (antiGravTimer.currentCount * animationFPS);
var _local3:* = (_local2 / gravDuration);
var _local4:Number = Math.floor((_local3 * indicatorsMc.antiGrav.movie.totalFrames));
indicatorsMc.antiGrav.movie.gotoAndStop(_local4);
}
public function showIndicators():void{
stopAnimations();
if (indicatorsMc == null){
indicatorsMc = new IndicatorsForBonuses();
indicatorsMc.y = 5;
indicatorsMc.x = ((stageObj.stageWidth - indicatorsMc.width) - 5);
indicatorsMc.antiGrav.gotoAndStop(1);
indicatorsMc.megaJump.gotoAndStop(2);
indicatorsMc.slower.gotoAndStop(3);
stageObj.addChild(indicatorsMc);
} else {
indicatorsMc.visible = true;
indicatorsMc.antiGrav.gotoAndStop(1);
indicatorsMc.megaJump.gotoAndStop(2);
indicatorsMc.slower.gotoAndStop(3);
};
}
public function hideIndicators():void{
if (indicatorsMc != null){
indicatorsMc.visible = false;
indicatorsMc.antiGrav.gotoAndStop(1);
indicatorsMc.megaJump.gotoAndStop(2);
indicatorsMc.slower.gotoAndStop(3);
stopAnimations();
};
}
public function removeIndicators():void{
if (indicatorsMc != null){
stageObj.removeChild(indicatorsMc);
indicatorsMc = null;
};
}
private function hOnMegaJumpAnimation(_arg1:TimerEvent):void{
var _local2:Number = (megaJumpTimer.currentCount * animationFPS);
var _local3:* = (_local2 / jumpDuration);
var _local4:Number = Math.floor((_local3 * indicatorsMc.megaJump.movie.totalFrames));
indicatorsMc.megaJump.movie.gotoAndStop(_local4);
}
}
}//package src
Section 82
//Jumper (src.Jumper)
package src {
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
public class Jumper extends Tool {
public function Jumper(_arg1:LevelProvider, _arg2:Point=null, _arg3:Boolean=false){
type = GameDataProvider.JUMPER_TOOL;
super(_arg1, _arg2, _arg2, GameDataProvider.JUMPER_PARTICLE_SIZE, _arg3);
toolID = 3;
}
override public function addDraggersListeners():void{
}
override public function initInstrument():void{
super.initInstrument();
wall = new RectangleParticle(start.x, start.y, 30, 30, 0, true, 1, 0, 0);
texture = new Tex_Jumper();
if (!permanent){
texture.addEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
};
texture.cacheAsBitmap = true;
wall.setDisplay(texture);
addParticle(wall);
}
}
}//package src
Section 83
//jumperForLevelMap (src.jumperForLevelMap)
package src {
import flash.display.*;
public class jumperForLevelMap extends MovieClip {
public var elasticity:Number;// = 0.1
public var friction:Number;// = 0
public function jumperForLevelMap():void{
LevelProvider.levelJumpers.push(this);
}
}
}//package src
Section 84
//LevelProvider (src.LevelProvider)
package src {
import flash.display.*;
import src.*;
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
import flash.utils.*;
import com.midasplayer.*;
import flash.media.*;
import flash.ui.*;
class LevelProvider {
private var gameLevels;
private var levelIsFrozen:Boolean;// = true
public var soundProvider:SoundProvider;
private var levelTimer:Timer;
private var levelNameMc:LevelNameMc;
private var hReturnToMainMenu:Function;
private var currentBloomer:uint;// = 0
public var draggedTool;
public var addedInstruments:Array;
public var addedInstrumentsLength:int;// = 0
private var indicatorsProvider:IndicatorsProvider;
private var pseudoPreloader:PseudoPreloader;
private var DOUBLE_CLICK_DELAY:int;
private var levelIsFinished:Boolean;// = false
private var i:int;
private var hGameOver:Function;
private var indicatorForMouse:IndicatorForMouse;
private var resetBtn:ResetBtn;
private var startBtn:StartBtn;
private var clickTimer:uint;// = 0
public var starsLength:int;// = 0
private var wallEnd:Point;
private var restartLevel:Function;
private var wallStart:Point;
private var gravTimer:Timer;
private var megaJumperTimer:Timer;
private var specials:XMLList;
private var showPannelBtn:ShowPannelBtn;
private var isAntiGravitated:Boolean;// = false
private var drawer:Sprite;
private var showDarkTimer:Timer;
private var isPaused:Boolean;// = false
private var apeContainer:Sprite;
private var smokeTimer:uint;
private var stageObj:Stage;
private var levelCompleted:Function;
private var background:Sprite;
private var foreground:Sprite;
private var levelSecondsMc:LevelSecondsMc;
public var toolIndicator:ToolIndicator;
public var toolBar:ToolBar;
private var levelNum:Number;// = 1
private var smoke:Sprite;
private var slowerTimer:Timer;
public var wndProvider:WindowProvider;
private var rightLimitWall:RectangleParticle;
private var dackOverMc:DackOverMc;
public var accounter:GameAccounter;
private var specialsArray:Array;
private var logo:Logo;
private var rotator:Rotator;
private var playground:Sprite;
public var carMoveEnabled:Boolean;// = false
private var hitPoint:Point;
private var cloudIterator:uint;// = 0
private var scoreMc:ScoreMc;
private var car:Car;
private var gameOver:Boolean;// = false
private var walls:Group;
public static var stars:Array;
public static var levelPortals:Array = [];
public static var levelWinds:Array = [];
public static var editMode:Boolean = false;
public static var levelRectangles:Array = [];
public static var levelFinish:MovieClip = null;
public static var activeDragger:EdgeDragger = null;
public static var levelJumpers:Array = [];
public static var levelStart:MovieClip = null;
function LevelProvider(_arg1:Stage, _arg2:Function, _arg3:Function, _arg4:GameAccounter, _arg5, _arg6):void{
addedInstruments = [];
specialsArray = [];
DOUBLE_CLICK_DELAY = GameDataProvider.DOUBLE_CLICK_DELAY;
super();
restartLevel = _arg6;
hReturnToMainMenu = _arg5;
accounter = _arg4;
accounter.setScoreUpdater(updateScorePanel);
hGameOver = _arg3;
levelCompleted = _arg2;
stageObj = _arg1;
wndProvider = new WindowProvider(stageObj, accounter, frozeLevel, unfrozeLevel);
soundProvider = new SoundProvider();
}
private function addResetButton():void{
resetBtn = new ResetBtn();
resetBtn.x = 300;
resetBtn.y = 535;
resetBtn.mouseChildren = false;
resetBtn.visible = false;
resetBtn.addEventListener(MouseEvent.CLICK, hOnResetBtnClick, false, 0, true);
resetBtn.addEventListener(MouseEvent.MOUSE_OUT, hOnResetBtnOut, false, 0, true);
resetBtn.addEventListener(MouseEvent.MOUSE_OVER, hOnResetBtnOver, false, 0, true);
resetBtn.resetBtnInside.gotoAndStop(1);
stageObj.addChild(resetBtn);
}
private function initCollidableLists():void{
walls.addCollidableList(new Array(car));
i = 0;
while (i < addedInstruments.length) {
if (((!((addedInstruments[i].toolID == 5))) && (!((addedInstruments[i].start == null))))){
car.addCollidable(addedInstruments[i]);
};
i++;
};
reCalcWinds();
}
private function initSpecials():void{
var _local4:Object;
var _local1:Number = 1;
while (specials[("megaJump" + _local1)].toString() != "") {
_local4 = {};
_local4.name = "megaJump";
_local4.px = specials[("megaJump" + _local1)].px;
_local4.py = specials[("megaJump" + _local1)].py;
_local4.duration = specials[("megaJump" + _local1)].duration;
specialsArray.push(_local4);
_local4 = null;
_local1++;
};
var _local2:Number = 1;
while (specials[("slower" + _local2)].toString() != "") {
_local4 = {};
_local4.name = "slower";
_local4.px = specials[("slower" + _local2)].px;
_local4.py = specials[("slower" + _local2)].py;
_local4.duration = specials[("slower" + _local2)].duration;
specialsArray.push(_local4);
_local4 = null;
_local2++;
};
var _local3:Number = 1;
while (specials[("antiGrav" + _local3)].toString() != "") {
_local4 = {};
_local4.name = "antiGrav";
_local4.px = specials[("antiGrav" + _local3)].px;
_local4.py = specials[("antiGrav" + _local3)].py;
_local4.duration = specials[("antiGrav" + _local3)].duration;
specialsArray.push(_local4);
_local4 = null;
_local3++;
};
}
public function restart():void{
clearCollidables();
car.remove();
initCar((gameLevels.carStart.x - 100), gameLevels.carStart.y);
initCollidableLists();
resetPortals();
}
private function showStatisticsWindow(_arg1, _arg2):void{
wndProvider.showLevelStatisticsWindow(_arg1, _arg2);
}
public function clearAll():void{
i = 0;
while (i < addedInstruments.length) {
if (!addedInstruments[i].permanent){
addedInstruments[i].removeInstrument();
addedInstruments.splice(i, 1);
if (i > 0){
i--;
};
addedInstrumentsLength--;
};
i++;
};
}
public function setToolIndicator(_arg1:String):void{
switch (_arg1){
case GameDataProvider.BRIDGE_TOOL:
toolIndicator.gotoAndStop(2);
indicatorForMouse.visible = true;
indicatorForMouse.gotoAndStop(1);
break;
case GameDataProvider.WALL_TOOL:
toolIndicator.gotoAndStop(3);
indicatorForMouse.visible = true;
indicatorForMouse.gotoAndStop(2);
break;
case GameDataProvider.JUMPER_TOOL:
toolIndicator.gotoAndStop(4);
indicatorForMouse.gotoAndStop(3);
indicatorForMouse.visible = true;
break;
case GameDataProvider.WIND_TOOL:
toolIndicator.gotoAndStop(5);
indicatorForMouse.gotoAndStop(4);
indicatorForMouse.visible = true;
break;
case GameDataProvider.TELEPORT_TOOL:
toolIndicator.gotoAndStop(6);
indicatorForMouse.gotoAndStop(5);
indicatorForMouse.visible = true;
break;
default:
toolIndicator.gotoAndStop(1);
indicatorForMouse.visible = false;
Mouse.show();
break;
};
}
private function hKeyDown(_arg1:KeyboardEvent):void{
if (levelIsFrozen){
return;
};
switch (_arg1.keyCode){
case 39:
if (!carMoveEnabled){
return;
};
if (isAntiGravitated){
car.speed = (car.speed + ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
} else {
car.speed = (car.speed - ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
};
addSmoke();
break;
case 37:
if (!carMoveEnabled){
return;
};
if (isAntiGravitated){
car.speed = (car.speed - ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
} else {
car.speed = (car.speed + ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
};
addSmoke();
break;
case 38:
if (!carMoveEnabled){
return;
};
car.jumpAll(GameDataProvider.CAR_JUMP_HEIGHT);
break;
case 65:
if (!carMoveEnabled){
return;
};
if (isAntiGravitated){
car.speed = (car.speed - ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
} else {
car.speed = (car.speed + ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
};
addSmoke();
break;
case 68:
if (!carMoveEnabled){
return;
};
if (isAntiGravitated){
car.speed = (car.speed + ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
} else {
car.speed = (car.speed - ((Math.abs(car.speed) - GameDataProvider.CAR_POWER) * GameDataProvider.CAR_ACCEL));
};
addSmoke();
break;
case 32:
if (!levelIsFinished){
changeMovementState();
};
break;
case 80:
if (!levelIsFinished){
isPaused = (isPaused) ? false : true;
};
break;
case 69:
if (!carMoveEnabled){
return;
};
car.jumpForwardWheel(GameDataProvider.CAR_HALF_JUMP_HEIGHT);
break;
case 87:
if (!carMoveEnabled){
return;
};
car.jumpAll(GameDataProvider.CAR_JUMP_HEIGHT);
break;
case 81:
if (!carMoveEnabled){
return;
};
car.jumpBackWheel(GameDataProvider.CAR_HALF_JUMP_HEIGHT);
break;
};
}
public function enableShowPannelBtn():void{
if (carMoveEnabled){
return;
};
if (showPannelBtn == null){
createShowPannelBtn();
};
showPannelBtn.visible = true;
showPannelBtn.mouseEnabled = true;
}
private function initToolIndicator():void{
toolIndicator = new ToolIndicator();
toolIndicator.mouseEnabled = false;
toolIndicator.mouseChildren = false;
toolIndicator.x = ((stageObj.stageWidth - toolIndicator.width) - 5);
toolIndicator.y = 5;
indicatorForMouse.visible = false;
stageObj.addChild(toolIndicator);
stageObj.addChild(indicatorForMouse);
}
private function resume():void{
isPaused = false;
}
private function hOnMegaJumper(_arg1:TimerEvent):void{
GameDataProvider.CAR_JUMP_ACCEL = GameDataProvider.CAR_JUMP_DEFAULT;
}
private function hOnLevelGraphicsInit(_arg1:Event=null):void{
if ((gameLevels.totalFrames - 2) < levelNum){
gameOver = true;
startLevelComplete();
hGameOver();
return;
};
removePseudoPreloader();
gameLevels.visible = true;
var _local2:Sound = new snd_gong();
_local2.play();
indicatorsProvider = new IndicatorsProvider(stageObj);
initStars();
addResetButton();
addLogo();
initLevelRectangles();
initJumpers();
initWinds();
initFinishFlag();
setTimeout(preInitCar, 100);
initToolBar();
initToolIndicator();
createSpecials();
initLevelTimer();
if (levelNameMc != null){
levelNameMc.nameTxt.text = GameAccounter.currentLevelName;
};
if ((((levelNum == 1)) && (!(carMoveEnabled)))){
setTimeout(getHelpWindow, 2000);
};
}
private function processReturnToMainMenu():void{
gameOver = true;
startLevelComplete();
hReturnToMainMenu();
SoundProvider.setQuietMode(false);
}
private function initToolBar():void{
toolBar = new ToolBar(this, returnToMainMenu, wndProvider);
toolBar.x = 0;
if (GameDataProvider.PANNEL_IS_HIDDEN){
toolBar.y = GameDataProvider.PANNEL_HIDDEN_Y;
enableShowPannelBtn();
} else {
toolBar.y = (stageObj.stageHeight - (toolBar.height * 0.1));
};
stageObj.addChild(toolBar);
initEventHandlers();
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
addStartButton();
initScorePannel();
};
}
private function initWinds():void{
var _local2:Point;
var _local3:Wind;
var _local1:Number = 0;
if (gameLevels.currentFrame == 1){
_local1++;
};
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
while (levelWinds[_local1]) {
_local2 = new Point(levelWinds[_local1].x, levelWinds[_local1].y);
_local3 = new Wind(this, _local2, true);
levelWinds[_local1].visible = false;
_local1++;
};
};
}
private function suspend():void{
isPaused = true;
}
private function removeResetButton():void{
if (resetBtn != null){
stageObj.removeChild(resetBtn);
resetBtn.removeEventListener(MouseEvent.CLICK, hOnResetBtnClick);
resetBtn.removeEventListener(MouseEvent.MOUSE_OUT, hOnResetBtnOut);
resetBtn.removeEventListener(MouseEvent.MOUSE_OVER, hOnResetBtnOver);
resetBtn = null;
};
}
public function getAllWalls():Array{
var _local1:Array = new Array();
i = 0;
while (i < walls.particles.length) {
_local1.push(walls.particles[i]);
i++;
};
i = 0;
while (i < addedInstruments.length) {
if (addedInstruments[i].wall){
_local1.push(addedInstruments[i].wall);
};
i++;
};
return (_local1);
}
private function eatSpecial(_arg1:Object):void{
switch (_arg1.name){
case "megaJump":
GameDataProvider.JUMPS++;
_arg1.movie.visible = false;
if (megaJumperTimer != null){
megaJumperTimer.stop();
megaJumperTimer.removeEventListener("timer", hOnMegaJumper);
megaJumperTimer = null;
};
megaJumperTimer = new Timer(_arg1.duration, 1);
megaJumperTimer.addEventListener("timer", hOnMegaJumper);
if (isAntiGravitated){
GameDataProvider.CAR_JUMP_ACCEL = -(GameDataProvider.CAR_JUMP_MEGA);
} else {
GameDataProvider.CAR_JUMP_ACCEL = GameDataProvider.CAR_JUMP_MEGA;
};
megaJumperTimer.start();
break;
case "slower":
GameDataProvider.SLOW++;
_arg1.movie.visible = false;
if (slowerTimer != null){
slowerTimer.stop();
slowerTimer.removeEventListener("timer", hOnSlower);
slowerTimer = null;
};
slowerTimer = new Timer(_arg1.duration, 1);
slowerTimer.addEventListener("timer", hOnSlower);
stageObj.frameRate = GameDataProvider.SLOW_FRAMERATE;
slowerTimer.start();
createDarkBack();
break;
case "antiGrav":
GameDataProvider.ANTIGRAV++;
isAntiGravitated = true;
_arg1.movie.visible = false;
if (gravTimer != null){
gravTimer.stop();
gravTimer.removeEventListener("timer", hOnGravitation);
gravTimer = null;
};
gravTimer = new Timer(Number(_arg1.duration), 1);
gravTimer.addEventListener("timer", hOnGravitation);
APEngine.addMasslessForce(new Vector(0, -(GameDataProvider.PLUS_TO_GRAVITY)));
if (GameDataProvider.CAR_JUMP_ACCEL > 0){
GameDataProvider.CAR_JUMP_ACCEL = -(GameDataProvider.CAR_JUMP_ACCEL);
};
gravTimer.start();
break;
};
indicatorsProvider.addSpecialIndicator(_arg1);
}
private function setResetBtnVisibleTo(_arg1:Boolean):void{
if (((!((resetBtn == null))) && (carMoveEnabled))){
resetBtn.visible = _arg1;
logo.visible = _arg1;
};
}
private function onSingleToolStartDrag(_arg1:MouseEvent):void{
editMode = true;
activeDragger = (_arg1.target as EdgeDragger);
toolBar.currentTool = _arg1.target.target.toolID;
draggedTool = _arg1.target.target;
_arg1.target.gotoAndStop(3);
}
private function hOnMouseDown(_arg1:MouseEvent):void{
if (((((isPaused) || ((toolBar.currentTool <= 0)))) || (((carMoveEnabled) && (!((accounter.gameMode == GameDataProvider.GM_ACTION))))))){
return;
};
if (toolIndicator.currentFrame <= 1){
return;
};
if (levelIsFrozen){
return;
};
if (toolBar.hitTestPoint(stageObj.mouseX, stageObj.mouseY, true)){
return;
};
if (startBtn != null){
if (startBtn.hitTestPoint(stageObj.mouseX, stageObj.mouseY, true)){
return;
};
};
if (((!((showPannelBtn == null))) && (showPannelBtn.visible))){
if (showPannelBtn.hitTestPoint(stageObj.mouseX, stageObj.mouseY, true)){
return;
};
};
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
switch (toolBar.currentTool){
case 1:
if (GameAccounter.currentBridgeNum <= 0){
return;
};
break;
case 2:
if (GameAccounter.currentWallNum <= 0){
return;
};
break;
case 3:
if (GameAccounter.currentJumperNum <= 0){
return;
};
break;
case 4:
if (GameAccounter.currentWindNum <= 0){
return;
};
break;
case 5:
if (GameAccounter.currentTeleportNum <= 0){
return;
};
break;
};
};
if (!editMode){
wallStart = new Point(_arg1.stageX, _arg1.stageY);
};
}
private function removeLogo():void{
if (logo != null){
stageObj.removeChild(logo);
logo.removeEventListener(MouseEvent.CLICK, hOnLogoClick);
logo = null;
};
}
public function updateScorePanel():void{
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
scoreMc.scoreTxt.text = accounter.currentScore.toString();
};
}
public function initLevel(_arg1:Number, _arg2:XMLList):void{
var _local3:*;
background = new Sprite();
playground = new Sprite();
foreground = new Sprite();
smoke = new Sprite();
stageObj.addChild(background);
stageObj.addChild(playground);
stageObj.addChild(foreground);
gameLevels = new GameLevels();
gameLevels.visible = false;
gameLevels.cacheAsBitmap = true;
background.cacheAsBitmap = true;
background.addChild(gameLevels);
playground.addChild(smoke);
i = 0;
while (i < GameDataProvider.CAR_SMOKE_TRAILS) {
_local3 = new Bloomer();
_local3.stop();
_local3.x = -100;
_local3.y = -100;
_local3.cacheAsBitmap = true;
smoke.addChild(_local3);
i++;
};
stageObj.frameRate = GameDataProvider.DEFAULT_FRAMERATE;
specials = _arg2;
isPaused = true;
isAntiGravitated = false;
specialsArray = [];
GameDataProvider.PANNEL_IS_HIDDEN = false;
if (accounter.gameMode == GameDataProvider.GM_ACTION){
carMoveEnabled = true;
} else {
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
carMoveEnabled = false;
};
};
levelNum = _arg1;
levelIsFinished = false;
isPaused = false;
gameOver = false;
addedInstruments = [];
stars = [];
drawer = new Sprite();
stageObj.addChild(drawer);
initSpecials();
initAPEngine();
initLevelGraphics();
unfrozeLevel();
SoundProvider.setQuietMode(true);
}
private function showInformWindow(_arg1, _arg2):void{
wndProvider.showInformWindow(_arg1, _arg2);
}
private function initLevelRectangles():void{
var _local1:Number;
var _local2:Point;
var _local3:Point;
var _local4:Portal;
var _local5:RectangleParticle;
var _local6:*;
var _local7:Number;
var _local8:MovieClip;
var _local9:MovingWall;
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
_local1 = 0;
while (_local1 < levelPortals.length) {
_local2 = levelPortals[_local1].localToGlobal(new Point(levelPortals[_local1]["start"].x, levelPortals[_local1]["start"].y));
_local3 = levelPortals[_local1].localToGlobal(new Point(levelPortals[_local1]["end"].x, levelPortals[_local1]["end"].y));
_local4 = new Portal(this, _local2, _local3, 4, true);
levelPortals[_local1].visible = false;
_local1++;
};
_local1 = 0;
while (_local1 < levelRectangles.length) {
_local6 = (levelRectangles[_local1] as Object);
_local7 = 0;
if (levelRectangles[_local1].rotation < 0){
levelRectangles[_local1].rotation = (levelRectangles[_local1].rotation + 360);
};
_local7 = GameDataProvider.ANGLE_TO_RADIAN(levelRectangles[_local1].rotation);
levelRectangles[_local1].rotation = 0;
if (_local6.elasticity != undefined){
_local5 = new RectangleParticle(levelRectangles[_local1].x, levelRectangles[_local1].y, levelRectangles[_local1].width, levelRectangles[_local1].height, _local7, true, 10, _local6.elasticity, _local6.friction);
} else {
_local5 = new RectangleParticle(levelRectangles[_local1].x, levelRectangles[_local1].y, levelRectangles[_local1].width, levelRectangles[_local1].height, _local7, true, 10, 0.3, 0);
};
levelRectangles[_local1].visible = false;
_local5.setStyle(0, GameDataProvider.COLOR_D, 0, GameDataProvider.COLOR_D, 0);
walls.addParticle(_local5);
_local1++;
};
if (gameLevels["water"]){
_local8 = gameLevels["water"];
foreground.addChild(_local8);
};
} else {
if (accounter.gameMode == GameDataProvider.GM_ACTION){
_local1 = 0;
while (_local1 < 5) {
_local9 = new MovingWall(this, new Point((_local1 * GameDataProvider.MM2_WALL_START_SIZE), 550), new Point(((_local1 + 1) * GameDataProvider.MM2_WALL_START_SIZE), 550), 150);
_local1++;
};
rightLimitWall = new RectangleParticle((stageObj.stageWidth + 10), (stageObj.stageHeight * 0.5), stageObj.stageHeight, 20, 1.5666, true);
walls.addParticle(rightLimitWall);
};
};
isPaused = false;
}
private function initAPEngine():void{
APEngine.init(0.2);
apeContainer = playground;
APEngine.container = apeContainer;
APEngine.addMasslessForce(new Vector(0, (3 * GameDataProvider.GRAVITY_K)));
APEngine.constraintCollisionCycles = 1;
APEngine.constraintCycles = 2;
walls = new Group();
APEngine.addGroup(walls);
}
public function changeInstrumentNum(_arg1:String, _arg2:Number):void{
if (accounter.gameMode != GameDataProvider.GM_ACTION){
switch (_arg1){
case GameDataProvider.BRIDGE_TOOL:
GameAccounter.currentBridgeNum = (GameAccounter.currentBridgeNum + _arg2);
if (GameAccounter.currentBridgeNum < 1){
setToolIndicator(null);
};
break;
case GameDataProvider.WIND_TOOL:
GameAccounter.currentWindNum = (GameAccounter.currentWindNum + _arg2);
if (GameAccounter.currentWindNum < 1){
setToolIndicator(null);
};
break;
case GameDataProvider.WALL_TOOL:
GameAccounter.currentWallNum = (GameAccounter.currentWallNum + _arg2);
if (GameAccounter.currentWallNum < 1){
setToolIndicator(null);
};
break;
case GameDataProvider.JUMPER_TOOL:
GameAccounter.currentJumperNum = (GameAccounter.currentJumperNum + _arg2);
if (GameAccounter.currentJumperNum < 1){
setToolIndicator(null);
};
break;
case GameDataProvider.TELEPORT_TOOL:
GameAccounter.currentTeleportNum = (GameAccounter.currentTeleportNum + _arg2);
if (GameAccounter.currentTeleportNum < 1){
setToolIndicator(null);
};
break;
};
};
toolBar.updateTextFields();
}
private function preInitCar():void{
initCar((gameLevels.carStart.x - 100), gameLevels.carStart.y);
setTimeout(initCollidableLists, 100);
}
public function restartGoods():void{
var _local1:* = 0;
while (_local1 < stars.length) {
stars[_local1].visible = true;
_local1++;
};
var _local2:* = 0;
while (_local2 < specialsArray.length) {
specialsArray[_local2].movie.visible = true;
_local2++;
};
accounter.removeScore(GameDataProvider.POINTS_IN_CURRENT_LEVEL);
updateScorePanel();
GameDataProvider.POINTS_IN_CURRENT_LEVEL = 0;
}
private function showLevelStatistic():void{
GameDataProvider.ECONOM = (GameDataProvider.ECONOM + GameAccounter.currentBridgeNum);
GameDataProvider.ECONOM = (GameDataProvider.ECONOM + GameAccounter.currentJumperNum);
GameDataProvider.ECONOM = (GameDataProvider.ECONOM + GameAccounter.currentTeleportNum);
GameDataProvider.ECONOM = (GameDataProvider.ECONOM + GameAccounter.currentWallNum);
GameDataProvider.ECONOM = (GameDataProvider.ECONOM + GameAccounter.currentWindNum);
switch (GameDataProvider.CURRENT_DIFFICULTY_LEVEL){
case 1:
GameDataProvider.EASY++;
accounter.addScore(500);
break;
case 2:
GameDataProvider.HARD++;
accounter.addScore(1000);
break;
case 3:
GameDataProvider.IMPOS++;
accounter.addScore(2000);
break;
};
setTimeout(showWindow, 100, GameDataProvider.LEVEL_STATISTICS_WINDOW, null, startLevelComplete, null, null, accounter.addScore);
}
private function hOnMoreClick(_arg1:MouseEvent):void{
KingAPI.openOtherGamesLink();
}
private function getHelpWindow():void{
if (((!(levelIsFrozen)) && ((GameDataProvider.CURRENT_DIFFICULTY_LEVEL == 1)))){
wndProvider.showHelpWindow();
};
}
private function run(_arg1:Event):void{
var _local2:*;
var _local3:Sound;
var _local4:Sound;
if (indicatorForMouse != null){
indicatorForMouse.x = (stageObj.mouseX + 30);
indicatorForMouse.y = (stageObj.mouseY + 15);
};
if (levelIsFrozen){
return;
};
if (!isPaused){
if (clickTimer < DOUBLE_CLICK_DELAY){
clickTimer++;
};
if (((car) && (!((car.carBody == null))))){
if (!car.carIsHiden){
i = 0;
while (i < starsLength) {
if (((((car.carBody.hitTestPoint(stars[i].x, stars[i].y)) || (car.wheel1.hitTestPoint(stars[i].x, stars[i].y, false)))) || (car.wheel2.hitTestPoint(stars[i].x, stars[i].y, false)))){
if (stars[i].visible){
eatStar(i);
i = 0;
};
};
i++;
};
if (specialsArray.length > 0){
for (_local2 in specialsArray) {
if (specialsArray[_local2].movie.visible){
if (((((car.carBody.hitTestPoint(specialsArray[_local2].px, specialsArray[_local2].py)) || (car.wheel1.hitTestPoint(specialsArray[_local2].px, specialsArray[_local2].py)))) || (car.wheel2.hitTestPoint(specialsArray[_local2].px, specialsArray[_local2].py)))){
eatSpecial(specialsArray[_local2]);
};
};
};
};
};
};
if (carMoveEnabled){
i = 0;
while (i < addedInstrumentsLength) {
switch (addedInstruments[i].toolID){
case 3:
hitPoint = new Point(addedInstruments[i].start.x, (addedInstruments[i].start.y - 30));
if (((((car.body.hitTestPoint(hitPoint.x, hitPoint.y, true)) || (car.wheel1.hitTestPoint(hitPoint.x, hitPoint.y, true)))) || (car.wheel2.hitTestPoint(hitPoint.x, hitPoint.y, true)))){
addedInstruments[i].texture.play();
car.jump(GameDataProvider.JUMPER_ACCEL);
_local3 = new snd_jumper();
_local3.play();
};
break;
case 4:
if (addedInstruments[i].checkPointIsBlown(car.center)){
car.jump((GameDataProvider.WIND_ACCEL + ((car.center.y - addedInstruments[i].posY) * GameDataProvider.WIND_DISTANCE_DECREMENT)));
};
break;
case 5:
if (addedInstruments[i].enter.currentFrame == 1){
if (addedInstruments[i].start != null){
hitPoint = new Point(addedInstruments[i].start.x, addedInstruments[i].start.y);
if (car.body.hitTestPoint(hitPoint.x, hitPoint.y, false)){
_local4 = new snd_teleport();
_local4.play();
car.teleportAt((addedInstruments[i].end.x - addedInstruments[i].start.x), (addedInstruments[i].end.y - addedInstruments[i].start.y));
addedInstruments[i].enter.play();
addedInstruments[i].exit.play();
addedInstruments[i].startED.visible = false;
addedInstruments[i].endED.visible = false;
};
};
};
break;
};
i++;
};
};
if (draggedTool != null){
draggedTool.teleportTo(stageObj.mouseX, stageObj.mouseY);
};
if (((car) && (!((levelFinish == null))))){
if (((carMoveEnabled) && (car.body.hitTestObject(levelFinish)))){
processLevelComplete();
levelIsFinished = true;
levelFinish.gotoAndStop(2);
resetBtn.visible = false;
startBtn.visible = false;
};
};
APEngine.step();
APEngine.paint();
};
}
private function hOnStartBtnOver(_arg1:MouseEvent):void{
if (levelIsFrozen){
return;
};
if (carMoveEnabled){
startBtn.gotoAndStop("stopOver");
} else {
startBtn.gotoAndStop("goOver");
};
}
public function frozeLevel():void{
levelIsFrozen = true;
if (indicatorForMouse != null){
indicatorForMouse.visible = false;
};
if (toolBar != null){
toolBar.disableToolBar();
};
SoundProvider.setQuietMode(true);
}
private function createDarkBack():void{
if (dackOverMc == null){
dackOverMc = new DackOverMc();
dackOverMc.alpha = 0;
showDarkTimer = new Timer(5, 100);
showDarkTimer.addEventListener("timer", hShowDarkTimer);
showDarkTimer.start();
stageObj.addChild(dackOverMc);
};
}
private function hOnResetBtnOut(_arg1:MouseEvent):void{
resetBtn.gotoAndStop(1);
}
private function restartGame():void{
startLevelComplete();
}
private function initCar(_arg1:Number, _arg2:Number):void{
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
car = new Car(GameAccounter.currentCarOrientation, _arg1, _arg2, this);
} else {
if (accounter.gameMode == GameDataProvider.GM_ACTION){
car = new Car(-1, GameDataProvider.TRAINING_CAR_START_X, GameDataProvider.TRAINING_CAR_START_Y, this);
};
};
car.setVisibilityTo(false);
APEngine.addGroup(car);
}
public function addCarCollidable(_arg1:Group):void{
if (car){
car.addCollidable(_arg1);
};
}
private function processLevelComplete():void{
var _local1:Sound;
removeLevelTimer();
if (!levelIsFinished){
if (megaJumperTimer){
hOnMegaJumper(null);
};
if (gravTimer){
hOnGravitation(null);
};
if (slowerTimer){
hOnSlower(null);
};
_local1 = new snd_fanfare();
setToolIndicator(null);
_local1.play();
setTimeout(showWindow, 1000, GameDataProvider.QUESTION_WINDOW, "\nCongratulations!\nGo to next \nlevel?", null, showLevelStatistic, restartCurrentLevel);
};
}
private function hHideDarkTimer(_arg1:TimerEvent):void{
if (dackOverMc != null){
dackOverMc.alpha = (dackOverMc.alpha - 0.01);
};
}
private function addStartButton():void{
startBtn = new StartBtn();
startBtn.x = 460;
startBtn.y = 535;
startBtn.mouseChildren = false;
startBtn.addEventListener(MouseEvent.MOUSE_OVER, hOnStartBtnOver, false, 0, true);
startBtn.addEventListener(MouseEvent.MOUSE_OUT, hOnStartBtnOut, false, 0, true);
startBtn.addEventListener(MouseEvent.CLICK, hOnStartBtnClick, false, 0, true);
if (levelNum == 1){
startBtn.startBtnInside.play();
} else {
startBtn.startBtnInside.gotoAndStop(1);
};
stageObj.addChild(startBtn);
}
public function disableShowPannelBtn():void{
if (showPannelBtn == null){
createShowPannelBtn();
};
showPannelBtn.visible = false;
showPannelBtn.mouseEnabled = false;
}
private function clearLevelGraphics():void{
var _local2:*;
var _local5:*;
car.remove();
removeResetButton();
removeLogo();
var _local1:* = 0;
while (_local1 < stars.length) {
gameLevels.removeChild(stars[_local1]);
_local1++;
};
for (_local2 in specialsArray) {
background.removeChild(specialsArray[_local2].movie);
};
specialsArray = [];
stars = [];
indicatorsProvider.hideIndicators();
indicatorsProvider.removeIndicators();
removeStartButton();
if (((!((scoreMc.parent == null))) && (!((levelSecondsMc == null))))){
stageObj.removeChild(scoreMc);
stageObj.removeChild(levelSecondsMc);
};
walls.cleanup();
APEngine.removeGroup(walls);
var _local3:* = 0;
while (_local3 < addedInstruments.length) {
APEngine.removeGroup(addedInstruments[_local3]);
_local3++;
};
var _local4:Number = 0;
while (levelRectangles[_local4]) {
levelRectangles[_local4] = null;
_local4++;
};
if (levelNameMc != null){
stageObj.removeChild(levelNameMc);
levelNameMc = null;
};
if (showPannelBtn != null){
stageObj.removeChild(showPannelBtn);
showPannelBtn = null;
};
if (toolIndicator.parent != null){
stageObj.removeChild(toolIndicator);
};
toolBar.clearToolBar();
if (toolBar.parent != null){
stageObj.removeChild(toolBar);
};
Cloud.clouds = [];
background.removeChild(gameLevels);
gameLevels = null;
while (levelJumpers.length > 0) {
_local5 = levelJumpers.pop();
_local5 = null;
};
while (levelWinds.length > 0) {
_local5 = levelWinds.pop();
_local5 = null;
};
while (levelPortals.length > 0) {
_local5 = levelPortals.pop();
_local5 = null;
};
while (stars.length > 0) {
_local5 = stars.pop();
_local5 = null;
};
walls = new Group();
stars = [];
levelRectangles = [];
levelPortals = [];
levelWinds = [];
levelJumpers = [];
levelStart = null;
levelFinish = null;
if (foreground.getChildByName("water")){
foreground.removeChild(foreground.getChildByName("water"));
};
addedInstrumentsLength = 0;
addedInstruments = [];
stageObj.removeChild(drawer);
playground.removeChild(smoke);
stageObj.removeChild(background);
stageObj.removeChild(playground);
stageObj.removeChild(foreground);
background = null;
playground = null;
playground = null;
if (dackOverMc != null){
stageObj.removeChild(dackOverMc);
};
}
public function undo():void{
var _local1:Tool = addedInstruments[(addedInstruments.length - 1)];
if (((!((_local1 == null))) && (!(_local1.permanent)))){
_local1.removeInstrument();
addedInstrumentsLength = addedInstruments.length;
};
}
private function initLevelGraphics():void{
initAPEngine();
background.graphics.clear();
gameLevels.gotoAndStop(((("level" + levelNum) + "_") + GameDataProvider.CURRENT_DIFFICULTY_LEVEL));
indicatorForMouse = new IndicatorForMouse();
indicatorForMouse.visible = false;
createPseudoPreloader();
setTimeout(hOnLevelGraphicsInit, 3000);
}
private function hOnResetBtnOver(_arg1:MouseEvent):void{
resetBtn.gotoAndStop(2);
}
private function removeStartButton():void{
if (startBtn.parent != null){
startBtn.removeEventListener(MouseEvent.MOUSE_OVER, hOnStartBtnOver);
startBtn.removeEventListener(MouseEvent.MOUSE_OUT, hOnStartBtnOut);
startBtn.removeEventListener(MouseEvent.CLICK, hOnStartBtnClick);
stageObj.removeChild(startBtn);
};
}
private function hLogoClick(_arg1:MouseEvent):void{
KingAPI.openSignLink();
}
public function setToolDragged(_arg1:Tool):void{
if (((!(carMoveEnabled)) || ((accounter.gameMode == GameDataProvider.GM_ACTION)))){
editMode = true;
draggedTool = _arg1;
toolBar.currentTool = _arg1.toolID;
};
}
public function reCalcWinds():void{
i = 0;
while (i < addedInstruments.length) {
if (addedInstruments[i].toolID == 4){
addedInstruments[i].findOverWalls();
};
i++;
};
}
private function clearCollidables():void{
walls.removeCollidable(car);
i = 0;
while (i < addedInstruments.length) {
car.removeCollidable(addedInstruments[i]);
i++;
};
}
public function onEdgeOver(_arg1:MouseEvent):void{
if (!editMode){
_arg1.target.gotoAndStop(2);
_arg1.target.mouseChildren = false;
};
}
private function initStars():void{
starsLength = stars.length;
}
private function showPannel(_arg1:MouseEvent):void{
if (accounter.gameMode == GameDataProvider.GM_ACTION){
toolBar.showPannel(null);
};
if (((levelIsFrozen) || (carMoveEnabled))){
return;
};
toolBar.showPannel(null);
}
public function resetPortals():void{
i = 0;
while (i < addedInstruments.length) {
if (addedInstruments[i].toolID == 5){
addedInstruments[i].enter.gotoAndStop(1);
addedInstruments[i].exit.gotoAndStop(1);
addedInstruments[i].startED.visible = true;
addedInstruments[i].endED.visible = true;
addedInstruments[i].enter.addChild(addedInstruments[i].startED);
addedInstruments[i].exit.addChild(addedInstruments[i].endED);
};
i++;
};
}
private function restartCurrentLevel():void{
levelIsFrozen = false;
toolBar.isEnabled = true;
levelIsFinished = false;
startBtn.visible = true;
levelFinish.gotoAndStop(1);
changeMovementState();
}
private function initJumpers():void{
var _local2:Point;
var _local3:Jumper;
var _local1:Number = 0;
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
while (levelJumpers[_local1]) {
_local2 = new Point(levelJumpers[_local1].x, levelJumpers[_local1].y);
_local3 = new Jumper(this, _local2, true);
levelJumpers[_local1].visible = false;
_local1++;
};
};
}
private function createShowPannelBtn():void{
showPannelBtn = new ShowPannelBtn();
showPannelBtn.x = ((stageObj.stageWidth / 2) - (showPannelBtn.width / 2));
showPannelBtn.y = (stageObj.stageHeight - showPannelBtn.height);
showPannelBtn.visible = false;
showPannelBtn.mouseEnabled = false;
showPannelBtn.addEventListener(MouseEvent.CLICK, showPannel, false, 0, true);
showPannelBtn.tabEnabled = false;
stageObj.addChild(showPannelBtn);
}
private function removePseudoPreloader():void{
if (pseudoPreloader != null){
pseudoPreloader.logo.removeEventListener(MouseEvent.CLICK, hOnLogoClick);
pseudoPreloader.moreBtn.removeEventListener(MouseEvent.CLICK, hOnMoreClick);
stageObj.removeChild(pseudoPreloader);
pseudoPreloader = null;
};
}
private function showWindow(_arg1:String, _arg2=null, _arg3=null, _arg4=null, _arg5=null, _arg6=null):void{
frozeLevel();
switch (_arg1){
case GameDataProvider.QUESTION_WINDOW:
showQuestionWindow(_arg2, _arg4, _arg5);
break;
case GameDataProvider.INFORM_WINDOW:
showInformWindow(_arg2, _arg3);
break;
case GameDataProvider.LEVEL_STATISTICS_WINDOW:
showStatisticsWindow(_arg3, _arg6);
break;
default:
unfrozeLevel();
break;
};
}
private function removeDarkMc():void{
if (dackOverMc != null){
stageObj.removeChild(dackOverMc);
dackOverMc = null;
};
}
private function changeMovementState():void{
var _local1:Sound;
var _local2:Sound;
if (!toolBar.isEnabled){
return;
};
if (accounter.gameMode == GameDataProvider.GM_STRATEGIC){
carMoveEnabled = ((carMoveEnabled)==true) ? false : true;
if (carMoveEnabled){
toolBar.hidePannel();
initLevelTimer();
levelTimer.start();
levelSecondsMc.visible = true;
levelNameMc.visible = false;
indicatorForMouse.visible = false;
toolIndicator.visible = false;
indicatorsProvider.showIndicators();
restart();
car.setVisibilityTo(true);
setDraggers(false);
startBtn.gotoAndStop("stop");
SoundProvider.setQuietMode(false);
_local1 = new snd_bulp();
_local1.play();
setTimeout(setResetBtnVisibleTo, 500, true);
} else {
resetBtn.visible = false;
logo.visible = false;
restartGoods();
removeLevelTimer();
levelSecondsMc.visible = false;
isAntiGravitated = false;
levelNameMc.visible = true;
indicatorsProvider.hideIndicators();
toolIndicator.visible = true;
if (megaJumperTimer != null){
megaJumperTimer.stop();
megaJumperTimer.removeEventListener("timer", hOnMegaJumper);
megaJumperTimer = null;
hOnMegaJumper(null);
};
if (slowerTimer != null){
slowerTimer.stop();
slowerTimer.removeEventListener("timer", hOnSlower);
slowerTimer = null;
hOnSlower(null);
};
if (gravTimer != null){
gravTimer.stop();
gravTimer.removeEventListener("timer", hOnGravitation);
gravTimer = null;
APEngine.addMasslessForce(new Vector(0, GameDataProvider.PLUS_TO_GRAVITY));
};
car.setVisibilityTo(false);
toolBar.showPannel();
resetPortals();
setDraggers(true);
startBtn.gotoAndStop("go");
SoundProvider.setQuietMode(true);
_local2 = new snd_kick();
_local2.play();
};
} else {
carMoveEnabled = true;
};
}
private function setDraggers(_arg1:Boolean):void{
var _local2:* = 0;
while (_local2 < addedInstruments.length) {
addedInstruments[_local2].dragger.visible = _arg1;
addedInstruments[_local2].startED.visible = _arg1;
addedInstruments[_local2].endED.visible = _arg1;
_local2++;
};
}
private function initLevelTimer():void{
levelTimer = new Timer(1000, GameDataProvider.LEVEL_TIME);
levelTimer.addEventListener("timer", hOnLevelTimer);
}
private function addSmoke():void{
var _local1:*;
soundProvider.stopIdleSound();
soundProvider.playDriveSound();
if (smokeTimer > GameDataProvider.CAR_SMOKE_DELAY){
GameDataProvider.DRIVE++;
_local1 = smoke.getChildAt(currentBloomer++);
if (currentBloomer >= smoke.numChildren){
currentBloomer = 0;
};
_local1.x = (((car.center.x - (GameDataProvider.CAR_SMOKE_SPREAD * 0.5)) + (Math.random() * GameDataProvider.CAR_SMOKE_SPREAD)) + (30 * GameAccounter.currentCarOrientation));
_local1.y = (car.center.y - 10);
_local1.gotoAndPlay((int((Math.abs(car.speed) * 5)) + 1));
smokeTimer = 0;
} else {
smokeTimer++;
};
}
private function hOnGravitation(_arg1:TimerEvent):void{
if (gravTimer != null){
APEngine.addMasslessForce(new Vector(0, GameDataProvider.PLUS_TO_GRAVITY));
if (GameDataProvider.CAR_JUMP_ACCEL < 0){
GameDataProvider.CAR_JUMP_ACCEL = -(GameDataProvider.CAR_JUMP_ACCEL);
};
gravTimer.removeEventListener("timer", hOnGravitation);
gravTimer = null;
isAntiGravitated = false;
};
}
private function hOnStartBtnOut(_arg1:MouseEvent):void{
if (levelIsFrozen){
return;
};
if (carMoveEnabled){
startBtn.gotoAndStop("stop");
} else {
startBtn.gotoAndStop("go");
};
}
private function hShowDarkTimer(_arg1:TimerEvent):void{
if (dackOverMc != null){
dackOverMc.alpha = (dackOverMc.alpha + 0.01);
};
}
public function onEdgeOut(_arg1:MouseEvent):void{
if (!editMode){
_arg1.target.gotoAndStop(1);
_arg1.target.mouseChildren = false;
};
}
private function removeScoreMovie(_arg1):void{
stageObj.removeChild(_arg1);
}
public function hOnMouseMove(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (((!(carMoveEnabled)) || ((accounter.gameMode == GameDataProvider.GM_ACTION)))){
if (draggedTool != null){
draggedTool.teleportTo(_arg1.stageX, _arg1.stageY);
} else {
if (((!((wallStart == null))) && (toolBar.isResizebleToolSelected))){
if (accounter.gameMode == GameDataProvider.GM_ACTION){
wallStart.x = (wallStart.x - GameDataProvider.MM2_WALL_ACCEL);
};
wallEnd = new Point(_arg1.stageX, _arg1.stageY);
_local2 = GameDataProvider.DISTANCE(wallStart, wallEnd);
_local3 = GameDataProvider.TOOL_RADIUS[toolBar.currentTool];
if (_local2 > _local3){
_local4 = (_local3 / _local2);
wallEnd.x = (wallStart.x + ((wallEnd.x - wallStart.x) * _local4));
wallEnd.y = (wallStart.y + ((wallEnd.y - wallStart.y) * _local4));
};
drawer.graphics.clear();
drawer.graphics.lineStyle(5, 0xFFFFFF, GameDataProvider.HUD_ALPHA);
drawer.graphics.drawCircle(wallStart.x, wallStart.y, _local3);
drawer.graphics.lineStyle(2, 0, GameDataProvider.HUD_ALPHA);
drawer.graphics.moveTo(wallStart.x, wallStart.y);
drawer.graphics.lineTo(wallEnd.x, wallEnd.y);
} else {
if (editMode){
activeDragger.target.texture.x = (_arg1.stageX - activeDragger.target.wall.px);
activeDragger.target.texture.y = (_arg1.stageY - activeDragger.target.wall.py);
};
};
};
};
}
private function startLevelComplete():void{
clearEventHandlers();
clearLevelGraphics();
if (!gameOver){
levelCompleted();
};
}
private function returnToMainMenu():void{
levelIsFrozen = true;
wndProvider.showQuestionWindow("Sure you want to end race?", processReturnToMainMenu, unfrozeLevel);
}
public function removeCarCollidable(_arg1:Tool):void{
var _local2:int;
while (_local2 < addedInstruments.length) {
if (addedInstruments[_local2] == _arg1){
addedInstruments.splice(_local2, 1);
if (_local2 > 0){
_local2--;
};
addedInstrumentsLength = addedInstruments.length;
reCalcWinds();
break;
};
_local2++;
};
if (car){
car.removeCollidable((_arg1 as Group));
};
}
private function hOnSlower(_arg1:TimerEvent):void{
stageObj.frameRate = GameDataProvider.DEFAULT_FRAMERATE;
if (showDarkTimer != null){
showDarkTimer.removeEventListener("timer", hShowDarkTimer);
showDarkTimer = new Timer(15, 100);
showDarkTimer.addEventListener("timer", hHideDarkTimer);
setTimeout(removeDarkMc, 1000);
showDarkTimer.start();
};
}
private function hOnMouseUp(_arg1:MouseEvent):void{
var _local2:Sound;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local7:Wall;
var _local8:Jumper;
var _local9:Wind;
var _local10:Portal;
if (((!(carMoveEnabled)) || ((accounter.gameMode == GameDataProvider.GM_ACTION)))){
if (draggedTool != null){
_local2 = new snd_click();
_local2.play();
draggedTool.fix();
if (clickTimer < GameDataProvider.DOUBLE_CLICK_DELAY){
draggedTool.removeInstrument();
};
if (draggedTool.toolID == 2){
reCalcWinds();
};
draggedTool = null;
} else {
if (wallStart != null){
_local2 = new snd_click();
_local2.play();
if (((editMode) && (!(toolBar.isResizebleToolSelected)))){
activeDragger.target.texture.x = _arg1.stageX;
activeDragger.target.texture.y = _arg1.stageY;
activeDragger.target.removeInstrument();
};
wallEnd = new Point(_arg1.stageX, _arg1.stageY);
_local3 = GameDataProvider.DISTANCE(wallStart, wallEnd);
_local4 = GameDataProvider.TOOL_RADIUS[toolBar.currentTool];
if ((((_local3 > _local4)) && (toolBar.isResizebleToolSelected))){
_local5 = (_local4 / _local3);
wallEnd.x = (wallStart.x + ((wallEnd.x - wallStart.x) * _local5));
wallEnd.y = (wallStart.y + ((wallEnd.y - wallStart.y) * _local5));
};
_local3 = GameDataProvider.DISTANCE(wallStart, wallEnd);
switch (toolBar.currentTool){
case 1:
if (_local3 < GameDataProvider.MIN_BRIDGE_LENGTH){
break;
};
_local6 = new Bridge(this, wallStart, wallEnd, 8);
break;
case 2:
if (_local3 < GameDataProvider.MIN_WALL_LENGTH){
break;
};
_local7 = new Wall(this, wallStart, wallEnd, 4);
reCalcWinds();
break;
case 3:
_local8 = new Jumper(this, wallEnd);
break;
case 4:
_local9 = new Wind(this, wallEnd);
break;
case 5:
if ((((_local3 < GameDataProvider.MIN_WALL_LENGTH)) || ((clickTimer < GameDataProvider.DOUBLE_CLICK_DELAY)))){
break;
};
_local10 = new Portal(this, wallStart, wallEnd, 4);
break;
};
};
};
};
clickTimer = 0;
toolBar.currentTool = toolBar.oldTool;
wallStart = null;
wallEnd = null;
editMode = false;
drawer.graphics.clear();
}
private function removeLevelTimer():void{
if (levelTimer != null){
levelTimer.stop();
levelTimer.removeEventListener("timer", hOnLevelTimer);
levelTimer = null;
};
}
private function eatStar(_arg1:Number):void{
var _local2:* = new ScoreMovie();
_local2.scoreInside.txt.text = (stars[_arg1] as Object).score;
accounter.addScore((stars[_arg1] as Object).score);
switch ((stars[_arg1] as Object).score){
case GameDataProvider.STAR1_SCORE:
GameDataProvider.GOLDEN_STARS++;
break;
case GameDataProvider.STAR2_SCORE:
GameDataProvider.SILVER_STARS++;
break;
case GameDataProvider.STAR2_SCORE:
GameDataProvider.GLASS_STARS++;
break;
};
_local2.gotoAndPlay(1);
_local2.x = (car.center.x + 20);
_local2.y = (car.center.y - 50);
stageObj.addChild(_local2);
setTimeout(removeScoreMovie, 4000, _local2);
stars[_arg1].visible = false;
var _local3:Sound = new snd_Star();
_local3.play();
}
private function createPseudoPreloader():void{
pseudoPreloader = new PseudoPreloader();
pseudoPreloader.logo.buttonMode = true;
pseudoPreloader.logo.addEventListener(MouseEvent.CLICK, hOnLogoClick);
pseudoPreloader.moreBtn.addEventListener(MouseEvent.CLICK, hOnMoreClick);
stageObj.addChild(pseudoPreloader);
}
private function initFinishFlag():void{
}
private function showQuestionWindow(_arg1, _arg2, _arg3):void{
wndProvider.showQuestionWindow(_arg1, _arg2, _arg3);
}
private function clearEventHandlers():void{
removeLevelTimer();
removePseudoPreloader();
stageObj.removeEventListener(KeyboardEvent.KEY_DOWN, hKeyDown);
stageObj.removeEventListener(KeyboardEvent.KEY_UP, hKeyUp);
stageObj.removeEventListener(Event.ENTER_FRAME, run);
stageObj.removeEventListener(MouseEvent.MOUSE_DOWN, hOnMouseDown);
stageObj.removeEventListener(MouseEvent.MOUSE_UP, hOnMouseUp);
stageObj.removeEventListener(MouseEvent.MOUSE_MOVE, hOnMouseMove);
if (megaJumperTimer != null){
megaJumperTimer.stop();
megaJumperTimer.removeEventListener("timer", hOnMegaJumper);
megaJumperTimer = null;
};
if (slowerTimer != null){
slowerTimer.stop();
slowerTimer.removeEventListener("timer", hOnSlower);
slowerTimer = null;
};
if (gravTimer != null){
gravTimer.stop();
gravTimer.removeEventListener("timer", hOnGravitation);
gravTimer = null;
};
if (showDarkTimer != null){
showDarkTimer.stop();
showDarkTimer.removeEventListener("timer", hShowDarkTimer);
showDarkTimer = null;
};
}
public function onEdgeStartDrag(_arg1:MouseEvent):void{
editMode = true;
activeDragger = (_arg1.target as EdgeDragger);
if (activeDragger.end){
wallStart = activeDragger.target.start;
} else {
wallStart = activeDragger.target.end;
};
toolBar.currentTool = _arg1.target.target.toolID;
_arg1.target.gotoAndStop(3);
_arg1.target.target.removeInstrument();
}
private function hOnResetBtnClick(_arg1:MouseEvent):void{
restart();
car.setVisibilityTo(true);
restartGoods();
hOnMegaJumper(null);
hOnSlower(null);
hOnGravitation(null);
indicatorsProvider.stopAnimations();
}
private function initScorePannel():void{
scoreMc = new ScoreMc();
scoreMc.mouseChildren = false;
scoreMc.mouseEnabled = false;
levelSecondsMc = new LevelSecondsMc();
levelNameMc = new LevelNameMc();
levelNameMc.mouseChildren = false;
levelNameMc.mouseEnabled = false;
levelNameMc.y = 5;
levelNameMc.x = ((stageObj.stageWidth / 2) - (levelNameMc.width / 2));
stageObj.addChild(levelNameMc);
scoreMc.x = 10;
levelSecondsMc.x = ((stageObj.stageWidth / 2) - (levelSecondsMc.width / 2));
scoreMc.y = (levelSecondsMc.y = 5);
scoreMc.scoreTxt.text = accounter.currentScore.toString();
levelSecondsMc.visible = false;
stageObj.addChild(scoreMc);
stageObj.addChild(levelSecondsMc);
}
private function hOnStartBtnClick(_arg1:MouseEvent):void{
if (levelIsFrozen){
return;
};
if (carMoveEnabled){
startBtn.gotoAndStop("stop");
} else {
startBtn.gotoAndStop("go");
};
changeMovementState();
}
private function hOnLevelTimer(_arg1:TimerEvent):void{
GameDataProvider.SAVED_LEVEL_TIME = (GameDataProvider.LEVEL_TIME - levelTimer.currentCount);
levelSecondsMc.scoreTxt.text = (GameDataProvider.LEVEL_TIME - levelTimer.currentCount).toString();
}
private function hKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 65:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
case 68:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
case 39:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
case 37:
car.speed = 0;
soundProvider.stopDriveSound();
soundProvider.playIdleSound();
break;
};
}
private function addLogo():void{
logo = new Logo();
logo.x = 76;
logo.y = 562;
logo.buttonMode = true;
logo.mouseChildren = false;
logo.visible = false;
logo.addEventListener(MouseEvent.CLICK, hLogoClick);
stageObj.addChild(logo);
}
public function unfrozeLevel():void{
levelIsFrozen = false;
if (toolIndicator != null){
if (((!((indicatorForMouse == null))) && ((toolIndicator.currentFrame > 1)))){
indicatorForMouse.visible = true;
};
};
if (toolBar != null){
toolBar.enableToolBar();
};
if (carMoveEnabled){
SoundProvider.setQuietMode(false);
};
}
private function initEventHandlers():void{
stageObj.addEventListener(KeyboardEvent.KEY_DOWN, hKeyDown, false, 0, true);
stageObj.addEventListener(KeyboardEvent.KEY_UP, hKeyUp, false, 0, true);
stageObj.addEventListener(Event.ENTER_FRAME, run, false, 0, true);
stageObj.addEventListener(MouseEvent.MOUSE_DOWN, hOnMouseDown, false, 0, true);
stageObj.addEventListener(MouseEvent.MOUSE_UP, hOnMouseUp, false, 0, true);
stageObj.addEventListener(MouseEvent.MOUSE_MOVE, hOnMouseMove, false, 0, true);
}
private function hOnLogoClick(_arg1:MouseEvent):void{
KingAPI.openSignLink();
}
private function createSpecials():void{
var _local1:*;
var _local2:MegaJump;
var _local3:Slower;
var _local4:AntiGravitationMc;
for (_local1 in specialsArray) {
switch (specialsArray[_local1].name){
case "megaJump":
_local2 = new MegaJump();
background.addChild(_local2);
_local2.x = specialsArray[_local1].px;
_local2.y = specialsArray[_local1].py;
specialsArray[_local1].movie = _local2;
break;
case "slower":
_local3 = new Slower();
background.addChild(_local3);
_local3.x = specialsArray[_local1].px;
_local3.y = specialsArray[_local1].py;
specialsArray[_local1].movie = _local3;
break;
case "antiGrav":
_local4 = new AntiGravitationMc();
background.addChild(_local4);
_local4.x = specialsArray[_local1].px;
_local4.y = specialsArray[_local1].py;
specialsArray[_local1].movie = _local4;
break;
};
};
}
}
}//package src
Section 85
//LowSpeedElement (src.LowSpeedElement)
package src {
import flash.events.*;
import flash.display.*;
public class LowSpeedElement extends MovieClip {
public var elasticity:Number;// = 0.8
public var friction:Number;// = 0.8
public function LowSpeedElement():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.levelRectangles.push(this);
}
}
}//package src
Section 86
//ModPlayer (src.ModPlayer)
package src {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import src._ModPlayer.*;
import src.haxe.*;
import src.flash.*;
public class ModPlayer {
protected var ldr:Loader;
protected var states:Array;
public var sinewave:Array;
public var notsupflag:Array;
protected var tickspermin:int;
protected var samplespertick:int;
protected var ticksperrow:int;
public var stopnow:Boolean;
public var chancount:int;
protected var crow:int;
protected var tmr:Timer;
public var volume:Number;// = 1
public var pat:Array;
protected var delaypattern:int;
protected var rowspermin:int;
public var showTraces:Boolean;
public var songlength:int;
protected var checktick:Boolean;
protected var breakpatnextrow:int;
public var onProgress:Function;
protected var corder:int;
public var order:Array;
public var periods:Array;
protected var cpattern:Pattern;
public var smp:Array;
protected var breakpatonrow:Boolean;
protected var cpat:int;
protected var checkrow:Boolean;
public var segbreak:int;
public var repeating:Boolean;
protected var ticksmpctr:int;
protected var cnt:int;
protected var onFinish:Function;
protected var rowtick:int;
public var wave:ByteArray;
public var wavelen:int;
public function ModPlayer():void{
if (!Boot.skip_constructor){
this.showTraces = false;
this.segbreak = 500000;
this.repeating = true;
};
}
public function stop():void{
this.stopnow = true;
SoundMixer.stopAll();
}
public function calcSegment():Boolean{
var cs:ChanState;
var nextcheckrow:Boolean;
var mixed:int;
var _g1:int;
var _g:int;
var c:int;
var note:Note;
var amigabps:Number;
var cmd:int;
var arg:int;
var amigabps2:Number;
var amigabps3:Number;
var amigabps4:Number;
var amigabps5:Number;
var aperiod:int;
var amigabps6:Number;
var amigabps7:Number;
var amigabps8:Number;
var vibval:int;
var amigabps9:Number;
var trmval:int;
var stamp:Number = Timer.stamp();
var segsamples:int;
while (true) {
nextcheckrow = false;
if (++this.ticksmpctr == this.samplespertick){
this.ticksmpctr = 0;
if (++this.rowtick == this.ticksperrow){
this.rowtick = 0;
if (this.delaypattern > 0){
this.delaypattern--;
} else {
if (((this.breakpatonrow) || ((++this.crow == 64)))){
this.crow = (this.breakpatonrow) ? this.breakpatnextrow : 0;
if (this.crow >= 64){
this.crow = 63;
};
if (++this.corder == this.songlength){
return (false);
};
this.cpat = this.order[this.corder];
this.cpattern = this.pat[this.cpat];
this.breakpatonrow = false;
this.delaypattern = 0;
};
this.checkrow = true;
};
};
this.checktick = true;
};
mixed = 0;
_g1 = 0;
_g = this.chancount;
try {
while (_g1 < _g) {
_g1 = (_g1 + 1);
c = _g1;
cs = this.states[c];
if (this.checkrow){
note = this.cpattern.channel[c].note[this.crow];
cs.arpeggio = false;
cs.delaynote = false;
cs.retriggersample = false;
cs.slidevolume = false;
cs.slideperiod = false;
cs.slidetonote = (((note.command == 3)) || ((note.command == 5)));
cs.vibrato = (((note.command == 4)) || ((note.command == 6)));
cs.tremolo = false;
if (note.sample != null){
cs.csmp = note.sample;
cs.cvolume = (cs.rvolume = (cs.csmp.volume * volume));
cs.cslength = (cs.csmp.length << 16);
cs.cslooplen = cs.cslength;
};
if (((((!((note.period == 0))) && (!((cs.csmp == null))))) && (!(cs.slidetonote)))){
if (note.peridx != -1){
cs.cperiod = this.periods[(note.peridx + (cs.csmp.fine * 84))];
} else {
cs.cperiod = note.period;
};
cs.lastnoteperiod = cs.cperiod;
amigabps = (7159090.5 / (cs.cperiod * 2));
cs.cspinc = Std._int(((amigabps / 22050) * 65536));
cs.csp = 0;
cs.slideperiod = false;
if (cs.vibratowave < 4){
cs.vibratopos = 0;
};
if (cs.tremolowave < 4){
cs.tremolopos = 0;
};
};
if (((!((note.command == 0))) || (!((note.cmdarg == 0))))){
cmd = note.command;
arg = note.cmdarg;
switch (cmd){
case 0:
cs.arpeggio = ((!((note.peridx == -1))) || ((note.period == 0)));
if (note.period != 0){
cs.arpeggionote = note.peridx;
};
cs.arpeggiosemi1 = ((arg & 240) >> 4);
cs.arpeggiosemi2 = (arg & 15);
cs.arpeggiotick = 0;
break;
case 1:
if (arg != 0){
cs.slideperiod = true;
cs.slideperiodval = -(arg);
};
throw ("__break__");
break;
case 2:
if (arg != 0){
cs.slideperiod = true;
cs.slideperiodval = arg;
};
throw ("__break__");
break;
case 3:
if (arg != 0){
cs.slideperiodval = arg;
};
if (note.period != 0){
cs.slidetonotetarget = ((note.peridx == 1)) ? note.period : this.periods[(note.peridx + (cs.csmp.fine * 84))];
if ((((cs.cperiod > note.period)) && ((cs.slideperiodval > 0)))){
cs.slideperiodval = -(cs.slideperiodval);
} else {
if ((((cs.cperiod < note.period)) && ((cs.slideperiodval < 0)))){
cs.slideperiodval = -(cs.slideperiodval);
};
};
} else {
if (arg != 0){
if ((((cs.cperiod > cs.slidetonotetarget)) && ((cs.slideperiodval > 0)))){
cs.slideperiodval = -(cs.slideperiodval);
} else {
if ((((cs.cperiod < cs.slidetonotetarget)) && ((cs.slideperiodval < 0)))){
cs.slideperiodval = -(cs.slideperiodval);
};
};
};
};
if (cs.slidetonotetarget == 0){
cs.slidetonote = false;
};
break;
case 4:
if (arg != 0){
cs.vibratospeed = ((arg & 240) >> 4);
cs.vibratodepth = (arg & 15);
cs.vibratopos = 0;
};
break;
case 7:
cs.tremolo = true;
if (arg != 0){
cs.tremolospeed = ((arg & 240) >> 4);
cs.tremolodepth = (arg & 15);
cs.tremolopos = 0;
};
break;
case 8:
break;
case 9:
if (arg != 0){
arg = (arg << 8);
if (arg >= cs.csmp.length){
arg = cs.csmp.length;
};
cs.csp = (arg << 16);
};
break;
case 5:
case 6:
case 10:
cs.slidevolume = true;
if (arg != 0){
if ((arg & 240) != 0){
cs.slidevolumeval = (arg >> 4);
} else {
cs.slidevolumeval = -((arg & 15));
};
};
break;
case 11:
if (arg > this.corder){
this.corder = arg;
if (this.corder >= this.order.length){
this.corder = (this.order.length - 1);
this.crow = 63;
this.cpat = this.order[this.corder];
this.cpattern = this.pat[this.cpat];
} else {
this.crow = 0;
};
nextcheckrow = true;
};
break;
case 12:
if (arg > 64){
arg = 64;
};
cs.cvolume = (cs.rvolume = arg);
break;
case 13:
arg = ((((arg & 240) >> 4) * 10) + (arg & 15));
if (arg > 63){
arg = 63;
};
this.breakpatonrow = true;
this.breakpatnextrow = arg;
break;
case 14:
switch ((arg & 240)){
case 0:
break;
case 16:
cs.cperiod = (cs.cperiod - (arg & 15));
amigabps2 = (7159090.5 / (cs.cperiod * 2));
cs.cspinc = Std._int(((amigabps2 / 22050) * 65536));
break;
case 32:
cs.cperiod = (cs.cperiod + (arg & 15));
amigabps3 = (7159090.5 / (cs.cperiod * 2));
cs.cspinc = Std._int(((amigabps3 / 22050) * 65536));
break;
case 48:
this.notsupport((arg & 240), this.cpat, this.crow);
break;
case 64:
switch ((arg & 15)){
case 0:
case 1:
case 2:
case 4:
case 5:
case 6:
cs.vibratowave = (arg & 15);
break;
case 3:
case 7:
cs.vibratowave = Std._int((Math.random() * 4));
if (cs.vibratowave > 3){
cs.vibratowave = 3;
};
if ((arg & 15) == 7){
cs.vibratowave = (cs.vibratowave + 4);
};
break;
};
break;
case 80:
this.notsupport((arg & 240), this.cpat, this.crow);
break;
case 96:
this.notsupport((arg & 240), this.cpat, this.crow);
break;
case 112:
switch ((arg & 15)){
case 0:
case 1:
case 2:
case 4:
case 5:
case 6:
cs.tremolowave = (arg & 15);
break;
case 3:
case 7:
cs.tremolowave = Std._int((Math.random() * 4));
if (cs.tremolowave > 3){
cs.tremolowave = 3;
};
if ((arg & 15) == 7){
cs.tremolowave = (cs.tremolowave + 4);
};
break;
};
break;
case 128:
break;
case 144:
cs.retriggersample = ((arg & 15) > 0);
cs.retriggersamplectr = 0;
cs.retriggersampleticks = (arg & 15);
break;
case 160:
cs.cvolume = (cs.cvolume + (arg & 15));
if (cs.cvolume > 64){
cs.cvolume = 64;
};
cs.rvolume = cs.cvolume;
break;
case 176:
cs.cvolume = (cs.cvolume - (arg & 15));
if (cs.cvolume < 0){
cs.cvolume = 0;
};
cs.rvolume = cs.cvolume;
break;
case 192:
cs.cutsample = ((arg & 15) > 0);
cs.cutsampleticks = (arg & 15);
break;
case 208:
cs.delaynote = true;
cs.delaynoteticks = (arg & 15);
break;
case 224:
this.delaypattern = (arg & 15);
break;
case 240:
break;
};
break;
case 15:
if (arg <= 32){
if (arg == 0){
arg = 1;
};
this.ticksperrow = arg;
} else {
this.rowspermin = (arg * 4);
this.tickspermin = (this.rowspermin * 6);
this.samplespertick = Std._int((1323000 / this.tickspermin));
};
break;
};
};
};
if (this.checktick){
if (this.rowtick > 0){
if (((cs.cutsample) && ((cs.cutsampleticks <= this.rowtick)))){
cs.cvolume = (cs.rvolume = 0);
cs.csmp = null;
cs.cutsample = false;
};
if (((cs.delaynote) && ((cs.delaynoteticks <= this.rowtick)))){
cs.csp = 0;
cs.delaynote = false;
};
if (cs.retriggersample){
if (++cs.retriggersamplectr == cs.retriggersampleticks){
cs.csp = 0;
cs.cslength = (cs.csmp.length << 16);
cs.cslooplen = cs.cslength;
cs.retriggersamplectr = 0;
};
};
if (cs.slidevolume){
cs.cvolume = (cs.cvolume + cs.slidevolumeval);
if (cs.cvolume <= 0){
cs.cvolume = 0;
} else {
if (cs.cvolume > 64){
cs.cvolume = 64;
};
};
cs.rvolume = cs.cvolume;
};
if (cs.slideperiod){
cs.cperiod = (cs.cperiod + cs.slideperiodval);
if (cs.cperiod < 113){
cs.cperiod = 113;
} else {
if (cs.cperiod > 856){
cs.cperiod = 856;
};
};
amigabps4 = (7159090.5 / (cs.cperiod * 2));
cs.cspinc = Std._int(((amigabps4 / 22050) * 65536));
};
if (cs.slidetonote){
cs.cperiod = (cs.cperiod + cs.slideperiodval);
if ((((cs.slideperiodval < 0)) && ((cs.slidetonotetarget > cs.cperiod)))){
cs.cperiod = cs.slidetonotetarget;
} else {
if ((((cs.slideperiodval > 0)) && ((cs.slidetonotetarget < cs.cperiod)))){
cs.cperiod = cs.slidetonotetarget;
};
};
amigabps5 = (7159090.5 / (cs.cperiod * 2));
cs.cspinc = Std._int(((amigabps5 / 22050) * 65536));
};
};
if (cs.arpeggio){
if (cs.arpeggiotick == 0){
aperiod = this.periods[(cs.arpeggionote + (cs.csmp.fine * 84))];
amigabps6 = (7159090.5 / (aperiod * 2));
cs.cspinc = Std._int(((amigabps6 / 22050) * 65536));
cs.arpeggiotick++;
} else {
if (cs.arpeggiotick == 1){
aperiod = this.periods[((cs.arpeggionote + (cs.csmp.fine * 84)) + cs.arpeggiosemi1)];
amigabps7 = (7159090.5 / (aperiod * 2));
cs.cspinc = Std._int(((amigabps7 / 22050) * 65536));
cs.arpeggiotick++;
} else {
if (cs.arpeggiotick == 2){
aperiod = this.periods[((cs.arpeggionote + (cs.csmp.fine * 84)) + cs.arpeggiosemi2)];
amigabps8 = (7159090.5 / (aperiod * 2));
cs.cspinc = Std._int(((amigabps8 / 22050) * 65536));
cs.arpeggiotick = 0;
};
};
};
};
if (cs.vibrato){
vibval = ((cs.vibratodepth * this.sinewave[(cs.vibratopos & 63)]) >> 7);
amigabps9 = (7159090.5 / ((cs.cperiod + vibval) * 2));
cs.cspinc = Std._int(((amigabps9 / 22050) * 65536));
if (this.rowtick > 0){
cs.vibratopos = (cs.vibratopos + cs.vibratospeed);
};
};
if (cs.tremolo){
trmval = ((cs.tremolodepth * this.sinewave[(cs.tremolopos & 63)]) >> 6);
cs.rvolume = (cs.cvolume + trmval);
if (cs.rvolume < 0){
cs.rvolume = 0;
} else {
if (cs.rvolume > 64){
cs.rvolume = 64;
};
};
if (this.rowtick > 0){
cs.tremolopos = (cs.tremolopos + cs.tremolospeed);
};
};
};
if ((((cs.csmp == null)) || ((cs.rvolume == 0)))){
} else {
if (!cs.delaynote){
mixed = (mixed + ((cs.csmp.wave[(cs.csp >> 16)] * cs.rvolume) >> 8));
};
cs.csp = (cs.csp + cs.cspinc);
if (cs.csp >= cs.cslooplen){
if (cs.csmp.looplen < 2){
cs.csmp = null;
continue;
} else {
cs.csp = (cs.csmp.loopstart << 16);
cs.cslooplen = (cs.csp + (cs.csmp.looplen << 16));
};
};
};
};
} catch(e) {
if (e != "__break__"){
throw (e);
};
};
if (mixed < -128){
mixed = -128;
} else {
if (mixed > 127){
mixed = 127;
};
};
mixed = (mixed + 128);
if (this.cnt >= this.wavelen){
this.wavelen = (this.wavelen + 1000000);
this.wave.length = this.wavelen;
};
var _local2 = this.cnt++;
this.wave[_local2] = mixed;
var _local3 = this.cnt++;
this.wave[_local3] = mixed;
if (this.checkrow){
this.checkrow = nextcheckrow;
};
if (this.checktick){
this.checktick = false;
};
segsamples = (segsamples + 1);
if ((segsamples + 1) >= this.segbreak){
return (true);
};
};
return (true);
}
public function setRepeating(_arg1:Boolean):void{
this.repeating = _arg1;
}
public function notsupport(_arg1:int, _arg2:int, _arg3:int):void{
if (!this.notsupflag[_arg1]){
this.notsupflag[_arg1] = true;
if (_arg1 > 15){
this.xtrace(((((("Command not supported at pat " + _arg2) + " row ") + _arg3) + ": Extended ") + (_arg1 >> 4)));
} else {
this.xtrace(((((("Command not supported at pat " + _arg2) + " row ") + _arg3) + ": ") + _arg1));
};
};
}
public function playBytes(_arg1:ByteArray):void{
var stamp:Number;
var self:ModPlayer;
var data = _arg1;
data.endian = Endian.BIG_ENDIAN;
this.stopnow = false;
try {
this.parseData(data);
} catch(e:Error) {
this.xtrace(("pderror - " + e.message));
if (this.onProgress != null){
this.onProgress(-1);
};
};
data.length = 0;
stamp = Timer.stamp();
self = this;
try {
this.genWaveform(function ():void{
self.xtrace((("Waveform synthesis time: " + (Timer.stamp() - stamp)) + " seconds"));
self.wave.length = self.cnt;
self.beginPlayback();
});
} catch(e2:Error) {
this.xtrace(e2.message);
if (this.onProgress != null){
this.onProgress(-1);
};
return;
};
}
public function genWaveform(_arg1:Function):void{
var _local5:int;
var _local6:int;
this.corder = 0;
this.cpat = this.order[this.corder];
this.cpattern = this.pat[this.cpat];
this.states = new Array();
this.rowspermin = 500;
this.ticksperrow = 6;
this.tickspermin = (this.rowspermin * this.ticksperrow);
this.samplespertick = Std._int((1323000 / this.tickspermin));
this.ticksmpctr = -1;
this.checkrow = true;
this.checktick = true;
this.delaypattern = 0;
this.sinewave = [0, 24, 49, 74, 97, 120, 141, 161, 180, 197, 212, 224, 235, 244, 250, 253, 0xFF, 253, 250, 244, 235, 224, 212, 197, 180, 161, 141, 120, 97, 74, 49, 24, 0, -24, -49, -74, -97, -120, -141, -161, -180, -197, -212, -224, -235, -244, -250, -253, -255, -253, -250, -244, -235, -224, -212, -197, -180, -161, -141, -120, -97, -74, -49, -24];
this.notsupflag = new Array();
var _local2:int;
while (_local2 < 0x0100) {
var _temp1 = _local2;
_local2 = (_local2 + 1);
_local5 = _temp1;
this.notsupflag[_local5] = false;
};
var _local3:int;
var _local4:int = this.chancount;
while (_local3 < _local4) {
var _temp2 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp2;
this.states[_local6] = new ChanState();
this.states[_local6].csmp = null;
this.states[_local6].cperiod = 0;
this.states[_local6].cvolume = 64;
this.states[_local6].rvolume = 64;
this.states[_local6].csp = 0;
this.states[_local6].cspinc = 0;
this.states[_local6].slideperiod = false;
this.states[_local6].vibratowave = 0;
this.states[_local6].tremolowave = 0;
};
this.xtrace("Generating waveform from module data");
this.wave = new ByteArray();
this.wave.length = (this.wavelen = 1000000);
this.cnt = 0;
this.stopnow = false;
this.onFinish = _arg1;
this.calcSegTask(null);
}
public function play(_arg1:String):void{
var loader:URLLoader;
var self:ModPlayer;
var url = _arg1;
var req:URLRequest = new URLRequest(url);
loader = new URLLoader();
self = this;
this.xtrace(("Downloading " + url));
loader.dataFormat = URLLoaderDataFormat.BINARY;
try {
loader.load(req);
} catch(e:Error) {
this.xtrace(("Flash error - " + e.message));
if (this.onProgress != null){
this.onProgress(-1);
};
return;
};
loader.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1):void{
self.xtrace(("IO Error while loading " + url));
if (self.onProgress != null){
self.onProgress(-1);
};
});
loader.addEventListener(Event.COMPLETE, function (_arg1):void{
var d = _arg1;
self.xtrace((("Finished loading " + loader.bytesTotal) + " bytes"));
self.playBytes(function ():ByteArray{
var $r:*;
var tmp:* = loader.data;
$r = (Std._is(tmp, ByteArray)) ? tmp : function (){
var _local1:*;
throw ("Class cast error");
}();
return ($r);
}());
loader.data.length = 0;
});
loader.addEventListener(ProgressEvent.PROGRESS, function (_arg1):void{
if (self.onProgress != null){
self.onProgress(Std._int(((9 * _arg1.bytesLoaded) / _arg1.bytesTotal)));
};
});
}
public function xtrace(_arg1:String):void{
if (this.showTraces){
Log.trace(_arg1, {fileName:"ModPlayer.hx", lineNumber:133, className:"ModPlayer", methodName:"xtrace"});
};
}
public function beginPlayback():void{
if (this.stopnow){
return;
};
this.xtrace("Beginning playback");
this.ldr = DynSound.playSound(this.wave, this.repeating);
this.wave.length = 0;
}
protected function calcSegTask(_arg1):void{
if (!this.calcSegment()){
if (this.onProgress != null){
this.onProgress(100);
};
this.onFinish();
} else {
if (this.onProgress != null){
this.onProgress((10 + Std._int(((89 * this.corder) / this.songlength))));
};
if (this.stopnow){
this.stopnow = false;
return;
};
this.tmr = new Timer(1, 1);
this.tmr.addEventListener(TimerEvent.TIMER_COMPLETE, this.calcSegTask);
this.tmr.start();
};
}
public function parseData(_arg1:ByteArray):void{
var _local2:int;
var _local3:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:int;
var _local28:int;
var _local29:int;
var _local30:int;
var _local31:int;
var _local32:int;
var _local33:int;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:int;
var _local38:int;
var _local39:int;
var _local40:int;
var _local41:int;
var _local42:int;
var _local43:int;
var _local44:int;
var _local45:int;
var _local46:int;
var _local47:int;
var _local48:int;
var _local49:int;
var _local50:int;
var _local4 = 64;
var _local5:Array = [3628, 3424, 3232, 3048, 2880, 2712, 0x0A00, 2416, 2280, 2152, 2032, 1920, 1814, 1712, 1616, 1524, 1440, 1356, 0x0500, 1208, 1140, 1076, 1016, 960, 907, 856, 808, 762, 720, 678, 640, 604, 570, 538, 508, 480, 453, 428, 404, 381, 360, 339, 320, 302, 285, 269, 254, 240, 226, 214, 202, 190, 180, 170, 160, 151, 143, 135, 127, 120, 113, 107, 101, 95, 90, 85, 80, 75, 71, 67, 63, 60, 56, 53, 50, 47, 45, 42, 40, 37, 35, 33, 31, 30, 3600, 3400, 3208, 3028, 2860, 2700, 2544, 2404, 2268, 2140, 2020, 1908, 1800, 1700, 1604, 1514, 1430, 1350, 1272, 1202, 1134, 1070, 1010, 954, 900, 850, 802, 757, 715, 675, 636, 601, 567, 535, 505, 477, 450, 425, 401, 379, 357, 337, 318, 300, 284, 268, 253, 238, 225, 212, 200, 189, 179, 169, 159, 150, 142, 134, 126, 119, 112, 106, 100, 94, 89, 84, 79, 75, 71, 67, 63, 59, 56, 53, 50, 47, 44, 42, 39, 37, 35, 33, 31, 29, 3576, 3376, 3184, 3008, 2836, 2680, 2528, 2388, 2252, 2128, 2008, 1896, 1788, 1688, 1592, 1504, 1418, 1340, 1264, 1194, 1126, 1064, 1004, 948, 894, 844, 796, 752, 709, 670, 632, 597, 563, 532, 502, 474, 447, 422, 398, 376, 355, 335, 316, 298, 282, 266, 251, 237, 223, 211, 199, 188, 177, 167, 158, 149, 141, 133, 125, 118, 111, 105, 99, 94, 88, 83, 79, 74, 70, 66, 62, 59, 55, 52, 49, 47, 44, 41, 39, 37, 35, 33, 31, 29, 3548, 3352, 3164, 2984, 0x0B00, 2660, 2512, 2368, 2236, 2112, 1992, 1880, 1774, 1676, 1582, 1492, 1408, 1330, 1256, 1184, 1118, 1056, 996, 940, 887, 838, 791, 746, 704, 665, 628, 592, 559, 528, 498, 470, 444, 419, 395, 373, 352, 332, 314, 296, 280, 264, 249, 235, 222, 209, 198, 187, 176, 166, 157, 148, 140, 132, 125, 118, 111, 104, 99, 93, 88, 83, 78, 74, 70, 66, 62, 59, 55, 52, 49, 46, 44, 41, 39, 37, 35, 33, 31, 29, 3524, 0x0D00, 3140, 2964, 2796, 2640, 2492, 2352, 2220, 2096, 1976, 1868, 1762, 1664, 1570, 1482, 1398, 1320, 1246, 1176, 1110, 1048, 988, 934, 881, 832, 785, 741, 699, 660, 623, 588, 555, 524, 494, 467, 441, 416, 392, 370, 350, 330, 312, 294, 278, 262, 247, 233, 220, 208, 196, 185, 175, 165, 156, 147, 139, 131, 123, 117, 110, 104, 98, 92, 87, 82, 78, 73, 69, 65, 61, 58, 55, 52, 49, 46, 43, 41, 39, 36, 34, 32, 30, 29, 3500, 3304, 3116, 2944, 2776, 2620, 2476, 2336, 2204, 2080, 1964, 1852, 1750, 1652, 1558, 1472, 1388, 1310, 1238, 1168, 1102, 1040, 982, 926, 875, 826, 779, 736, 694, 655, 619, 584, 551, 520, 491, 463, 437, 413, 390, 368, 347, 328, 309, 292, 276, 260, 245, 232, 219, 206, 195, 184, 174, 164, 155, 146, 138, 130, 123, 116, 109, 103, 97, 92, 87, 82, 77, 73, 69, 65, 61, 58, 54, 51, 48, 46, 43, 41, 38, 36, 34, 32, 30, 29, 3472, 3280, 3096, 2920, 2756, 2604, 2456, 2320, 2188, 2064, 1948, 1840, 1736, 1640, 1548, 1460, 1378, 1302, 1228, 1160, 1094, 1032, 974, 920, 868, 820, 774, 730, 689, 651, 614, 580, 547, 516, 487, 460, 434, 410, 387, 365, 345, 325, 307, 290, 274, 258, 244, 230, 217, 205, 193, 183, 172, 163, 154, 145, 137, 129, 122, 115, 108, 102, 96, 91, 86, 81, 77, 72, 68, 64, 61, 57, 54, 51, 48, 45, 43, 40, 38, 36, 34, 32, 30, 28, 3448, 3256, 0x0C00, 2900, 2736, 2584, 2440, 2300, 2172, 2052, 1936, 1828, 1724, 1628, 0x0600, 1450, 1368, 1292, 1220, 1150, 1086, 1026, 968, 914, 862, 814, 0x0300, 725, 684, 646, 610, 575, 543, 513, 484, 457, 431, 407, 384, 363, 342, 323, 305, 288, 272, 0x0100, 242, 228, 216, 203, 192, 181, 171, 161, 152, 144, 136, 128, 121, 114, 108, 101, 96, 90, 85, 80, 76, 72, 68, 64, 60, 57, 54, 50, 48, 45, 42, 40, 38, 36, 34, 32, 30, 28, 3424, 3232, 3048, 2880, 2712, 0x0A00, 2416, 2280, 2152, 2032, 1920, 1812, 1712, 1616, 1524, 1440, 1356, 0x0500, 1208, 1140, 1076, 1016, 960, 906, 856, 808, 762, 720, 678, 640, 604, 570, 538, 508, 480, 453, 428, 404, 381, 360, 339, 320, 302, 285, 269, 254, 240, 226, 214, 202, 190, 180, 170, 160, 151, 143, 135, 127, 120, 113, 107, 101, 95, 90, 85, 80, 75, 71, 67, 63, 60, 56, 53, 50, 47, 45, 42, 40, 37, 35, 33, 31, 30, 28, 3400, 3208, 3028, 2860, 2696, 2548, 2404, 2268, 2140, 2020, 1908, 1800, 1700, 1604, 1514, 1430, 1348, 1274, 1202, 1134, 1070, 1010, 954, 900, 850, 802, 757, 715, 674, 637, 601, 567, 535, 505, 477, 450, 425, 401, 379, 357, 337, 318, 300, 284, 268, 253, 239, 225, 213, 201, 189, 179, 169, 159, 150, 142, 134, 126, 119, 113, 106, 100, 94, 89, 84, 79, 75, 71, 67, 63, 59, 56, 53, 50, 47, 44, 42, 39, 37, 35, 33, 31, 29, 28, 3376, 3184, 3008, 2836, 2680, 2528, 2388, 2252, 2128, 2008, 1896, 1788, 1688, 1592, 1504, 1418, 1340, 1264, 1194, 1126, 1064, 1004, 948, 894, 844, 796, 752, 709, 670, 632, 597, 563, 532, 502, 474, 447, 422, 398, 376, 355, 335, 316, 298, 282, 266, 251, 237, 224, 211, 199, 188, 177, 167, 158, 149, 141, 133, 125, 118, 112, 105, 99, 94, 88, 83, 79, 74, 70, 66, 62, 59, 56, 52, 49, 47, 44, 41, 39, 37, 35, 33, 31, 29, 28, 3352, 3164, 2984, 0x0B00, 2660, 2512, 2368, 2236, 2112, 1992, 1880, 1776, 1676, 1582, 1492, 1408, 1330, 1256, 1184, 1118, 1056, 996, 940, 888, 838, 791, 746, 704, 665, 628, 592, 559, 528, 498, 470, 444, 419, 395, 373, 352, 332, 314, 296, 280, 264, 249, 235, 222, 209, 198, 187, 176, 166, 157, 148, 140, 132, 125, 118, 111, 104, 99, 93, 88, 83, 78, 74, 70, 66, 62, 59, 55, 52, 49, 46, 44, 41, 39, 37, 35, 33, 31, 29, 27, 0x0D00, 3140, 2964, 2796, 2640, 2492, 2352, 2220, 2096, 1980, 1868, 1764, 1664, 1570, 1482, 1398, 1320, 1246, 1176, 1110, 1048, 990, 934, 882, 832, 785, 741, 699, 660, 623, 588, 555, 524, 495, 467, 441, 416, 392, 370, 350, 330, 312, 294, 278, 262, 247, 233, 220, 208, 196, 185, 175, 165, 156, 147, 139, 131, 124, 117, 110, 104, 98, 92, 87, 82, 78, 73, 69, 65, 62, 58, 55, 52, 49, 46, 43, 41, 39, 36, 34, 32, 31, 29, 27, 3304, 3116, 2944, 2776, 2620, 2476, 2336, 2204, 2080, 1964, 1852, 1748, 1652, 1558, 1472, 1388, 1310, 1238, 1168, 1102, 1040, 982, 926, 874, 826, 779, 736, 694, 655, 619, 584, 551, 520, 491, 463, 437, 413, 390, 368, 347, 328, 309, 292, 276, 260, 245, 232, 219, 206, 195, 184, 174, 164, 155, 146, 138, 130, 123, 116, 109, 103, 97, 92, 87, 82, 77, 73, 69, 65, 61, 58, 54, 51, 48, 46, 43, 41, 38, 36, 34, 32, 30, 29, 27, 3280, 3096, 2920, 2756, 2604, 2456, 2320, 2188, 2064, 1948, 1840, 1736, 1640, 1548, 1460, 1378, 1302, 1228, 1160, 1094, 1032, 974, 920, 868, 820, 774, 730, 689, 651, 614, 580, 547, 516, 487, 460, 434, 410, 387, 365, 345, 325, 307, 290, 274, 258, 244, 230, 217, 205, 193, 183, 172, 163, 154, 145, 137, 129, 122, 115, 109, 102, 96, 91, 86, 81, 77, 72, 68, 64, 61, 57, 54, 51, 48, 45, 43, 40, 38, 36, 34, 32, 30, 28, 27, 3256, 0x0C00, 2900, 2736, 2584, 2440, 2300, 2172, 2052, 1936, 1828, 1724, 1628, 0x0600, 1450, 1368, 1292, 1220, 1150, 1086, 1026, 968, 914, 862, 814, 0x0300, 725, 684, 646, 610, 575, 543, 513, 484, 457, 431, 407, 384, 363, 342, 323, 305, 288, 272, 0x0100, 242, 228, 216, 204, 192, 181, 171, 161, 152, 144, 136, 128, 121, 114, 108, 102, 96, 90, 85, 80, 76, 72, 68, 64, 60, 57, 54, 51, 48, 45, 42, 40, 38, 36, 34, 32, 30, 28, 27];
this.periods = _local5;
this.xtrace("Parsing mod data...");
this.chancount = 4;
this.smp = new Array();
if ((((((((((((_arg1[1080] == 77)) && ((_arg1[1081] == 46)))) && ((_arg1[1082] == 75)))) && ((_arg1[1083] == 46)))) || ((((((((_arg1[1080] == 70)) && ((_arg1[1081] == 76)))) && ((_arg1[1082] == 84)))) && ((_arg1[1083] == 52)))))) || ((((((((_arg1[1080] == 52)) && ((_arg1[1081] == 67)))) && ((_arg1[1082] == 72)))) && ((_arg1[1083] == 78)))))){
_local2 = 31;
} else {
if ((((((((_arg1[1080] == 52)) && ((_arg1[1081] == 67)))) && ((_arg1[1082] == 72)))) && ((_arg1[1083] == 78)))){
_local2 = 31;
this.chancount = 2;
} else {
if ((((((((_arg1[1080] == 54)) && ((_arg1[1081] == 67)))) && ((_arg1[1082] == 72)))) && ((_arg1[1083] == 78)))){
_local2 = 31;
this.chancount = 6;
} else {
if ((((((((((((_arg1[1080] == 67)) && ((_arg1[1081] == 68)))) && ((_arg1[1082] == 56)))) && ((_arg1[1083] == 49)))) || ((((((((_arg1[1080] == 79)) && ((_arg1[1081] == 67)))) && ((_arg1[1082] == 84)))) && ((_arg1[1083] == 65)))))) || ((((((((_arg1[1080] == 56)) && ((_arg1[1081] == 67)))) && ((_arg1[1082] == 72)))) && ((_arg1[1083] == 78)))))){
_local2 = 31;
this.chancount = 8;
} else {
_local2 = 15;
};
};
};
};
this.xtrace((((("Module has " + _local2) + " samples, ") + this.chancount) + " channels"));
var _local6 = "";
var _local7:int;
while (_local7 < 20) {
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local14 = _temp1;
_local15 = _arg1.readUnsignedByte();
if ((((_local15 > 31)) && ((_local15 < 127)))){
_local6 = (_local6 + String.fromCharCode(_local15));
} else {
break;
};
};
this.xtrace(("Module title: " + _local6));
_arg1.position = 20;
var _local8:int;
while (_local8 < _local2) {
var _temp2 = _local8;
_local8 = (_local8 + 1);
_local16 = _temp2;
_arg1.position = (_arg1.position + 22);
_local17 = (_arg1.readUnsignedShort() * 2);
_local18 = (_arg1.readUnsignedByte() & 15);
_local19 = _arg1.readUnsignedByte();
_local20 = (_arg1.readUnsignedShort() * 2);
_local21 = (_arg1.readUnsignedShort() * 2);
if (_local17 < 4){
_local17 = 0;
};
if (_local18 > 7){
_local18 = (_local18 - 16);
};
this.smp[_local16] = new Sample();
this.smp[_local16].length = _local17;
this.smp[_local16].fine = _local18;
this.smp[_local16].volume = (_local19 * volume);
this.smp[_local16].loopstart = _local20;
this.smp[_local16].looplen = _local21;
};
this.songlength = _arg1.readByte();
if (this.songlength < 1){
this.songlength = 1;
};
_arg1.readByte();
this.order = new Array();
var _local9:int;
while (_local9 < 128) {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local22 = _temp3;
this.order[_local22] = _arg1.readUnsignedByte();
};
if (_local2 != 15){
_arg1.readInt();
};
this.xtrace((("Song length is " + this.songlength) + " patterns."));
_local3 = 0;
var _local10:int;
var _local11:int = this.songlength;
while (_local10 < _local11) {
var _temp4 = _local10;
_local10 = (_local10 + 1);
_local23 = _temp4;
if (_local3 < this.order[_local23]){
_local3 = this.order[_local23];
};
};
_local3 = (_local3 + 1);
this.xtrace(("Pattern count: " + _local3));
this.pat = new Array();
var _local12:int;
while (_local12 < _local3) {
var _temp5 = _local12;
_local12 = (_local12 + 1);
_local24 = _temp5;
this.pat[_local24] = new Pattern();
this.pat[_local24].channel = new Array();
_local25 = 0;
_local26 = this.chancount;
while (_local25 < _local26) {
var _temp6 = _local25;
_local25 = (_local25 + 1);
_local28 = _temp6;
this.pat[_local24].channel[_local28] = new Channel();
this.pat[_local24].channel[_local28].note = new Array();
_local29 = 0;
while (_local29 < _local4) {
var _temp7 = _local29;
_local29 = (_local29 + 1);
_local30 = _temp7;
this.pat[_local24].channel[_local28].note[_local30] = new Note();
};
};
_local27 = 0;
while (_local27 < _local4) {
var _temp8 = _local27;
_local27 = (_local27 + 1);
_local31 = _temp8;
_local32 = 0;
_local33 = this.chancount;
while (_local32 < _local33) {
var _temp9 = _local32;
_local32 = (_local32 + 1);
_local34 = _temp9;
_local35 = _arg1.readUnsignedByte();
_local36 = _arg1.readUnsignedByte();
_local37 = _arg1.readUnsignedByte();
_local38 = _arg1.readUnsignedByte();
_local39 = ((((_local35 >> 4) & 15) << 4) | ((_local37 >> 4) & 15));
_local40 = (_local36 | ((_local35 & 15) << 8));
_local41 = (_local38 | ((_local37 & 15) << 8));
_local42 = -1;
if (_local40 > 0){
_local43 = 50;
_local44 = 672;
while (_local44 < 756) {
var _temp10 = _local44;
_local44 = (_local44 + 1);
_local45 = _temp10;
if (Math.abs((_local40 - _local5[_local45])) < _local43){
_local42 = _local45;
_local43 = Std._int(Math.abs((_local40 - _local5[_local45])));
};
};
};
this.pat[_local24].channel[_local34].note[_local31].sample = ((_local39 == 0)) ? null : this.smp[(_local39 - 1)];
this.pat[_local24].channel[_local34].note[_local31].period = _local40;
this.pat[_local24].channel[_local34].note[_local31].peridx = _local42;
this.pat[_local24].channel[_local34].note[_local31].command = ((_local41 >> 8) & 15);
this.pat[_local24].channel[_local34].note[_local31].cmdarg = (_local41 & 0xFF);
};
};
};
var _local13:int;
while (_local13 < _local2) {
var _temp11 = _local13;
_local13 = (_local13 + 1);
_local46 = _temp11;
this.smp[_local46].wave = new Array();
_local47 = 0;
_local48 = this.smp[_local46].length;
while (_local47 < _local48) {
var _temp12 = _local47;
_local47 = (_local47 + 1);
_local49 = _temp12;
_local50 = _arg1.readByte();
this.smp[_local46].wave[_local49] = _local50;
};
};
this.xtrace("Done parsing module data");
}
}
}//package src
Section 87
//MovingWall (src.MovingWall)
package src {
import src.org.cove.ape.*;
import flash.geom.*;
public class MovingWall extends Tool {
public function MovingWall(_arg1:LevelProvider, _arg2:Point=null, _arg3:Point=null, _arg4:Number=4){
super(_arg1, _arg2, _arg3, _arg4);
toolID = 128;
posY = _arg2.y;
posX = _arg2.x;
permanent = true;
i = 0;
while (i < particles.length) {
particles[i].mass = 99;
particles[i].fixed = false;
particles[i].friction = GameDataProvider.MM2_WALL_FRICTION;
i++;
};
}
override public function addDraggersListeners():void{
}
override public function teleportTo(_arg1:Number, _arg2:Number):void{
super.teleportTo(_arg1, _arg2);
posX = _arg1;
posY = _arg2;
}
override public function initInstrument():void{
super.initInstrument();
texture = new Tex_MovingWallBlock();
texture.width = dist;
texture.height = particleSize;
wall.setDisplay(texture, 0, 0, 0);
addParticle(wall);
var _local1:Tex_MovingWallCircle = new Tex_MovingWallCircle();
var _local2:Tex_MovingWallCircle = new Tex_MovingWallCircle();
_local1.width = (_local1.height = (_local2.width = (_local2.height = particleSize)));
_local1.cacheAsBitmap = true;
_local2.cacheAsBitmap = true;
particleA.setDisplay(_local1, 0, 0, 0);
particleB.setDisplay(_local2, 0, 0, 0);
addParticle(particleA);
addParticle(particleB);
}
}
}//package src
Section 88
//NormalSpeedElement (src.NormalSpeedElement)
package src {
import flash.events.*;
import flash.display.*;
public class NormalSpeedElement extends MovieClip {
public var elasticity:Number;// = 0.2
public var friction:Number;// = 0
public function NormalSpeedElement():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.levelRectangles.push(this);
}
}
}//package src
Section 89
//Portal (src.Portal)
package src {
import src.org.cove.ape.*;
import flash.geom.*;
import flash.utils.*;
public class Portal extends Tool {
public var enter:Tex_PortalEnter;
public var exit:Tex_PortalExit;
public function Portal(_arg1:LevelProvider, _arg2:Point=null, _arg3:Point=null, _arg4:Number=4, _arg5:Boolean=false){
type = GameDataProvider.TELEPORT_TOOL;
super(_arg1, _arg2, _arg3, _arg4, _arg5);
toolID = 5;
}
override public function initInstrument():void{
setTimeout(setVisible, 100);
super.initInstrument();
particleA = new CircleParticle(start.x, start.y, 1, true);
particleA.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
enter = new Tex_PortalEnter();
enter.alpha = 0;
enter.addChild(startED);
particleA.setDisplay(enter);
addParticle(particleA);
particleB = new CircleParticle(end.x, end.y, 1, true);
particleB.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
exit = new Tex_PortalExit();
exit.alpha = 0;
exit.addChild(endED);
particleB.setDisplay(exit);
addParticle(particleB);
}
public function setVisible():void{
enter.alpha = 1;
exit.alpha = 1;
}
}
}//package src
Section 90
//RectComposite (src.RectComposite)
package src {
import src.org.cove.ape.*;
public class RectComposite extends Composite {
private var cpA:CircleParticle;
private var cpC:CircleParticle;
public function RectComposite(_arg1:Vector, _arg2:uint, _arg3:uint){
var _local4:Number = 75;
var _local5:Number = 18;
var _local6:Number = 4;
cpA = new CircleParticle((_arg1.x - (_local4 / 2)), (_arg1.y - (_local5 / 2)), _local6, true);
var _local7:CircleParticle = new CircleParticle((_arg1.x + (_local4 / 2)), (_arg1.y - (_local5 / 2)), _local6, true);
cpC = new CircleParticle((_arg1.x + (_local4 / 2)), (_arg1.y + (_local5 / 2)), _local6, true);
var _local8:CircleParticle = new CircleParticle((_arg1.x - (_local4 / 2)), (_arg1.y + (_local5 / 2)), _local6, true);
cpA.setStyle(0, 0, 0, _arg2);
_local7.setStyle(0, 0, 0, _arg2);
cpC.setStyle(0, 0, 0, _arg2);
_local8.setStyle(0, 0, 0, _arg2);
cpA.alwaysRepaint = true;
_local7.alwaysRepaint = true;
cpC.alwaysRepaint = true;
_local8.alwaysRepaint = true;
var _local9:SpringConstraint = new SpringConstraint(cpA, _local7, 0.5, true, (_local6 * 2));
var _local10:SpringConstraint = new SpringConstraint(_local7, cpC, 0.5, true, (_local6 * 2));
var _local11:SpringConstraint = new SpringConstraint(cpC, _local8, 0.5, true, (_local6 * 2));
var _local12:SpringConstraint = new SpringConstraint(_local8, cpA, 0.5, true, (_local6 * 2));
_local9.setStyle(0, 0, 0, _arg2);
_local10.setStyle(0, 0, 0, _arg2);
_local11.setStyle(0, 0, 0, _arg2);
_local12.setStyle(0, 0, 0, _arg2);
_local9.alwaysRepaint = true;
_local10.alwaysRepaint = true;
_local11.alwaysRepaint = true;
_local12.alwaysRepaint = true;
addParticle(cpA);
addParticle(_local7);
addParticle(cpC);
addParticle(_local8);
addConstraint(_local9);
addConstraint(_local10);
addConstraint(_local11);
addConstraint(_local12);
}
public function get pa():CircleParticle{
return (cpA);
}
public function get pc():CircleParticle{
return (cpC);
}
}
}//package src
Section 91
//Rotator (src.Rotator)
package src {
import src.org.cove.ape.*;
public class Rotator extends Group {
private var ctr:Vector;
private var rectComposite:RectComposite;
public function Rotator(_arg1:uint, _arg2:uint){
collideInternal = true;
ctr = new Vector(555, 175);
rectComposite = new RectComposite(ctr, _arg1, _arg2);
addComposite(rectComposite);
var _local3:CircleParticle = new CircleParticle(ctr.x, ctr.y, 5);
_local3.setStyle(1, _arg1, 1, _arg2);
addParticle(_local3);
var _local4:RectangleParticle = new RectangleParticle(555, 160, 10, 10, 0, false, 3);
_local4.setStyle(1, _arg1, 1, _arg2);
addParticle(_local4);
var _local5:SpringConstraint = new SpringConstraint(rectComposite.pa, _local4, 1);
_local5.setStyle(2, _arg2);
addConstraint(_local5);
var _local6:RectangleParticle = new RectangleParticle(555, 190, 10, 10, 0, false, 3);
_local6.setStyle(1, _arg1, 1, _arg2);
addParticle(_local6);
var _local7:SpringConstraint = new SpringConstraint(rectComposite.pc, _local6, 1);
_local7.setStyle(2, _arg2);
addConstraint(_local7);
}
public function rotateByRadian(_arg1:Number):void{
rectComposite.rotateByRadian(_arg1, ctr);
}
}
}//package src
Section 92
//ShowPannelBtn (src.ShowPannelBtn)
package src {
import flash.display.*;
public dynamic class ShowPannelBtn extends SimpleButton {
}
}//package src
Section 93
//SoundProvider (src.SoundProvider)
package src {
import flash.events.*;
import flash.utils.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.media.*;
public class SoundProvider {
public var driveTween:Tween;
private var driveSndChannel:SoundChannel;
private var idleSndChannel:SoundChannel;
private var sTransformDrive:SoundTransform;
private var vol;// = 0
private var driveSnd:snd_carDrive;
private var sTransformIdle:SoundTransform;
private var idleSnd:snd_carIdle;
public var idleTween:Tween;
private static var ModClassGame:Class = SoundProvider_ModClassGame;
private static var mus_menu:ByteArray = (new ModClassMenu() as ByteArray);
private static var _musicVolume:Number = 1;
private static var player:ModPlayer = new ModPlayer();
private static var volume:Number = 0.5;
private static var muted:Boolean = false;
private static var mus_game:ByteArray = (new ModClassGame() as ByteArray);
public static var bonus:Boolean = true;
private static var ModClassMenu:Class = SoundProvider_ModClassMenu;
public function SoundProvider(){
sTransformIdle = new SoundTransform(GameDataProvider.ENGINE_VOLUME);
sTransformDrive = new SoundTransform(GameDataProvider.ENGINE_VOLUME);
idleTween = new Tween(sTransformDrive, "volume", None.easeNone, GameDataProvider.ENGINE_VOLUME, 0, 0.5, true);
idleTween.stop();
idleTween.addEventListener(TweenEvent.MOTION_FINISH, hZeroVolumeIdle);
idleTween.addEventListener(TweenEvent.MOTION_CHANGE, hUpdateVolumeIdle);
driveTween = new Tween(sTransformDrive, "volume", None.easeNone, GameDataProvider.ENGINE_VOLUME, 0, 0.5, true);
driveTween.stop();
driveTween.addEventListener(TweenEvent.MOTION_CHANGE, hUpdateVolumeDrive);
driveTween.addEventListener(TweenEvent.MOTION_FINISH, hZeroVolumeDrive);
}
public function stopIdleSound():void{
if (idleSndChannel != null){
idleTween.start();
};
}
public function hUpdateVolumeIdle(_arg1:Event):void{
sTransformIdle = new SoundTransform(idleTween.position);
if (idleSndChannel != null){
idleSndChannel.soundTransform = sTransformIdle;
};
}
public function playIdleSound():void{
idleTween.rewind();
idleTween.stop();
sTransformIdle = new SoundTransform(GameDataProvider.ENGINE_VOLUME);
if (idleSndChannel == null){
idleSnd = new snd_carIdle();
idleSndChannel = idleSnd.play(0, 9999);
idleSndChannel.soundTransform = sTransformIdle;
};
}
public function hZeroVolumeDrive(_arg1:Event):void{
if (driveSndChannel != null){
driveSndChannel.stop();
driveSndChannel = null;
};
}
public function stopDriveSound():void{
if (driveSndChannel != null){
driveTween.start();
};
}
public function hZeroVolumeIdle(_arg1:Event):void{
if (idleSndChannel != null){
idleSndChannel.stop();
idleSndChannel = null;
};
}
public function playDriveSound():void{
driveTween.rewind();
driveTween.stop();
sTransformDrive = new SoundTransform(GameDataProvider.ENGINE_VOLUME);
if (driveSndChannel == null){
driveSnd = new snd_carDrive();
driveSndChannel = driveSnd.play();
driveSndChannel.soundTransform = sTransformDrive;
};
}
public function hUpdateVolumeDrive(_arg1:Event):void{
sTransformDrive = new SoundTransform(driveTween.position);
if (driveSndChannel != null){
driveSndChannel.soundTransform = sTransformDrive;
};
}
public static function stopMusic(){
player.stop();
}
public static function mute(_arg1:Boolean=false){
muted = _arg1;
if (muted){
SoundMixer.soundTransform = new SoundTransform(0, 0);
} else {
SoundMixer.soundTransform = new SoundTransform(volume, 0);
};
}
public static function playBonusMusic(){
bonus = true;
player.stop();
player.volume = _musicVolume;
player.playBytes((new ModClassGame() as ByteArray));
}
public static function get musicVolume():Number{
return (_musicVolume);
}
public static function setQuietMode(_arg1:Boolean=false){
if (!muted){
volume = (_arg1) ? (GameDataProvider.DEFAULT_VOLUME * GameDataProvider.DRIVE_VOLUME_MULTIPLIER) : GameDataProvider.DEFAULT_VOLUME;
SoundMixer.soundTransform = new SoundTransform(volume, 0);
};
}
public static function set musicVolume(_arg1:Number):void{
_musicVolume = _arg1;
player.volume = _musicVolume;
}
public static function playGameMusic(){
if (bonus){
player.stop();
player.volume = _musicVolume;
player.playBytes((new ModClassMenu() as ByteArray));
bonus = false;
};
}
player.setRepeating(true);
}
}//package src
Section 94
//SoundProvider_ModClassGame (src.SoundProvider_ModClassGame)
package src {
import mx.core.*;
public class SoundProvider_ModClassGame extends ByteArrayAsset {
}
}//package src
Section 95
//SoundProvider_ModClassMenu (src.SoundProvider_ModClassMenu)
package src {
import mx.core.*;
public class SoundProvider_ModClassMenu extends ByteArrayAsset {
}
}//package src
Section 96
//Star1 (src.Star1)
package src {
import flash.events.*;
import flash.display.*;
public class Star1 extends MovieClip {
public var score:Number;// = 300
public var body:MovieClip;
public function Star1():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.stars.push(this);
}
}
}//package src
Section 97
//Star2 (src.Star2)
package src {
import flash.display.*;
import flash.events.*;
public class Star2 extends MovieClip {
public var score:Number;// = 200
public var body:MovieClip;
public function Star2():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.stars.push(this);
}
}
}//package src
Section 98
//Star3 (src.Star3)
package src {
import flash.events.*;
import flash.display.*;
public class Star3 extends MovieClip {
public var score:Number;// = 100
public var body:MovieClip;
public function Star3():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.stars.push(this);
}
}
}//package src
Section 99
//Std (src.Std)
package src {
import src.flash.*;
public class Std {
public static function _int(_arg1:Number):int{
return (int(_arg1));
}
public static function string(_arg1):String{
return (Boot.__string_rec(_arg1, ""));
}
public static function random(_arg1:int):int{
return (Math.floor((Math.random() * _arg1)));
}
public static function _parseFloat(_arg1:String):Number{
return (parseFloat(_arg1));
}
public static function _is(_arg1, _arg2):Boolean{
return (Boot.__instanceof(_arg1, _arg2));
}
public static function _parseInt(_arg1:String){
var _local2:* = parseInt(_arg1);
if (isNaN(_local2)){
return (null);
};
return (_local2);
}
}
}//package src
Section 100
//teleportElement (src.teleportElement)
package src {
import flash.display.*;
public class teleportElement extends MovieClip {
public var start:MovieClip;
public var end:MovieClip;
public function teleportElement():void{
LevelProvider.levelPortals.push(this);
}
}
}//package src
Section 101
//Tex_Portal (src.Tex_Portal)
package src {
import flash.display.*;
public dynamic class Tex_Portal extends MovieClip {
public function Tex_Portal(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package src
Section 102
//Tex_PortalEnter (src.Tex_PortalEnter)
package src {
import flash.display.*;
public dynamic class Tex_PortalEnter extends MovieClip {
public function Tex_PortalEnter(){
addFrameScript(0, frame1, 24, frame25);
}
function frame25(){
stop();
}
function frame1(){
stop();
}
}
}//package src
Section 103
//Tool (src.Tool)
package src {
import flash.display.*;
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
public class Tool extends Group {
public var startED:EdgeDragger;
public var posX:Number;
public var posY:Number;
public var particleA:CircleParticle;
public var texture:MovieClip;
public var dragger:EdgeDragger;
public var dist:Number;
public var particleSize:Number;// = 4
public var xOffset:Number;
protected var creator:LevelProvider;
public var permanent:Boolean;
public var toolID;// = 0
public var endED:EdgeDragger;
public var type:String;
public var wall:RectangleParticle;
public var center:Point;// = null
public var end:Point;// = null
public var start:Point;// = null
protected var i:int;// = 0
public var yOffset:Number;
public var particleB:CircleParticle;
public function Tool(_arg1:LevelProvider, _arg2:Point=null, _arg3:Point=null, _arg4:Number=4, _arg5=false){
this.creator = _arg1;
this.start = _arg2;
this.end = _arg3;
this.particleSize = _arg4;
this.permanent = _arg5;
initInstrument();
}
public function teleportTo(_arg1:Number, _arg2:Number):void{
posX = _arg1;
posY = _arg2;
wall.fixed = (particleA.fixed = (particleB.fixed = false));
center = new Point(_arg1, _arg2);
wall.position = new Vector(_arg1, _arg2);
particleA.position = new Vector((_arg1 - xOffset), (_arg2 - yOffset));
particleB.position = new Vector((_arg1 + xOffset), (_arg2 + yOffset));
}
public function addDraggersListeners():void{
startED.addEventListener(MouseEvent.MOUSE_OVER, creator.onEdgeOver);
startED.addEventListener(MouseEvent.MOUSE_OUT, creator.onEdgeOut);
endED.addEventListener(MouseEvent.MOUSE_OVER, creator.onEdgeOver);
endED.addEventListener(MouseEvent.MOUSE_OUT, creator.onEdgeOut);
dragger.addEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
startED.addEventListener(MouseEvent.MOUSE_DOWN, creator.onEdgeStartDrag);
endED.addEventListener(MouseEvent.MOUSE_DOWN, creator.onEdgeStartDrag);
}
public function hDClick(_arg1:MouseEvent):void{
if (!creator.carMoveEnabled){
removeInstrument();
};
}
public function removeInstrument():void{
creator.removeCarCollidable(this);
APEngine.removeGroup(this);
if (!permanent){
creator.changeInstrumentNum(type, 1);
};
start = null;
end = null;
cleanup();
}
public function fix():void{
wall.fixed = (particleA.fixed = (particleB.fixed = true));
start.x = particleA.px;
start.y = particleA.py;
end.x = particleB.px;
end.y = particleB.py;
}
public function initInstrument():void{
xOffset = ((start.x + end.x) * 0.5);
yOffset = ((start.y + end.y) * 0.5);
center = new Point(xOffset, yOffset);
xOffset = (end.x - xOffset);
yOffset = (end.y - yOffset);
posX = center.x;
posY = center.y;
dist = GameDataProvider.DISTANCE(start, end);
wall = new RectangleParticle(center.x, center.y, dist, particleSize, GameDataProvider.ANGLE(start, end), true);
wall.setStyle(0, GameDataProvider.COLOR_D, 1, GameDataProvider.COLOR_D, 0.2);
particleA = new CircleParticle(start.x, start.y, (particleSize * 0.5), true);
particleA.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
addParticle(particleA);
particleB = new CircleParticle(end.x, end.y, (particleSize * 0.5), true);
particleB.setStyle(1, GameDataProvider.COLOR_C, 1, GameDataProvider.COLOR_B);
addParticle(particleB);
startED = new EdgeDragger(this);
endED = new EdgeDragger(this);
endED.end = true;
dragger = new EdgeDragger(this);
if (!permanent){
addDraggersListeners();
};
particleA.setDisplay(startED, 0, 0, 0);
particleB.setDisplay(endED, 0, 0, 0);
wall.friction = (particleA.friction = (particleB.friction = GameDataProvider.WALL_FRICTION));
APEngine.addGroup(this);
creator.addCarCollidable(this);
creator.addedInstruments.push(this);
creator.addedInstrumentsLength++;
creator.reCalcWinds();
if (!permanent){
creator.changeInstrumentNum(type, -1);
};
}
public function jump(_arg1:Number):void{
var _local2:int;
while (_local2 < particles.length) {
particles[_local2].addForce(new Vector(0, -(_arg1)));
_local2++;
};
}
public function hMouseDown(_arg1:MouseEvent):void{
creator.setToolDragged(this);
}
public function moveLeft():void{
posX = (posX - GameDataProvider.MM2_WALL_X_VEL);
if (posX < GameDataProvider.MM2_WALL_LEFT_LIMIT){
posY = (posY + GameDataProvider.MM2_WALL_ACCEL);
if ((((posX < -(dist))) || ((posY > (GameDataProvider.MM2_WALL_BOTTOM_LIMIT + yOffset))))){
if (permanent){
wall.width = (wall.width - (10 / GameDataProvider.MM2_WALL_X_VEL));
xOffset = (xOffset - (5 / GameDataProvider.MM2_WALL_X_VEL));
texture.width = wall.width;
posX = GameDataProvider.MM2_WALL_RIGHT_LIMIT;
posY = (400 + (Math.random() * 100));
} else {
removeInstrument();
return;
};
};
};
start.x = (posX - xOffset);
end.x = (posX + xOffset);
start.y = (posY - yOffset);
end.y = (posY + yOffset);
teleportTo(posX, posY);
}
}
}//package src
Section 104
//ToolBar (src.ToolBar)
package src {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import flash.text.*;
import com.midasplayer.*;
import fl.transitions.easing.*;
import flash.media.*;
public class ToolBar extends MovieClip {
public var soundMc:MovieClip;
public var isResizebleToolSelected:Boolean;// = false
public var creator;
public var logo:Logo;
public var isEnabled:Boolean;
private var openTween:Tween;
public var closeBtn:SimpleButton;
private var closeTween:Tween;
public var helpBtn:SimpleButton;
public var oldTool:uint;
private var returnButtonPress:Function;
public var solutionsBtn:SimpleButton;
private var _currentTool:uint;
private var tf:TextField;
private var wndProvider:WindowProvider;
public static var currentIcon:MovieClip;
public function ToolBar(_arg1, _arg2, _arg3:WindowProvider){
tabChildren = false;
wndProvider = _arg3;
returnButtonPress = _arg2;
this.creator = _arg1;
isEnabled = true;
initToolBar();
}
private function hOnPannelHiden(_arg1:TweenEvent):void{
creator.enableShowPannelBtn();
enableToolBar();
}
private function hMouseOver(_arg1:MouseEvent){
if (((!(isEnabled)) || (!(_arg1.currentTarget.enabled)))){
return;
};
_arg1.currentTarget.tool.gotoAndStop(2);
if (_arg1.currentTarget.popUp != null){
_arg1.currentTarget.popUp.popUpInside.gotoAndStop(_arg1.currentTarget.currentFrame);
_arg1.currentTarget.popUp.gotoAndPlay("RollOver");
};
}
private function hOnSoundMcOver(_arg1:MouseEvent):void{
if (!isEnabled){
return;
};
if (_arg1.currentTarget.soundMcInside != null){
_arg1.currentTarget.soundMcInside.gotoAndStop(2);
};
}
private function hOnSoundMcPressed(_arg1:MouseEvent):void{
if (!isEnabled){
return;
};
var _local2:Number = ((soundMc.currentFrame)==1) ? 2 : 1;
soundMc.gotoAndStop(_local2);
if (_local2 > 1){
GameDataProvider.SOUNDS_OFF = true;
SoundProvider.mute(true);
} else {
GameDataProvider.SOUNDS_OFF = false;
SoundProvider.mute(false);
};
}
private function initToolBar():void{
var _local2:but_Tool;
if (GameDataProvider.SOUNDS_OFF){
soundMc.gotoAndStop(2);
};
logo.buttonMode = true;
logo.addEventListener(MouseEvent.CLICK, hOnLogoClick);
soundMc.addEventListener(MouseEvent.MOUSE_OVER, hOnSoundMcOver);
soundMc.addEventListener(MouseEvent.MOUSE_OUT, hOnSoundMcOut);
soundMc.addEventListener(MouseEvent.MOUSE_DOWN, hOnSoundMcPressed);
helpBtn.addEventListener(MouseEvent.MOUSE_DOWN, hOnHelp);
solutionsBtn.addEventListener(MouseEvent.MOUSE_DOWN, hOnSolutions);
helpBtn.useHandCursor = false;
var _local1:int;
while (_local1 < 8) {
_local2 = new but_Tool();
_local2.x = ((_local1 * (_local2.width + 10)) + 20);
if (_local1 >= 5){
_local2.x = 600;
};
_local2.gotoAndStop((_local1 + 1));
_local2.name = ("button" + (_local1 + 1).toString());
if (_local1 == 7){
_local2.name = "backBtn";
};
_local2.addEventListener(MouseEvent.MOUSE_DOWN, onClick, false, 1, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, hMouseOver, false, 2, true);
_local2.addEventListener(MouseEvent.MOUSE_OUT, hMouseOut, false, 2, true);
_local2.none.visible = false;
if (_local2.txtMc != null){
_local2.txtMc.buttonMode = false;
_local2.txtMc.mouseChildren = false;
_local2.txtMc.mouseEnabled = true;
};
addChild(_local2);
_local1++;
};
updateTextFields();
if (GameDataProvider.PANNEL_IS_HIDDEN){
closeBtn.visible = false;
};
closeBtn.addEventListener(MouseEvent.CLICK, hidePannel);
}
public function get currentTool():uint{
return (_currentTool);
}
public function showPannel(_arg1:MouseEvent=null){
if (!isEnabled){
return;
};
isEnabled = false;
creator.disableShowPannelBtn();
openTween = new Tween(this, "y", Regular.easeOut, this.y, GameDataProvider.TOOL_BAR_DEFAULT_Y, 0.5, true);
openTween.addEventListener(TweenEvent.MOTION_FINISH, hOnPannelShowed);
}
public function hidePannel(_arg1:MouseEvent=null){
if (!isEnabled){
return;
};
closeBtn.visible = false;
isEnabled = false;
closeTween = new Tween(this, "y", Regular.easeIn, this.y, GameDataProvider.PANNEL_HIDDEN_Y, 0.5, true);
closeTween.addEventListener(TweenEvent.MOTION_FINISH, hOnPannelHiden);
GameDataProvider.PANNEL_IS_HIDDEN = true;
}
private function hOnHelp(_arg1:MouseEvent):void{
if (!isEnabled){
return;
};
wndProvider.showHelpWindow();
}
public function clearToolBar():void{
logo.removeEventListener(MouseEvent.CLICK, hOnLogoClick);
solutionsBtn.removeEventListener(MouseEvent.MOUSE_DOWN, hOnSolutions);
soundMc.removeEventListener(MouseEvent.MOUSE_OVER, hOnSoundMcOver);
soundMc.removeEventListener(MouseEvent.MOUSE_OUT, hOnSoundMcOut);
soundMc.removeEventListener(MouseEvent.MOUSE_DOWN, hOnSoundMcPressed);
if (openTween != null){
openTween.removeEventListener(TweenEvent.MOTION_FINISH, hOnPannelShowed);
};
if (closeTween != null){
closeTween.removeEventListener(TweenEvent.MOTION_FINISH, hOnPannelShowed);
};
closeBtn.removeEventListener(MouseEvent.CLICK, hidePannel);
var _local1:* = 0;
while (_local1 < 6) {
(getChildByName(("button" + (_local1 + 1).toString())) as MovieClip).removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
_local1++;
};
}
private function hOnSoundMcOut(_arg1:MouseEvent):void{
if (!isEnabled){
return;
};
if (_arg1.currentTarget.soundMcInside != null){
_arg1.currentTarget.soundMcInside.gotoAndStop(1);
};
}
private function checkToolResizable():void{
switch (currentTool){
case 1:
isResizebleToolSelected = true;
break;
case 2:
isResizebleToolSelected = true;
break;
case 5:
isResizebleToolSelected = true;
break;
default:
isResizebleToolSelected = false;
break;
};
}
public function disableToolBar():void{
isEnabled = false;
}
public function enableToolBar():void{
isEnabled = true;
}
private function onClick(_arg1:MouseEvent){
if (!isEnabled){
return;
};
if (currentIcon != null){
currentIcon.gotoAndStop(1);
};
var _local2:Sound = new snd_blip();
_local2.play();
var _local3:* = _arg1.currentTarget.currentFrame;
switch (_local3){
case 1:
if (GameAccounter.currentBridgeNum <= 0){
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
};
creator.setToolIndicator(GameDataProvider.BRIDGE_TOOL);
break;
case 2:
if (GameAccounter.currentWallNum <= 0){
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
};
creator.setToolIndicator(GameDataProvider.WALL_TOOL);
break;
case 3:
if (GameAccounter.currentJumperNum <= 0){
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
};
creator.setToolIndicator(GameDataProvider.JUMPER_TOOL);
break;
case 4:
if (GameAccounter.currentWindNum <= 0){
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
};
creator.setToolIndicator(GameDataProvider.WIND_TOOL);
break;
case 5:
if (GameAccounter.currentTeleportNum <= 0){
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
};
creator.setToolIndicator(GameDataProvider.TELEPORT_TOOL);
break;
case 6:
creator.undo();
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
case 7:
creator.clearAll();
currentTool = 0;
oldTool = 0;
creator.setToolIndicator(0);
return;
case 8:
if (!isEnabled){
return;
};
returnButtonPress();
return;
};
currentTool = (oldTool = _local3);
currentIcon = (_arg1.target as MovieClip);
if (currentIcon != null){
currentIcon.gotoAndStop(2);
};
}
private function hOnPannelShowed(_arg1:TweenEvent):void{
closeBtn.visible = true;
isEnabled = true;
GameDataProvider.PANNEL_IS_HIDDEN = false;
enableToolBar();
}
public function updateTextFields():void{
var _local2:MovieClip;
if (creator.accounter.gameMode == GameDataProvider.GM_ACTION){
return;
};
var _local1:int;
var _local3 = 1;
while (_local3 < 6) {
_local2 = (getChildByName(("button" + _local3)) as MovieClip);
switch (_local3){
case 1:
_local1 = GameAccounter.currentBridgeNum;
break;
case 2:
_local1 = GameAccounter.currentWallNum;
break;
case 3:
_local1 = GameAccounter.currentJumperNum;
break;
case 4:
_local1 = GameAccounter.currentWindNum;
break;
case 5:
_local1 = GameAccounter.currentTeleportNum;
break;
};
_local2.txtMc.txt.text = _local1.toString();
if (_local1 < 1){
_local2.txtMc.visible = false;
_local2.none.visible = true;
_local2.enabled = false;
} else {
_local2.txtMc.visible = true;
_local2.none.visible = false;
_local2.enabled = true;
};
_local3++;
};
}
public function set currentTool(_arg1:uint){
_currentTool = _arg1;
checkToolResizable();
}
private function hOnSolutions(_arg1:MouseEvent):void{
KingAPI.openKingPage("Solutions", "/game/chaos-racer");
}
private function hOnLogoClick(_arg1:MouseEvent):void{
KingAPI.openSignLink();
}
private function hOnReturn(_arg1:MouseEvent):void{
if (!isEnabled){
return;
};
returnButtonPress();
}
private function hMouseOut(_arg1:MouseEvent){
if (((!(isEnabled)) || (!(_arg1.currentTarget.enabled)))){
return;
};
_arg1.currentTarget.tool.gotoAndPlay(1);
if (_arg1.currentTarget.popUp != null){
_arg1.currentTarget.popUp.gotoAndPlay("RollOut");
};
}
}
}//package src
Section 105
//Wall (src.Wall)
package src {
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
public class Wall extends Tool {
public function Wall(_arg1:LevelProvider, _arg2:Point=null, _arg3:Point=null, _arg4:Number=4){
type = GameDataProvider.WALL_TOOL;
super(_arg1, _arg2, _arg3, GameDataProvider.WALL_THICKNESS);
toolID = 2;
}
override public function initInstrument():void{
super.initInstrument();
texture = new Tex_Wall();
texture["msk"].width = dist;
texture.height = GameDataProvider.WALL_THICKNESS;
texture.cacheAsBitmap = true;
texture.addEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
wall.setDisplay(texture, 0, 0, 0);
addParticle(wall);
}
}
}//package src
Section 106
//verticalElement (src.verticalElement)
package src {
import flash.display.*;
import flash.events.*;
public class verticalElement extends MovieClip {
public var elasticity:Number;// = 0.1
public var friction:Number;// = 0
public function verticalElement():void{
addEventListener(Event.ADDED_TO_STAGE, hAdded);
}
public function hAdded(_arg1:Event):void{
LevelProvider.levelRectangles.push(this);
}
}
}//package src
Section 107
//Wind (src.Wind)
package src {
import flash.events.*;
import src.org.cove.ape.*;
import flash.geom.*;
public class Wind extends Tool {
private var b_left:Number;// = 0
private var overWallsData:Array;
private var totalOverWalls:Number;// = 0
private var overWalls:Array;
private var b_right:Number;// = 0
public function Wind(_arg1:LevelProvider, _arg2:Point=null, _arg3:Boolean=false){
type = GameDataProvider.WIND_TOOL;
super(_arg1, _arg2, _arg2, GameDataProvider.WIND_PARTICLE_SIZE, _arg3);
toolID = 4;
}
public function findOverWalls():void{
var _local3:Number;
var _local4:Number;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Number;
var _local9:*;
b_left = (posX - GameDataProvider.WIND_EFFECT_WIDTH);
b_right = (posX + GameDataProvider.WIND_EFFECT_WIDTH);
overWalls = [];
overWallsData = [];
var _local1:Array = creator.getAllWalls();
var _local2:int;
while (_local2 < _local1.length) {
if (Math.abs(_local1[_local2].angle) != 90){
_local3 = ((Math.cos(_local1[_local2].radian) * _local1[_local2].width) * 0.5);
_local4 = ((Math.sin(_local1[_local2].radian) * _local1[_local2].width) * 0.5);
_local5 = new Point((_local1[_local2].px + _local3), (_local1[_local2].py + _local4));
_local6 = new Point((_local1[_local2].px - _local3), (_local1[_local2].py - _local4));
if (_local5.x > _local6.x){
_local7 = _local5.x;
_local5.x = _local6.x;
_local6.x = _local7;
};
if (_local5.y > _local6.y){
_local7 = _local5.y;
_local5.y = _local6.y;
_local6.y = _local7;
};
if ((((((posX > _local5.x)) && ((posX < _local6.x)))) && ((_local5.y < posY)))){
_local8 = Math.tan(_local1[_local2].radian);
_local9 = (((posX - _local1[_local2].px) * _local8) + _local1[_local2].py);
if (posY > _local9){
overWalls.push(_local1[_local2]);
overWallsData.push({k:_local8, x:_local1[_local2].px, y:_local1[_local2].py, limL:_local5.y, limR:_local6.y, straight:(_local5.y == _local6.y)});
};
};
};
_local2++;
};
totalOverWalls = overWalls.length;
}
override public function addDraggersListeners():void{
}
override public function removeInstrument():void{
texture.stop();
texture = null;
super.removeInstrument();
}
override public function initInstrument():void{
super.initInstrument();
texture = new Tex_Wind();
texture.cacheAsBitmap = true;
if (!permanent){
texture.addEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
};
wall.setDisplay(texture);
addParticle(wall);
findOverWalls();
}
public function checkPointIsBlown(_arg1:Point):Boolean{
var _local2:Number;
var _local3:* = 0;
if ((((((_arg1.x > b_left)) && ((_arg1.x < b_right)))) && ((_arg1.y < posY)))){
while (_local3 < totalOverWalls) {
if (overWallsData[_local3].straight){
if (_arg1.y < overWallsData[_local3].y){
return (false);
};
};
_local2 = (((_arg1.x - overWallsData[_local3].x) * overWallsData[_local3].k) + overWallsData[_local3].y);
if (_arg1.y < _local2){
return (false);
};
_local3++;
};
return (true);
};
return (false);
}
override public function fix():void{
super.fix();
findOverWalls();
}
}
}//package src
Section 108
//windForLevelMap (src.windForLevelMap)
package src {
import flash.display.*;
public class windForLevelMap extends MovieClip {
public var elasticity:Number;// = 0.1
public var friction:Number;// = 0
public function windForLevelMap():void{
LevelProvider.levelWinds.push(this);
}
}
}//package src
Section 109
//WindowProvider (src.WindowProvider)
package src {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.transitions.*;
import com.midasplayer.*;
import fl.transitions.easing.*;
import flash.media.*;
public class WindowProvider {
private var minusScore:Function;
private var statisticsWindow:StatisticsWindow;
private var plusForBonus:Number;// = 0
private var helpWindow:HelpWindow;
private var froze:Function;
private var getPointsFromSavedTools:Timer;
private var plusScore:Function;
private var stageObj:Stage;
private var accounter:GameAccounter;
private var unfroze:Function;
private var getPointsFromBonusSeconds:Timer;
private var difficultyWnd:DifficultyWnd;
private var totalScore:Number;
private var informWindow:InformWindow;
private var reinitMainMenu:Function;
private var speed:Number;// = 0.5
private var statisticsWnd:LevelStatistics;
private var tweensIndex:Number;// = 0
private var tweens:Array;
private var needToPlus:Number;// = 0
private var windowsDepths:MovieClip;
private var questionWindow:QuestionWindow;
public var gameModeWnd:GameModeWnd;
private var bonusStatisticsWnd:BonusStatistics;
private var hStartGame:Function;
public function WindowProvider(_arg1:Stage, _arg2, _arg3, _arg4):void{
tweens = [];
super();
plusScore = _arg2.addScore;
accounter = _arg2;
froze = _arg3;
unfroze = _arg4;
stageObj = _arg1;
stageObj.tabChildren = false;
}
private function hOnYes(_arg1:MouseEvent):void{
setTimeout(removeQuestionWindow, 200, true);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function startHelpAnimation():void{
helpWindow.animation.animationInside.play();
}
public function showInformWindow(_arg1, _arg2):void{
informWindow = new InformWindow();
informWindow.hOk = _arg2;
informWindow.txt.text = _arg1;
standartWindowInit(informWindow);
informWindow.okBtn.addEventListener(MouseEvent.CLICK, hOnInformOk);
stageObj.addChild(informWindow);
createTransition(informWindow, informWindow.yPos, (speed / 2));
}
private function processBonusStatisticsOkBtn(_arg1):void{
if (getPointsFromBonusSeconds != null){
getPointsFromBonusSeconds.stop();
getPointsFromBonusSeconds.removeEventListener("timer", hGetBonusPoints);
if ((((plusForBonus > 0)) && (!(GameDataProvider.IS_CHEATED)))){
plusScore(plusForBonus);
plusForBonus = 0;
};
};
_arg1.hOkBtn();
destroyWindow(_arg1);
}
public function setHardDifficulty(_arg1:MouseEvent):void{
difficultyWnd.easyCheckBox.gotoAndStop(1);
difficultyWnd.hardCheckBox.gotoAndStop(2);
difficultyWnd.impossibleCheckBox.gotoAndStop(1);
GameDataProvider.CURRENT_DIFFICULTY_LEVEL = 2;
difficultyWnd.faceMc.gotoAndStop(2);
}
private function destroyWindow(_arg1:MovieClip):void{
if (_arg1 != null){
stageObj.removeChild(_arg1);
_arg1 = null;
stageObj.focus = stageObj;
};
}
private function hStatisticsOkBtn(_arg1:MouseEvent):void{
setTimeout(processStatisticsOkBtn, 200, statisticsWnd);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function hGetPointsFromSavedTools():void{
getPointsFromSavedTools.start();
}
private function hBonusStatisticsOkBtn(_arg1:MouseEvent):void{
setTimeout(processBonusStatisticsOkBtn, 200, bonusStatisticsWnd);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function processStatisticsOkBtn(_arg1):void{
if (getPointsFromSavedTools != null){
getPointsFromSavedTools.stop();
getPointsFromSavedTools.removeEventListener("timer", hGetPoints);
if (needToPlus > 0){
plusScore(needToPlus);
needToPlus = 0;
};
};
_arg1.hOkBtn();
destroyWindow(_arg1);
}
private function removeStatisticsWindow():void{
statisticsWindow.bonusTimeAward.removeEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.bonusTimeAward.removeEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
statisticsWindow.economAward.removeEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.economAward.removeEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
statisticsWindow.gagarinAward.removeEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.gagarinAward.removeEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
statisticsWindow.hardTruckAward.removeEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.hardTruckAward.removeEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
statisticsWindow.starsAward.removeEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.starsAward.removeEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
stageObj.removeChild(statisticsWindow);
}
public function showStatisticsWindow(_arg1):void{
reinitMainMenu = _arg1;
statisticsWindow = new StatisticsWindow();
statisticsWindow.x = ((stageObj.stageWidth / 2) - (statisticsWindow.width / 2));
statisticsWindow.y = ((stageObj.stageHeight / 2) - (statisticsWindow.height / 2));
stageObj.addChild(statisticsWindow);
initStatisticWindow();
}
private function addEventsToChooseWnd():void{
gameModeWnd.startGameBtn.mouseEnabled = true;
gameModeWnd.difficultyBtn.mouseEnabled = true;
gameModeWnd.moreBtn.mouseEnabled = true;
gameModeWnd.submitBtn.mouseEnabled = true;
gameModeWnd.hostBtn.mouseEnabled = true;
gameModeWnd.startGameBtn.addEventListener(MouseEvent.CLICK, hOnStartGame);
gameModeWnd.difficultyBtn.addEventListener(MouseEvent.CLICK, showSelectDifficulty);
gameModeWnd.moreBtn.addEventListener(MouseEvent.CLICK, hOnMore);
gameModeWnd.submitBtn.addEventListener(MouseEvent.CLICK, hOnSubmit);
gameModeWnd.hostBtn.addEventListener(MouseEvent.CLICK, hOnHost);
gameModeWnd.logo.buttonMode = true;
gameModeWnd.logo.addEventListener(MouseEvent.CLICK, hOnLogoClick);
}
public function showChooseGameModeWindow(_arg1, _arg2):void{
this.hStartGame = _arg1;
gameModeWnd = new GameModeWnd();
if (GameDataProvider.IS_CHEATED){
};
gameModeWnd.hStartGame = _arg1;
gameModeWnd.hStartTraining = _arg2;
standartWindowInit(gameModeWnd);
stageObj.addChild(gameModeWnd);
gameModeWnd.startGameBtn.mouseEnabled = false;
gameModeWnd.difficultyBtn.mouseEnabled = false;
gameModeWnd.moreBtn.mouseEnabled = false;
gameModeWnd.submitBtn.mouseEnabled = false;
gameModeWnd.hostBtn.mouseEnabled = false;
createTransition(gameModeWnd, gameModeWnd.yPos, (speed / 2));
setTimeout(addEventsToChooseWnd, 500);
}
private function hLeftArrowPress(_arg1:MouseEvent):void{
if ((helpWindow.animation.currentFrame - 1) <= 1){
helpWindow.arrowLeft.mouseEnabled = false;
helpWindow.arrowLeft.alpha = 0;
} else {
helpWindow.arrowLeft.mouseEnabled = true;
helpWindow.arrowLeft.alpha = 1;
};
helpWindow.animation.gotoAndStop((helpWindow.animation.currentFrame - 1));
helpWindow.arrowRight.alpha = 1;
}
private function hOnSolutions(_arg1:MouseEvent):void{
KingAPI.openKingPage("Solutions", "/game/chaos-racer");
}
private function hOnHost(_arg1:MouseEvent):void{
KingAPI.openAddToWebsiteLink();
}
private function hBackToMainMenu():void{
destroyWindow(difficultyWnd);
showChooseGameModeWindow(hStartGame, null);
}
public function showDifficultyWindow():void{
difficultyWnd = new DifficultyWnd();
standartWindowInit(difficultyWnd);
difficultyWnd.okBtn.addEventListener(MouseEvent.CLICK, backToMainMenu);
switch (GameDataProvider.CURRENT_DIFFICULTY_LEVEL){
case 1:
difficultyWnd.easyCheckBox.gotoAndStop(2);
difficultyWnd.faceMc.gotoAndStop(1);
break;
case 2:
difficultyWnd.hardCheckBox.gotoAndStop(2);
difficultyWnd.faceMc.gotoAndStop(2);
break;
case 3:
difficultyWnd.impossibleCheckBox.gotoAndStop(2);
difficultyWnd.faceMc.gotoAndStop(3);
break;
};
difficultyWnd.easyCheckBox.buttonMode = true;
difficultyWnd.hardCheckBox.buttonMode = true;
difficultyWnd.impossibleCheckBox.buttonMode = true;
difficultyWnd.easyCheckBox.addEventListener(MouseEvent.CLICK, setEasyDifficulty);
difficultyWnd.hardCheckBox.addEventListener(MouseEvent.CLICK, setHardDifficulty);
difficultyWnd.impossibleCheckBox.addEventListener(MouseEvent.CLICK, setImpossibleDifficulty);
stageObj.addChild(difficultyWnd);
createTransition(difficultyWnd, difficultyWnd.yPos, (speed / 2));
}
private function hOnAwardOut(_arg1:MouseEvent):void{
_arg1.currentTarget.popUp.visible = false;
}
private function destroyHelpWindow():void{
destroyWindow(helpWindow);
}
private function hGetBonusPoints(_arg1:TimerEvent):void{
plusScore(GameDataProvider.COST_OF_A_SECOND);
plusForBonus = (plusForBonus - GameDataProvider.COST_OF_A_SECOND);
bonusStatisticsWnd.secondsTxt.text = Math.floor((plusForBonus / GameDataProvider.COST_OF_A_SECOND)).toString();
bonusStatisticsWnd.totalScoreTxt.text = accounter.currentScore.toString();
var _local2:Sound = new snd_score();
_local2.play();
}
private function removeHelpWindow(_arg1:MouseEvent):void{
unfroze();
stageObj.frameRate = GameDataProvider.DEFAULT_FRAMERATE;
setTimeout(destroyHelpWindow, 200);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function initStatisticWindow():void{
statisticsWindow.score.text = accounter.currentScore.toString();
statisticsWindow.antigrav.text = GameDataProvider.ANTIGRAV.toString();
statisticsWindow.jump.text = GameDataProvider.JUMPS.toString();
statisticsWindow.slow.text = GameDataProvider.SLOW.toString();
statisticsWindow.star1.text = GameDataProvider.GOLDEN_STARS.toString();
statisticsWindow.star2.text = GameDataProvider.SILVER_STARS.toString();
statisticsWindow.star3.text = GameDataProvider.GLASS_STARS.toString();
statisticsWindow.meters.text = GameDataProvider.DRIVE.toString();
statisticsWindow.bonusTimeAward.addEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.bonusTimeAward.addEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
if (GameDataProvider.BONUS >= GameDataProvider.NEED_FOR_AWARD_1){
statisticsWindow.bonusTimeAward.gotoAndStop(2);
};
statisticsWindow.bonusTimeAward.mouseChildren = false;
statisticsWindow.bonusTimeAward.popUp.visible = false;
statisticsWindow.economAward.addEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.economAward.addEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
if (GameDataProvider.ECONOM >= GameDataProvider.NEED_FOR_AWARD_2){
statisticsWindow.economAward.gotoAndStop(2);
};
statisticsWindow.economAward.mouseChildren = false;
statisticsWindow.economAward.popUp.visible = false;
statisticsWindow.gagarinAward.addEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.gagarinAward.addEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
if (GameDataProvider.ANTIGRAV >= GameDataProvider.NEED_FOR_AWARD_3){
statisticsWindow.gagarinAward.gotoAndStop(2);
};
statisticsWindow.gagarinAward.mouseChildren = false;
statisticsWindow.gagarinAward.popUp.visible = false;
statisticsWindow.hardTruckAward.addEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.hardTruckAward.addEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
if (GameDataProvider.DRIVE >= GameDataProvider.NEED_FOR_AWARD_4){
statisticsWindow.hardTruckAward.gotoAndStop(2);
};
statisticsWindow.hardTruckAward.mouseChildren = false;
statisticsWindow.hardTruckAward.popUp.visible = false;
statisticsWindow.starsAward.addEventListener(MouseEvent.MOUSE_OVER, hOnAwardOver);
statisticsWindow.starsAward.addEventListener(MouseEvent.MOUSE_OUT, hOnAwardOut);
if (((GameDataProvider.GOLDEN_STARS + GameDataProvider.SILVER_STARS) + GameDataProvider.GLASS_STARS) >= GameDataProvider.NEED_FOR_AWARD_5){
statisticsWindow.starsAward.gotoAndStop(2);
};
statisticsWindow.starsAward.mouseChildren = false;
statisticsWindow.starsAward.popUp.visible = false;
statisticsWindow.menuBtn.addEventListener(MouseEvent.CLICK, backToMenu);
}
private function hOnAwardOver(_arg1:MouseEvent):void{
_arg1.currentTarget.popUp.visible = true;
}
private function removeQuestionWindow(_arg1:Boolean):void{
if (_arg1){
questionWindow.hYes();
} else {
questionWindow.hNo();
};
}
private function hOnInformOk(_arg1:MouseEvent):void{
informWindow.okBtn.removeEventListener(MouseEvent.CLICK, hOnInformOk);
setTimeout(removeInformWindow, 200);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function backToMenu(_arg1:MouseEvent):void{
removeStatisticsWindow();
reinitMainMenu();
}
private function hOnStartGame(_arg1:MouseEvent):void{
setTimeout(processStartGameBtn, 200, _arg1.currentTarget.parent);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function hOnNo(_arg1:MouseEvent):void{
setTimeout(removeQuestionWindow, 200, false);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function backToMainMenu(_arg1:MouseEvent):void{
setTimeout(hBackToMainMenu, 200);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
public function setImpossibleDifficulty(_arg1:MouseEvent):void{
difficultyWnd.easyCheckBox.gotoAndStop(1);
difficultyWnd.hardCheckBox.gotoAndStop(1);
difficultyWnd.impossibleCheckBox.gotoAndStop(2);
GameDataProvider.CURRENT_DIFFICULTY_LEVEL = 3;
difficultyWnd.faceMc.gotoAndStop(3);
}
private function processStartGameBtn(_arg1):void{
_arg1.hStartGame();
destroyWindow(_arg1);
}
public function showQuestionWindow(_arg1, _arg2, _arg3):void{
destroyWindow(questionWindow);
questionWindow = new QuestionWindow();
questionWindow.hYes = _arg2;
questionWindow.hNo = _arg3;
questionWindow.txt.text = _arg1;
standartWindowInit(questionWindow);
questionWindow.yesBtn.addEventListener(MouseEvent.CLICK, hOnYes);
questionWindow.noBtn.addEventListener(MouseEvent.CLICK, hOnNo);
stageObj.addChild(questionWindow);
createTransition(questionWindow, questionWindow.yPos, (speed / 2));
}
private function hOnSubmit(_arg1:MouseEvent):void{
KingAPI.openHighscoresLink();
}
public function showLevelStatisticsWindow(_arg1:Function, _arg2):void{
var _local3:*;
needToPlus = ((((((GameDataProvider.BRIDGE_TOOL_SAVED_COST * GameAccounter.currentBridgeNum) + (GameDataProvider.JUMPER_TOOL_SAVED_COST * GameAccounter.currentJumperNum)) + (GameDataProvider.TELEPORT_TOOL_SAVED_COST * GameAccounter.currentTeleportNum)) + (GameDataProvider.WALL_TOOL_SAVED_COST * GameAccounter.currentWallNum)) + (GameDataProvider.WIND_TOOL_SAVED_COST * GameAccounter.currentWindNum)) + ((GameDataProvider.COST_OF_SECOND * GameDataProvider.SAVED_LEVEL_TIME) * GameDataProvider.CURRENT_DIFFICULTY_LEVEL));
plusScore = _arg2;
statisticsWnd = new LevelStatistics();
statisticsWnd.hOkBtn = _arg1;
standartWindowInit(statisticsWnd);
statisticsWnd.okBtn.addEventListener(MouseEvent.CLICK, hStatisticsOkBtn);
stageObj.addChild(statisticsWnd);
createTransition(statisticsWnd, statisticsWnd.yPos, (speed / 2));
statisticsWnd.bridgeTxt.text = GameAccounter.currentBridgeNum.toString();
statisticsWnd.wallTxt.text = GameAccounter.currentWallNum.toString();
statisticsWnd.windTxt.text = GameAccounter.currentWindNum.toString();
statisticsWnd.jumpTxt.text = GameAccounter.currentJumperNum.toString();
statisticsWnd.teleportTxt.text = GameAccounter.currentTeleportNum.toString();
statisticsWnd.totalScoreTxt.text = accounter.currentScore.toString();
statisticsWnd.timeTxt.text = GameDataProvider.SAVED_LEVEL_TIME.toString();
if (needToPlus > 0){
_local3 = (((((GameAccounter.currentBridgeNum + GameAccounter.currentJumperNum) + GameAccounter.currentTeleportNum) + GameAccounter.currentWallNum) + GameAccounter.currentWindNum) + GameDataProvider.SAVED_LEVEL_TIME);
getPointsFromSavedTools = new Timer(300, _local3);
getPointsFromSavedTools.addEventListener("timer", hGetPoints);
setTimeout(hGetPointsFromSavedTools, 1000);
};
}
private function hOnMore(_arg1:MouseEvent):void{
KingAPI.openOtherGamesLink();
}
private function hGetPointsFromBonusGame():void{
getPointsFromBonusSeconds.start();
}
private function hGetPoints(_arg1:TimerEvent):void{
var _local2:Sound = new snd_score();
_local2.play();
if (GameAccounter.currentBridgeNum > 0){
plusScore(GameDataProvider.BRIDGE_TOOL_SAVED_COST);
needToPlus = (needToPlus - GameDataProvider.BRIDGE_TOOL_SAVED_COST);
GameAccounter.currentBridgeNum--;
statisticsWnd.bridgeTxt.text = GameAccounter.currentBridgeNum.toString();
} else {
if (GameAccounter.currentWallNum > 0){
plusScore(GameDataProvider.WALL_TOOL_SAVED_COST);
needToPlus = (needToPlus - GameDataProvider.WALL_TOOL_SAVED_COST);
GameAccounter.currentWallNum--;
statisticsWnd.wallTxt.text = GameAccounter.currentWallNum.toString();
} else {
if (GameAccounter.currentWindNum > 0){
plusScore(GameDataProvider.WIND_TOOL_SAVED_COST);
needToPlus = (needToPlus - GameDataProvider.WIND_TOOL_SAVED_COST);
GameAccounter.currentWindNum--;
statisticsWnd.windTxt.text = GameAccounter.currentWindNum.toString();
} else {
if (GameAccounter.currentJumperNum > 0){
plusScore(GameDataProvider.JUMPER_TOOL_SAVED_COST);
needToPlus = (needToPlus - GameDataProvider.JUMPER_TOOL_SAVED_COST);
GameAccounter.currentJumperNum--;
statisticsWnd.jumpTxt.text = GameAccounter.currentJumperNum.toString();
} else {
if (GameAccounter.currentTeleportNum > 0){
plusScore(GameDataProvider.TELEPORT_TOOL_SAVED_COST);
needToPlus = (needToPlus - GameDataProvider.TELEPORT_TOOL_SAVED_COST);
GameAccounter.currentTeleportNum--;
statisticsWnd.teleportTxt.text = GameAccounter.currentTeleportNum.toString();
} else {
if (GameDataProvider.SAVED_LEVEL_TIME > 0){
plusScore(GameDataProvider.COST_OF_SECOND);
needToPlus = (needToPlus - GameDataProvider.COST_OF_SECOND);
GameDataProvider.SAVED_LEVEL_TIME--;
statisticsWnd.timeTxt.text = GameDataProvider.SAVED_LEVEL_TIME.toString();
};
};
};
};
};
};
statisticsWnd.totalScoreTxt.text = accounter.currentScore.toString();
}
public function showHelpWindow():void{
froze();
stageObj.frameRate = GameDataProvider.HELP_WND_FRAMERATE;
helpWindow = new HelpWindow();
standartWindowInit(helpWindow);
helpWindow.okBtn.addEventListener(MouseEvent.CLICK, removeHelpWindow);
stageObj.addChild(helpWindow);
helpWindow.animation.gotoAndStop(1);
helpWindow.arrowLeft.buttonMode = true;
helpWindow.arrowRight.buttonMode = true;
helpWindow.arrowLeft.mouseEnabled = false;
helpWindow.arrowLeft.alpha = 0;
helpWindow.arrowLeft.addEventListener(MouseEvent.CLICK, hLeftArrowPress);
helpWindow.arrowRight.addEventListener(MouseEvent.CLICK, hRightArrowPress);
setTimeout(createTransition, 300, helpWindow, helpWindow.yPos, (speed / 2));
setTimeout(startHelpAnimation, 1000);
}
private function standartWindowInit(_arg1:MovieClip):void{
if (froze != null){
froze();
};
_arg1.cacheAsBitmap = true;
_arg1.x = ((stageObj.stageWidth / 2) - (_arg1.width / 2));
_arg1.y = (-(_arg1.height) * 1.5);
_arg1.yPos = ((stageObj.stageHeight / 2) - (_arg1.height / 2));
_arg1.tabChildren = false;
}
private function createTransition(_arg1, _arg2, _arg3):void{
var _local4 = tweensIndex++;
tweens[_local4] = new Tween(_arg1, "y", Regular.easeOut, _arg1.y, _arg2, _arg3, true);
}
private function showSelectDifficulty(_arg1:MouseEvent):void{
setTimeout(hShowSelectDifficulty, 200);
createTransition(_arg1.currentTarget.parent, ((_arg1.currentTarget.parent.height * 2) + stageObj.stageHeight), speed);
}
private function hRightArrowPress(_arg1:MouseEvent):void{
if ((helpWindow.animation.currentFrame + 1) >= helpWindow.animation.totalFrames){
helpWindow.arrowRight.mouseEnabled = false;
helpWindow.arrowRight.alpha = 0;
} else {
helpWindow.arrowRight.mouseEnabled = true;
helpWindow.arrowRight.alpha = 1;
};
helpWindow.animation.gotoAndStop((helpWindow.animation.currentFrame + 1));
helpWindow.arrowLeft.alpha = 1;
}
public function setEasyDifficulty(_arg1:MouseEvent):void{
difficultyWnd.easyCheckBox.gotoAndStop(2);
difficultyWnd.hardCheckBox.gotoAndStop(1);
difficultyWnd.impossibleCheckBox.gotoAndStop(1);
GameDataProvider.CURRENT_DIFFICULTY_LEVEL = 1;
difficultyWnd.faceMc.gotoAndStop(1);
}
private function hShowSelectDifficulty():void{
destroyWindow(gameModeWnd);
showDifficultyWindow();
}
private function hOnLogoClick(_arg1:MouseEvent):void{
KingAPI.openSignLink();
}
public function showBonusLevelStatisticWindow(_arg1:Function, _arg2:Number):void{
plusForBonus = (GameDataProvider.COST_OF_A_SECOND * _arg2);
bonusStatisticsWnd = new BonusStatistics();
bonusStatisticsWnd.hOkBtn = _arg1;
standartWindowInit(bonusStatisticsWnd);
bonusStatisticsWnd.okBtn.addEventListener(MouseEvent.CLICK, hBonusStatisticsOkBtn);
stageObj.addChild(bonusStatisticsWnd);
createTransition(bonusStatisticsWnd, bonusStatisticsWnd.yPos, (speed / 2));
bonusStatisticsWnd.secondsTxt.text = _arg2.toString();
bonusStatisticsWnd.totalScoreTxt.text = accounter.currentScore.toString();
if ((((plusForBonus > 0)) && (!(GameDataProvider.IS_CHEATED)))){
getPointsFromBonusSeconds = new Timer(300, _arg2);
getPointsFromBonusSeconds.addEventListener("timer", hGetBonusPoints);
setTimeout(hGetPointsFromBonusGame, 1000);
};
}
private function removeInformWindow():void{
informWindow.hOk();
destroyWindow(informWindow);
}
}
}//package src
Section 110
//AntiGravitationMc (AntiGravitationMc)
package {
import flash.display.*;
public dynamic class AntiGravitationMc extends MovieClip {
}
}//package
Section 111
//BG_Sky (BG_Sky)
package {
import flash.display.*;
import src.*;
public dynamic class BG_Sky extends MovieClip {
public var carStart:carStart;
}
}//package
Section 112
//Bloomer (Bloomer)
package {
import flash.display.*;
public dynamic class Bloomer extends MovieClip {
public function Bloomer(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package
Section 113
//Body (Body)
package {
import flash.display.*;
public dynamic class Body extends MovieClip {
public function Body(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 114
//bonusRectangle (bonusRectangle)
package {
import flash.display.*;
public dynamic class bonusRectangle extends MovieClip {
}
}//package
Section 115
//BonusStatistics (BonusStatistics)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BonusStatistics extends MovieClip {
public var okBtn:SimpleButton;
public var secondsTxt:TextField;
public var totalScoreTxt:TextField;
public var wallTxt:TextField;
}
}//package
Section 116
//BonusTimer (BonusTimer)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BonusTimer extends MovieClip {
public var scoreTxt:TextField;
}
}//package
Section 117
//but_Tool (but_Tool)
package {
import flash.display.*;
public dynamic class but_Tool extends MovieClip {
public var popUp:MovieClip;
public var txtMc:MovieClip;
public var tool:MovieClip;
public var none:MovieClip;
public function but_Tool(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 118
//CowboyAward (CowboyAward)
package {
import flash.display.*;
public dynamic class CowboyAward extends MovieClip {
public var popUp:MovieClip;
public function CowboyAward(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 119
//DackOverMc (DackOverMc)
package {
import flash.display.*;
public dynamic class DackOverMc extends MovieClip {
}
}//package
Section 120
//DifficultyWnd (DifficultyWnd)
package {
import flash.display.*;
public dynamic class DifficultyWnd extends MovieClip {
public var okBtn:SimpleButton;
public var easyCheckBox:MovieClip;
public var hardCheckBox:MovieClip;
public var brandingMc:Logo;
public var faceMc:MovieClip;
public var impossibleCheckBox:MovieClip;
}
}//package
Section 121
//EconomistAward (EconomistAward)
package {
import flash.display.*;
public dynamic class EconomistAward extends MovieClip {
public var popUp:MovieClip;
public function EconomistAward(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 122
//GagarinAward (GagarinAward)
package {
import flash.display.*;
public dynamic class GagarinAward extends MovieClip {
public var popUp:MovieClip;
public function GagarinAward(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 123
//GameLevels (GameLevels)
package {
import flash.display.*;
import src.*;
public dynamic class GameLevels extends MovieClip {
public var water:WaterLine;
public var tree:MovieClip;
public var element1_1:HighSpeedElement;
public var element1_2:verticalElement;
public var element1_3:MovieClip;
public var element1_4:verticalElement;
public var element1_5:MovieClip;
public var element1_6:MovieClip;
public var element5_7:HighSpeedElement;
public var bird:MovieClip;
public var finishMc1:carFinish;
public var finishMc2:carFinish;
public var finishMc4:carFinish;
public var finishMc5:carFinish;
public var finishMc6:carFinish;
public var star2_2:Star2;
public var wind4_1:windForLevelMap;
public var element1_10:MovieClip;
public var element1_12:MovieClip;
public var element1_13:MovieClip;
public var element2_6:MovieClip;
public var element2_7:MovieClip;
public var element6_1:MovieClip;
public var element6_2:HighSpeedElement;
public var carStart:carStart;
public var element2_9:MovieClip;
public var wind20_1:windForLevelMap;
public var wind20_2:windForLevelMap;
public function GameLevels(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 124
//GameMap (GameMap)
package {
import flash.display.*;
public dynamic class GameMap extends MovieClip {
public var level10:MovieClip;
public var level11:MovieClip;
public var level12:MovieClip;
public var level13:MovieClip;
public var level14:MovieClip;
public var level15:MovieClip;
public var level16:MovieClip;
public var level17:MovieClip;
public var level18:MovieClip;
public var level19:MovieClip;
public var level1:MovieClip;
public var level2:MovieClip;
public var level3:MovieClip;
public var level4:MovieClip;
public var level5:MovieClip;
public var level6:MovieClip;
public var level7:MovieClip;
public var level8:MovieClip;
public var level9:MovieClip;
public var logo:Logo;
public var level20:MovieClip;
public var any:MovieClip;
public var bonus1:MovieClip;
public var bonus2:MovieClip;
public var bonus3:MovieClip;
public var bonus4:MovieClip;
}
}//package
Section 125
//GameModeWnd (GameModeWnd)
package {
import flash.display.*;
public dynamic class GameModeWnd extends MovieClip {
public var difficultyBtn:SimpleButton;
public var submitBtn:SimpleButton;
public var moreBtn:SimpleButton;
public var startGameBtn:SimpleButton;
public var logo:Logo;
public var hostBtn:SimpleButton;
}
}//package
Section 126
//HardTruckAward (HardTruckAward)
package {
import flash.display.*;
public dynamic class HardTruckAward extends MovieClip {
public var popUp:MovieClip;
public function HardTruckAward(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 127
//HelpWindow (HelpWindow)
package {
import flash.display.*;
public dynamic class HelpWindow extends MovieClip {
public var okBtn:SimpleButton;
public var brandingMc:Logo;
public var arrowRight:MovieClip;
public var animation:MovieClip;
public var arrowLeft:MovieClip;
}
}//package
Section 128
//IndicatorForMouse (IndicatorForMouse)
package {
import flash.display.*;
public dynamic class IndicatorForMouse extends MovieClip {
public function IndicatorForMouse(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 129
//IndicatorsForBonuses (IndicatorsForBonuses)
package {
import flash.display.*;
public dynamic class IndicatorsForBonuses extends MovieClip {
public var megaJump:MovieClip;
public var antiGrav:MovieClip;
public var slower:MovieClip;
}
}//package
Section 130
//InformWindow (InformWindow)
package {
import flash.display.*;
import flash.text.*;
public dynamic class InformWindow extends MovieClip {
public var txt:TextField;
public var brandingMc:Logo;
public var okBtn:SimpleButton;
}
}//package
Section 131
//LevelNameMc (LevelNameMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelNameMc extends MovieClip {
public var nameTxt:TextField;
}
}//package
Section 132
//LevelSecondsMc (LevelSecondsMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelSecondsMc extends MovieClip {
public var scoreTxt:TextField;
}
}//package
Section 133
//LevelsMap (LevelsMap)
package {
import flash.display.*;
public dynamic class LevelsMap extends MovieClip {
public var map:GameMap;
}
}//package
Section 134
//LevelStatistics (LevelStatistics)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelStatistics extends MovieClip {
public var okBtn:SimpleButton;
public var jumpTxt:TextField;
public var timeTxt:TextField;
public var teleportTxt:TextField;
public var bridgeTxt:TextField;
public var windTxt:TextField;
public var totalScoreTxt:TextField;
public var wallTxt:TextField;
}
}//package
Section 135
//libGlow (libGlow)
package {
import flash.display.*;
public dynamic class libGlow extends MovieClip {
}
}//package
Section 136
//Logo (Logo)
package {
import flash.display.*;
public dynamic class Logo extends MovieClip {
}
}//package
Section 137
//MainMenuBack (MainMenuBack)
package {
import flash.display.*;
public dynamic class MainMenuBack extends MovieClip {
public function MainMenuBack(){
addFrameScript(369, frame370);
}
function frame370(){
stop();
}
}
}//package
Section 138
//mcDragon (mcDragon)
package {
import flash.display.*;
public dynamic class mcDragon extends MovieClip {
}
}//package
Section 139
//mcGlimmer (mcGlimmer)
package {
import flash.display.*;
public dynamic class mcGlimmer extends MovieClip {
}
}//package
Section 140
//MegaJump (MegaJump)
package {
import flash.display.*;
public dynamic class MegaJump extends MovieClip {
}
}//package
Section 141
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
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 142
//OutroEasy (OutroEasy)
package {
import flash.display.*;
public dynamic class OutroEasy extends MovieClip {
public function OutroEasy(){
addFrameScript(0, frame1, 329, frame330);
}
function frame330(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 143
//Preloader (Preloader)
package {
import flash.display.*;
public dynamic class Preloader extends MovieClip {
public function Preloader(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 144
//PseudoPreloader (PseudoPreloader)
package {
import flash.display.*;
public dynamic class PseudoPreloader extends MovieClip {
public var logo:Logo;
public var moreBtn:SimpleButton;
}
}//package
Section 145
//QuestionWindow (QuestionWindow)
package {
import flash.display.*;
import flash.text.*;
public dynamic class QuestionWindow extends MovieClip {
public var txt:TextField;
public var yesBtn:SimpleButton;
public var noBtn:SimpleButton;
}
}//package
Section 146
//ResetBtn (ResetBtn)
package {
import flash.display.*;
public dynamic class ResetBtn extends MovieClip {
public var resetBtnInside:MovieClip;
public function ResetBtn(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 147
//ScoreMc (ScoreMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreMc extends MovieClip {
public var scoreTxt:TextField;
}
}//package
Section 148
//ScoreMovie (ScoreMovie)
package {
import flash.display.*;
public dynamic class ScoreMovie extends MovieClip {
public var scoreInside:MovieClip;
public function ScoreMovie(){
addFrameScript(75, frame76);
}
function frame76(){
stop();
}
}
}//package
Section 149
//sfxBell (sfxBell)
package {
import flash.media.*;
public dynamic class sfxBell extends Sound {
}
}//package
Section 150
//Slower (Slower)
package {
import flash.display.*;
public dynamic class Slower extends MovieClip {
}
}//package
Section 151
//snd_blip (snd_blip)
package {
import flash.media.*;
public dynamic class snd_blip extends Sound {
}
}//package
Section 152
//snd_bulp (snd_bulp)
package {
import flash.media.*;
public dynamic class snd_bulp extends Sound {
}
}//package
Section 153
//snd_carDrive (snd_carDrive)
package {
import flash.media.*;
public dynamic class snd_carDrive extends Sound {
}
}//package
Section 154
//snd_carIdle (snd_carIdle)
package {
import flash.media.*;
public dynamic class snd_carIdle extends Sound {
}
}//package
Section 155
//snd_click (snd_click)
package {
import flash.media.*;
public dynamic class snd_click extends Sound {
}
}//package
Section 156
//snd_fanfare (snd_fanfare)
package {
import flash.media.*;
public dynamic class snd_fanfare extends Sound {
}
}//package
Section 157
//snd_gong (snd_gong)
package {
import flash.media.*;
public dynamic class snd_gong extends Sound {
}
}//package
Section 158
//snd_jumper (snd_jumper)
package {
import flash.media.*;
public dynamic class snd_jumper extends Sound {
}
}//package
Section 159
//snd_kick (snd_kick)
package {
import flash.media.*;
public dynamic class snd_kick extends Sound {
}
}//package
Section 160
//snd_score (snd_score)
package {
import flash.media.*;
public dynamic class snd_score extends Sound {
}
}//package
Section 161
//snd_Star (snd_Star)
package {
import flash.media.*;
public dynamic class snd_Star extends Sound {
}
}//package
Section 162
//snd_teleport (snd_teleport)
package {
import flash.media.*;
public dynamic class snd_teleport extends Sound {
}
}//package
Section 163
//spark (spark)
package {
import flash.display.*;
public dynamic class spark extends MovieClip {
public function spark(){
addFrameScript(22, frame23);
}
function frame23(){
gotoAndStop("loop");
}
}
}//package
Section 164
//StarEaterAward (StarEaterAward)
package {
import flash.display.*;
public dynamic class StarEaterAward extends MovieClip {
public var popUp:MovieClip;
public function StarEaterAward(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 165
//StartBtn (StartBtn)
package {
import flash.display.*;
public dynamic class StartBtn extends MovieClip {
public var startBtnInside:MovieClip;
public function StartBtn(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 166
//StatisticsWindow (StatisticsWindow)
package {
import flash.display.*;
import flash.text.*;
public dynamic class StatisticsWindow extends MovieClip {
public var slow:TextField;
public var meters:TextField;
public var hardTruckAward:HardTruckAward;
public var economAward:EconomistAward;
public var score:TextField;
public var antigrav:TextField;
public var star1:TextField;
public var star2:TextField;
public var star3:TextField;
public var gagarinAward:GagarinAward;
public var jump:TextField;
public var bonusTimeAward:CowboyAward;
public var starsAward:StarEaterAward;
public var menuBtn:SimpleButton;
}
}//package
Section 167
//Tex_Bridge (Tex_Bridge)
package {
import flash.display.*;
public dynamic class Tex_Bridge extends MovieClip {
}
}//package
Section 168
//Tex_Jumper (Tex_Jumper)
package {
import flash.display.*;
public dynamic class Tex_Jumper extends MovieClip {
public function Tex_Jumper(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 169
//Tex_MovingWallBlock (Tex_MovingWallBlock)
package {
import flash.display.*;
public dynamic class Tex_MovingWallBlock extends MovieClip {
}
}//package
Section 170
//Tex_MovingWallCircle (Tex_MovingWallCircle)
package {
import flash.display.*;
public dynamic class Tex_MovingWallCircle extends MovieClip {
}
}//package
Section 171
//Tex_PortalExit (Tex_PortalExit)
package {
import flash.display.*;
public dynamic class Tex_PortalExit extends MovieClip {
public function Tex_PortalExit(){
addFrameScript(0, frame1, 25, frame26);
}
function frame26(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 172
//Tex_Wall (Tex_Wall)
package {
import flash.display.*;
public dynamic class Tex_Wall extends MovieClip {
public var msk:MovieClip;
}
}//package
Section 173
//Tex_Wind (Tex_Wind)
package {
import flash.display.*;
public dynamic class Tex_Wind extends MovieClip {
}
}//package
Section 174
//ToolIndicator (ToolIndicator)
package {
import flash.display.*;
public dynamic class ToolIndicator extends MovieClip {
public var popUp:MovieClip;
public var txtMc:MovieClip;
public var tool:MovieClip;
public var none:MovieClip;
public function ToolIndicator(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 175
//WaterLine (WaterLine)
package {
import flash.display.*;
public dynamic class WaterLine extends MovieClip {
}
}//package
Section 176
//Wheel1 (Wheel1)
package {
import flash.display.*;
public dynamic class Wheel1 extends MovieClip {
public function Wheel1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 177
//Wheel2 (Wheel2)
package {
import flash.display.*;
public dynamic class Wheel2 extends MovieClip {
}
}//package