Section 1
//MD5 (CMG_AS3.MD5)
package CMG_AS3 {
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 _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
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;
_local3 = 1732584193;
_local4 = -271733879;
_local5 = -1732584194;
_local6 = 271733878;
_local7 = 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:String;
var _local3:Number;
_local2 = "";
_local3 = 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:String;
var _local3:Number;
_local2 = "";
_local3 = 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:Array;
var _local3:Number;
_local2 = new Array((_arg1.length >> 2));
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = 0;
_local3++;
};
_local3 = 0;
while (_local3 < (_arg1.length * 8)) {
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | ((_arg1.charCodeAt((_local3 / 8)) & 0xFF) << (_local3 % 32)));
_local3 = (_local3 + 8);
};
return (_local2);
}
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 _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
_local2 = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
_local3 = "";
_local5 = 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 _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
_local3 = "";
_local4 = _arg1.length;
_local5 = 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;
var _local4:Number;
_local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
_local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = "";
_local3 = -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;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
_local4 = new Array(16);
_local5 = new Array(16);
_local6 = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
_local7 = 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:String;
var _local3:Number;
_local2 = "";
_local3 = 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 _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:Array;
var _local10:String;
_local3 = _arg2.length;
_local4 = [];
_local9 = new Array((_arg1.length / 2));
_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;
};
_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 CMG_AS3
Section 2
//ScoreSubmitter (CMG_AS3.ScoreSubmitter)
package CMG_AS3 {
import flash.events.*;
import flash.net.*;
public class ScoreSubmitter extends EventDispatcher {
private var m_UrlLoader:URLLoader;// = null
public static const RETURNCODE_SUCCESS = 1;
public static const RETURNCODE_REJECTED = 2;
public static const RETURNCODE_INTERNALERROR = 5;
public static const URL_SUBMITSCORE = "http://scores.crazymonkeygames.com/hs/regscores2.php";
public static const URL_UPDATEGAME = "http://scores.crazymonkeygames.com/hs/pleaseupdate.php";
public static const SCORE_RESPONSE:String = "score_response";
public static const RETURNCODE_WORKING = 0;
public static const RETURNCODE_WRONGVERSION = 3;
public static const URL_VIEWSCORES = "http://scores.crazymonkeygames.com/hs/listscores.php";
public static const RETURNCODE_NETWORKERROR = 4;
public static var gameVersion:String = "";
public static var gameValidationCode:String = "";
public static var gameId:uint = 0;
public function ScoreSubmitter(){
m_UrlLoader = null;
super();
}
private function onIoError(_arg1:Event){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_NETWORKERROR));
}
public function submitScore(_arg1:String, _arg2, _arg3:String=null):void{
var _local4:*;
var _local5:URLRequest;
_arg1 = Utilities.trim(_arg1);
gameVersion = Utilities.trim(gameVersion);
if (_arg3 == null){
_arg3 = "";
} else {
_arg3 = Utilities.trim(_arg3);
};
gameValidationCode = Utilities.trim(gameValidationCode);
if ((((((gameId < 1)) || ((gameVersion == "")))) || ((gameValidationCode == "")))){
trace("ERROR: CMG_AS3.ScoreSubmitter.submitScore: gameId, gameVersion, or gameValidationCode member variables were not set before calling this function!");
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_REJECTED));
return;
};
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_WORKING));
_local4 = new URLVariables();
_local4.name = _arg1;
_local4.score = _arg2;
_local4.gameId = gameId;
_local4.gameVersion = gameVersion;
_local4.special = _arg3;
_local4.key = MD5.encrypt(((((((((_arg1 + "|") + _arg2) + "|") + gameId) + "|") + _arg3) + "|") + gameValidationCode));
_local5 = new URLRequest(URL_SUBMITSCORE);
_local5.method = URLRequestMethod.POST;
_local5.data = _local4;
m_UrlLoader = new URLLoader();
m_UrlLoader.addEventListener("complete", onComplete);
m_UrlLoader.addEventListener("ioError", onIoError);
m_UrlLoader.load(_local5);
}
private function onComplete(_arg1:Event):void{
var _local2:URLVariables;
var _local3:*;
_local2 = new URLVariables(m_UrlLoader.data.replace("&", ""));
_local3 = Utilities.trim(_local2.ok);
if (_local3 == 1){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_SUCCESS));
} else {
if (_local3 == 0){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_REJECTED));
} else {
if (_local3 == 2){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_WRONGVERSION));
} else {
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_INTERNALERROR));
};
};
};
}
public static function loadHighScorePage():void{
Utilities.goToUrl(((URL_VIEWSCORES + "?id=") + gameId));
}
public static function loadUpdatePage(){
Utilities.goToUrl(((URL_VIEWSCORES + "?id=") + gameId));
}
}
}//package CMG_AS3
Section 3
//ServerResponseEvent (CMG_AS3.ServerResponseEvent)
package CMG_AS3 {
import flash.events.*;
public class ServerResponseEvent extends Event {
public var returnCode:uint;
public function ServerResponseEvent(_arg1:String, _arg2:uint){
super(_arg1, false, false);
returnCode = _arg2;
}
}
}//package CMG_AS3
Section 4
//Utilities (CMG_AS3.Utilities)
package CMG_AS3 {
import flash.net.*;
import flash.system.*;
import flash.external.*;
public class Utilities {
public static function trim(_arg1:String):String{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_arg1.charCodeAt(_local2) < 33) {
_local2++;
};
_local3 = (_arg1.length - 1);
while (_arg1.charCodeAt(_local3) < 33) {
_local3--;
};
return (_arg1.substring(_local2, (_local3 + 1)));
}
public static function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
}
}//package CMG_AS3
Section 5
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 6
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 7
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 8
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 9
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 10
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.geom.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.3 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 11
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 12
//bg_111 (pyroblossomCMG_fla.bg_111)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class bg_111 extends MovieClip {
public function bg_111(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 13
//chopperintro_119 (pyroblossomCMG_fla.chopperintro_119)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class chopperintro_119 extends MovieClip {
public function chopperintro_119(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 14
//CMG_Logo_Animation_1 (pyroblossomCMG_fla.CMG_Logo_Animation_1)
package pyroblossomCMG_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.system.*;
import flash.external.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class CMG_Logo_Animation_1 extends MovieClip {
public var CMG_MonkeyBlink:MovieClip;
public var CMG_HomePageLink:SimpleButton;
public var monkeyBlinkCheckTimer:Timer;
public var CMG_LoadingWidget:MovieClip;
public function CMG_Logo_Animation_1(){
addFrameScript(0, frame1, 80, frame81, 81, frame82);
}
public function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
function frame81(){
stop();
monkeyBlinkCheckTimer.addEventListener(TimerEvent.TIMER, onMonkeyBlinkCheckTimer);
monkeyBlinkCheckTimer.start();
}
function frame82(){
monkeyBlinkCheckTimer.stop();
MovieClip(parent).play();
}
public function onMouseUpHandler_CMGHomePageBtn(_arg1:MouseEvent):void{
goToUrl("http://www.crazymonkeygames.com");
}
function frame1(){
MovieClip(parent).stop();
CMG_HomePageLink.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler_CMGHomePageBtn);
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler_CMGLoader);
monkeyBlinkCheckTimer = new Timer(800);
}
public function onEnterFrameHandler_CMGLoader(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = CMG_HomePageLink.stage.loaderInfo.bytesLoaded;
_local3 = CMG_HomePageLink.stage.loaderInfo.bytesTotal;
CMG_LoadingWidget.CMG_LoadingBar.bar.scaleX = (_local2 / _local3);
if (_local2 == _local3){
CMG_LoadingWidget.nextFrame();
removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler_CMGLoader);
};
}
public function onMonkeyBlinkCheckTimer(_arg1:TimerEvent):void{
var _local2:Number;
_local2 = Math.random();
if (_local2 < 0.3){
CMG_MonkeyBlink.play();
};
}
}
}//package pyroblossomCMG_fla
Section 15
//CMG_monkey_blink_19 (pyroblossomCMG_fla.CMG_monkey_blink_19)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class CMG_monkey_blink_19 extends MovieClip {
public function CMG_monkey_blink_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 16
//compannel_55 (pyroblossomCMG_fla.compannel_55)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class compannel_55 extends MovieClip {
public function compannel_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 17
//convotext_68 (pyroblossomCMG_fla.convotext_68)
package pyroblossomCMG_fla {
import flash.display.*;
import flash.text.*;
public dynamic class convotext_68 extends MovieClip {
public var txt:TextField;
}
}//package pyroblossomCMG_fla
Section 18
//creditsbtn_107 (pyroblossomCMG_fla.creditsbtn_107)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class creditsbtn_107 extends MovieClip {
public function creditsbtn_107(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 19
//gotitle_47 (pyroblossomCMG_fla.gotitle_47)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class gotitle_47 extends MovieClip {
public function gotitle_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 20
//healthbar_62 (pyroblossomCMG_fla.healthbar_62)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class healthbar_62 extends MovieClip {
public function healthbar_62(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 21
//load_barMC_12 (pyroblossomCMG_fla.load_barMC_12)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class load_barMC_12 extends MovieClip {
public var bar:MovieClip;
}
}//package pyroblossomCMG_fla
Section 22
//mainmenubtn_51 (pyroblossomCMG_fla.mainmenubtn_51)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class mainmenubtn_51 extends MovieClip {
public function mainmenubtn_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 23
//MainTimeline (pyroblossomCMG_fla.MainTimeline)
package pyroblossomCMG_fla {
import flash.display.*;
import flash.events.*;
import CMG_AS3.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.system.*;
import flash.external.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var menuMusic:musictitle;
public var textsound:textplay;
public var powerbg:Sprite;
public var missiles:Array;
public var nextTimer:int;
public var spath1:Array;
public var spath2:Array;
public var spath3:Array;
public var spath4:Array;
public var spath5:Array;
public var invincible:int;
public var shoot:int;
public var SCORES:scores;
public var powerNum:int;
public var bg:Sprite;
public var SCROLLER:scrollingtxt;
public var monies:Array;
public var powerRect:Rectangle;
public var currentScore:int;
public var reportping:reportsound;
public var CREDITS:credits;
public var launchers:Array;
public var kills:int;
public var bosses:Array;
public var clouds:Array;
public var apath1:Array;
public var apath2:Array;
public var choppers:Array;
public var enemybmp:BitmapData;
public var menchange:menuchange;
public var lives:int;
public var bit:Bitmap;
public var stageH:int;
public var stageW:int;
public var respawn:int;
public var level1:Array;
public var level2:Array;
public var level3:Array;
public var level4:Array;
public var level5:Array;
public var level6:Array;
public var REPORT:missionreport;
public var gui:GUI;
public var gun:int;
public var currentChannel:int;
public var gameMusic:musicgame;
public var spinners:Array;
public var boosttimer;
public var bmp:BitmapData;
public var timer3:int;
public var timer5:int;
public var dispCT:ColorTransform;
public var planes:Array;
public var timer2:int;
public var pbar:power;
public var dialogMusic:musicdialog;
public var startcall:opencall;
public var psyco:Boolean;
public var downKeys:Object;
public var explosionsList:Array;
public var explosionsTimer:int;
public var levelCounts:Array;
public var powerbit:Bitmap;
public var stringPo:int;
public var stageRect:Rectangle;
public var textTimer:int;
public var offsetX:int;
public var enemies:int;
public var mute:muteic;
public var levelPointer:int;
public var TITLE:titlescreen;
public var ship:player;
public var buysound:kaching;
public var menselect:menuselect;
public var finalMusic:musicfinalboss;
public var health:int;
public var powerbmp:BitmapData;
public var reportTimer:int;
public var lazerSprite:Sprite;
public var nextAt:int;
public var TRANS:trans;
public var score:int;
public var options:Array;
public var hangup:callend;
public var xshoot:int;
public var bgbit:Bitmap;
public var hbar:healthbar;
public var xshootm:int;
public var powerupsound:levelup;
public var particles:Array;
public var bossMusic:musicboss;
public var emitters:Array;
public var psycoMeter:Number;
public var bossbmp:BitmapData;
public var powertexts:Array;
public var bgSpeed:int;
public var shake:int;
public var warning1Music:musicwarning1;
public var bgcol:MovieClip;
public var convoPo:int;
public var bgbmp:BitmapData;
public var transto;
public var menuSelect:int;
public var rocketShips:Array;
public var soundOn:Boolean;
public var bullethit:hit1;
public var cover2:powerbarcover;
public var endLevel:int;
public var shipSpeed:int;
public var hitTimer:int;
public var keyboardControl;
public var psychosound:psycho;
public var WARNING:warning;
public var incomingcall:makingcall;
public var stealthPlanes:Array;
public var channel1:SoundChannel;
public var channel2:SoundChannel;
public var bombers:Array;
public var shipType:int;
public var level:int;
public var warning2Music:musicwarning2;
public var bullets:Array;
public var cover:powerbarcover;
public var explosion1:explode1;
public var explosion2:explode2;
public var explosion3:explode3;
public var gameState:String;
public var gamePaused:Boolean;
public var interTimer:int;
public var GAMEOVER:gameover;
public var convo1:Array;
public var convo2:Array;
public var convo4:Array;
public var convo5:Array;
public var convo6:Array;
public var gameCT:ColorTransform;
public var shakeTimer:int;
public var convo3:Array;
public var badBullets:Array;
public var game:Sprite;
public var explosions:Array;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 6, frame7, 7, frame8);
}
public function newParticle(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:shipparticle;
_local6 = new shipparticle();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.xv = _arg4;
_local6.yv = _arg5;
_local6.gotoAndStop(_arg3);
particles.push(_local6);
game.addChild(_local6);
}
public function newSpinner(_arg1:int):void{
var _local2:spinner;
enemies++;
_local2 = new spinner();
game.addChild(_local2);
_local2.x = _arg1;
_local2.y = -80;
_local2.health = (30 + int(gun));
_local2.shotTime = 100;
spinners.push(_local2);
}
public function updateGame():void{
if (gameState == "game"){
if (levelPointer < this[("level" + level)].length){
nextTimer++;
if (nextAt == 99999){
nextTimer = 0;
};
if ((((nextTimer >= nextAt)) || ((enemies <= 0)))){
nextTimer = 0;
if (levelPointer < this[("level" + level)].length){
newEnemy(this[("level" + level)][levelPointer]);
nextAt = this[("level" + level)][levelPointer][(this[("level" + level)][levelPointer].length - 1)];
};
levelPointer++;
};
} else {
if (enemies == 0){
endLevel = 200;
gameState = "endLevel";
};
};
};
}
public function newBigBullet(_arg1:int, _arg2:int):void{
var _local3:bigbullet;
var _local4:Number;
_local3 = new bigbullet();
_local3.x = _arg1;
_local3.y = _arg2;
if (psyco == true){
_local3.scaleX = 2;
_local3.scaleY = 2;
_local3.damage = 1.5;
} else {
_local3.damage = 0.5;
};
_local4 = ((ship.rotation - 90) * (Math.PI / 180));
_local3.xv = (Math.cos(_local4) * 20);
_local3.yv = (Math.sin(_local4) * 20);
_local3.rotation = ship.rotation;
_local3.dead = false;
bullets.push(_local3);
game.addChild(_local3);
}
function frame1(){
stop();
MochiBot.track(this, "87d177e9");
stage.showDefaultContextMenu = false;
stage.frameRate = 30;
}
function frame2(){
SoundMixer.soundTransform = new SoundTransform(0, 0);
}
function frame3(){
SoundMixer.stopAll();
stage.frameRate = 40;
}
function frame4(){
channel1 = new SoundChannel();
channel2 = new SoundChannel();
menuMusic = new musictitle();
channel1 = menuMusic.play(0, 9999);
SoundMixer.soundTransform = new SoundTransform(1, 0);
stop();
timer5 = 0;
this.addEventListener(Event.ENTER_FRAME, updatelogo5);
stage.addEventListener(MouseEvent.MOUSE_UP, getLink5);
stage.showDefaultContextMenu = false;
}
function frame5(){
stop();
timer3 = 0;
this.addEventListener(Event.ENTER_FRAME, updatelogo3);
stage.addEventListener(MouseEvent.MOUSE_UP, getLink3);
stage.showDefaultContextMenu = false;
}
function frame7(){
stop();
timer2 = 0;
this.addEventListener(Event.ENTER_FRAME, updatelogo1);
}
function frame8(){
stageW = 520;
stageH = 580;
level1 = [[0, 1, 8, false, false, 200], [0, 2, 10, false, false, 300], [0, 3, 15, true, false, 250], [2, (stageW / 2), 200], [0, 1, 10, true, true, 0], [0, 1, 10, false, true, 200], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 99999], [0, 4, 15, false, false, 0], [0, 4, 15, true, false, 300], [0, 4, 15, false, true, 0], [0, 4, 15, true, true, 300], [2, (stageW / 2), 100], [2, (stageW / 2), 100], [0, 3, 15, true, false, 250], [0, 1, 15, true, true, 100], [3, 1, 200], [0, 1, 15, false, true, 250], [0, 1, 8, false, false, 200], [0, 2, 10, false, false, 300], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 150], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 99999], [0, 3, 15, false, false, 0], [0, 3, 15, true, false, 100], [3, 0, 0], [3, 2, 99999], [0, 2, 15, true, false, 99999], [20, 99999]];
level2 = [[0, 3, 5, true, true, 50], [0, 4, 5, true, true, 50], [0, 5, 5, true, true, 50], [0, 2, 5, true, true, 50], [2, ((stageW / 2) - (stageW / 4)), 0], [2, (stageW / 2), 0], [2, ((stageW / 2) + (stageW / 4)), 99999], [1, 1, 10, false, false, 200], [0, 2, 10, true, false, 100], [0, 2, false, false, 100], [0, 3, true, false, 100], [3, 1, 99999], [1, 2, 10, true, false, 0], [1, 2, 10, false, false, 99999], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 0], [3, 1, 99999], [0, 1, 10, false, false, 150], [1, 2, 10, false, false, 150], [0, 5, 10, false, false, 100], [3, 0, 0], [3, 1, 0], [3, 2, 99999], [1, 1, 10, false, false, 0], [1, 1, 10, true, false, 99999], [21, 99999]];
level3 = [[2, (stageW / 2), 50], [0, 1, 10, true, true, 50], [0, 3, 10, false, true, 200], [1, 1, 15, true, false, 100], [3, 1, 99999], [4, (stageW / 2), 99999], [2, (stageW / 2), 60], [2, (stageW / 2), 60], [2, (stageW / 2), 60], [0, 5, 10, false, false, 50], [0, 4, 15, true, false, 99999], [3, 0, 0], [3, 2, 100], [1, 2, 10, true, false, 99999], [4, ((stageW / 2) - (stageW / 4)), 0], [4, ((stageW / 2) + (stageW / 4)), 99999], [0, 1, 3, false, false, 10], [0, 2, 3, false, false, 10], [0, 3, 3, false, false, 10], [0, 4, 3, false, false, 10], [0, 5, 3, false, false, 10], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 99999], [1, 1, 10, true, false, 0], [1, 1, 10, false, false, 0], [1, 1, 10, true, true, 0], [1, 1, 10, false, true, 99999], [3, 0, 0], [3, 1, 0], [3, 2, 100], [0, 3, 10, true, false, 100], [0, 4, false, false, 150], [4, (stageW / 2), 99999], [4, ((stageW / 2) - (stageW / 4)), 0], [4, ((stageW / 2) + (stageW / 4)), 99999], [22, 99999]];
level4 = [[0, 3, 10, false, true, 100], [0, 4, 10, true, false, 100], [1, 2, 10, false, true, 100], [0, 2, 10, true, false, 100], [0, 3, 5, false, true, 50], [0, 1, 5, true, false, 50], [1, 1, 10, false, true, 50], [3, 0, 0], [3, 1, 0], [3, 2, 99999], [6, -50, 400, 330, 99999], [2, (stageW / 8), 0], [2, ((stageW / 8) + (stageW / 4)), 0], [2, ((stageW / 8) + (stageW / 2)), 0], [2, (stageW - (stageW / 8)), 99999], [6, (stageW + 50), 400, 210, 99999], [0, 3, 10, false, false, 50], [0, 1, 10, false, false, 50], [4, ((stageW / 2) - (stageW / 4)), 0], [4, (stageW / 2), 0], [4, ((stageW / 2) + (stageW / 4)), 99999], [1, 2, 15, false, false, 0], [1, 2, 15, true, false, 200], [0, 4, 20, false, true, 150], [3, 1, 0], [4, ((stageW / 2) - (stageW / 4)), 0], [4, ((stageW / 2) + (stageW / 4)), 99999], [6, -50, 100, 60, 0], [6, (stageW + 50), 100, 120, 0], [6, (stageW / 2), -80, 90, 99999], [0, 5, 10, false, true, 0], [0, 5, 10, false, false, 0], [0, 5, 10, true, false, 0], [0, 5, 10, true, true, 200], [3, 0, 0], [3, 2, 0], [2, ((stageW / 2) - 80), 0], [2, ((stageW / 2) + 80), 99999], [23, 99999]];
level5 = [[6, -50, 400, 330, 0], [6, (stageW + 50), 400, 210, 99999], [0, 3, 10, false, false, 0], [0, 3, 10, true, false, 100], [1, 2, 10, false, true, 100], [0, 5, 10, false, true, 150], [2, (stageW / 8), 0], [2, ((stageW / 8) + (stageW / 4)), 0], [2, ((stageW / 8) + (stageW / 2)), 0], [2, (stageW - (stageW / 8)), 100], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 99999], [5, 1, 99999], [6, -50, (stageH / 2), 0, 0], [6, (stageW + 50), (stageH / 2), 180, 100], [0, 2, 10, false, false, 0], [0, 2, 10, true, false, 150], [1, 2, 10, false, false, 0], [1, 2, 10, true, false, 99999], [4, (stageW / 2), 100], [4, (stageW / 2), 100], [4, (stageW / 2), 99999], [5, 0, 0], [5, 2, 99999], [2, (stageW / 8), 0], [2, (stageW - (stageW / 8)), 0], [4, ((stageW / 2) - (stageW / 4)), 0], [4, ((stageW / 2) + (stageW / 4)), 99999], [0, 1, 10, false, true, 0], [0, 1, 10, false, false, 0], [0, 2, 10, false, false, 0], [0, 2, 10, false, true, 200], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 100], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 100], [2, ((stageW / 2) - (stageW / 4)), 0], [2, ((stageW / 2) + (stageW / 4)), 99999], [24, 99999]];
level6 = [[0, 1, 5, true, false, 20], [0, 2, 5, true, false, 20], [0, 3, 5, true, false, 20], [0, 4, 5, true, false, 20], [0, 5, 5, true, false, 20], [4, (stageW / 2), 0], [6, ((stageW / 2) - (stageW / 4)), -80, 90, 0], [6, ((stageW / 2) + (stageW / 4)), -80, 90, 0], [1, 1, 10, true, false, 0], [1, 1, 10, false, false, 20], [1, 2, 10, false, false, 0], [1, 2, 10, true, false, 99999], [2, (stageW / 2), 0], [0, 1, 5, false, false, 100], [2, (stageW / 2), 0], [0, 2, 5, false, false, 100], [2, (stageW / 2), 0], [0, 3, 5, false, false, 100], [2, (stageW / 2), 0], [0, 4, 5, false, false, 100], [3, 0, 0], [3, 1, 0], [3, 2, 99999], [5, 0, 0], [5, 1, 0], [5, 2, 99999], [0, 4, 20, true, true, 100], [4, (stageW / 2), 100], [4, ((stageW / 2) - (stageW / 4)), 0], [4, ((stageW / 2) + (stageW / 4)), 100], [1, 2, 10, false, true, 100], [6, -50, 400, 270, 0], [6, (stageW + 50), 400, 110, 100], [5, 1, 0], [4, ((stageW / 2) - (stageW / 4)), 0], [4, ((stageW / 2) + (stageW / 4)), 99999], [0, 3, 30, false, false, 100], [6, -50, 200, 20, 0], [6, (stageW + 50), 200, 160, 99999], [25, 99999]];
levelCounts = [234, 122, 154, 193, 147, 169];
spath1 = [[222, -20], [215.931849350548, -25.2132089633497], [209.599176614473, -30.1016909381327], [203.019339207567, -34.6520469350503], [196.210372006804, -38.8518047446063], [189.190937917994, -42.6894531225662], [181.980276722061, -46.1544733414779], [174.598152340136, -49.2373680217718], [167.064798662024, -51.9296871634186], [159.40086408652, -54.2240513067919], [151.627354925582, -56.114171759254], [143.765577827491, -57.5948678320254], [135.837081376806, -58.6620810400925], [127.863597031195, -59.3128862262331], [119.866979557021, -59.5454995786689], [111.869147126941, -59.3592835203697], [103.892021243725, -58.7547484566074], [95.9574666549343, -57.7335513759712], [88.087231423173, -56.2984913086765], [80.3028873161581, -54.453501654618], [72.6257706800039, -52.2036394021938], [65.07692395778, -49.5550712674518], [57.6770380136384, -46.5150567915497], [50.446395420592, -43.0919284428569], [43.4048148673927, -39.2950687782387], [36.5715968368824, -35.1348847261191], [29.9654707047118, -30.6227790618143], [23.6045434034227, -25.7711191533175], [17.5062497926055, -20.593203063203], [11.6873048711602, -15.1032230995615], [6.16365796264652, -9.31622691586935], [0.950448999296781, -3.24807626641691], [-3.9380329754862, 3.08459646965763], [-8.48838897240377, 9.66443387656339], [-12.6881467819597, 16.4734010773269], [-16.5257951599197, 23.4928351661365], [-19.9908153788314, 30.7034963620694], [-23.0737100591253, 38.0856207439947], [-25.7660292007721, 45.6189744221066], [-28.0603933441454, 53.2829089976104], [-29.9505137966075, 61.0564181585482], [-31.4312098693789, 68.91819525664], [-32.498423077446, 76.8466917073251], [-33.1492282635866, 84.8201760529354], [-33.3818416160224, 92.8167935271097], [-33.1956255577231, 100.814625957189], [-32.5910904939608, 108.791751840406], [-31.5698934133246, 116.726306429196], [-30.1348333460299, 124.596541660958], [-28.2898436919714, 132.380885767972], [-26.0399814395472, 140.058002404127], [-23.3914133048053, 147.606849126351], [-20.3513988289031, 155.006735070492], [-16.9282704802103, 162.237377663539], [-13.1314108155921, 169.278958216738], [-8.97122676347255, 176.112176247248], [-4.45912109916774, 182.718302379419], [0.392538809329108, 189.079229680708], [5.57045489944354, 195.177523291525], [11.0604348630851, 200.99646821297], [16.8474310467773, 206.520115121484], [22.3374110104188, 212.339060042929], [27.5153271005332, 218.437353653747], [32.3669870090301, 224.798280955036], [36.8790926733349, 231.404407087206], [41.0392767254544, 238.237625117717], [44.8361363900727, 245.279205670916], [48.2592647387654, 252.509848263962], [51.3669514149922, 259.881570147105], [54.4730803745207, 267.253948520925], [57.5775363749857, 274.62703152203], [60.6946563016793, 281.994769530578], [63.8104026212812, 289.363088529637], [66.9246604998737, 296.732036749405], [70.0537856226325, 304.094684097073], [73.181891663893, 311.457764471117], [76.2659932688324, 318.83938470589], [79.365670210689, 326.214478119273], [82.4625727775723, 333.590736960395], [85.5777382875124, 340.959301531984], [88.6907127212837, 348.328792028259], [92.1851102639295, 355.525262400181], [96.0513530146779, 362.528987622681], [100.278843870888, 369.320770971748], [104.855995573973, 375.881996641312], [109.770262469269, 382.194680767878], [115.008174892801, 388.241520723046], [120.555376090699, 394.005942538807], [126.396661570063, 399.472146335647], [132.516020773414, 404.625149628908], [138.896680962529, 409.450828394744], [145.521153191343, 413.935955783088], [152.371280241939, 418.068238371524], [159.428286392217, 421.836349860711], [166.672828878845, 425.229962118973], [174.085050914431, 428.239773490999], [181.644636113592, 430.857534293027], [189.330864178757, 433.076069424657], [197.122667693062, 434.889298035301], [204.998689864677, 436.292250191374], [212.937343064285, 437.281080498534], [220.916867995274, 437.853078641642], [228.915393334459, 438.006676813546], [236.910995679856, 437.741454012335], [244.881759641204, 437.05813719527], [252.805837908525, 435.958599286251], [260.661511134084, 434.445854042257], [268.427247463613, 432.524047792855], [276.08176155362, 430.198448075389], [283.604072913045, 427.475429197035], [290.97356340932, 424.362454763263], [298.170033781242, 420.868057220618], [305.173759003742, 417.001814469869], [311.965542352808, 412.774323613659], [318.526768022372, 408.197171910574], [324.839452148939, 403.282905015278], [330.886292104106, 398.044992591746], [336.722589737227, 392.573463560696], [342.56784434543, 387.111504336637], [348.421275095407, 381.658308167855], [354.285504326473, 376.216726088577], [359.856906433593, 370.475691463984], [365.120210590855, 364.450940070927], [370.060990447412, 358.158985334198], [374.665703669106, 351.617073064383], [378.921729057066, 344.84313418829], [382.817401141537, 337.855735601529], [386.34204215612, 330.674029277937], [389.485991304788, 323.317699775353], [392.240631241459, 315.806910281612], [394.598411689539, 308.162247348646], [396.552870136706, 300.404664466183], [398.098649548211, 292.555424629678], [399.231513050131, 284.636042059931], [399.948355542352, 276.668223234095], [400.247212209431, 268.673807389735], [400.127263906016, 260.674706664997], [399.706793241034, 252.685764030337], [399.323234846087, 244.694964135604], [398.913516830302, 236.705462827791], [398.546929836733, 228.713866368], [397.762597395268, 220.752407794267], [396.56266930661, 212.842908911149], [394.950434490244, 205.007049105302], [392.930311969736, 197.266305923789], [390.507838760499, 189.641896205619], [387.689654693215, 182.154717927862], [384.483484214522, 174.825292925752], [380.898115214845, 167.673710643756], [376.943374941395, 160.71957307181], [372.630103062372, 153.981941017621], [367.970121956185, 147.479281862324], [362.976204307133, 141.229418942668], [357.662038096371, 135.249482698494], [352.042189084098, 129.555863719386], [346.132060885826, 124.164167819208], [339.947852752139, 119.089173261651], [333.506515167672, 114.344790254037], [326.825703391013, 109.944022820412], [319.923729062863, 105.89893315842], [312.819510015106, 102.220608577651], [305.532518418343, 98.9191311101058], [298.082727410029, 96.0035498760392], [290.490556349488, 93.4818562809543], [282.776814849873, 91.3609621117144], [274.962645740458, 89.646680591816], [267.069467115616, 88.3437104477467], [259.11891362931, 87.4556230301032], [251.132777196008, 86.984852524767], [243.132947260566, 86.9326892809704], [235.141350800775, 87.2992762745388], [227.179892227042, 88.083608716004], [219.270393343924, 89.2835368046622], [211.434533538076, 90.8957716210284], [203.693790356563, 92.9158941415359], [196.069380638393, 95.3383673507731], [188.582202360637, 98.1565514180575], [181.252777358527, 101.36272189675], [174.101195076531, 104.948090896427], [167.147057504585, 108.902831169877]];
spath2 = [[142, -20], [136.793705069019, -26.0740837244514], [131.27665220428, -31.867366704565], [125.463963264199, -37.3639699543784], [119.371570425126, -42.5488276664481], [113.016172512355, -47.4077285061804], [106.415189229808, -51.9273545641116], [99.5867134138327, -56.0953178593723], [92.5494614419994, -59.9001942942817], [85.3227219328097, -63.3315549670055], [77.9263028769336, -66.3799947564508], [70.3804773448845, -69.037158101049], [62.7059279199419, -71.2957619007698], [54.9236900086281, -73.1496154795918], [47.0550941841214, -74.5936375537152], [39.1217077206374, -75.6238701590076], [31.1452754790294, -76.2374894995084], [23.1476603056367, -76.4328136872576], [15.1507831077423, -76.2093073522334], [7.17656276988938, -75.5675831097642], [-0.753143924257253, -74.509399881393], [-8.61660219983608, -73.0376580737953], [-16.392258864296, -71.1563916289663], [-24.0588013831991, -68.8707569674659], [-31.5952162963957, -66.1870188550289], [-38.9808468144587, -63.1125332312771], [-46.1954494375069, -59.6557270476004], [-53.2192494412315, -55.8260751694684], [-60.0329950780404, -51.6340744064834], [-66.618010344761, -47.0912147413543], [-72.9562461722659, -42.2099478366529], [-79.0303298967173, -37.0036529056723], [-84.8236128768309, -31.4866000409331], [-90.3202161266443, -25.6739111008521], [-95.505073838714, -19.5815182617788], [-100.363974678446, -13.2261203490082], [-104.883600736377, -6.62513706646089], [-109.051564031638, 0.203338749514426], [-112.856440466548, 7.24059072134767], [-116.287801139271, 14.4673302305374], [-119.336240928717, 21.8637492864135], [-121.993404273315, 29.4095748184626], [-124.252008073036, 37.0841242434052], [-126.105861651858, 44.866362154719], [-127.549883725981, 52.7349579792257], [-128.580116331273, 60.6683444427097], [-129.193735671774, 68.6447766843177], [-129.389059859524, 76.6423918577104], [-129.165553524499, 84.6392690556048], [-128.52382928203, 92.6134893934577], [-127.465646053659, 100.543196087604], [-125.993904246061, 108.406654363183], [-124.112637801232, 116.182311027643], [-121.827003139732, 123.848853546546], [-119.143265027295, 131.385268459743], [-116.068779403543, 138.770898977806], [-112.611973219866, 145.985501600854], [-108.782321341734, 153.009301604579], [-104.590320578749, 159.823047241388], [-100.04746091362, 166.408062508108], [-95.1661940089188, 172.746298335613], [-90.6233343437897, 179.331313602334], [-86.0936559718308, 185.925402913725], [-81.5666429488384, 192.52132234089], [-77.0379558575016, 199.116092483114], [-72.5120696377191, 205.712785133646], [-67.9742853270331, 212.30129889243], [-63.4496253364622, 218.898832671785], [-58.9125579189776, 225.487840127328], [-54.389237350434, 232.086292296904], [-49.8529545442193, 238.675839952248], [-45.3196840529632, 245.267460288182], [-40.7842636466996, 251.857601541482], [-36.2520330636031, 258.449936935077], [-31.7355086457864, 265.053042809078], [-27.2044296314447, 271.646169758091], [-22.6769446147901, 278.241765214452], [-18.1471478343728, 284.835773185945], [-13.6211965220796, 291.432421177065], [-9.0928362174399, 298.027415714695], [-4.56860937302767, 304.625246529463], [0.294720960551891, 310.977255508241], [5.48382473290041, 317.066032235943], [10.984478971268, 322.874887798782], [16.7816067647332, 328.38790052743], [22.8593185889675, 333.589959637202], [29.2009558583172, 338.466806645669], [35.7891365858287, 343.005074454167], [42.605803026067, 347.192323986083], [49.6322711701398, 351.017078281502], [56.8492819572682, 354.468853954757], [64.2370540625329, 357.538189928656], [71.7753381161111, 360.216673366643], [79.4434722053916, 362.496962731792], [87.2204385078413, 364.372807909456], [95.0849208993953, 365.839067338389], [103.015363380472, 366.891722103417], [110.990029159469, 367.527886950997], [118.987060231798, 367.745818197502], [126.984537291157, 367.544918508532], [134.960539808823, 366.925738536172], [142.893206116302, 365.889975409686], [150.760793326638, 364.440468083809], [158.541736930155, 362.581189557368], [166.214709901283, 360.317235983566], [173.758681154451, 357.654812701784], [181.152973188829, 354.601217229175], [188.377318763921, 351.164819258675], [195.411916450664, 347.355037718262], [202.237484905767, 343.182314954323], [208.835315720535, 338.65808810991], [215.187324699313, 333.794757776331], [221.276101427015, 328.605654003982], [227.139162010586, 323.162812779643], [233.006604383546, 317.724695458363], [238.868209310033, 312.280286612053], [244.734354564739, 306.840770103144], [250.594374307192, 301.394655100864], [256.45910434932, 295.953612780411], [262.317391288227, 290.505633876136], [268.19134860539, 285.074554293203], [274.341496611601, 279.958336989208], [280.750978178667, 275.171005160157], [287.402225363129, 270.72568054983], [294.277007558778, 266.634547483993], [301.356481465476, 262.908819474008], [308.621242737332, 259.558708481379], [316.051379168669, 256.593396927473], [323.626525271989, 254.021012525143], [331.325918098366, 251.848606001231], [339.128454147241, 250.082131771018], [347.012747209652, 248.726431617583], [354.957186986344, 247.785221420811], [362.939998320102, 247.261080972431], [370.939300879938, 247.155446904978], [378.933169133559, 247.468608754089], [386.899692443731, 248.199708164903], [394.817035123805, 249.346741244753], [402.663496287825, 250.906564055697], [410.417569331139, 252.874901231831], [418.058000878515, 255.246357697773], [425.563849038161, 258.014433456189], [432.914540801998, 261.17154140383], [440.089928434841, 264.709028127261], [447.070344697943, 268.617197621259], [453.83665675553, 272.885337864896], [460.370318616572, 277.501750182439], [466.653421968059, 282.453781308607], [472.668745260435, 287.727858070296], [478.399800910678, 293.309524589699], [483.830880493611, 299.183481906862], [488.947097797606, 305.333629913073], [493.734429626657, 311.743111480139], [498.179754236984, 318.394358664601], [502.270887302821, 325.26914086025], [505.996615312806, 332.348614766948], [509.346726305435, 339.613376038804], [512.312037859341, 347.043512470141], [514.884422261671, 354.618658573461], [517.056828785583, 362.318051399838], [518.823303015796, 370.120587448713], [520.179003169231, 378.004880511124], [521.120213366003, 385.949320287816], [521.644353814383, 393.932131621574], [521.749987881836, 401.93143418141], [521.436826032725, 409.925302435031], [520.705726621911, 417.891825745203], [519.558693542061, 425.809168425277], [517.998870731117, 433.655629589296], [516.030533554983, 441.40970263261], [513.659077089041, 449.050134179987], [510.891001330625, 456.555982339633], [507.733893382984, 463.90667410347], [504.196406659553, 471.082061736313], [500.288237165555, 478.062477999415], [496.020096921918, 484.828790057002], [491.403684604375, 491.362451918044], [486.451653478207, 497.645555269531], [481.177576716518, 503.660878561907], [475.595910197115, 509.39193421215]];
spath3 = [[24, -20], [30.6921144301883, -15.6164392951316], [37.1456397088932, -10.8886478998694], [43.3428871719051, -5.82958436180292], [49.4169399908274, -0.623253374155166], [55.4879524693946, 4.58662258262941], [61.555655466805, 9.80035256558947], [67.6197424570684, 15.0182878827928], [73.6798622704446, 20.240830160987], [79.7612470771137, 25.4385949530119], [85.815831139267, 30.6675539157806], [91.8651805989692, 35.9025678712922], [97.9086580699099, 41.1443595552713], [103.978051635357, 46.3561214212534], [110.042138625621, 51.5740567384567], [116.100126781763, 56.7990715231291], [122.15103216138, 62.0322869865818], [128.193611899797, 67.2751135243258], [134.274582654611, 72.4733627179575], [140.348635473533, 77.6796937056052], [146.414117044027, 82.8960078562296], [152.198285293695, 88.4226160076671], [157.685286219417, 94.2443701111243], [162.860080333053, 100.345313143269], [167.708483883634, 106.708722843321], [172.217207734035, 113.317157547609], [176.373893785579, 120.152503995953], [180.167148850728, 127.196026978859], [183.586575881013, 134.428420689419], [186.622802464627, 141.829861639191], [189.267506515548, 149.380062992999], [191.513439083805, 157.05833017374], [193.354444224341, 164.843617584781], [194.785475870032, 172.714586294478], [195.802611662607, 180.649662524702], [196.403063703559, 188.627096783066], [196.585186195581, 196.625023476772], [196.348479953581, 204.621520844682], [195.693593772915, 212.594671043341], [194.622322651084, 220.522620222261], [193.13760286777, 228.383638423807], [191.243503936697, 236.156179143501], [188.945217451378, 243.818938387494], [186.249042855317, 251.35091306533], [183.333848066673, 258.800855302976], [180.41442002588, 266.24913966346], [177.503615808756, 273.700798459297], [174.588421020112, 281.150740696943], [171.68275538758, 288.60440471083], [168.787419744362, 296.06208742821], [165.887849655122, 303.518124800541], [162.99989683466, 310.978669586733], [160.063717200696, 318.420366245231], [157.138498221312, 325.866378192754], [154.206302074252, 333.30964533529], [151.286614485998, 340.757827958387], [148.359426806202, 348.203066187433], [145.446786162738, 355.654007368387], [142.52608593219, 363.101792956284], [139.622729504654, 370.556356756714], [136.739535271037, 378.018741831959], [134.250843413679, 385.621794695061], [132.163475263973, 393.344675906603], [130.483152152929, 401.166217585996], [129.214479729394, 409.064981431166], [128.360935336297, 417.019317479449], [127.924858479491, 425.007423448636], [127.90744441533, 433.007404495512], [128.308740874551, 440.997333228099], [129.127647931455, 448.955309807114], [130.36192101872, 456.859521971906], [132.008177079607, 464.688304826347], [134.061903840683, 472.420200220805], [136.517472179649, 480.034015567441], [139.368151554372, 487.50888192762], [142.606128450834, 494.824311212219], [146.222527799431, 501.96025233806], [150.207437300922, 508.897146186529], [154.54993459535, 515.615979213766], [159.238117199475, 522.098335565463], [164.25913513065, 528.326447553442], [168.947317734775, 534.808803905139], [173.289815029203, 541.527636932376], [177.274724530693, 548.464530780845], [180.89112387929, 555.600471906686], [184.129100775753, 562.915901191285], [186.979780150475, 570.390767551464], [189.435348489441, 578.0045828981], [191.489075250517, 585.736478292558], [193.135331311404, 593.565261146999], [194.369604398669, 601.469473311791], [195.188511455573, 609.427449890807], [195.589807914795, 617.417378623393], [195.572393850633, 625.417359670269], [195.136316993828, 633.405465639456], [194.282772600731, 641.359801687739], [193.014100177196, 649.258565532909], [191.333777066151, 657.080107212302], [189.246408916446, 664.802988423844], [186.757717059088, 672.406041286946], [183.87452282547, 679.868426362191], [181.385830968112, 687.471479225293], [179.298462818407, 695.194360436835], [177.618139707362, 703.015902116229], [176.349467283827, 710.914665961398], [175.495922890731, 718.869002009681], [175.059846033925, 726.857107978868], [175.042431969763, 734.857089025744], [175.443728428985, 742.84701775833], [176.262635485889, 750.804994337346], [177.496908573154, 758.709206502138], [179.143164634041, 766.537989356579], [181.196891395117, 774.269884751037], [183.652459734083, 781.883700097673], [186.503139108806, 789.358566457852], [189.741116005268, 796.673995742451], [193.357515353865, 803.809936868292], [197.342424855355, 810.746830716761], [201.684922149784, 817.465663743998], [206.373104753908, 823.948020095695], [211.394122685083, 830.176132083674], [216.734213682166, 836.132928885889], [222.378740926919, 841.802083336355], [228.31223316251, 847.168056676783], [234.518427099154, 852.21614114723], [240.980311990657, 856.932500299051], [247.680176259692, 861.30420691964], [254.599656044, 865.319278465025], [261.719785530458, 868.966709903184], [269.021048939058, 872.236503878075], [276.483434014303, 875.119698111692], [284.086486877405, 877.60838996905], [291.809368088947, 879.695758118755], [299.630909768341, 881.3760812298], [307.529673613511, 882.644753653335], [315.484009661793, 883.498298046432], [323.47211563098, 883.934374903237], [331.472096677856, 883.951788967399], [339.462025410443, 883.550492508178], [347.420001989458, 882.731585451274], [355.32421415425, 881.497312364009], [363.152997008692, 879.851056303121], [370.884892403149, 877.797329542045], [378.498707749785, 875.34176120308], [385.973574109964, 872.491081828357], [393.289003394564, 869.253104931895], [400.424944520404, 865.636705583297], [407.361838368874, 861.651796081807], [414.08067139611, 857.309298787379], [420.563027747807, 852.621116183254], [426.791139735787, 847.600098252079], [432.747936538001, 842.260007254996], [438.417090988468, 836.615480010243], [443.783064328895, 830.681987774652], [448.831148799342, 824.475793838008], [453.547507951163, 818.013908946505], [457.919214571753, 811.31404467747], [461.934286117138, 804.394564893163], [465.581717555297, 797.274435406705], [468.851511530187, 789.973171998104], [471.734705763804, 782.510786922859], [474.223397621162, 774.907734059757], [476.310765770868, 767.184852848215], [477.991088881912, 759.363311168821], [479.259761305447, 751.464547323652], [480.113305698544, 743.510211275369], [480.54938255535, 735.522105306182], [480.566796619511, 727.522124259306], [480.16550016029, 719.53219552672], [479.346593103386, 711.574218947704], [478.112320016121, 703.670006782912], [476.466063955234, 695.841223928471], [474.412337194158, 688.109328534013], [471.956768855192, 680.495513187377], [469.106089480469, 673.020646827198], [465.868112584007, 665.705217542599], [462.25171323541, 658.569276416758], [458.266803733919, 651.632382568289], [453.924306439491, 644.913549541052], [449.236123835366, 638.431193189355]];
spath4 = [[540, 352], [534.656112733341, 346.046608623546], [529.00797264788, 340.381053613221], [523.071060902996, 335.018863861501], [516.861650161111, 329.974736757773], [510.396759985458, 325.262497903816], [503.888185904476, 320.610781722408], [497.379639018036, 315.959027491259], [490.873806570856, 311.303477666671], [484.368062395101, 306.647804490897], [477.865198534356, 301.98810904928], [471.362494367606, 297.328190753889], [464.852626597952, 292.678285204136], [458.353231199151, 288.013753132208], [451.8464179546, 283.359574214231], [445.339680800623, 278.705288919037], [438.836210797686, 274.046439498751], [432.332907896577, 269.387356823329], [425.821361279051, 264.739802558149], [419.321842681016, 260.0754421525], [412.813741391203, 255.423064523638], [406.071072596012, 251.117670520953], [399.278449220726, 246.891529529277], [392.480789340269, 242.673494423967], [385.680933446474, 238.459000406459], [378.883812116889, 234.240097512233], [372.089529514576, 230.016624543228], [365.298195860338, 225.78841130395], [358.496074686835, 221.57757438702], [351.696853153136, 217.362057036127], [344.900650401876, 213.141674569601], [338.107593061498, 208.916231164425], [331.308556636547, 204.700415265671], [324.506884274657, 200.488853431684], [317.708433656828, 196.272092921891], [310.913351730294, 192.049906093754], [304.121795714687, 187.822050031058], [297.323606436172, 183.604868207437], [290.522488513493, 179.392411085778], [283.724994778995, 175.174108236355], [276.931310979421, 170.949672128256], [269.925847784078, 167.086579401088], [262.727806680641, 163.595418523495], [255.356916999445, 160.485758524776], [247.833381836761, 157.766122766837], [240.177822679517, 155.44396558225], [232.411222883229, 153.525651842448], [224.554870158092, 152.016439512052], [216.630298220835, 150.920465237154], [208.659227772308, 150.240733007062], [200.663506962549, 149.979105920572], [192.665051506521, 150.13630107934], [184.685784614664, 150.711887622365], [176.747576902896, 151.70428790694], [168.872186446777, 153.110781832866], [161.081199144135, 154.927514298056], [153.395969549622, 157.149505765103], [145.837562343364, 159.770665909843], [138.426694594133, 162.783810314516], [131.183678975307, 166.180680159749], [124.128368089243, 169.951964861409], [117.280100052669, 174.087327590269], [110.657645492257, 178.575433604534], [104.279156095636, 183.403981317583], [98.1621148588778, 188.559736015762], [92.3232881668231, 194.028566133818], [86.7786798375825, 199.795481988529], [81.5434872571855, 205.844676864391], [76.6320597246013, 212.159570338724], [72.0578591213074, 218.722853727457], [67.8334230132088, 225.516537527031], [63.9703302860407, 232.522000722374], [60.479169408448, 239.720041825811], [57.3695094097287, 247.090931507007], [54.6498736517894, 254.614466669691], [52.327716467203, 262.270025826935], [50.4094027274013, 270.036625623223], [48.9001903970048, 277.89297834836], [47.804216122107, 285.817550285617], [47.1244838920152, 293.788620734144], [46.8628568055244, 301.784341543903], [47.0200519642933, 309.782796999931], [47.5956385073181, 317.762063891788], [48.588038791893, 325.700271603556], [49.9945327178189, 333.575662059675], [51.8112651830089, 341.366649362317], [54.0332566500555, 349.05187895683], [56.6544167947963, 356.610286163088], [59.6675611994691, 364.021153912319], [63.0644310447018, 371.264169531145], [66.8357157463622, 378.319480417209], [70.9710784752219, 385.167748453783], [75.4591844894865, 391.790203014195], [80.2877322025353, 398.168692410816], [85.4434869007152, 404.285733647574], [90.9123170187705, 410.124560339629], [96.6792328734815, 415.66916866887], [102.728427749344, 420.904361249267], [109.043321223677, 425.815788781851], [115.60660461241, 430.389989385145], [122.400288411984, 434.614425493243], [129.405751607327, 438.477518220411], [136.603792710764, 441.968679098004], [143.97468239196, 445.078339096723], [151.498217554643, 447.797974854663], [159.153776711888, 450.120132039249], [166.920376508175, 452.038445779051], [174.776729233313, 453.547658109447], [182.70130117057, 454.643632384345], [190.672371619097, 455.323364614437], [198.668092428856, 455.584991700928], [206.666547884884, 455.427796542159], [214.645814776741, 454.852209999134], [222.584022488509, 453.859809714559], [230.459412944628, 452.453315788633], [238.25040024727, 450.636583323443], [245.935629841783, 448.414591856396], [253.494037048041, 445.793431711656], [260.904904797272, 442.780287306983], [268.147920416097, 439.38341746175], [275.203231302162, 435.61213276009], [282.446246920987, 432.215262914857], [289.857114670218, 429.202118510184], [297.415521876477, 426.580958365443], [305.100751470989, 424.358966898397], [312.891738773631, 422.542234433207], [320.76712922975, 421.135740507281], [328.705336941518, 420.143340222706], [336.684603833376, 419.567753679681], [344.683059289403, 419.410558520912], [352.678780099162, 419.672185607403], [360.649850547689, 420.351917837495], [368.614075127965, 421.107647177229], [376.579684855901, 421.848634128665], [384.546830507643, 422.572920097005], [392.515687443301, 423.278128675382], [400.479651224053, 424.036601416406], [408.445436858864, 424.775694928914], [416.413312246734, 425.491908446925], [424.374576960902, 426.278206196473], [432.338048791696, 427.041826782987], [440.330571774715, 427.387624940749], [448.330238960016, 427.314652861043], [456.315123815894, 426.823110555269], [464.263340327982, 425.914345306719], [472.153102987294, 424.590847977772], [479.962786502791, 422.856246182612], [487.670985074802, 420.715294344189], [495.256571066831, 418.173860662676], [502.698752914942, 415.238911031141], [509.977132115989, 411.918489942518], [517.071759138496, 408.221698440212], [523.963188102934, 404.15866917277], [530.632530081531, 399.740538620995], [537.061504871504, 394.97941657363], [543.232491099824, 389.888352935266], [549.128574522181, 384.481301957459], [554.733594383746, 378.7730839911], [560.032187714678, 372.779344864861], [565.009831438958, 366.516513001069], [569.65288218113, 360.001754386537], [573.948613661843, 353.252925521792], [577.885251579701, 346.288524477648], [581.452005883805, 339.127640193276], [584.639100348528, 331.789900154754], [587.437799369476, 324.295416597487], [589.840431907166, 316.66473137997], [591.840412512818, 308.918759679982], [593.432259378609, 301.078732667537], [594.611609362927, 293.166139311722], [595.375229949442, 285.202667480927], [595.721028107203, 277.210144497908], [595.648056027498, 269.210477312607], [595.156513721723, 261.225592456729], [594.247748473173, 253.277375944641], [592.924251144227, 245.387613285329], [591.189649349067, 237.577929769832], [589.048697510644, 229.869731197821], [586.50726382913, 222.284145205792], [583.572314197595, 214.841963357681]];
spath5 = [[236, -20], [231.137532017169, -26.3526691332021], [225.949254863933, -32.4421502425593], [220.449389247339, -38.2517524836254], [214.653009916749, -43.7655521404783], [208.576004345008, -48.9684362715179], [202.235029181979, -53.8461441329892], [195.64746459983, -58.3853062666892], [188.831366655184, -62.5734811447226], [181.805417798726, -66.3991892708653], [174.588875667904, -69.8519446450653], [167.201520303082, -72.9222835048398], [159.663599931827, -75.601790264791], [151.995775469923, -77.88312058314], [144.219063891235, -79.7600214920576], [136.354780621647, -81.2273485366141], [128.424481114963, -82.2810798753732], [120.449901770901, -82.9183273039792], [112.452900357138, -83.1373441715249], [104.455396098684, -82.937530168], [96.4793095988109, -82.3194329696992], [88.5465027562048, -81.2847467380797], [80.6787188430185, -79.8363074761822], [72.8975229080749, -77.9780852553438], [65.2242426685675, -75.7151733335084], [57.6799100522696, -73.0537741949606], [50.2852035504822, -70.0011825497476], [43.0603915397272, -66.5657653393859], [36.0252767275353, -62.7569388036561], [29.1991418746021, -58.5851426713445], [22.6006969420806, -54.0618115456717], [16.2480278088784, -49.1993435628402], [10.1585466995213, -44.011066409605], [4.34894445845512, -38.5112007930105], [-1.16485519839773, -32.7148214624206], [-6.36773932943736, -26.6378158906792], [-11.2454471909086, -20.2968407276509], [-15.7846093246086, -13.7092761455019], [-19.972784202642, -6.89317820085575], [-23.7984923287848, 0.132770655602403], [-27.2512477029847, 7.34931278642472], [-30.3215865627593, 14.7366681512463], [-33.0010933227104, 22.274588522501], [-35.2824236410594, 29.9424129844055], [-37.159324549977, 37.7191245630938], [-38.6266515945335, 45.5834078326812], [-39.6803829332926, 53.5137073393655], [-40.3176303618987, 61.4882866834272], [-40.5366472294443, 69.4852880971904], [-40.3368332259194, 77.4827923556447], [-39.7187360276187, 85.4588788555175], [-38.6840497959992, 93.3916856981235], [-37.2356105341017, 101.25946961131], [-35.3773883132633, 109.040665546253], [-33.1144763914279, 116.713945785761], [-30.4530772528801, 124.258278402059], [-27.4004856076671, 131.652984903846], [-23.9650683973054, 138.877796914601], [-20.1562418615756, 145.912911726793], [-15.984445729264, 152.739046579726], [-11.4611146035912, 159.337491512248], [-6.59864662075972, 165.69016064545], [-1.41036946752455, 171.779641754807], [4.08949614907002, 177.589243995873], [9.88587547965988, 183.103043652726], [15.9628810514013, 188.305927783766], [22.3038562144295, 193.183635645237], [28.8914207965786, 197.722797778937], [35.7075187412247, 201.91097265697], [42.7334675976829, 205.736680783113], [49.9500097285052, 209.189436157313], [57.3373650933268, 212.259775017088], [64.8752854645814, 214.939281777039], [72.543109926486, 217.220612095388], [80.3198215051742, 219.097513004305], [88.1841047747617, 220.564840048862], [96.114404281446, 221.618571387621], [104.088983625508, 222.255818816227], [112.085985039271, 222.474835683773], [120.083489297725, 222.275021680248], [128.059575797598, 221.656924481947], [135.992382640204, 220.622238250328], [143.86016655339, 219.17379898843], [151.641362488334, 217.315576767592], [159.314642727841, 215.052664845756], [166.858975344139, 212.391265707208], [174.253681845927, 209.338674061995], [181.478493856682, 205.903256851634], [188.513608668873, 202.094430315904], [195.339743521807, 197.922634183592], [201.938188454328, 193.39930305792], [208.29085758753, 188.536835075088], [214.380338696888, 183.348557921853], [220.189940937954, 177.848692305258], [225.703740594807, 172.052312974668], [230.906624725846, 165.975307402927], [235.784332587317, 159.634332239899], [240.323494721017, 153.04676765775], [244.511669599051, 146.230669713104], [248.337377725194, 139.204720856646], [251.790133099394, 131.988178725823], [255.615841225536, 124.962229869365], [259.80401610357, 118.146131924719], [264.34317823727, 111.55856734257], [269.220886098741, 105.217592179542], [274.423770229781, 99.1405866078002], [279.937569886633, 93.3442072772104], [285.7471721277, 87.8443416606158], [291.836653237057, 82.6560645073806], [298.189322370259, 77.7935965245492], [304.78776730278, 73.2702653988763], [311.613902155714, 69.0984692665647], [318.649016967906, 65.289642730835], [325.873828978661, 61.8542255204733], [333.268535480448, 58.8016338752603], [340.812868096746, 56.1402347367125], [348.486148336253, 53.877322814877], [356.267344271197, 52.0191005940386], [364.135128184383, 50.5706613321412], [372.067935026989, 49.5359751005217], [380.044021526862, 48.9178779022209], [388.041525785316, 48.718063898696], [396.03852719908, 48.9370807662417], [404.013106543141, 49.5743281948477], [411.943406049826, 50.6280595336068], [419.807689319413, 52.0953865781634], [427.584400898101, 53.9722874870809], [435.252225360006, 56.2536178054299], [442.79014573126, 58.9331245653811], [450.177501096082, 62.0034634251557], [457.394043226904, 65.4562187993556], [464.419992083363, 69.2819269254983], [471.236090028009, 73.4701018035318], [477.823654610158, 78.0092639372318], [484.164629773186, 82.886971798703], [490.241635344927, 88.0898559297427], [496.038014675517, 93.6036555865955], [501.537880292112, 99.4132578276617], [506.726157445347, 105.502738937019], [511.588625428178, 111.855408070221], [516.111956553851, 118.453853002743], [520.283752686163, 125.279987855676], [524.092579221893, 132.315102667868], [527.527996432254, 139.539914678623], [530.580588077467, 146.93462118041], [533.241987216015, 154.478953796708], [535.504899137851, 162.152234036215], [537.363121358689, 169.933429971159], [538.811560620586, 177.801213884345], [539.846246852206, 185.734020726951], [540.464344050507, 193.710107226824], [540.664158054032, 201.707611485278], [540.445141186486, 209.704612899042], [539.80789375788, 217.679192243103], [538.754162419121, 225.609491749788], [537.286835374564, 233.473775019375], [535.409934465647, 241.250486598063], [533.128604147298, 248.918311059968], [530.449097387346, 256.456231431222], [527.378758527572, 263.843586796044], [523.926003153372, 271.060128926866], [520.100295027229, 278.086077783325], [515.912120149196, 284.902175727971], [511.372958015496, 291.48974031012], [506.495250154025, 297.830715473148], [501.292366022985, 303.907721044889], [495.778566366132, 309.704100375479], [489.968964125066, 315.203965992074], [483.879483015709, 320.392243145309], [477.526813882507, 325.25471112814], [470.928368949985, 329.778042253813], [464.102234097052, 333.949838386125], [457.06711928486, 337.758664921855], [449.842307274105, 341.194082132216], [442.447600772318, 344.246673777429], [434.90326815602, 346.908072915977], [427.229987916512, 349.170984837812], [419.448791981569, 351.029207058651], [411.581008068382, 352.477646320548], [403.648201225776, 353.512332552168]];
apath1 = [[-50, 100], [600, 500]];
apath2 = [[570, 300], [-50, 400]];
convo1 = [[1, "INCOMING CALL..."], [3, "COME IN RED RAGE, WHAT IS YOUR POSITION?"], [2, "APPROACING MISSION LOCATION NOW."], [3, "GOOD. SAME TERMS AS USUAL, YOU GET 20% OF THE LOOT."], [2, "HOW MUCH RESISTANCE SHOULD I EXPECT?"], [3, "WE'RE MERCENARIES, DO YOU THINK I'D ACCEPT A MISSION THAT MIGHT BE DANGEROUS? HAHAHA!"], [2, "AS LONG AS I GET MY MONEY. HERE THEY COME!"], [3, "MAKE ME RICH RED."]];
convo2 = [[1, "INCOMING CALL..."], [3, "NICE JOB RED! DON'T YOU JUST LOVE THE SMELL OF FRESH LOOT?"], [2, "SHOULD I RETURN TO BASE?"], [3, "NO, OUR CLIENT WAS SO IMPRESSED WITH OUR WORK THAT HE'S SIGNED US ON FOR ANOTHER MISSION"], [2, "WHAT'S THE TARGET?"], [3, "A TRANSPORT CHOPPER BELIEVED TO BE CARRYING MUNITIONS TO THE REBELS"], [3, "I'M SENDING YOU THE COORDINATES"], [2, "GOT THEM. ON MY WAY."]];
convo3 = [[1, "INCOMING CALL..."], [3, "EASY MONEY EH? HAHA!"], [2, "NOTHING I CAN'T HANDLE"], [3, "GLAD TO HEAR IT BECAUSE YOUR DAY ISN'T OVER YET."], [2, "WHERE AM I HEADED?"], [3, "NOT FAR. IT SEEMS OUR CLIENTS ENEMIES ARE MASSING FOR AN ATTACK."], [2, "AND HE WANTS ME TO HIT THEM FIRST?"], [3, "YOU ALWAYS WERE MY BRIGHTEST STUDENT. DO ME PROUD."], [2, "SINCE WHEN WAS PRIDE INVOLVED?"], [3, "HAHAHA, YOU'RE RIGHT, GO MAKE ME MONEY!"]];
convo4 = [[1, "INTERCEPTING TRANSMISSION..."], [4, "WHY IS HE NOT DEAD YET?"], [3, "HE'S BETTER THAN I THOUGHT..."], [1, "SIGNAL LOST"], [1, "INCOMING CALL..."], [3, "COME IN RED RAGE"], [2, "I'M HERE"], [3, "GOOD, I HAVE THE DETAILS OF YOUR NEXT MISSION."], [2, "SEND THEM OVER."], [3, "THEY SHOULD BE ON YOUR SCREEN NOW. ONE THING, THERE MIGHT BE MORE RESISTANCE THIS TIME"], [2, "WHAT HAPPENED TO NOT ACCEPTING DANGEROUS MISSIONS?"], [3, "HAHA, MONEY FIRST RED, BESIDES, YOU CAN HANDLE IT RIGHT?"], [2, "CONSIDER IT DONE"]];
convo5 = [[1, "INTERCEPTING TRANSMISSION..."], [4, "YOU TOLD ME HE WOULD BE DEAD BY NOW! WHAT AM I PAYING YOU FOR?"], [3, "RED RAGE IS AN EXPERT PILOT, I TRAINED HIM MYSELF. KILLING HIM IS NOT SUCH AN EASY TASK."], [4, "THAT IS NOT MY CONCERN. GET THE JOB DONE OR THERE WILL BE A BOUNTY ON YOUR HEAD NEXT!"], [3, "OF COURSE. PERHAPS IF THE MONEY WAS DOUBLED THE JOB MIGHT PROCEED AT A FASTER PACE?"], [4, "DO NOT PRESUME TO BARGAIN WITH ME CAPTAIN, YOU WILL GET THE MONEY I ORIGINALY OFFERED YOU AND NO MORE."], [3, "OF COURSE, OF COURSE. LEAVE IT WITH ME, THIS NEXT MISSION SHOULD FINISH HIM OFF."]];
convo6 = [[1, "DIALING..."], [3, "RED RAGE?"], [2, "YOU SEEM SUPPRISED TO HEAR MY VOICE CAPTAIN."], [3, "...NO OF COURSE NOT, IT'S GOOD TO HEAR THE MISSION WAS A SUCCESS."], [2, "HA, NOT EVEN SLIGHTLY DISAPOINTED? AFTER ALL YOU WERE OFFERED A LOT OF MONEY FOR MY DEATH NO DOUBT?"], [3, "SO YOU KNOW. YOU ALWAYS WERE GOOD RED, IN FACT IT WAS A SHAME I WAS OFFERED SO MUCH FOR YOU"], [2, "WHY DID YOU DO IT?"], [3, "MONEY FIRST, THAT'S THE CODE. NO HARD FEELINGS. NOW RUN WHILE YOU CAN"], [2, "RUN? HA, NOT BEFORE I TAKE YOU DOWN"], [3, "DON'T BE STUPID RED, MY SHIP OUTGUNS YOU TEN TIMES OVER. YOU DON'T STAND A CHANCE"], [2, "WE SHALL SEE"]];
stop();
stage.quality = StageQuality.LOW;
keyboardControl = true;
downKeys = {};
SoundMixer.soundTransform = new SoundTransform(1, 0);
dialogMusic = new musicdialog();
gameMusic = new musicgame();
warning1Music = new musicwarning1();
warning2Music = new musicwarning2();
bossMusic = new musicboss();
finalMusic = new musicfinalboss();
mute = new muteic();
soundOn = true;
currentChannel = 1;
gameState = "title";
transto = "game";
shipSpeed = 8;
gamePaused = false;
respawn = 0;
invincible = 0;
offsetX = 0;
stageRect = new Rectangle(0, 0, (stageW + 80), stageH);
powerRect = new Rectangle(0, 0, (stageW + 160), stageH);
bmp = new BitmapData(stageW, stageH, true, 0);
bit = new Bitmap(bmp);
bgbmp = new BitmapData((stageW + 80), stageH, true, 0);
bgbit = new Bitmap(bgbmp);
powerbmp = new BitmapData((stageW + 160), stageH, true, 0);
powerbit = new Bitmap(powerbmp);
bossbmp = new BitmapData(stageW, stageH, true, 0);
enemybmp = new BitmapData(stageW, stageH, true, 0);
lazerSprite = new Sprite();
menchange = new menuchange();
menselect = new menuselect();
explosion1 = new explode1();
explosion2 = new explode2();
explosion3 = new explode3();
powerupsound = new levelup();
incomingcall = new makingcall();
textsound = new textplay();
startcall = new opencall();
hangup = new callend();
bullethit = new hit1();
buysound = new kaching();
reportping = new reportsound();
psychosound = new psycho();
bit.x = offsetX;
bgbit.x = offsetX;
dispCT = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
gameCT = new ColorTransform(1, 1, 1, 0, 0, 0, 0, 0);
psyco = false;
psycoMeter = 0;
interTimer = 0;
convoPo = -1;
stringPo = 0;
textTimer = 0;
hitTimer = 0;
explosions = new Array();
bullets = new Array();
badBullets = new Array();
planes = new Array();
stealthPlanes = new Array();
choppers = new Array();
bombers = new Array();
launchers = new Array();
emitters = new Array();
clouds = new Array();
spinners = new Array();
rocketShips = new Array();
options = new Array();
monies = new Array();
particles = new Array();
missiles = new Array();
bosses = new Array();
powertexts = new Array();
nextTimer = 0;
nextAt = 0;
levelPointer = 0;
menuSelect = 1;
enemies = 0;
shoot = 3;
gun = 1;
xshoot = 0;
xshootm = 10;
health = 1;
lives = 5;
reportTimer = 80;
score = 0;
currentScore = 0;
kills = 0;
shakeTimer = 0;
shake = 0;
powerNum = 0;
explosionsList = [];
explosionsTimer = 0;
bgSpeed = 8;
level = 1;
boosttimer = 5;
endLevel = 0;
pbar = new power();
cover = new powerbarcover();
hbar = new healthbar();
cover2 = new powerbarcover();
shipType = 1;
MochiServices.connect("784f7ef34b7cc8d9", root);
this.addEventListener(Event.ENTER_FRAME, update);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mousedown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseup);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousemove);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyup);
init();
ScoreSubmitter.gameId = 524;
ScoreSubmitter.gameVersion = "1.0";
ScoreSubmitter.gameValidationCode = "pyro4363cf1f2377f50444922b47359a137e";
}
public function newCloud(_arg1:int):void{
var _local2:cloud;
_local2 = new cloud();
bg.addChild(_local2);
_local2.x = (Math.random() * stageW);
_local2.y = _arg1;
_local2.scaleX = ((Math.random() * 0.5) + 0.5);
_local2.scaleY = _local2.scaleX;
_local2.gotoAndStop((int((Math.random() * 5)) + 1));
clouds.push(_local2);
}
public function newBomber(_arg1:int):void{
var _local2:bomber;
enemies++;
_local2 = new bomber();
_local2.x = _arg1;
_local2.y = -100;
_local2.rot = 0;
_local2.shootTime = 10;
_local2.health = (40 + int((gun * 8)));
bombers.push(_local2);
game.addChild(_local2);
}
public function newRocket(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:rocket;
var _local5:*;
_local4 = new rocket();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.speed = 9;
_local4.rotSpeed = 2;
_local4.rotation = _arg3;
_local4.rot = _arg3;
_local4.homing = false;
_local5 = (_arg3 * (Math.PI / 180));
_local4.xv = (Math.cos(_local5) * _local4.speed);
_local4.yv = (Math.sin(_local5) * _local4.speed);
_local4.health = 8;
_local4.timer = 3;
game.addChild(_local4);
missiles.push(_local4);
}
public function newChopper(_arg1:int):void{
var _local2:enemychopper1;
enemies++;
_local2 = new enemychopper1();
_local2.y = -100;
_local2.x = (80 + (_arg1 * 180));
_local2.health = (40 + int((gun * 5)));
_local2.shootTime = 10;
_local2.ang = 90;
_local2.turnDir = int((Math.random() * 2));
choppers.push(_local2);
game.addChild(_local2);
}
public function updateConvo():void{
var _local1:Array;
var _local2:String;
if (interTimer == 0){
if (textTimer == 0){
convoPo++;
_local1 = this[("convo" + level)][convoPo];
gui.callPannel.gotoAndStop((_local1[0] + 1));
gui.calltext.txt.text = "";
};
_local1 = this[("convo" + level)][convoPo];
_local2 = _local1[1];
if ((((((_local2 == "INCOMING CALL...")) || ((_local2 == "DIALING...")))) || ((_local2 == "INTERCEPTING TRANSMISSION...")))){
if (textTimer == 5){
incomingcall.play();
};
if (textTimer == (_local2.length + 75)){
startcall.play();
};
} else {
if (textTimer < _local2.length){
textsound.play();
};
};
gui.calltext.txt.appendText(_local2.charAt(textTimer));
textTimer++;
if (textTimer == (_local2.length + 90)){
if (convoPo < (this[("convo" + level)].length - 1)){
textTimer = 0;
} else {
gui.callPannel.gotoAndStop(2);
hangup.play();
gui.calltext.txt.text = "CALL TERMINATED \n PRESS ENTER TO ENGAGE";
};
};
};
}
public function newBoss5():void{
var _local1:boss5;
enemies++;
_local1 = new boss5();
_local1.timers = [200, 300, 100, 300, 200, 300];
_local1.patterns1 = [6, 8, 0, 2, 1, 0];
_local1.patterns2 = [6, 8, 0, 2, 1, 0];
_local1.patterns3 = [0, 0, 7, 0, 0, 7];
_local1.patterns = 3;
_local1.moves = [[(stageW / 2), 150], [(stageW / 2), 250], [((stageW / 2) + (stageW / 4)), 150], [(stageW / 2), 150], [(stageW / 2), 250], [(stageW / 4), 150]];
_local1.movePo = 0;
_local1.movesNum = 5;
_local1.moveTimer = 300;
_local1.x = _local1.moves[0][0];
_local1.y = -350;
_local1.loc1 = [-100, 50];
_local1.loc2 = [100, 50];
_local1.loc3 = [0, 60];
_local1.shealth = 3000;
_local1.health = 3000;
_local1.attackTimer = 0;
_local1.pos = -1;
_local1.num = 5;
bosses.push(_local1);
game.removeChild(WARNING);
game.addChild(WARNING);
game.addChild(_local1);
}
public function newBoss6():void{
var _local1:boss6;
enemies++;
_local1 = new boss6();
_local1.timers = [200, 200, 200, 100, 200, 300];
_local1.patterns1 = [3, 0, 4, 0, 7, 8];
_local1.patterns2 = [3, 0, 4, 0, 7, 8];
_local1.patterns3 = [0, 11, 0, 5, 0, 0];
_local1.patterns = 3;
_local1.moves = [[(stageW / 2), 250], [(stageW / 2), 100], [((stageW / 2) - 100), 100], [((stageW / 2) + 100), 100]];
_local1.movePo = 0;
_local1.movesNum = 3;
_local1.x = _local1.moves[0][0];
_local1.y = -350;
_local1.moveTimer = 300;
_local1.loc1 = [-100, -30];
_local1.loc2 = [100, -30];
_local1.loc3 = [0, -50];
_local1.shealth = 3500;
_local1.health = 3500;
_local1.attackTimer = 0;
_local1.pos = -1;
_local1.num = 6;
bosses.push(_local1);
game.removeChild(WARNING);
game.addChild(WARNING);
game.addChild(_local1);
}
public function newBoss1():void{
var _local1:boss1;
enemies++;
_local1 = new boss1();
_local1.timers = [200, 300, 100, 300, 200, 300];
_local1.patterns1 = [1, 9, 0, 9, 1, 9];
_local1.patterns2 = [1, 9, 0, 9, 1, 9];
_local1.patterns3 = [0, 0, 3, 0, 0, 0];
_local1.moves = [[(stageW / 2), 150], [((stageW / 2) + (stageW / 4)), 150], [(stageW / 2), 150], [(stageW / 4), 150]];
_local1.movePo = 0;
_local1.movesNum = 3;
_local1.moveTimer = 300;
_local1.x = _local1.moves[0][0];
_local1.y = -350;
_local1.patterns = 3;
_local1.loc1 = [-100, 0];
_local1.loc2 = [100, 0];
_local1.loc3 = [0, 60];
_local1.shealth = 600;
_local1.health = 600;
_local1.attackTimer = 0;
_local1.pos = -1;
_local1.num = 1;
bosses.push(_local1);
game.removeChild(WARNING);
game.addChild(WARNING);
game.addChild(_local1);
}
public function newBoss2():void{
var _local1:boss2;
enemies++;
_local1 = new boss2();
_local1.rotation = 90;
_local1.timers = [200, 200, 200, 200, 200];
_local1.patterns1 = [3, 10, 0, 0, 10];
_local1.patterns2 = [0, 10, 5, 3, 10];
_local1.patterns = 2;
_local1.moves = [[(stageW / 2), 150], [((stageW / 2) + (stageW / 4)), 200], [(stageW / 2), 150], [(stageW / 4), 200]];
_local1.movePo = 0;
_local1.movesNum = 3;
_local1.moveTimer = 300;
_local1.x = _local1.moves[0][0];
_local1.y = -350;
_local1.loc1 = [-50, 0];
_local1.loc2 = [50, 0];
_local1.shealth = 1000;
_local1.health = 1000;
_local1.attackTimer = 0;
_local1.pos = -1;
_local1.num = 2;
bosses.push(_local1);
game.removeChild(WARNING);
game.addChild(WARNING);
game.addChild(_local1);
}
public function newBoss3():void{
var _local1:boss3;
enemies++;
_local1 = new boss3();
_local1.timers = [200, 200, 200, 200, 200];
_local1.patterns1 = [1, 6, 1, 10, 6];
_local1.patterns2 = [1, 6, 1, 10, 6];
_local1.patterns = 2;
_local1.moves = [[(stageW / 2), 150], [(stageW / 2), 300], [((stageW / 2) + (stageW / 4)), 150], [(stageW / 2), 150], [(stageW / 2), 300], [(stageW / 4), 150]];
_local1.movePo = 0;
_local1.movesNum = 5;
_local1.moveTimer = 300;
_local1.x = _local1.moves[0][0];
_local1.y = -350;
_local1.loc1 = [-100, 20];
_local1.loc2 = [100, 20];
_local1.shealth = 1800;
_local1.health = 1800;
_local1.attackTimer = 0;
_local1.pos = -1;
_local1.num = 3;
bosses.push(_local1);
game.removeChild(WARNING);
game.addChild(WARNING);
game.addChild(_local1);
}
public function explodeSound():void{
var _local1:int;
_local1 = ((Math.random() * 3) + 1);
this[("explosion" + _local1)].play();
}
public function newPowerup(_arg1:int, _arg2:int):void{
var _local3:money;
var _local4:int;
var _local5:int;
var _local6:Number;
_local3 = new money();
_local3.x = _arg1;
_local3.y = _arg2;
_local4 = ((Math.random() * stageW) - _arg1);
_local5 = -(_arg2);
_local6 = Math.atan2(_local5, _local4);
_local3.xv = (Math.cos(_local6) * 12);
_local3.yv = (Math.sin(_local6) * 12);
_local3.rotation = (Math.random() * 360);
game.addChild(_local3);
monies.push(_local3);
}
public function updatePowertexts():void{
var _local1:int;
var _local2:powertext;
_local1 = 0;
while (_local1 < powertexts.length) {
_local2 = powertexts[_local1];
_local2.y = (_local2.y + (bgSpeed * 2));
if (_local2.y > (stageH + 100)){
powerbg.removeChild(_local2);
powertexts.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function firePattern(_arg1:int, _arg2:Array, _arg3:int):void{
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
if (_arg1 == 1){
if ((_arg3 % 2) == 0){
_local4 = ((_arg3 * 10) * (Math.PI / 180));
newBadBullet(2, _arg2[0], _arg2[1], (Math.cos(_local4) * 5), (Math.sin(_local4) * 5));
};
} else {
if (_arg1 == 2){
if ((_arg3 % 40) == 0){
_local6 = (Math.random() * 360);
_local5 = 0;
while (_local5 < 18) {
_local4 = (((_local5 * 20) + _local6) * (Math.PI / 180));
newBadBullet(5, _arg2[0], _arg2[1], (Math.cos(_local4) * 5), (Math.sin(_local4) * 5));
_local5++;
};
};
} else {
if (_arg1 == 3){
if ((_arg3 % 50) == 0){
newBadBullet(3, _arg2[0], _arg2[1], 3, 4);
newBadBullet(3, _arg2[0], _arg2[1], 0, 6);
newBadBullet(3, _arg2[0], _arg2[1], -3, 4);
};
} else {
if (_arg1 == 4){
if ((_arg3 % 50) == 0){
_local7 = 0;
while (_local7 < 30) {
_local4 = ((_local7 * 6) * (Math.PI / 180));
newBadBullet(2, _arg2[0], _arg2[1], (Math.cos(_local4) * 4), (Math.sin(_local4) * 4));
_local7++;
};
};
} else {
if (_arg1 == 5){
if ((_arg3 % 100) == 0){
newMissile(_arg2[0], _arg2[1], 60);
newMissile((_arg2[0] - 100), _arg2[1], 120);
};
} else {
if (_arg1 == 6){
if ((_arg3 % 10) == 0){
_local4 = ((Math.random() * 180) * (Math.PI / 180));
newBadBullet(6, _arg2[0], _arg2[1], (Math.cos(_local4) * 5), (Math.sin(_local4) * 5));
};
} else {
if (_arg1 == 7){
if ((_arg3 % 40) == 0){
_local5 = 0;
while (_local5 < 6) {
_local4 = (_local5 * 36);
newRocket(_arg2[0], _arg2[1], _local4);
_local5++;
};
};
} else {
if (_arg1 == 8){
_local4 = ((Math.random() * 360) * (Math.PI / 180));
newBadBullet(8, _arg2[0], _arg2[1], (Math.cos(_local4) * 3), (Math.sin(_local4) * 3));
} else {
if (_arg1 == 9){
if ((_arg3 % 4) == 0){
_local4 = ((Math.random() * 360) * (Math.PI / 180));
newBadBullet(9, _arg2[0], _arg2[1], (Math.cos(_local4) * 3), (Math.sin(_local4) * 3));
};
} else {
if (_arg1 == 10){
if ((_arg3 % 50) == 0){
_local5 = 0;
while (_local5 < 15) {
_local4 = ((_local5 * 12) * (Math.PI / 180));
newBadBullet(10, _arg2[0], _arg2[1], (Math.cos(_local4) * 5), (Math.sin(_local4) * 5));
_local5++;
};
};
} else {
if (_arg1 == 11){
if ((_arg3 % 15) == 0){
_local8 = (200 - _arg3);
newRocket((_arg2[0] + _local8), _arg2[1], 90);
newRocket((_arg2[0] - _local8), _arg2[1], 90);
};
};
};
};
};
};
};
};
};
};
};
};
}
public function updatelogo1(_arg1:Event):void{
timer2++;
if (timer2 >= 20){
this.removeEventListener(Event.ENTER_FRAME, updatelogo1);
gotoAndStop(8);
};
}
public function updatelogo3(_arg1:Event):void{
timer3++;
if (timer3 >= 100){
this.removeEventListener(Event.ENTER_FRAME, updatelogo3);
stage.removeEventListener(MouseEvent.MOUSE_UP, getLink3);
gotoAndStop(7);
};
}
public function updatelogo5(_arg1:Event):void{
timer5++;
if (timer5 >= 96){
this.removeEventListener(Event.ENTER_FRAME, updatelogo5);
stage.removeEventListener(MouseEvent.MOUSE_UP, getLink5);
gotoAndStop(5);
};
}
public function newBoss4():void{
var _local1:boss4;
enemies++;
_local1 = new boss4();
_local1.timers = [200, 200, 200, 200, 200];
_local1.patterns1 = [5, 3, 2, 4, 2];
_local1.patterns2 = [5, 3, 2, 4, 2];
_local1.patterns = 2;
_local1.moves = [[(stageW / 4), 150], [((stageW / 2) + (stageW / 4)), 150]];
_local1.movePo = 0;
_local1.movesNum = 1;
_local1.moveTimer = 300;
_local1.x = _local1.moves[0][0];
_local1.y = -350;
_local1.loc1 = [-90, 0];
_local1.loc2 = [90, 0];
_local1.shealth = 2500;
_local1.health = 2500;
_local1.attackTimer = 0;
_local1.pos = -1;
_local1.num = 4;
bosses.push(_local1);
game.removeChild(WARNING);
game.addChild(WARNING);
game.addChild(_local1);
}
public function update(_arg1:Event):void{
var _local2:Matrix;
var _local3:Matrix;
var _local4:Matrix;
var _local5:Matrix;
var _local6:Matrix;
var _local7:String;
var _local8:Matrix;
var _local9:Matrix;
var _local10:Matrix;
updateMusic();
if ((((mute.currentFrame == 30)) || ((mute.currentFrame == 61)))){
mute.x = -500;
};
if (gameState == "title"){
updateTitle();
updateClouds();
bgbmp.colorTransform(stageRect, dispCT);
_local2 = new Matrix();
bgbmp.draw(bg, _local2);
} else {
if (gameState == "gameover"){
updateClouds();
updateGameOver();
bgbmp.colorTransform(stageRect, dispCT);
_local3 = new Matrix();
bgbmp.draw(bg, _local3);
} else {
if ((((((gameState == "interlevel")) || ((gameState == "selectShip")))) || ((gameState == "shipSelected")))){
updateConvo();
bmp.colorTransform(stageRect, dispCT);
bgbmp.colorTransform(stageRect, dispCT);
_local4 = new Matrix();
_local4.translate(game.x, game.y);
updateClouds();
updateShip();
updateParticles();
gameCT = new ColorTransform(1, 1, 1, 1, (Math.random() * 150), (Math.random() * 150), (Math.random() * 150), 0);
bmp.draw(game, _local4, gameCT);
bgbmp.draw(bg, _local4);
SCROLLER.x = (SCROLLER.x + 4);
if (SCROLLER.x > (stageW + 570)){
SCROLLER.x = 0;
};
} else {
if (gameState == "trans"){
transition();
} else {
if (gameState == "credits"){
updateClouds();
updateParticles();
bmp.colorTransform(stageRect, dispCT);
bgbmp.colorTransform(stageRect, dispCT);
_local5 = new Matrix();
_local5.translate(game.x, game.y);
bgbmp.draw(bg, _local5);
} else {
if (gameState == "report"){
updateReport();
updateClouds();
updateParticles();
bmp.colorTransform(stageRect, dispCT);
bgbmp.colorTransform(stageRect, dispCT);
powerbmp.colorTransform(powerRect, dispCT);
_local6 = new Matrix();
_local6.translate(game.x, game.y);
gameCT = new ColorTransform(1, 1, 1, 1, (Math.random() * 150), (Math.random() * 150), (Math.random() * 150), 0);
bmp.draw(game, _local6, gameCT);
bgbmp.draw(bg, _local6);
} else {
if ((((gameState == "game")) || ((gameState == "endLevel")))){
if (lives < 10){
gui.lives1.text = "";
gui.lives2.text = String(lives);
} else {
_local7 = String(lives);
gui.lives1.text = _local7.charAt(0);
gui.lives2.text = _local7.charAt(1);
};
if (!gamePaused){
bossbmp.fillRect(stageRect, 0);
enemybmp.fillRect(stageRect, 0);
lazerSprite.graphics.clear();
if (hitTimer > 0){
hitTimer--;
};
updateOptions();
updateExplosions();
updateBosses();
updateBullets();
updateBadBullets();
updateEmitters();
updateSmallPlanes();
updateStealthPlanes();
updateChoppers();
updateBombers();
updateLaunchers();
updateRocketShips();
updateMissiles();
updateClouds();
updateSpinners();
updateMoney();
updateScore();
updateParticles();
updateGame();
updatePowertexts();
updateShip();
if (shakeTimer > 0){
game.x = ((Math.random() * shake) - (Math.random() * shake));
game.y = ((Math.random() * shake) - (Math.random() * shake));
shakeTimer--;
} else {
game.x = 0;
game.y = 0;
};
bmp.colorTransform(stageRect, dispCT);
bgbmp.colorTransform(stageRect, dispCT);
powerbmp.colorTransform(powerRect, dispCT);
_local8 = new Matrix();
_local8.translate(game.x, game.y);
_local9 = new Matrix();
_local9.scale(1, (psycoMeter / 100));
_local9.translate(560, 530);
_local10 = new Matrix();
_local10.scale(1, 1);
_local10.translate(40, 530);
if (psyco == true){
psycoMeter = (psycoMeter - 0.6);
gui.pbar.height = (4.3 * psycoMeter);
if (psycoMeter <= 0){
psycoMeter = 0;
psyco = false;
powerbg = new Sprite();
powertexts = [];
dispCT = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
ship.scaleX = 1;
ship.scaleY = 1;
};
powerNum--;
if (powerNum <= 0){
powerNum = 2;
newPowertext();
};
gameCT = new ColorTransform(1, 1, 1, 1, (Math.random() * 0xFF), (Math.random() * 0xFF), (Math.random() * 0xFF), 0);
bmp.draw(game, _local8, gameCT);
bgbmp.draw(powerbg, _local8);
} else {
gameCT = new ColorTransform(1, 1, 1, 1, (Math.random() * 150), (Math.random() * 150), (Math.random() * 150), 0);
bmp.draw(game, _local8, gameCT);
bgbmp.draw(bg, _local8);
};
};
};
};
};
};
};
};
};
}
public function loadScores():void{
var o:Object;
var boardID:String;
o = {n:[9, 15, 2, 10, 7, 6, 8, 5, 8, 5, 9, 11, 0, 8, 3, 3], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "9f2a7685859b0833");
MochiScores.showLeaderboard({onClose:function (){
closeBoard();
}, boardID:boardID});
}
public function explode(_arg1:int, _arg2:int, _arg3:Number):void{
var _local4:int;
_local4 = 0;
while (_local4 < (4 + _arg3)) {
newExplosion(_arg1, _arg2, _arg3);
_local4++;
};
}
public function updateChoppers():void{
var _local1:int;
var _local2:enemychopper1;
var _local3:int;
var _local4:int;
var _local5:Matrix;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = 0;
while (_local1 < choppers.length) {
_local2 = choppers[_local1];
_local3 = (ship.x - _local2.x);
_local4 = (ship.y - _local2.y);
if (((_local3 * _local3) + (_local4 * _local4)) < 900){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 4);
shakeTimer = 14;
shake = 15;
game.removeChild(_local2);
choppers.splice(_local1, 1);
_local1--;
playerHit();
playerHit();
playerHit();
} else {
if (_local2.y < 100){
_local2.y = (_local2.y + 5);
} else {
if (_local2.turnDir == 0){
_local2.ang = (_local2.ang + 1);
if (_local2.ang == 145){
_local2.turnDir = 1;
};
} else {
_local2.ang = (_local2.ang - 1);
if (_local2.ang == 35){
_local2.turnDir = 0;
};
};
_local2.shootTime--;
if (_local2.shootTime <= 0){
_local2.shootTime = 12;
_local6 = (_local2.ang * (Math.PI / 180));
_local7 = (Math.cos(_local6) * 8);
_local8 = (Math.sin(_local6) * 8);
newBadBullet(1, (_local2.x + (_local7 * 5)), (_local2.y + (_local8 * 5)), _local7, _local8);
};
};
_local2.rotation = _local2.ang;
_local2.blades.rotation = (_local2.blades.rotation + 12);
_local5 = new Matrix();
_local5.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local5);
if (_local2.health <= 0){
kills++;
enemies--;
addScore(999);
explodeSound();
explode(_local2.x, _local2.y, 4);
shakeTimer = 14;
shake = 15;
game.removeChild(_local2);
choppers.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
public function updateSmallPlanes():void{
var _local1:int;
var _local2:plane;
var _local3:int;
var _local4:int;
var _local5:Matrix;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
_local1 = 0;
while (_local1 < planes.length) {
_local2 = planes[_local1];
_local3 = (ship.x - _local2.x);
_local4 = (ship.y - _local2.y);
if (((_local3 * _local3) + (_local4 * _local4)) <= (_local2.rad * _local2.rad)){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 1);
shakeTimer = 8;
shake = 5;
game.removeChild(_local2);
planes.splice(_local1, 1);
_local1--;
playerHit();
} else {
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
_local5 = new Matrix();
_local5.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local5);
_local2.pos++;
if (_local2.pos < (_local2.path.length - 1)){
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 0;
if (_local2.xm == false){
_local6 = _local2.path[_local2.pos][0];
_local8 = _local2.path[(_local2.pos + 1)][0];
} else {
_local6 = (stageW - _local2.path[_local2.pos][0]);
_local8 = (stageW - _local2.path[(_local2.pos + 1)][0]);
};
if (_local2.ym == false){
_local7 = _local2.path[_local2.pos][1];
_local9 = _local2.path[(_local2.pos + 1)][1];
} else {
_local7 = (stageH - _local2.path[_local2.pos][1]);
_local9 = (stageH - _local2.path[(_local2.pos + 1)][1]);
};
_local10 = Math.atan2((_local9 - _local7), (_local8 - _local6));
_local2.rot = _local10;
_local2.xv = (Math.cos(_local10) * _local2.speed);
_local2.yv = (Math.sin(_local10) * _local2.speed);
_local2.rotation = (_local10 * (180 / Math.PI));
} else {
if ((((((((_local2.x < -30)) || ((_local2.x > (stageW + 30))))) || ((_local2.y < -30)))) || ((_local2.y > (stageH + 30))))){
enemies--;
game.removeChild(_local2);
planes.splice(_local1, 1);
_local1--;
};
};
if ((((((((((_local2.health <= 0)) && ((_local2.x > -30)))) && ((_local2.x < (stageW + 30))))) && ((_local2.y > -30)))) && ((_local2.y < (stageH + 30))))){
kills++;
enemies--;
addScore(102);
explodeSound();
explode(_local2.x, _local2.y, 1);
shakeTimer = 8;
shake = 5;
game.removeChild(_local2);
planes.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
public function newRocketShip(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:rocketship;
var _local5:Number;
_local4 = new rocketship();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.rotation = _arg3;
_local5 = (_arg3 * (Math.PI / 180));
_local4.xv = (Math.cos(_local5) * 6);
_local4.yv = (Math.sin(_local5) * 6);
_local4.timer = 0;
_local4.deathTimer = 60;
_local4.health = (5 + int((gun * 2)));
game.addChild(_local4);
rocketShips.push(_local4);
enemies++;
}
public function playerHit():void{
if ((((invincible == 0)) && ((psyco == false)))){
health--;
if (health <= 0){
playerDie();
};
};
}
public function init():void{
var _local1:int;
addChild(bgbit);
addChild(bit);
game = new Sprite();
game.addChild(lazerSprite);
bg = new Sprite();
powerbg = new Sprite();
gui = new GUI();
TITLE = new titlescreen();
addChild(TITLE);
GAMEOVER = new gameover();
addChild(GAMEOVER);
GAMEOVER.x = -800;
SCORES = new scores();
addChild(SCORES);
SCORES.x = -800;
CREDITS = new credits();
addChild(CREDITS);
CREDITS.x = -800;
_local1 = 0;
while (_local1 < 10) {
newCloud(((Math.random() * (stageH * 2)) - stageH));
_local1++;
};
TRANS = new trans();
addChild(TRANS);
addChild(mute);
mute.y = (stageH / 2);
mute.x = -500;
mute.scaleX = 0.5;
mute.scaleY = 0.5;
}
public function updateStealthPlanes():void{
var _local1:int;
var _local2:stealthplane;
var _local3:int;
var _local4:int;
var _local5:Matrix;
var _local6:Number;
_local1 = 0;
while (_local1 < stealthPlanes.length) {
_local2 = stealthPlanes[_local1];
_local3 = (ship.x - _local2.x);
_local4 = (ship.y - _local2.y);
if (((_local3 * _local3) + (_local4 * _local4)) <= (_local2.rad * _local2.rad)){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 1);
shakeTimer = 8;
shake = 6;
game.removeChild(_local2);
stealthPlanes.splice(_local1, 1);
_local1--;
playerHit();
} else {
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
_local5 = new Matrix();
_local5.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local5);
_local2.turnTime--;
if (_local2.turnTime <= 0){
_local2.rotation = (_local2.rotation + _local2.turn);
_local6 = (_local2.rotation * (Math.PI / 180));
_local2.xv = (Math.cos(_local6) * _local2.speed);
_local2.yv = (Math.sin(_local6) * _local2.speed);
};
if ((((_local2.turnTime <= 0)) && ((((((((_local2.x < -30)) || ((_local2.x > (stageW + 30))))) || ((_local2.y < -30)))) || ((_local2.y > (stageH + 30))))))){
enemies--;
game.removeChild(_local2);
stealthPlanes.splice(_local1, 1);
_local1--;
} else {
if (_local2.health <= 0){
kills++;
enemies--;
addScore(367);
explodeSound();
explode(_local2.x, _local2.y, 1);
shakeTimer = 8;
shake = 6;
game.removeChild(_local2);
stealthPlanes.splice(_local1, 1);
_local1--;
};
};
};
_local1++;
};
}
public function clearLevel():void{
bmp.fillRect(stageRect, 0);
levelPointer = 0;
nextTimer = 0;
nextAt = 0;
kills = 0;
}
public function endTrack():void{
if (currentChannel == 1){
currentChannel = 2;
channel2.soundTransform = new SoundTransform(0, 0);
channel1.soundTransform = new SoundTransform(1, 0);
} else {
currentChannel = 1;
channel1.soundTransform = new SoundTransform(0, 0);
channel2.soundTransform = new SoundTransform(1, 0);
};
}
public function keyup(_arg1:KeyboardEvent):void{
var _local2:int;
if (gameState == "game"){
if (keyboardControl == true){
if (_arg1.keyCode == 32){
psyco = false;
powerbg = new Sprite();
powertexts = [];
dispCT = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
ship.scaleX = 1;
ship.scaleY = 1;
_local2 = 0;
while (_local2 < bullets.length) {
bullets[_local2].scaleX = 1;
bullets[_local2].scaleY = 1;
bullets[_local2].damage = (bullets[_local2].damage / 2);
_local2++;
};
};
downKeys[("key" + _arg1.keyCode)] = false;
};
};
}
public function onScoreResponse(_arg1:ServerResponseEvent):void{
switch (_arg1.returnCode){
case ScoreSubmitter.RETURNCODE_WORKING:
break;
case ScoreSubmitter.RETURNCODE_SUCCESS:
ScoreSubmitter.loadHighScorePage();
break;
case ScoreSubmitter.RETURNCODE_REJECTED:
break;
case ScoreSubmitter.RETURNCODE_WRONGVERSION:
ScoreSubmitter.loadUpdatePage();
break;
case ScoreSubmitter.RETURNCODE_NETWORKERROR:
break;
default:
break;
};
}
public function newExplosion(_arg1:int, _arg2:int, _arg3:Number):void{
var _local4:explosion;
var _local5:Number;
_local4 = new explosion();
_local4.x = ((_arg1 + (Math.random() * (5 + (5 * _arg3)))) - (Math.random() * (5 + (5 * _arg3))));
_local4.y = ((_arg2 + (Math.random() * (5 + (5 * _arg3)))) - (Math.random() * (5 + (5 * _arg3))));
_local4.scaleX = (((Math.random() * (0.5 + (_arg3 / 4))) + 0.3) + (_arg3 / 4));
_local4.scaleY = _local4.scaleX;
if (psyco == true){
_local4.scaleX = (_local4.scaleX * 1.5);
_local4.scaleY = (_local4.scaleY * 1.5);
};
_local4.gotoAndStop((int((Math.random() * 5)) + 1));
_local4.rotation = (Math.random() * 360);
_local5 = ((Math.random() * 360) * (Math.PI / 180));
_local4.xv = (Math.cos(_local5) * 6);
_local4.yv = (Math.sin(_local5) * 6);
_local4.timer = 5;
_local4.s = _arg3;
explosions.push(_local4);
game.addChild(_local4);
}
public function transition():void{
if (TRANS.currentFrame == 27){
if (transto == "game"){
TITLE.x = -800;
switchTrack(dialogMusic);
startGame();
} else {
if (transto == "report"){
REPORT.x = 0;
REPORT.purchasetxt.gotoAndStop(1);
REPORT.presskey.y = 800;
REPORT.btn1.y = 474;
REPORT.btn2.y = 519;
reportTimer = 80;
REPORT.leveltxt.text = ("LEVEL " + String(level));
menuSelect = 1;
gui.x = -800;
gameState = "report";
if (level == 6){
REPORT.purchasetxt.gotoAndStop(3);
REPORT.btn1.y = 800;
REPORT.btn2.y = 800;
REPORT.presskey.y = 500;
};
} else {
if (transto == "credits"){
CREDITS.x = 0;
TITLE.x = -800;
gameState = "credits";
} else {
if (transto == "nextlevel"){
gui.x = 0;
REPORT.x = -800;
clearLevel();
addChild(SCROLLER);
level++;
SCROLLER.txt.text = (("LEVEL " + level) + " - PRESS ENTER KEY TO ENGAGE.");
SCROLLER.x = 0;
interTimer = 0;
convoPo = -1;
textTimer = 0;
gameState = "interlevel";
ship.y = (stageH + 100);
} else {
if (transto == "gameover"){
gui.x = -800;
GAMEOVER.x = 0;
REPORT.x = -800;
clearLevel();
endGame();
gameState = "gameover";
level = 1;
} else {
if (transto == "title"){
stage.quality = StageQuality.LOW;
TITLE.x = 0;
menuSelect = 1;
GAMEOVER.x = -800;
SCORES.x = -800;
CREDITS.x = -800;
gameState = "title";
} else {
if (transto == "scores"){
stage.quality = StageQuality.BEST;
TITLE.x = -800;
menuSelect = 1;
SCORES.x = 0;
gameState = "scores";
loadScores();
};
};
};
};
};
};
};
};
}
public function updateSpinners():void{
var _local1:int;
var _local2:spinner;
var _local3:Matrix;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local1 = 0;
while (_local1 < spinners.length) {
_local2 = spinners[_local1];
_local2.y++;
_local3 = new Matrix();
_local3.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local3);
_local2.shotTime--;
_local4 = (ship.x - _local2.x);
_local5 = (ship.y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) < 900){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 3);
shakeTimer = 20;
shake = 7;
game.removeChild(_local2);
spinners.splice(_local1, 1);
_local1--;
playerHit();
playerHit();
} else {
if (_local2.shotTime <= 0){
_local2.shotTime = 100;
_local6 = 0;
while (_local6 < 5) {
_local7 = (((20 * _local6) + 50) * (Math.PI / 180));
_local8 = (Math.cos(_local7) * 6);
_local9 = (Math.sin(_local7) * 6);
newBadBullet(2, (_local2.x + (_local8 * 5)), (_local2.y + (_local9 * 5)), _local8, _local9);
_local6++;
};
};
if (_local2.y > (stageH + 100)){
enemies--;
game.removeChild(_local2);
spinners.splice(_local1, 1);
_local1--;
} else {
if (_local2.health <= 0){
kills++;
enemies--;
addScore(525);
explodeSound();
explode(_local2.x, _local2.y, 3);
shakeTimer = 20;
shake = 7;
game.removeChild(_local2);
spinners.splice(_local1, 1);
_local1--;
};
};
};
_local1++;
};
}
public function newLauncher(_arg1:int):void{
var _local2:launcher;
enemies++;
_local2 = new launcher();
_local2.y = -100;
_local2.x = (80 + (_arg1 * 180));
_local2.health = (40 + int((gun * 8)));
_local2.shootTime = 100;
_local2.ang = 90;
_local2.turnDir = int((Math.random() * 2));
launchers.push(_local2);
game.addChild(_local2);
}
public function damageEnemy(_arg1:int, _arg2:int, _arg3:Number):void{
var _local4:int;
var _local5:int;
var _local6:int;
if (bosses.length > 0){
if (bosses[0].y >= 80){
bosses[0].health = (bosses[0].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
};
_local4 = 0;
while (_local4 < planes.length) {
_local5 = (planes[_local4].x - _arg1);
_local6 = (planes[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 900){
planes[_local4].health = (planes[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
_local4 = 0;
while (_local4 < stealthPlanes.length) {
_local5 = (stealthPlanes[_local4].x - _arg1);
_local6 = (stealthPlanes[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 900){
stealthPlanes[_local4].health = (stealthPlanes[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
_local4 = 0;
while (_local4 < spinners.length) {
_local5 = (spinners[_local4].x - _arg1);
_local6 = (spinners[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 5000){
spinners[_local4].health = (spinners[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
_local4 = 0;
while (_local4 < choppers.length) {
_local5 = (choppers[_local4].x - _arg1);
_local6 = (choppers[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 5000){
choppers[_local4].health = (choppers[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
_local4 = 0;
while (_local4 < bombers.length) {
_local5 = (bombers[_local4].x - _arg1);
_local6 = (bombers[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 1600){
bombers[_local4].health = (bombers[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
_local4 = 0;
while (_local4 < launchers.length) {
_local5 = (launchers[_local4].x - _arg1);
_local6 = (launchers[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 5000){
launchers[_local4].health = (launchers[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
_local4 = 0;
while (_local4 < missiles.length) {
_local5 = (missiles[_local4].x - _arg1);
_local6 = (missiles[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 1600){
missiles[_local4].health = (missiles[_local4].health - 0.5);
};
_local4++;
};
_local4 = 0;
while (_local4 < rocketShips.length) {
_local5 = (rocketShips[_local4].x - _arg1);
_local6 = (rocketShips[_local4].y - _arg2);
if (((_local5 * _local5) + (_local6 * _local6)) <= 1600){
rocketShips[_local4].health = (rocketShips[_local4].health - _arg3);
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
};
_local4++;
};
}
public function updateMoney():void{
var _local1:int;
var _local2:money;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
_local1 = 0;
while (_local1 < monies.length) {
_local2 = monies[_local1];
_local2.y = (_local2.y + _local2.yv);
_local2.x = (_local2.x + _local2.xv);
_local2.xv = (_local2.xv * 0.98);
if (_local2.x < 50){
_local2.x = 50;
};
if (_local2.x > (stageW - 50)){
_local2.x = (stageW - 50);
};
if (_local2.xv < 0.2){
_local2.xv = 0;
};
if (_local2.yv < 5){
_local2.yv = (_local2.yv + 0.2);
};
_local3 = (ship.x - _local2.x);
_local4 = (ship.y - _local2.y);
_local5 = ((_local3 * _local3) + (_local4 * _local4));
if (_local5 < 10000){
_local6 = Math.atan2(_local4, _local3);
_local2.xv = (Math.cos(_local6) * 8);
_local2.yv = (Math.sin(_local6) * 8);
};
if (_local5 < 900){
powerupsound.play();
gun++;
currentScore = 0;
if ((((gun == 2)) || ((gun == 3)))){
newOption();
};
game.removeChild(_local2);
monies.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function updateBadBullets():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:*;
var _local7:int;
var _local8:int;
_local5 = 0;
while (_local5 < badBullets.length) {
_local6 = badBullets[_local5];
badBullets[_local5].x = (_local6.x + _local6.xv);
_local6.y = (_local6.y + _local6.yv);
_local7 = (ship.x - _local6.x);
_local8 = (ship.y - _local6.y);
if (((_local7 * _local7) + (_local8 * _local8)) < 100){
newExplosion(_local6.x, _local6.y, 1);
_local6.dead = true;
playerHit();
};
if (_local6.currentFrame == 3){
_local6.timer--;
if (_local6.timer <= 0){
_local6.dead = true;
_local2 = ((Math.random() * 360) * (Math.PI / 180));
_local1 = 0;
while (_local1 < 10) {
_local3 = (Math.cos((((36 * _local1) * (Math.PI / 180)) + _local2)) * 5);
_local4 = (Math.sin((((36 * _local1) * (Math.PI / 180)) + _local2)) * 5);
newBadBullet(4, _local6.x, _local6.y, _local3, _local4);
_local1++;
};
};
};
if (_local6.currentFrame == 6){
_local6.timer--;
if (_local6.timer <= 0){
_local6.dead = true;
_local2 = ((Math.random() * 360) * (Math.PI / 180));
_local1 = 0;
while (_local1 < 6) {
_local3 = (Math.cos((((60 * _local1) * (Math.PI / 180)) + _local2)) * 5);
_local4 = (Math.sin((((60 * _local1) * (Math.PI / 180)) + _local2)) * 5);
newBadBullet(7, _local6.x, _local6.y, _local3, _local4);
explode(_local6.x, _local6.y, 0);
_local1++;
};
};
};
if ((((((((_local6.x < -20)) || ((_local6.y < -20)))) || ((_local6.x > (stageW + 20))))) || ((_local6.y > (stageH + 20))))){
_local6.dead = true;
};
if (_local6.dead == true){
game.removeChild(_local6);
badBullets.splice(_local5, 1);
_local5--;
};
_local5++;
};
}
public function updateOptions():void{
var _local1:int;
var _local2:*;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
_local1 = 0;
while (_local1 < options.length) {
_local2 = options[_local1];
_local2.blades.rotation = (_local2.blades.rotation + 12);
_local2.shoot--;
if (_local2.shoot <= 0){
_local2.shoot = 8;
newPellet(_local2.x, (_local2.y - 20));
};
_local3 = ((ship.x + _local2.offx) - _local2.x);
_local4 = ((ship.y + _local2.offy) - _local2.y);
_local5 = ((_local3 * _local3) + (_local4 * _local4));
_local6 = Math.atan2(_local4, _local3);
if (_local5 > 0){
_local2.x = (_local2.x + (Math.cos(_local6) * ((_local5 / 800) + 2)));
_local2.y = (_local2.y + (Math.sin(_local6) * ((_local5 / 800) + 2)));
} else {
if (_local5 < 0){
_local2.x = (_local2.x - (Math.cos(_local6) * 4));
_local2.y = (_local2.y - (Math.sin(_local6) * 4));
};
};
_local2.ang = (_local2.ang + (Math.PI / 50));
_local2.offx = (Math.cos(_local2.ang) * 60);
_local2.offy = (Math.sin(_local2.ang) * 60);
_local1++;
};
}
public function updateExplosions():void{
var _local1:int;
var _local2:*;
if (explosionsList.length > 0){
explosionsTimer--;
if (explosionsTimer <= 0){
explosionsTimer = 10;
explodeSound();
explode(explosionsList[0][0], explosionsList[0][1], explosionsList[0][2]);
explosionsList.splice(0, 1);
};
};
_local1 = 0;
while (_local1 < explosions.length) {
_local2 = explosions[_local1];
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
_local2.timer--;
_local2.xv = (_local2.xv * 0.93);
_local2.yv = (_local2.yv * 0.93);
if (Math.abs(_local2.xv) <= 0.2){
_local2.xv = 0;
};
if (Math.abs(_local2.yv) <= 0.2){
_local2.yv = 0;
};
if (_local2.s < 1){
_local2.scaleX = (_local2.scaleX - 0.05);
_local2.scaleY = (_local2.scaleY - 0.05);
};
if ((((_local2.timer == 0)) && ((_local2.s >= 1)))){
newExplosion(_local2.x, _local2.y, (_local2.s / 2));
newExplosion(_local2.x, _local2.y, (_local2.s / 2));
game.removeChild(_local2);
explosions.splice(_local1, 1);
_local1--;
} else {
_local2.rotation = (_local2.rotation + 5);
if (_local2.scaleX <= 0.1){
game.removeChild(_local2);
explosions.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
public function newEmitter(_arg1:Array, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Boolean, _arg7:Boolean):void{
var _local8:Object;
_local8 = new Object();
_local8.emits = _arg2;
_local8.t = _arg3;
_local8.er = _arg4;
_local8.timer = 0;
_local8.path = _arg1;
_local8.speed = _arg5;
_local8.xm = _arg6;
_local8.ym = _arg7;
emitters.push(_local8);
enemies++;
}
public function getLink3(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://lambdarecords.net/artists/akelixe/");
navigateToURL(_local2, "_blank");
}
public function getLink5(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.alillm.com");
navigateToURL(_local2, "_blank");
}
public function newEnemy(_arg1:Array):void{
if (_arg1[0] == 0){
newEmitter(this[("spath" + _arg1[1])], _arg1[2], 1, 18, 8, _arg1[3], _arg1[4]);
} else {
if (_arg1[0] == 1){
newEmitter(this[("apath" + _arg1[1])], _arg1[2], 2, 18, 8, _arg1[3], _arg1[4]);
} else {
if (_arg1[0] == 2){
newSpinner(_arg1[1]);
} else {
if (_arg1[0] == 3){
newChopper(_arg1[1]);
} else {
if (_arg1[0] == 4){
newBomber(_arg1[1]);
} else {
if (_arg1[0] == 5){
newLauncher(_arg1[1]);
} else {
if (_arg1[0] == 6){
newRocketShip(_arg1[1], _arg1[2], _arg1[3]);
} else {
if (_arg1[0] == 20){
newBoss1();
switchTrack(bossMusic);
warning1Music.play(0, 8);
} else {
if (_arg1[0] == 21){
newBoss2();
switchTrack(bossMusic);
warning1Music.play(0, 8);
} else {
if (_arg1[0] == 22){
newBoss3();
switchTrack(bossMusic);
warning1Music.play(0, 8);
} else {
if (_arg1[0] == 23){
newBoss4();
switchTrack(bossMusic);
warning1Music.play(0, 8);
} else {
if (_arg1[0] == 24){
newBoss5();
switchTrack(bossMusic);
warning1Music.play(0, 8);
} else {
if (_arg1[0] == 25){
newBoss6();
switchTrack(finalMusic);
warning2Music.play(0, 8);
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function newHBullet(_arg1:int, _arg2:int):void{
var _local3:hammerbullet;
var _local4:Number;
_local3 = new hammerbullet();
_local3.x = _arg1;
_local3.y = _arg2;
if (psyco == true){
_local3.scaleX = 2;
_local3.scaleY = 2;
_local3.damage = 3;
} else {
_local3.damage = 1.2;
};
_local4 = ((ship.rotation - 90) * (Math.PI / 180));
_local3.xv = (Math.cos(_local4) * 20);
_local3.yv = (Math.sin(_local4) * 20);
_local3.rotation = ship.rotation;
_local3.dead = false;
bullets.push(_local3);
game.addChild(_local3);
}
public function newStealthPlane(_arg1:Array, _arg2:Number, _arg3:Boolean, _arg4:Boolean):void{
var _local5:stealthplane;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
enemies++;
_local5 = new stealthplane();
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 0;
if (_arg3 == false){
_local6 = _arg1[0][0];
_local8 = _arg1[1][0];
} else {
_local6 = (stageW - _arg1[0][0]);
_local8 = (stageW - _arg1[1][0]);
};
if (_arg4 == false){
_local7 = _arg1[0][1];
_local9 = _arg1[1][1];
} else {
_local7 = (stageH - _arg1[0][1]);
_local9 = (stageH - _arg1[1][1]);
};
_local5.x = _local6;
_local5.y = _local7;
_local10 = Math.atan2((_local9 - _local7), (_local8 - _local6));
_local5.rotation = (_local10 * (180 / Math.PI));
_local5.rad = 15;
_local5.xv = (Math.cos(_local10) * 6);
_local5.yv = (Math.sin(_local10) * 6);
if (_arg2 == 0){
_local5.turn = 1;
} else {
_local5.turn = -1;
};
_local5.health = 7;
_local5.turnTime = 40;
_local5.dead = false;
_local5.speed = 6;
stealthPlanes.push(_local5);
game.addChild(_local5);
}
public function newPath(_arg1:int, _arg2:int, _arg3:int):Array{
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Object;
var _local11:Object;
var _local12:int;
var _local13:int;
_local4 = new Array();
_local5 = (Math.random() * 4);
_local6 = (Math.random() * stageW);
_local7 = (Math.random() * (stageH - 150));
if (_local5 == 0){
_local8 = -20;
_local9 = _local7;
} else {
if (_local5 == 1){
_local8 = (stageW + 20);
_local9 = _local7;
} else {
_local8 = _local6;
_local9 = -20;
};
};
_local4.push([_local8, _local9]);
_local10 = new Object();
_local10.x = _local8;
_local10.y = _local9;
_local10.speed = _arg1;
_local10.rotSpeed = _arg2;
_local10.xv = 0;
_local10.yv = 0;
_local11 = new Object();
_local11.x = (((Math.random() * stageW) / 4) + (stageW / 8));
_local11.y = (((Math.random() * stageH) / 4) + (stageW / 8));
_local10.rot = (Math.atan2((_local11.y - _local10.x), (_local11.x - _local10.x)) * (180 / Math.PI));
_local12 = _arg3;
_local13 = 1;
while (_local13 < 180) {
seekTarget(_local10, _local11);
_local10.x = (_local10.x + _local10.xv);
_local10.y = (_local10.y + _local10.yv);
_local4.push([_local10.x, _local10.y]);
--_local12;
if (_local12 <= 0){
_local12 = _arg3;
_local11.x = (Math.random() * stageW);
_local11.y = (Math.random() * stageH);
};
_local13++;
};
return (_local4);
}
public function playerDie():void{
var _local1:int;
var _local2:int;
if ((((invincible == 0)) && ((endLevel == 0)))){
lives--;
respawn = 80;
currentScore = 0;
invincible = 180;
explosionsList.push([ship.x, ship.y, 4]);
explosionsList.push([((ship.x + (Math.random() * 150)) - (Math.random() * 150)), ((ship.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((ship.x + (Math.random() * 150)) - (Math.random() * 150)), ((ship.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
shakeTimer = 30;
shake = 18;
_local1 = 0;
while (_local1 < (gun - 1)) {
newPowerup(ship.x, ship.y);
_local1++;
};
ship.rotation = 0;
gun = 1;
currentScore = 0;
_local2 = 0;
while (_local2 < options.length) {
game.removeChild(options[_local2]);
_local2++;
};
options = [];
ship.y = (stageH + 400);
ship.x = (stageW / 2);
health = 1;
};
}
public function newPowertext(_arg1:int=-100):void{
var _local2:powertext;
_local2 = new powertext();
powerbg.addChild(_local2);
_local2.x = (Math.random() * stageW);
_local2.y = _arg1;
_local2.scaleX = ((Math.random() * 1) + 0.5);
_local2.scaleY = _local2.scaleX;
_local2.gotoAndStop((int((Math.random() * 20)) + 1));
powertexts.push(_local2);
}
public function mousemove(_arg1:MouseEvent):void{
if (gameState == "title"){
if ((((mouseY > 170)) && ((mouseY < 220)))){
if ((((mouseX > 230)) && ((mouseX < 360)))){
if (menuSelect != 1){
menchange.play();
};
menuSelect = 1;
};
} else {
if ((((mouseY > 250)) && ((mouseY < 300)))){
if ((((mouseX > 200)) && ((mouseX < 400)))){
if (menuSelect != 2){
menchange.play();
};
menuSelect = 2;
};
} else {
if ((((mouseY > 335)) && ((mouseY < 385)))){
if ((((mouseX > 190)) && ((mouseX < 410)))){
if (menuSelect != 3){
menchange.play();
};
menuSelect = 3;
};
} else {
if ((((mouseY > 420)) && ((mouseY < 470)))){
if ((((mouseX > 140)) && ((mouseX < 460)))){
if (menuSelect != 4){
menchange.play();
};
menuSelect = 4;
};
};
};
};
};
} else {
if (gameState == "gameover"){
if ((((mouseY > 210)) && ((mouseY < 260)))){
if ((((mouseX > 120)) && ((mouseX < 440)))){
if (menuSelect != 1){
menchange.play();
};
menuSelect = 1;
};
} else {
if ((((mouseY > 290)) && ((mouseY < 340)))){
if ((((mouseX > 100)) && ((mouseX < 468)))){
if (menuSelect != 2){
menchange.play();
};
menuSelect = 2;
};
} else {
if ((((mouseY > 375)) && ((mouseY < 425)))){
if ((((mouseX > 115)) && ((mouseX < 457)))){
if (menuSelect != 3){
menchange.play();
};
menuSelect = 3;
};
} else {
if ((((mouseY > 460)) && ((mouseY < 510)))){
if ((((mouseX > 144)) && ((mouseX < 430)))){
if (menuSelect != 4){
menchange.play();
};
menuSelect = 4;
};
};
};
};
};
} else {
if (gameState == "report"){
if ((((mouseY > 480)) && ((mouseY < 520)))){
if ((((mouseX > 265)) && ((mouseX < 340)))){
if (menuSelect != 1){
menchange.play();
};
menuSelect = 1;
};
} else {
if ((((mouseY > 525)) && ((mouseY < 565)))){
if ((((mouseX > 265)) && ((mouseX < 340)))){
if (menuSelect != 2){
menchange.play();
};
menuSelect = 2;
};
};
};
};
};
};
}
public function mouseup(_arg1:MouseEvent):void{
var _local2:int;
var _local3:URLRequest;
var _local4:URLRequest;
var _local5:ScoreSubmitter;
if (keyboardControl == false){
psyco = false;
dispCT = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
ship.scaleX = 1;
ship.scaleY = 1;
_local2 = 0;
while (_local2 < bullets.length) {
bullets[_local2].scaleX = 1;
bullets[_local2].scaleY = 1;
bullets[_local2].damage = (bullets[_local2].damage / 2);
_local2++;
};
};
if (gameState == "title"){
if (menuSelect == 2){
ScoreSubmitter.loadHighScorePage();
} else {
if (menuSelect == 4){
_local3 = new URLRequest("http://www.crazymonkeygames.com");
navigateToURL(_local3, "_blank");
};
};
} else {
if (gameState == "gameover"){
if (mouseY > 170){
if (menuSelect == 1){
_local4 = new URLRequest("http://www.crazymonkeygames.com");
navigateToURL(_local4, "_blank");
} else {
if (menuSelect == 2){
_local5 = new ScoreSubmitter();
_local5.addEventListener(ScoreSubmitter.SCORE_RESPONSE, onScoreResponse);
_local5.submitScore(GAMEOVER.nom.text, score);
transto = "title";
TRANS.play();
gameState = "trans";
} else {
if (menuSelect == 3){
ScoreSubmitter.loadHighScorePage();
};
};
};
};
};
};
}
public function updateLaunchers():void{
var _local1:int;
var _local2:launcher;
var _local3:int;
var _local4:int;
var _local5:Matrix;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = 0;
while (_local1 < launchers.length) {
_local2 = launchers[_local1];
_local3 = (ship.x - _local2.x);
_local4 = (ship.y - _local2.y);
if (((_local3 * _local3) + (_local4 * _local4)) < 900){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 4);
shakeTimer = 14;
shake = 18;
game.removeChild(_local2);
launchers.splice(_local1, 1);
_local1--;
playerHit();
playerHit();
playerHit();
} else {
if (_local2.y < 100){
_local2.y = (_local2.y + 5);
} else {
if (_local2.turnDir == 0){
_local2.ang = (_local2.ang + 1);
if (_local2.ang == 145){
_local2.turnDir = 1;
};
} else {
_local2.ang = (_local2.ang - 1);
if (_local2.ang == 35){
_local2.turnDir = 0;
};
};
_local2.shootTime--;
if (_local2.shootTime <= 0){
_local2.shootTime = 100;
_local6 = (_local2.ang * (Math.PI / 180));
_local7 = (Math.cos(_local6) * 8);
_local8 = (Math.sin(_local6) * 8);
newMissile(_local2.x, _local2.y, (_local2.rotation + 30));
newMissile(_local2.x, _local2.y, (_local2.rotation - 30));
};
};
_local2.rotation = _local2.ang;
_local2.blades1.rotation = (_local2.blades1.rotation + 12);
_local2.blades2.rotation = (_local2.blades2.rotation + 12);
_local5 = new Matrix();
_local5.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local5);
if (_local2.health <= 0){
kills++;
enemies--;
addScore(0x0808);
explodeSound();
explode(_local2.x, _local2.y, 4);
shakeTimer = 14;
shake = 18;
game.removeChild(_local2);
launchers.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
public function seekTarget(_arg1, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
var _local9:*;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (_local5 * (180 / Math.PI));
_local7 = _arg1.rot;
if (_local6 < 0){
_local6 = (_local6 + 360);
} else {
if (_local6 > 360){
_local6 = (_local6 - 360);
};
};
if (_local7 < 0){
_local7 = (_local7 + 360);
} else {
if (_local7 > 360){
_local7 = (_local7 - 360);
};
};
_local8 = (_local7 - _local6);
if (Math.abs(_local8) > _arg1.rotSpeed){
if ((((((_local8 > 0)) && ((_local8 <= 180)))) || ((_local8 < -180)))){
_arg1.rot = (_arg1.rot - _arg1.rotSpeed);
} else {
if ((((((_local8 < 0)) && ((_local8 >= -180)))) || ((_local8 > 180)))){
_arg1.rot = (_arg1.rot + _arg1.rotSpeed);
};
};
} else {
_arg1.rot = _local6;
};
_local9 = (_arg1.rot * (Math.PI / 180));
_arg1.xv = (Math.cos(_local9) * _arg1.speed);
_arg1.yv = (Math.sin(_local9) * _arg1.speed);
}
public function newOption():void{
var _local1:player1option;
_local1 = new player1option();
if (options.length == 0){
_local1.ang = 0;
} else {
_local1.ang = (options[0].ang + Math.PI);
};
_local1.x = (Math.random() * stageW);
_local1.y = (stageH + 50);
_local1.shoot = 5;
_local1.offx = (Math.cos(_local1.ang) * 60);
_local1.offy = (Math.sin(_local1.ang) * 60);
options.push(_local1);
game.addChild(_local1);
}
public function fire():void{
if ((((((gun == 1)) || ((gun == 2)))) || ((gun == 3)))){
newBullet(ship.x, (ship.y - 25));
} else {
if (gun == 4){
newBullet((ship.x - 10), (ship.y - 25));
newBullet((ship.x + 10), (ship.y - 25));
} else {
if (gun == 5){
newHBullet((ship.x + xshoot), (ship.y - 25));
newHBullet((ship.x + -(xshoot)), (ship.y - 25));
xshoot = (xshoot + xshootm);
if (xshoot > 30){
xshoot = 20;
xshootm = -10;
} else {
if (xshoot < 0){
xshoot = 10;
xshootm = 10;
};
};
} else {
if (gun == 6){
newHBullet((ship.x + xshoot), (ship.y - 25));
newHBullet((ship.x + -(xshoot)), (ship.y - 25));
xshoot = (xshoot + xshootm);
if (xshoot > 30){
xshoot = 20;
xshootm = -10;
} else {
if (xshoot < 0){
xshoot = 10;
xshootm = 10;
};
};
newBigBullet(ship.x, (ship.y - 20));
} else {
if (gun == 7){
lazerSprite.x = ship.x;
lazerSprite.y = (ship.y - 15);
fireLazers(ship.x, (ship.y - 15));
} else {
if (gun == 8){
lazerSprite.x = ship.x;
lazerSprite.y = (ship.y - 15);
fireLazers((ship.x - 15), (ship.y - 15));
fireLazers((ship.x + 15), (ship.y - 15));
};
};
};
};
};
};
}
public function submitScores():void{
var o:Object;
var boardID:String;
o = {n:[9, 15, 2, 10, 7, 6, 8, 5, 8, 5, 9, 11, 0, 8, 3, 3], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "9f2a7685859b0833");
MochiScores.showLeaderboard({onClose:function (){
closeBoard();
}, boardID:boardID, score:score});
}
public function addScore(_arg1:int):void{
score = (score + _arg1);
currentScore = (currentScore + _arg1);
psycoMeter = (psycoMeter + (_arg1 / 200));
if (psycoMeter > 100){
psycoMeter = 100;
};
pbar.height = (4 * psycoMeter);
}
public function updateBombers():void{
var _local1:int;
var _local2:bomber;
var _local3:int;
var _local4:int;
var _local5:Matrix;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local1 = 0;
while (_local1 < bombers.length) {
_local2 = bombers[_local1];
_local3 = (ship.x - _local2.x);
_local4 = (ship.y - _local2.y);
if (((_local3 * _local3) + (_local4 * _local4)) <= (_local2.rad * _local2.rad)){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 4);
shakeTimer = 14;
shake = 18;
game.removeChild(_local2);
bombers.splice(_local1, 1);
_local1--;
playerHit();
} else {
_local2.y++;
_local2.shootTime--;
_local2.rotor.rotation = (_local2.rotor.rotation + 15);
_local5 = new Matrix();
_local5.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local5);
if (_local2.shootTime <= 0){
_local2.shootTime = 15;
_local6 = 0;
while (_local6 < 4) {
_local2.rot = (_local2.rot + 10);
if (_local2.rot >= 360){
_local2.rot = (_local2.rot - 360);
};
_local7 = (((90 * _local6) + _local2.rot) * (Math.PI / 180));
_local8 = (Math.cos(_local7) * 5);
_local9 = (Math.sin(_local7) * 5);
newBadBullet(4, (_local2.x + (_local8 * 2)), (_local2.y + (_local9 * 2)), _local8, _local9);
_local6++;
};
};
if (_local2.health <= 0){
enemies--;
explodeSound();
explode(_local2.x, _local2.y, 4);
addScore(1469);
shakeTimer = 14;
shake = 12;
game.removeChild(_local2);
bombers.splice(_local1, 1);
_local1--;
} else {
if (_local2.y > (stageH + 100)){
kills++;
enemies--;
game.removeChild(_local2);
bombers.splice(_local1, 1);
_local1--;
};
};
};
_local1++;
};
}
public function switchTrack(_arg1):void{
if (currentChannel == 1){
currentChannel = 2;
channel2 = _arg1.play(0, 9999);
channel2.soundTransform = new SoundTransform(0, 0);
channel1.soundTransform = new SoundTransform(1, 0);
} else {
currentChannel = 1;
channel1 = _arg1.play(0, 9999);
channel1.soundTransform = new SoundTransform(0, 0);
channel2.soundTransform = new SoundTransform(1, 0);
};
}
public function updateShip():void{
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:int;
var _local5:int;
if (gameState == "game"){
if (keyboardControl == true){
if (respawn == 0){
if (downKeys.key37 == true){
if (ship.x > 0){
ship.x = (ship.x - shipSpeed);
} else {
ship.x = 0;
};
if (ship.rotation > -20){
ship.rotation = (ship.rotation - 2);
};
} else {
if (downKeys.key39 == true){
if (ship.x < stageW){
ship.x = (ship.x + shipSpeed);
} else {
ship.x = stageW;
};
if (ship.rotation < 20){
ship.rotation = (ship.rotation + 2);
};
} else {
if (ship.rotation > 5){
ship.rotation = (ship.rotation - 5);
} else {
if (ship.rotation < -5){
ship.rotation = (ship.rotation + 5);
} else {
ship.rotation = 0;
};
};
};
};
if (downKeys.key38 == true){
if (ship.y > 0){
ship.y = (ship.y - shipSpeed);
} else {
ship.y = 0;
};
} else {
if (downKeys.key40 == true){
if (ship.y < stageH){
ship.y = (ship.y + shipSpeed);
} else {
ship.y = stageH;
};
};
};
};
} else {
_local1 = (stage.mouseX - ship.x);
_local2 = (stage.mouseY - ship.y);
_local3 = Math.atan2(_local2, _local1);
_local4 = ((_local1 * _local1) + (_local2 * _local2));
if (_local4 > 100){
ship.rotation = (_local1 / 8);
if (_local4 <= 7500){
ship.x = (ship.x + (Math.cos(_local3) * (_local4 / 500)));
ship.y = (ship.y + (Math.sin(_local3) * (_local4 / 500)));
} else {
ship.x = (ship.x + (Math.cos(_local3) * 15));
ship.y = (ship.y + (Math.sin(_local3) * 15));
};
} else {
ship.rotation = 0;
};
};
if (invincible > 0){
invincible--;
if ((invincible % 16) == 0){
ship.visible = true;
} else {
if ((invincible % 8) == true){
ship.visible = false;
};
};
if (invincible == 0){
ship.visible = true;
};
};
if (respawn == 0){
shoot--;
if ((((shoot == 0)) || ((gun > 6)))){
shoot = 5;
fire();
};
} else {
respawn--;
if ((((lives < 0)) && ((respawn == 20)))){
switchTrack(menuMusic);
gameState = "trans";
transto = "gameover";
GAMEOVER.ti.gotoAndStop(1);
TRANS.play();
};
if (ship.y > ((stageH / 2) + (stageH / 4))){
ship.y = (ship.y - shipSpeed);
} else {
respawn = 0;
};
};
} else {
if (gameState == "interlevel"){
_local5 = (stageH / 2);
if (interTimer > 0){
_local5 = (stageH - 80);
interTimer--;
if (interTimer <= 0){
gameState = "game";
};
};
if (ship.y > _local5){
ship.y = (ship.y - shipSpeed);
} else {
if (ship.y < _local5){
ship.y = (ship.y + shipSpeed);
};
};
if (ship.x > ((stageW / 2) + 5)){
ship.x = (ship.x - shipSpeed);
} else {
if (ship.x < ((stageW / 2) - 5)){
ship.x = (ship.x + shipSpeed);
};
};
if (boosttimer == 0){
if (interTimer == 0){
newParticle(ship.x, ship.y, 1, 0, 16);
newParticle((Math.random() * stageW), 0, 2, 0, 20);
};
boosttimer = 3;
} else {
boosttimer--;
};
} else {
if (gameState == "endLevel"){
endLevel--;
ship.visible = true;
if (endLevel < 150){
if (ship.x > ((stageW / 2) + 5)){
ship.x = (ship.x - shipSpeed);
} else {
if (ship.x < ((stageW / 2) - 5)){
ship.x = (ship.x + shipSpeed);
};
};
ship.y = (ship.y - shipSpeed);
ship.rotation = 0;
psyco = false;
powerbg = new Sprite();
powertexts = [];
dispCT = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
ship.scaleX = 1;
ship.scaleY = 1;
if (boosttimer == 0){
if (interTimer == 0){
newParticle(ship.x, ship.y, 1, 0, 16);
newParticle((Math.random() * stageW), 0, 2, 0, 20);
};
boosttimer = 3;
} else {
boosttimer--;
};
if (endLevel == 0){
gameState = "trans";
TRANS.play();
transto = "report";
};
};
};
};
};
if (((!((ship.blades == null))) && (!((ship.blades2 == null))))){
if (shipType == 1){
ship.blades.rotation = (ship.blades.rotation + 15);
} else {
ship.blades.rotation = (ship.blades.rotation + 15);
ship.blades2.rotation = (ship.blades2.rotation + 15);
};
};
}
public function updateEmitters():void{
var _local1:int;
var _local2:Object;
var _local3:Number;
_local1 = 0;
while (_local1 < emitters.length) {
_local2 = emitters[_local1];
_local2.timer++;
if (_local2.timer >= _local2.er){
_local2.timer = 0;
_local2.emits--;
if (_local2.t == 1){
newSmallPlane(_local2.path, _local2.speed, _local2.xm, _local2.ym);
} else {
if (_local2.t == 2){
_local3 = (_local2.emits % 2);
newStealthPlane(_local2.path, _local3, _local2.xm, _local2.ym);
};
};
if (_local2.emits <= 0){
enemies--;
emitters.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
public function updateBullets():void{
var _local1:int;
var _local2:*;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = 0;
while (_local1 < bullets.length) {
_local2 = bullets[_local1];
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
if (gameState == "game"){
_local3 = 0;
_local4 = 0;
_local5 = 0;
if (bossbmp.getPixel(_local2.x, _local2.y) != 0){
if (bosses.length > 0){
if (bosses[0].y >= 80){
bosses[0].health = (bosses[0].health - _local2.damage);
};
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
};
};
_local3 = 0;
while (_local3 < planes.length) {
_local4 = (planes[_local3].x - _local2.x);
_local5 = (planes[_local3].y - _local2.y);
if ((((((((((((_local4 * _local4) + (_local5 * _local5)) <= 900)) && ((planes[_local3].x > 0)))) && ((planes[_local3].x < stageW)))) && ((planes[_local3].y > 0)))) && ((planes[_local3].y < stageH)))){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
planes[_local3].health = (planes[_local3].health - _local2.damage);
};
_local3++;
};
_local3 = 0;
while (_local3 < stealthPlanes.length) {
_local4 = (stealthPlanes[_local3].x - _local2.x);
_local5 = (stealthPlanes[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 900){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
stealthPlanes[_local3].health = (stealthPlanes[_local3].health - _local2.damage);
};
_local3++;
};
_local3 = 0;
while (_local3 < spinners.length) {
_local4 = (spinners[_local3].x - _local2.x);
_local5 = (spinners[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 1600){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
spinners[_local3].health = (spinners[_local3].health - _local2.damage);
};
_local3++;
};
_local3 = 0;
while (_local3 < choppers.length) {
_local4 = (choppers[_local3].x - _local2.x);
_local5 = (choppers[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 1600){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
choppers[_local3].health = (choppers[_local3].health - _local2.damage);
};
_local3++;
};
_local3 = 0;
while (_local3 < bombers.length) {
_local4 = (bombers[_local3].x - _local2.x);
_local5 = (bombers[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 1600){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
bombers[_local3].health = (bombers[_local3].health - _local2.damage);
};
_local3++;
};
_local3 = 0;
while (_local3 < launchers.length) {
_local4 = (launchers[_local3].x - _local2.x);
_local5 = (launchers[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 1600){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
launchers[_local3].health = (launchers[_local3].health - _local2.damage);
};
_local3++;
};
_local3 = 0;
while (_local3 < missiles.length) {
_local4 = (missiles[_local3].x - _local2.x);
_local5 = (missiles[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 1600){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
missiles[_local3].health--;
};
_local3++;
};
_local3 = 0;
while (_local3 < rocketShips.length) {
_local4 = (rocketShips[_local3].x - _local2.x);
_local5 = (rocketShips[_local3].y - _local2.y);
if (((_local4 * _local4) + (_local5 * _local5)) <= 1600){
_local2.dead = true;
explode(_local2.x, _local2.y, 0);
rocketShips[_local3].health = (rocketShips[_local3].health - _local2.damage);
};
_local3++;
};
};
if ((((_local2.y < -50)) || ((_local2.dead == true)))){
if (_local2.dead == true){
if ((((psycoMeter < 100)) && ((hitTimer == 0)))){
psycoMeter = (psycoMeter + 0.2);
hitTimer = 3;
gui.pbar.height = (4.3 * psycoMeter);
};
bullethit.play();
};
game.removeChild(_local2);
bullets.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function updateRocketShips():void{
var _local1:int;
var _local2:rocketship;
var _local3:Matrix;
_local1 = 0;
while (_local1 < rocketShips.length) {
_local2 = rocketShips[_local1];
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
_local2.timer--;
_local3 = new Matrix();
_local3.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local3);
_local2.deathTimer--;
if (_local2.timer <= 0){
_local2.timer = 20;
newBadBullet(6, _local2.x, _local2.y, 0, 0);
};
if (_local2.health <= 0){
enemies--;
kills++;
explodeSound();
explode(_local2.x, _local2.y, 3);
shakeTimer = 12;
shake = 12;
addScore(2034);
game.removeChild(_local2);
rocketShips.splice(_local1, 1);
_local1--;
} else {
if ((((_local2.deathTimer <= 0)) && ((((((((_local2.x < -50)) || ((_local2.y < -50)))) || ((_local2.x > (stageW + 50))))) || ((_local2.y > (stageH + 50))))))){
enemies--;
game.removeChild(_local2);
rocketShips.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
public function newBullet(_arg1:int, _arg2:int):void{
var _local3:bullet;
var _local4:Number;
_local3 = new bullet();
_local3.x = _arg1;
_local3.y = _arg2;
if (psyco == true){
_local3.scaleX = 2;
_local3.scaleY = 2;
_local3.damage = 2.5;
} else {
_local3.damage = 1;
};
_local4 = ((ship.rotation - 90) * (Math.PI / 180));
_local3.xv = (Math.cos(_local4) * 20);
_local3.yv = (Math.sin(_local4) * 20);
_local3.rotation = ship.rotation;
_local3.dead = false;
bullets.push(_local3);
game.addChild(_local3);
}
public function mousedown(_arg1:MouseEvent):void{
if (keyboardControl == false){
psyco = true;
dispCT = new ColorTransform(1, 1, 1, 0.85, (Math.random() * 0xFF), (Math.random() * 0xFF), (Math.random() * 0xFF), 0);
ship.scaleX = 2;
ship.scaleY = 2;
};
if (gameState == "title"){
menselect.play();
if (menuSelect == 1){
gameState = "trans";
transto = "game";
TRANS.play();
} else {
if (menuSelect == 2){
} else {
if (menuSelect == 3){
gameState = "trans";
transto = "credits";
TRANS.play();
} else {
if (menuSelect == 4){
};
};
};
};
} else {
if (gameState == "gameover"){
if (mouseY > 170){
if (menuSelect == 1){
} else {
if (menuSelect == 2){
} else {
if (menuSelect == 3){
} else {
if (menuSelect == 4){
transto = "title";
TRANS.play();
gameState = "trans";
};
};
};
};
};
} else {
if (gameState == "report"){
if (REPORT.presskey.y > 580){
menselect.play();
if (menuSelect == 1){
if (score >= 10000){
score = (score - 10000);
lives++;
buysound.play();
REPORT.gold.text = String(score);
REPORT.lives.text = String(lives);
REPORT.purchasetxt.gotoAndStop(3);
} else {
REPORT.purchasetxt.gotoAndStop(2);
};
REPORT.btn1.y = 800;
REPORT.btn2.y = 800;
REPORT.presskey.y = 500;
} else {
if (menuSelect == 2){
REPORT.purchasetxt.gotoAndStop(3);
REPORT.btn1.y = 800;
REPORT.btn2.y = 800;
REPORT.presskey.y = 500;
};
};
} else {
if (level <= 5){
switchTrack(dialogMusic);
gameState = "trans";
transto = "nextlevel";
TRANS.play();
} else {
switchTrack(menuMusic);
gameState = "trans";
transto = "gameover";
GAMEOVER.ti.gotoAndStop(2);
TRANS.play();
};
};
} else {
if (gameState == "credits"){
gameState = "trans";
TRANS.play();
transto = "title";
};
};
};
};
}
public function updateMusic():void{
if (currentChannel == 1){
if (channel2.soundTransform.volume > 0){
channel2.soundTransform = new SoundTransform((channel2.soundTransform.volume - 0.03), 0);
} else {
channel2.stop();
};
if (channel1.soundTransform.volume < 1){
channel1.soundTransform = new SoundTransform((channel1.soundTransform.volume + 0.03), 0);
};
} else {
if (channel1.soundTransform.volume > 0){
channel1.soundTransform = new SoundTransform((channel1.soundTransform.volume - 0.03), 0);
} else {
channel1.stop();
};
if (channel2.soundTransform.volume < 1){
channel2.soundTransform = new SoundTransform((channel2.soundTransform.volume + 0.03), 0);
};
};
}
public function updateBosses():void{
var _local1:int;
var _local2:*;
var _local3:Matrix;
var _local4:int;
var _local5:Matrix;
var _local6:*;
var _local7:*;
_local1 = 0;
while (_local1 < bosses.length) {
_local2 = bosses[_local1];
_local3 = new Matrix();
_local3.translate(_local2.x, _local2.y);
bossbmp.draw(_local2, _local3);
enemybmp.draw(_local2, _local3);
if (_local2.num == 2){
_local2.blades1.rotation = (_local2.blades1.rotation + 15);
_local2.blades2.rotation = (_local2.blades2.rotation + 15);
if ((((_local2.y > 0)) && ((_local2.rotation > 0)))){
_local2.rotation--;
};
} else {
if (_local2.num == 4){
_local2.blades1.rotation = (_local2.blades1.rotation + 15);
_local2.blades2.rotation = (_local2.blades2.rotation + 15);
};
};
if (_local2.y >= 80){
gui.bossbar.y = 20;
gui.bossback.y = 20;
gui.bossbar.width = ((_local2.health / _local2.shealth) * 430);
_local2.attackTimer--;
if (_local2.attackTimer <= 0){
_local2.pos++;
if (_local2.pos == _local2.timers.length){
_local2.pos = 0;
};
_local2.attackTimer = _local2.timers[_local2.pos];
};
_local4 = 1;
while (_local4 <= _local2.patterns) {
_local6 = _local2[("patterns" + _local4)][_local2.pos];
_local7 = _local2[("loc" + _local4)];
if (_local6 > 0){
firePattern(_local6, [(_local2.x + _local7[0]), (_local2.y + _local7[1])], _local2.attackTimer);
};
_local4++;
};
_local5 = new Matrix();
_local5.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local5);
} else {
if (_local2.y < -150){
if (WARNING.y < 100){
WARNING.y = (WARNING.y + 8);
};
} else {
if (WARNING.y > -100){
WARNING.y = (WARNING.y - 8);
};
};
WARNING.x = ((stageW / 2) + ((Math.random() * 5) - (Math.random() * 5)));
};
if (_local2.y > _local2.moves[_local2.movePo][1]){
_local2.y--;
} else {
if (_local2.y < _local2.moves[_local2.movePo][1]){
_local2.y++;
};
};
if (_local2.x > _local2.moves[_local2.movePo][0]){
_local2.x--;
} else {
if (_local2.x < _local2.moves[_local2.movePo][0]){
_local2.x++;
};
};
_local2.moveTimer--;
if (_local2.moveTimer <= 0){
_local2.movePo++;
if (_local2.movePo > _local2.movesNum){
_local2.movePo = 0;
};
_local2.moveTimer = 300;
};
if (_local2.health <= 0){
kills++;
gui.bossbar.y = -50;
gui.bossback.y = -50;
explosionsList.push([_local2.x, _local2.y, 5]);
explosionsList.push([((_local2.x + (Math.random() * 150)) - (Math.random() * 150)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 4]);
explosionsList.push([((_local2.x + (Math.random() * 150)) - (Math.random() * 150)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 4]);
explosionsList.push([((_local2.x + (Math.random() * 150)) - (Math.random() * 150)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 150)) - (Math.random() * 150)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 150)) - (Math.random() * 150)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 250)) - (Math.random() * 250)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 250)) - (Math.random() * 250)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 250)) - (Math.random() * 250)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 250)) - (Math.random() * 250)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
explosionsList.push([((_local2.x + (Math.random() * 250)) - (Math.random() * 250)), ((_local2.y + (Math.random() * 150)) - (Math.random() * 150)), 3]);
shakeTimer = 100;
shake = 25;
enemies--;
addScore((5000 * level));
game.removeChild(_local2);
bosses.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function updateClouds():void{
var _local1:int;
var _local2:cloud;
_local1 = 0;
while (_local1 < clouds.length) {
_local2 = clouds[_local1];
_local2.y = (_local2.y + bgSpeed);
if (_local2.y > (stageH + 100)){
_local2.y = ((Math.random() * -(stageH)) - 100);
_local2.x = (Math.random() * stageW);
_local2.scaleX = ((Math.random() * 0.5) + 0.5);
_local2.scaleY = _local2.scaleX;
_local2.gotoAndStop((int((Math.random() * 5)) + 1));
};
_local1++;
};
}
public function updateTitle():void{
TITLE.btn1.gotoAndStop(1);
TITLE.btn2.gotoAndStop(1);
TITLE.btn3.gotoAndStop(1);
TITLE.btn4.gotoAndStop(1);
TITLE[("btn" + menuSelect)].gotoAndStop(2);
}
public function updateScore():void{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
gui.score.text = "";
_local1 = String(score);
_local2 = (8 - _local1.length);
_local3 = 1;
while (_local3 <= _local2) {
gui.score[("num" + _local3)].gotoAndStop(1);
_local3++;
};
_local4 = (_local2 + 1);
while (_local4 <= (_local2 + _local1.length)) {
gui.score[("num" + _local4)].gotoAndStop((Number(_local1.charAt(((_local4 - _local2) - 1))) + 2));
_local4++;
};
_local5 = (3200 * (gun * 1.2));
if (gun < 8){
gui.lbar.width = ((currentScore / _local5) * 60);
} else {
gui.lbar.width = 60;
};
if ((currentScore / (3500 * (gun * 1.2))) > 1){
if (gun < 8){
gun++;
currentScore = 0;
gui.leveldisp.gotoAndStop(gun);
powerupsound.play();
};
if ((((gun == 2)) || ((gun == 3)))){
newOption();
};
};
}
public function newSmallPlane(_arg1:Array, _arg2:int, _arg3:Boolean, _arg4:Boolean):void{
var _local5:plane;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
enemies++;
_local5 = new plane();
_local5.path = _arg1;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 0;
if (_arg3 == false){
_local6 = _local5.path[0][0];
_local8 = _local5.path[1][0];
} else {
_local6 = (stageW - _local5.path[0][0]);
_local8 = (stageW - _local5.path[1][0]);
};
if (_arg4 == false){
_local7 = _local5.path[0][1];
_local9 = _local5.path[1][1];
} else {
_local7 = (stageH - _local5.path[0][1]);
_local9 = (stageH - _local5.path[1][1]);
};
_local5.x = _local6;
_local5.y = _local7;
_local10 = Math.atan2((_local9 - _local7), (_local8 - _local6));
_local5.rot = _local10;
_local5.pos = 0;
_local5.rad = 15;
_local5.speed = _arg2;
_local5.xm = _arg3;
_local5.ym = _arg4;
_local5.xv = (Math.cos(_local10) * _arg2);
_local5.yv = (Math.sin(_local10) * _arg2);
_local5.health = 1;
_local5.dead = false;
planes.push(_local5);
game.addChild(_local5);
}
public function updateReport():void{
var _local1:int;
REPORT.btn1.gotoAndStop(1);
REPORT.btn2.gotoAndStop(1);
REPORT[("btn" + menuSelect)].gotoAndStop(2);
reportTimer--;
if (reportTimer > 60){
REPORT.gold.text = "";
REPORT.killed.text = "";
REPORT.lives.text = "";
REPORT.grade.text = "";
} else {
if (reportTimer == 60){
reportping.play();
REPORT.gold.text = String(score);
} else {
if (reportTimer == 40){
reportping.play();
REPORT.killed.text = String(kills);
} else {
if (reportTimer == 20){
reportping.play();
REPORT.lives.text = String(lives);
} else {
if (reportTimer == 0){
reportping.play();
_local1 = ((kills / levelCounts[(level - 1)]) * 100);
if (_local1 >= 80){
REPORT.grade.text = "A+";
} else {
if (_local1 >= 70){
REPORT.grade.text = "A";
} else {
if (_local1 >= 65){
REPORT.grade.text = "B+";
} else {
if (_local1 >= 60){
REPORT.grade.text = "B";
} else {
if (_local1 >= 55){
REPORT.grade.text = "C+";
} else {
if (_local1 >= 50){
REPORT.grade.text = "C";
} else {
if (_local1 >= 45){
REPORT.grade.text = "D+";
} else {
if (_local1 >= 40){
REPORT.grade.text = "D";
} else {
if (_local1 >= 35){
REPORT.grade.text = "E+";
} else {
if (_local1 >= 30){
REPORT.grade.text = "E";
} else {
REPORT.grade.text = "F";
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function newPellet(_arg1:int, _arg2:int):void{
var _local3:pellet;
var _local4:Number;
_local3 = new pellet();
_local3.x = _arg1;
_local3.y = _arg2;
if (psyco == true){
_local3.scaleX = 2;
_local3.scaleY = 2;
_local3.damage = 1.5;
} else {
_local3.damage = 0.5;
};
_local4 = ((ship.rotation - 90) * (Math.PI / 180));
_local3.xv = (Math.cos(_local4) * 20);
_local3.yv = (Math.sin(_local4) * 20);
_local3.rotation = ship.rotation;
_local3.dead = false;
bullets.push(_local3);
game.addChild(_local3);
}
public function newMissile(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:missile;
var _local5:*;
_local4 = new missile();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.speed = 7;
_local4.rotSpeed = 2;
_local4.rotation = _arg3;
_local4.rot = _arg3;
_local4.homing = true;
_local5 = (_arg3 * (Math.PI / 180));
_local4.xv = (Math.cos(_local5) * _local4.speed);
_local4.yv = (Math.sin(_local5) * _local4.speed);
_local4.health = 10;
_local4.timer = 3;
game.addChild(_local4);
missiles.push(_local4);
}
public function endGame():void{
bmp.fillRect(stageRect, 0);
bgbmp.fillRect(stageRect, 0);
powerbmp.fillRect(stageRect, 0);
bossbmp.fillRect(stageRect, 0);
enemybmp.fillRect(stageRect, 0);
explosions = new Array();
bullets = new Array();
badBullets = new Array();
planes = new Array();
stealthPlanes = new Array();
choppers = new Array();
bombers = new Array();
launchers = new Array();
emitters = new Array();
clouds = new Array();
spinners = new Array();
rocketShips = new Array();
options = new Array();
monies = new Array();
particles = new Array();
missiles = new Array();
bosses = new Array();
powertexts = new Array();
game = new Sprite();
game.addChild(lazerSprite);
keyboardControl = true;
downKeys = {};
SoundMixer.soundTransform = new SoundTransform(1, 0);
currentChannel = 1;
gameState = "title";
transto = "game";
shipSpeed = 8;
gamePaused = false;
respawn = 0;
invincible = 0;
offsetX = 0;
bit.x = offsetX;
bgbit.x = offsetX;
dispCT = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
gameCT = new ColorTransform(1, 1, 1, 0, 0, 0, 0, 0);
psyco = false;
psycoMeter = 0;
interTimer = 0;
convoPo = -1;
stringPo = 0;
textTimer = 0;
hitTimer = 0;
nextTimer = 0;
nextAt = 0;
levelPointer = 0;
menuSelect = 1;
enemies = 0;
shoot = 3;
gun = 1;
xshoot = 0;
xshootm = 10;
health = 1;
lives = 5;
reportTimer = 80;
currentScore = 0;
kills = 0;
shakeTimer = 0;
shake = 0;
powerNum = 0;
explosionsList = [];
explosionsTimer = 0;
bgSpeed = 8;
level = 1;
boosttimer = 5;
endLevel = 0;
shipType = 1;
}
public function fireLazers(_arg1:int, _arg2:int):void{
var _local3:Boolean;
_local3 = false;
while (!(_local3)) {
_arg2 = (_arg2 - 10);
if (enemybmp.getPixel(_arg1, _arg2) != 0){
_local3 = true;
explode((_arg1 + ((Math.random() * 10) - (Math.random() * 10))), (_arg2 + ((Math.random() * 10) - (Math.random() * 10))), 0.5);
if (psyco == false){
damageEnemy(_arg1, _arg2, 0.8);
} else {
damageEnemy(_arg1, _arg2, 1.8);
};
};
if (_arg2 < 0){
_local3 = true;
};
};
if (psyco == false){
lazerSprite.graphics.lineStyle(10, 0xFFFFFF, 1);
lazerSprite.graphics.moveTo((_arg1 - ship.x), 0);
lazerSprite.graphics.lineTo((_arg1 - ship.x), (_arg2 - (ship.y - 15)));
lazerSprite.graphics.lineStyle(10, 16767821, 1);
lazerSprite.graphics.moveTo(((_arg1 - ship.x) - 10), 0);
lazerSprite.graphics.lineTo(((_arg1 - ship.x) - 10), (_arg2 - (ship.y - 15)));
lazerSprite.graphics.lineStyle(10, 16767821, 1);
lazerSprite.graphics.moveTo(((_arg1 - ship.x) + 10), 0);
lazerSprite.graphics.lineTo(((_arg1 - ship.x) + 10), (_arg2 - (ship.y - 15)));
} else {
lazerSprite.graphics.lineStyle(15, 0xFFFFFF, 1);
lazerSprite.graphics.moveTo((_arg1 - ship.x), 0);
lazerSprite.graphics.lineTo((_arg1 - ship.x), (_arg2 - (ship.y - 15)));
lazerSprite.graphics.lineStyle(15, 16767821, 1);
lazerSprite.graphics.moveTo(((_arg1 - ship.x) - 13), 0);
lazerSprite.graphics.lineTo(((_arg1 - ship.x) - 13), (_arg2 - (ship.y - 15)));
lazerSprite.graphics.lineStyle(15, 16767821, 1);
lazerSprite.graphics.moveTo(((_arg1 - ship.x) + 13), 0);
lazerSprite.graphics.lineTo(((_arg1 - ship.x) + 13), (_arg2 - (ship.y - 15)));
};
}
public function keydown(_arg1:KeyboardEvent):void{
var _local2:URLRequest;
var _local3:URLRequest;
var _local4:ScoreSubmitter;
var _local5:Matrix;
var _local6:int;
if ((((_arg1.keyCode == 77)) && (!((gameState == "gameover"))))){
if (soundOn == true){
mute.x = 280;
mute.y = 280;
mute.gotoAndPlay(31);
soundOn = false;
SoundMixer.soundTransform = new SoundTransform(0, 0);
} else {
mute.x = 280;
mute.y = 280;
mute.gotoAndPlay(1);
soundOn = true;
SoundMixer.soundTransform = new SoundTransform(1, 0);
};
};
if (gameState == "title"){
if (_arg1.keyCode == 38){
menchange.play();
menuSelect--;
if (menuSelect < 1){
menuSelect = 4;
};
} else {
if (_arg1.keyCode == 40){
menchange.play();
menuSelect++;
if (menuSelect > 4){
menuSelect = 1;
};
} else {
if (_arg1.keyCode != 77){
menselect.play();
if (menuSelect == 1){
gameState = "trans";
transto = "game";
TRANS.play();
} else {
if (menuSelect == 2){
ScoreSubmitter.loadHighScorePage();
} else {
if (menuSelect == 3){
gameState = "trans";
transto = "credits";
TRANS.play();
} else {
if (menuSelect == 4){
_local2 = new URLRequest("http://www.crazymonkeygames.com");
navigateToURL(_local2, "_blank");
};
};
};
};
};
};
};
} else {
if (gameState == "gameover"){
if (_arg1.keyCode == 38){
menchange.play();
menuSelect--;
if (menuSelect < 1){
menuSelect = 4;
};
} else {
if (_arg1.keyCode == 40){
menchange.play();
menuSelect++;
if (menuSelect > 4){
menuSelect = 1;
};
} else {
if (_arg1.keyCode == 13){
menselect.play();
if (menuSelect == 1){
_local3 = new URLRequest("http://www.crazymonkeygames.com");
navigateToURL(_local3, "_blank");
} else {
if (menuSelect == 2){
_local4 = new ScoreSubmitter();
_local4.addEventListener(ScoreSubmitter.SCORE_RESPONSE, onScoreResponse);
_local4.submitScore(GAMEOVER.nom.text, score);
transto = "title";
TRANS.play();
gameState = "trans";
} else {
if (menuSelect == 3){
ScoreSubmitter.loadHighScorePage();
} else {
if (menuSelect == 4){
transto = "title";
TRANS.play();
gameState = "trans";
};
};
};
};
};
};
};
} else {
if (gameState == "credits"){
gameState = "trans";
TRANS.play();
transto = "title";
} else {
if (gameState == "report"){
if (REPORT.presskey.y > 580){
if (_arg1.keyCode == 38){
menchange.play();
menuSelect--;
if (menuSelect < 1){
menuSelect = 2;
};
} else {
if (_arg1.keyCode == 40){
menchange.play();
menuSelect++;
if (menuSelect > 2){
menuSelect = 1;
};
} else {
if (_arg1.keyCode != 77){
menselect.play();
if (menuSelect == 1){
if (score >= 10000){
score = (score - 10000);
lives++;
buysound.play();
REPORT.gold.text = String(score);
REPORT.lives.text = String(lives);
REPORT.purchasetxt.gotoAndStop(3);
} else {
REPORT.purchasetxt.gotoAndStop(2);
};
REPORT.btn1.y = 800;
REPORT.btn2.y = 800;
REPORT.presskey.y = 500;
} else {
if (menuSelect == 2){
REPORT.purchasetxt.gotoAndStop(3);
REPORT.btn1.y = 800;
REPORT.btn2.y = 800;
REPORT.presskey.y = 500;
};
};
};
};
};
} else {
if (level <= 5){
switchTrack(dialogMusic);
gameState = "trans";
transto = "nextlevel";
TRANS.play();
} else {
switchTrack(menuMusic);
gameState = "trans";
transto = "gameover";
GAMEOVER.ti.gotoAndStop(2);
TRANS.play();
};
};
} else {
if (gameState == "game"){
if (_arg1.keyCode == 80){
if (gamePaused == false){
gamePaused = true;
_local5 = new Matrix();
_local5.translate(game.x, game.y);
bmp.fillRect(stageRect, 0);
bgbmp.fillRect(stageRect, 0);
gameCT = new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0);
bmp.draw(game, _local5, gameCT);
gui.pauseflash.gotoAndPlay(2);
} else {
gamePaused = false;
gui.pauseflash.gotoAndStop(1);
};
} else {
if (gamePaused == true){
gamePaused = false;
gui.pauseflash.gotoAndStop(1);
};
};
if (keyboardControl == true){
if (_arg1.keyCode == 32){
if ((((psyco == false)) && ((psycoMeter > 5)))){
psyco = true;
psychosound.play();
dispCT = new ColorTransform(1, 1, 1, 0.85, 0, 0, 0, 0);
ship.scaleX = 2;
ship.scaleY = 2;
_local6 = 0;
while (_local6 < 50) {
newPowertext((Math.random() * stageH));
_local6++;
};
};
};
downKeys[("key" + _arg1.keyCode)] = true;
};
} else {
if (gameState == "interlevel"){
if ((((((_arg1.keyCode == 13)) && ((interTimer == 0)))) && ((ship.y < (stageH - 200))))){
menselect.play();
gui.callPannel.gotoAndStop(1);
gui.calltext.txt.text = "";
if (level <= 5){
switchTrack(gameMusic);
} else {
switchTrack(bossMusic);
};
removeChild(SCROLLER);
interTimer = 20;
downKeys = {};
bgSpeed = 8;
};
};
};
};
};
};
};
}
public function startGame():void{
var _local1:int;
game = new Sprite();
game.addChild(lazerSprite);
bg = new Sprite();
powerbg = new Sprite();
gui = new GUI();
_local1 = 0;
while (_local1 < 10) {
newCloud(((Math.random() * (stageH * 2)) - stageH));
_local1++;
};
health = 1;
lives = 5;
score = 0;
gun = 1;
ship = new player();
ship.x = (stageW / 2);
ship.y = (stageH + 80);
game.addChild(ship);
SCROLLER = new scrollingtxt();
SCROLLER.y = 10;
addChild(SCROLLER);
WARNING = new warning();
game.addChild(WARNING);
WARNING.x = (stageW / 2);
WARNING.y = -100;
addChild(gui);
REPORT = new missionreport();
addChild(REPORT);
REPORT.x = -800;
level = 1;
kills = 0;
SCROLLER.txt.text = "LEVEL 1 - PRESS ENTER KEY TO ENGAGE";
bgSpeed = 16;
boosttimer = 5;
gameState = "interlevel";
removeChild(TRANS);
addChild(TRANS);
removeChild(mute);
addChild(mute);
}
public function newBadBullet(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number):void{
var _local6:enemybullet;
var _local7:Number;
_local6 = new enemybullet();
_local6.x = _arg2;
_local6.y = _arg3;
_local6.gotoAndStop(_arg1);
_local6.xv = _arg4;
_local6.yv = _arg5;
if ((((_arg1 == 3)) || ((_arg1 == 6)))){
_local6.timer = 25;
};
_local7 = Math.atan2(_arg5, _arg4);
_local6.rotation = (_local7 * (180 / Math.PI));
_local6.dead = false;
game.addChild(_local6);
badBullets.push(_local6);
}
public function newSmoke(_arg1:int, _arg2:int):void{
var _local3:explosion;
_local3 = new explosion();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.xv = 0;
_local3.yv = 0;
_local3.scaleX = 0.5;
_local3.scaleY = 0.5;
_local3.gotoAndStop((int((Math.random() * 5)) + 1));
_local3.rotation = (Math.random() * 360);
_local3.timer = 9999;
_local3.s = 0.5;
explosions.push(_local3);
game.addChild(_local3);
}
public function updateGameOver():void{
GAMEOVER.btn1.gotoAndStop(1);
GAMEOVER.btn2.gotoAndStop(1);
GAMEOVER.btn3.gotoAndStop(1);
GAMEOVER.btn4.gotoAndStop(1);
GAMEOVER[("btn" + menuSelect)].gotoAndStop(2);
GAMEOVER.nom.text = GAMEOVER.nom.text.toUpperCase();
}
public function closeBoard():void{
transto = "title";
gameState = "trans";
TRANS.play();
}
public function updateParticles():void{
var _local1:int;
var _local2:shipparticle;
_local1 = 0;
while (_local1 < particles.length) {
_local2 = particles[_local1];
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
if ((((((((_local2.x > stageW)) || ((_local2.x < 0)))) || ((_local2.y > stageH)))) || ((_local2.y < 0)))){
game.removeChild(_local2);
particles.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function updateMissiles():void{
var _local1:int;
var _local2:*;
var _local3:Matrix;
var _local4:*;
var _local5:int;
var _local6:int;
_local1 = 0;
while (_local1 < missiles.length) {
_local2 = missiles[_local1];
if (_local2.homing == true){
seekTarget(_local2, ship);
};
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
_local3 = new Matrix();
_local3.translate(_local2.x, _local2.y);
enemybmp.draw(_local2, _local3);
_local2.timer--;
if (_local2.timer <= 0){
_local2.timer = 2;
newSmoke((_local2.x - (_local2.xv * 2)), (_local2.y - (_local2.yv * 2)));
};
_local4 = (Math.atan2(_local2.yv, _local2.xv) * (180 / Math.PI));
_local2.rotation = _local4;
_local2.rot = _local2.rotation;
_local5 = (ship.x - _local2.x);
_local6 = (ship.y - _local2.y);
if (((_local5 * _local5) + (_local6 * _local6)) < 400){
explode(_local2.x, _local2.y, 2);
game.removeChild(_local2);
missiles.splice(_local1, 1);
_local1--;
playerHit();
} else {
if ((((((((((_local2.health <= 0)) || ((_local2.x < -50)))) || ((_local2.y > (stageH + 50))))) || ((_local2.y < -50)))) || ((_local2.x > (stageW + 50))))){
explode(_local2.x, _local2.y, 2);
game.removeChild(_local2);
missiles.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
}
}
}//package pyroblossomCMG_fla
Section 24
//menuintro_120 (pyroblossomCMG_fla.menuintro_120)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class menuintro_120 extends MovieClip {
public var btn3:MovieClip;
public var btn2:MovieClip;
public var btn4:MovieClip;
public var btn1:MovieClip;
public function menuintro_120(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 25
//moregamesbtn_48 (pyroblossomCMG_fla.moregamesbtn_48)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class moregamesbtn_48 extends MovieClip {
public function moregamesbtn_48(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 26
//nobtn_76 (pyroblossomCMG_fla.nobtn_76)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class nobtn_76 extends MovieClip {
public function nobtn_76(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 27
//optionsbtn_106 (pyroblossomCMG_fla.optionsbtn_106)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class optionsbtn_106 extends MovieClip {
public function optionsbtn_106(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 28
//pausedflash_59 (pyroblossomCMG_fla.pausedflash_59)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class pausedflash_59 extends MovieClip {
public function pausedflash_59(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
gotoAndPlay(2);
}
}
}//package pyroblossomCMG_fla
Section 29
//playbtn_105 (pyroblossomCMG_fla.playbtn_105)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class playbtn_105 extends MovieClip {
public function playbtn_105(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 30
//Preloader_2 (pyroblossomCMG_fla.Preloader_2)
package pyroblossomCMG_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Preloader_2 extends MovieClip {
public var CMG_LoadingBar:MovieClip;
public var play_btn:SimpleButton;
public function Preloader_2(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
play_btn.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler_CMGPlayBtn);
}
public function onMouseUpHandler_CMGPlayBtn(_arg1:MouseEvent):void{
MovieClip(parent).gotoAndStop(82);
}
}
}//package pyroblossomCMG_fla
Section 31
//purchasetxt_77 (pyroblossomCMG_fla.purchasetxt_77)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class purchasetxt_77 extends MovieClip {
public function purchasetxt_77(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 32
//pyroblossomintro_118 (pyroblossomCMG_fla.pyroblossomintro_118)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class pyroblossomintro_118 extends MovieClip {
public function pyroblossomintro_118(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 33
//score_63 (pyroblossomCMG_fla.score_63)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class score_63 extends MovieClip {
public var num1:MovieClip;
public var num3:MovieClip;
public var num6:MovieClip;
public var num7:MovieClip;
public var num4:MovieClip;
public var num5:MovieClip;
public var num2:MovieClip;
public var num8:MovieClip;
}
}//package pyroblossomCMG_fla
Section 34
//scorenumber_64 (pyroblossomCMG_fla.scorenumber_64)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class scorenumber_64 extends MovieClip {
public function scorenumber_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 35
//submitbtn_49 (pyroblossomCMG_fla.submitbtn_49)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class submitbtn_49 extends MovieClip {
public function submitbtn_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 36
//viewbtn_50 (pyroblossomCMG_fla.viewbtn_50)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class viewbtn_50 extends MovieClip {
public function viewbtn_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 37
//yesbtn_75 (pyroblossomCMG_fla.yesbtn_75)
package pyroblossomCMG_fla {
import flash.display.*;
public dynamic class yesbtn_75 extends MovieClip {
public function yesbtn_75(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package pyroblossomCMG_fla
Section 38
//bigbullet (bigbullet)
package {
import flash.display.*;
public dynamic class bigbullet extends MovieClip {
}
}//package
Section 39
//bomber (bomber)
package {
import flash.display.*;
public dynamic class bomber extends MovieClip {
public var rotor:MovieClip;
}
}//package
Section 40
//boss1 (boss1)
package {
import flash.display.*;
public dynamic class boss1 extends MovieClip {
}
}//package
Section 41
//boss2 (boss2)
package {
import flash.display.*;
public dynamic class boss2 extends MovieClip {
public var blades1:MovieClip;
public var blades2:MovieClip;
}
}//package
Section 42
//boss3 (boss3)
package {
import flash.display.*;
public dynamic class boss3 extends MovieClip {
}
}//package
Section 43
//boss4 (boss4)
package {
import flash.display.*;
public dynamic class boss4 extends MovieClip {
public var blades1:MovieClip;
public var blades2:MovieClip;
}
}//package
Section 44
//boss5 (boss5)
package {
import flash.display.*;
public dynamic class boss5 extends MovieClip {
}
}//package
Section 45
//boss6 (boss6)
package {
import flash.display.*;
public dynamic class boss6 extends MovieClip {
}
}//package
Section 46
//bullet (bullet)
package {
import flash.display.*;
public dynamic class bullet extends MovieClip {
}
}//package
Section 47
//callend (callend)
package {
import flash.media.*;
public dynamic class callend extends Sound {
}
}//package
Section 48
//cloud (cloud)
package {
import flash.display.*;
public dynamic class cloud extends MovieClip {
}
}//package
Section 49
//credits (credits)
package {
import flash.display.*;
public dynamic class credits extends MovieClip {
}
}//package
Section 50
//enemybullet (enemybullet)
package {
import flash.display.*;
public dynamic class enemybullet extends MovieClip {
}
}//package
Section 51
//enemychopper1 (enemychopper1)
package {
import flash.display.*;
public dynamic class enemychopper1 extends MovieClip {
public var blades:MovieClip;
}
}//package
Section 52
//explode1 (explode1)
package {
import flash.media.*;
public dynamic class explode1 extends Sound {
}
}//package
Section 53
//explode2 (explode2)
package {
import flash.media.*;
public dynamic class explode2 extends Sound {
}
}//package
Section 54
//explode3 (explode3)
package {
import flash.media.*;
public dynamic class explode3 extends Sound {
}
}//package
Section 55
//explosion (explosion)
package {
import flash.display.*;
public dynamic class explosion extends MovieClip {
}
}//package
Section 56
//gameover (gameover)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameover extends MovieClip {
public var btn3:MovieClip;
public var btn2:MovieClip;
public var btn4:MovieClip;
public var btn1:MovieClip;
public var ti:MovieClip;
public var nom:TextField;
}
}//package
Section 57
//GUI (GUI)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GUI extends MovieClip {
public var lives2:TextField;
public var lives1:TextField;
public var leveldisp:MovieClip;
public var lbar:MovieClip;
public var bossbar:MovieClip;
public var score:MovieClip;
public var calltext:MovieClip;
public var pauseflash:MovieClip;
public var pbar:MovieClip;
public var bossback:MovieClip;
public var callPannel:MovieClip;
}
}//package
Section 58
//hammerbullet (hammerbullet)
package {
import flash.display.*;
public dynamic class hammerbullet extends MovieClip {
}
}//package
Section 59
//healthbar (healthbar)
package {
import flash.display.*;
public dynamic class healthbar extends MovieClip {
}
}//package
Section 60
//hit1 (hit1)
package {
import flash.media.*;
public dynamic class hit1 extends Sound {
}
}//package
Section 61
//kaching (kaching)
package {
import flash.media.*;
public dynamic class kaching extends Sound {
}
}//package
Section 62
//launcher (launcher)
package {
import flash.display.*;
public dynamic class launcher extends MovieClip {
public var blades1:MovieClip;
public var blades2:MovieClip;
}
}//package
Section 63
//levelup (levelup)
package {
import flash.media.*;
public dynamic class levelup extends Sound {
}
}//package
Section 64
//makingcall (makingcall)
package {
import flash.media.*;
public dynamic class makingcall extends Sound {
}
}//package
Section 65
//menuchange (menuchange)
package {
import flash.media.*;
public dynamic class menuchange extends Sound {
}
}//package
Section 66
//menuselect (menuselect)
package {
import flash.media.*;
public dynamic class menuselect extends Sound {
}
}//package
Section 67
//missile (missile)
package {
import flash.display.*;
public dynamic class missile extends MovieClip {
}
}//package
Section 68
//missionreport (missionreport)
package {
import flash.display.*;
import flash.text.*;
public dynamic class missionreport extends MovieClip {
public var lives:TextField;
public var presskey:MovieClip;
public var btn2:MovieClip;
public var btn1:MovieClip;
public var leveltxt:TextField;
public var killed:TextField;
public var gold:TextField;
public var purchasetxt:MovieClip;
public var grade:TextField;
}
}//package
Section 69
//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{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 70
//money (money)
package {
import flash.display.*;
public dynamic class money extends MovieClip {
}
}//package
Section 71
//musicboss (musicboss)
package {
import flash.media.*;
public dynamic class musicboss extends Sound {
}
}//package
Section 72
//musicdialog (musicdialog)
package {
import flash.media.*;
public dynamic class musicdialog extends Sound {
}
}//package
Section 73
//musicfinalboss (musicfinalboss)
package {
import flash.media.*;
public dynamic class musicfinalboss extends Sound {
}
}//package
Section 74
//musicgame (musicgame)
package {
import flash.media.*;
public dynamic class musicgame extends Sound {
}
}//package
Section 75
//musictitle (musictitle)
package {
import flash.media.*;
public dynamic class musictitle extends Sound {
}
}//package
Section 76
//musicwarning1 (musicwarning1)
package {
import flash.media.*;
public dynamic class musicwarning1 extends Sound {
}
}//package
Section 77
//musicwarning2 (musicwarning2)
package {
import flash.media.*;
public dynamic class musicwarning2 extends Sound {
}
}//package
Section 78
//muteic (muteic)
package {
import flash.display.*;
public dynamic class muteic extends MovieClip {
public function muteic(){
addFrameScript(29, frame30, 60, frame61);
}
function frame30(){
stop();
}
function frame61(){
stop();
}
}
}//package
Section 79
//opencall (opencall)
package {
import flash.media.*;
public dynamic class opencall extends Sound {
}
}//package
Section 80
//pellet (pellet)
package {
import flash.display.*;
public dynamic class pellet extends MovieClip {
}
}//package
Section 81
//plane (plane)
package {
import flash.display.*;
public dynamic class plane extends MovieClip {
}
}//package
Section 82
//player (player)
package {
import flash.display.*;
public dynamic class player extends MovieClip {
public var ship:MovieClip;
public var blades2:MovieClip;
public var blades:MovieClip;
public function player(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 83
//player1option (player1option)
package {
import flash.display.*;
public dynamic class player1option extends MovieClip {
public var blades:MovieClip;
}
}//package
Section 84
//player2 (player2)
package {
import flash.display.*;
public dynamic class player2 extends MovieClip {
public var blades1:MovieClip;
public var blades2:MovieClip;
}
}//package
Section 85
//power (power)
package {
import flash.display.*;
public dynamic class power extends MovieClip {
}
}//package
Section 86
//powerbarcover (powerbarcover)
package {
import flash.display.*;
public dynamic class powerbarcover extends MovieClip {
}
}//package
Section 87
//powertext (powertext)
package {
import flash.display.*;
public dynamic class powertext extends MovieClip {
public function powertext(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 88
//psycho (psycho)
package {
import flash.media.*;
public dynamic class psycho extends Sound {
}
}//package
Section 89
//reportsound (reportsound)
package {
import flash.media.*;
public dynamic class reportsound extends Sound {
}
}//package
Section 90
//rocket (rocket)
package {
import flash.display.*;
public dynamic class rocket extends MovieClip {
}
}//package
Section 91
//rocketship (rocketship)
package {
import flash.display.*;
public dynamic class rocketship extends MovieClip {
}
}//package
Section 92
//scores (scores)
package {
import flash.display.*;
public dynamic class scores extends MovieClip {
public var pressany:MovieClip;
}
}//package
Section 93
//scrollingtxt (scrollingtxt)
package {
import flash.display.*;
import flash.text.*;
public dynamic class scrollingtxt extends MovieClip {
public var txt:TextField;
}
}//package
Section 94
//shipparticle (shipparticle)
package {
import flash.display.*;
public dynamic class shipparticle extends MovieClip {
public function shipparticle(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 95
//smoke (smoke)
package {
import flash.display.*;
public dynamic class smoke extends MovieClip {
}
}//package
Section 96
//specialspin (specialspin)
package {
import flash.display.*;
public dynamic class specialspin extends MovieClip {
}
}//package
Section 97
//spinner (spinner)
package {
import flash.display.*;
public dynamic class spinner extends MovieClip {
}
}//package
Section 98
//stealthplane (stealthplane)
package {
import flash.display.*;
public dynamic class stealthplane extends MovieClip {
}
}//package
Section 99
//textplay (textplay)
package {
import flash.media.*;
public dynamic class textplay extends Sound {
}
}//package
Section 100
//titlescreen (titlescreen)
package {
import flash.display.*;
public dynamic class titlescreen extends MovieClip {
public var btn3:MovieClip;
public var btn2:MovieClip;
public var btn4:MovieClip;
public var btn1:MovieClip;
}
}//package
Section 101
//trans (trans)
package {
import flash.display.*;
public dynamic class trans extends MovieClip {
public function trans(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 102
//warning (warning)
package {
import flash.display.*;
public dynamic class warning extends MovieClip {
}
}//package