Section 1
//005MUNAIZD_95 (desertslidehighscore_fla.005MUNAIZD_95)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 005MUNAIZD_95 extends MovieClip {
public var tu:MovieClip;
public function 005MUNAIZD_95(){
addFrameScript(1, frame2);
}
function frame2(){
if (((this.parent) && (this.parent.parent))){
tu.rotation = -(this.parent.parent.rotation);
};
}
}
}//package desertslidehighscore_fla
Section 2
//04_66 (desertslidehighscore_fla.04_66)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 04_66 extends MovieClip {
public var body:MovieClip;
public var c:MovieClip;
public var drawb:MovieClip;
public var hand:MovieClip;
public var b2:MovieClip;
public var a2:MovieClip;
public var drawa:MovieClip;
public function 04_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package desertslidehighscore_fla
Section 3
//04_91 (desertslidehighscore_fla.04_91)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 04_91 extends MovieClip {
public var body:MovieClip;
public var c:MovieClip;
public var drawb:MovieClip;
public var hand:MovieClip;
public var b2:MovieClip;
public var a2:MovieClip;
public var drawa:MovieClip;
public function 04_91(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package desertslidehighscore_fla
Section 4
//04LUOTUOZHUANTI_104 (desertslidehighscore_fla.04LUOTUOZHUANTI_104)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 04LUOTUOZHUANTI_104 extends MovieClip {
public var tu:MovieClip;
public function 04LUOTUOZHUANTI_104(){
addFrameScript(1, frame2);
}
function frame2(){
if (((this.parent) && (this.parent.parent))){
tu.rotation = -(this.parent.parent.rotation);
};
}
}
}//package desertslidehighscore_fla
Section 5
//04TUONIAOZAIDI_60 (desertslidehighscore_fla.04TUONIAOZAIDI_60)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 04TUONIAOZAIDI_60 extends MovieClip {
public var tu:MovieClip;
public function 04TUONIAOZAIDI_60(){
addFrameScript(1, frame2);
}
function frame2(){
if (((this.parent) && (this.parent.parent))){
tu.rotation = -(this.parent.parent.rotation);
};
}
}
}//package desertslidehighscore_fla
Section 6
//04tuoniaozhuaqi_99 (desertslidehighscore_fla.04tuoniaozhuaqi_99)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 04tuoniaozhuaqi_99 extends MovieClip {
public var body:MovieClip;
public var c:MovieClip;
public var drawb:MovieClip;
public var hand:MovieClip;
public var b2:MovieClip;
public var a2:MovieClip;
public var drawa:MovieClip;
public function 04tuoniaozhuaqi_99(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package desertslidehighscore_fla
Section 7
//04tuoniaozhunb_65 (desertslidehighscore_fla.04tuoniaozhunb_65)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 04tuoniaozhunb_65 extends MovieClip {
public function 04tuoniaozhunb_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package desertslidehighscore_fla
Section 8
//111_63 (desertslidehighscore_fla.111_63)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class 111_63 extends MovieClip {
public function 111_63(){
addFrameScript(31, frame32);
}
function frame32(){
this.gotoAndPlay(20);
}
}
}//package desertslidehighscore_fla
Section 9
//dadiyidong_53 (desertslidehighscore_fla.dadiyidong_53)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class dadiyidong_53 extends MovieClip {
public function dadiyidong_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package desertslidehighscore_fla
Section 10
//gameslist_24 (desertslidehighscore_fla.gameslist_24)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class gameslist_24 extends MovieClip {
public function gameslist_24(){
addFrameScript(80, frame81);
}
function frame81(){
stop();
}
}
}//package desertslidehighscore_fla
Section 11
//loading_2 (desertslidehighscore_fla.loading_2)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class loading_2 extends MovieClip {
public function loading_2(){
addFrameScript(0, frame1, 99, frame100);
}
function frame100(){
stop();
}
function frame1(){
stop();
}
}
}//package desertslidehighscore_fla
Section 12
//particular_30 (desertslidehighscore_fla.particular_30)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class particular_30 extends MovieClip {
public function particular_30(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package desertslidehighscore_fla
Section 13
//Timeline_1 (desertslidehighscore_fla.Timeline_1)
package desertslidehighscore_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class Timeline_1 extends MovieClip {
public var con:SimpleButton;
public var loadMC:MovieClip;
public var mc:SimpleButton;
public function Timeline_1(){
addFrameScript(0, frame1, 12, frame13);
}
public function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gameslist.com"), "_blank");
}
function frame1(){
stop();
mc.addEventListener(MouseEvent.CLICK, onClick);
}
function frame13(){
stop();
con.addEventListener(MouseEvent.CLICK, onClick1);
}
public function onClick1(_arg1:MouseEvent):void{
MovieClip(this.parent).gotoAndStop(2);
}
}
}//package desertslidehighscore_fla
Section 14
//Timeline_101 (desertslidehighscore_fla.Timeline_101)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_101 extends MovieClip {
public var slideMC:MovieClip;
public function Timeline_101(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package desertslidehighscore_fla
Section 15
//Timeline_106 (desertslidehighscore_fla.Timeline_106)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_106 extends MovieClip {
public function Timeline_106(){
addFrameScript(20, frame21);
}
function frame21(){
this.gotoAndPlay(6);
}
}
}//package desertslidehighscore_fla
Section 16
//Timeline_23 (desertslidehighscore_fla.Timeline_23)
package desertslidehighscore_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class Timeline_23 extends MovieClip {
public var mc:SimpleButton;
public function Timeline_23(){
addFrameScript(0, frame1, 58, frame59, 119, frame120);
}
function frame59(){
}
function frame120(){
MovieClip(this.parent).gotoAndStop(5);
}
function frame1(){
mc.addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gameslist.com"), "_blank");
}
}
}//package desertslidehighscore_fla
Section 17
//Timeline_58 (desertslidehighscore_fla.Timeline_58)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_58 extends MovieClip {
public var slideMC:MovieClip;
public function Timeline_58(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package desertslidehighscore_fla
Section 18
//Timeline_80 (desertslidehighscore_fla.Timeline_80)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_80 extends MovieClip {
public var pauseBn:SimpleButton;
public function Timeline_80(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package desertslidehighscore_fla
Section 19
//Timeline_85 (desertslidehighscore_fla.Timeline_85)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_85 extends MovieClip {
public var soundBn:SimpleButton;
public function Timeline_85(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package desertslidehighscore_fla
Section 20
//Timeline_92 (desertslidehighscore_fla.Timeline_92)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_92 extends MovieClip {
public var slideMC:MovieClip;
public function Timeline_92(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package desertslidehighscore_fla
Section 21
//Timeline_97 (desertslidehighscore_fla.Timeline_97)
package desertslidehighscore_fla {
import flash.display.*;
public dynamic class Timeline_97 extends MovieClip {
public function Timeline_97(){
addFrameScript(18, frame19);
}
function frame19(){
this.gotoAndPlay(4);
}
}
}//package desertslidehighscore_fla
Section 22
//GamesListAPIAS3 (GamesList.as3.GamesListAPIAS3)
package GamesList.as3 {
import flash.net.*;
public class GamesListAPIAS3 {
private static var HighScore_Pass:String;
private static var HighScore_GameName:String;
private static var HighScore_ScoreID:String;
private static var HighScore_RequestURL:URLRequest;
public static function submitScore(_arg1:Number):void{
trace("submitscore");
var _local2:* = GamesListMD5AS3.calculate(((HighScore_Pass + HighScore_ScoreID) + _arg1));
HighScore_RequestURL.url = ((((((("http://www.gameslist.com/submitscore.php?game=" + HighScore_GameName) + "&scoreid=") + HighScore_ScoreID) + "&score=") + _arg1) + "&key=") + _local2);
navigateToURL(HighScore_RequestURL, "_blank");
}
public static function config(_arg1:String, _arg2:String):void{
HighScore_GameName = _arg1;
HighScore_Pass = _arg2;
HighScore_RequestURL = new URLRequest();
}
public static function GenerateScoreID():void{
var _local1:Date = new Date();
HighScore_ScoreID = (_local1.getTime() + String((Math.floor((Math.random() * 9000)) + 1000)));
}
}
}//package GamesList.as3
Section 23
//GamesListMD5AS3 (GamesList.as3.GamesListMD5AS3)
package GamesList.as3 {
public class GamesListMD5AS3 {
private static var hexChars:String = "0123456789abcdef";
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((rol(_local9, _arg7) + _arg3));
}
public static function calculate(_arg1:String):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((toHex(_local2) + toHex(_local3)) + toHex(_local4)) + toHex(_local5)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
private static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package GamesList.as3
Section 24
//AbstractCollection (org.cove.ape.AbstractCollection)
package org.cove.ape {
import flash.display.*;
import flash.utils.*;
public class AbstractCollection {
private var _sprite:Sprite;
private var _particles:Array;
private var _isParented:Boolean;
private var _constraints:Array;
public function AbstractCollection(){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractCollection"){
throw (new ArgumentError("AbstractCollection can't be instantiated directly"));
};
_isParented = false;
_particles = new Array();
_constraints = new Array();
}
public function removeConstraint(_arg1:AbstractConstraint):void{
var _local2:int = constraints.indexOf(_arg1);
if (_local2 == -1){
return;
};
constraints.splice(_local2, 1);
_arg1.cleanup();
}
public function getAll():Array{
return (particles.concat(constraints));
}
function checkCollisionsVsCollection(_arg1:AbstractCollection):void{
var _local5:AbstractParticle;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:AbstractParticle;
var _local10:SpringConstraint;
var _local11:SpringConstraint;
var _local12:int;
var _local2:int = _particles.length;
var _local3:int;
while (_local3 < _local2) {
_local5 = _particles[_local3];
if (!_local5.collidable){
} else {
_local6 = _arg1.particles.length;
_local7 = 0;
while (_local7 < _local6) {
_local9 = _arg1.particles[_local7];
if (_local9.collidable){
CollisionDetector.test(_local5, _local9);
};
_local7++;
};
_local8 = _arg1.constraints.length;
_local7 = 0;
while (_local7 < _local8) {
_local10 = _arg1.constraints[_local7];
if (((_local10.collidable) && (!(_local10.isConnectedTo(_local5))))){
_local10.scp.updatePosition();
CollisionDetector.test(_local5, _local10.scp);
};
_local7++;
};
};
_local3++;
};
var _local4:int = _constraints.length;
_local3 = 0;
while (_local3 < _local4) {
_local11 = _constraints[_local3];
if (!_local11.collidable){
} else {
_local6 = _arg1.particles.length;
_local12 = 0;
while (_local12 < _local6) {
_local9 = _arg1.particles[_local12];
if (((_local9.collidable) && (!(_local11.isConnectedTo(_local9))))){
_local11.scp.updatePosition();
CollisionDetector.test(_local9, _local11.scp);
};
_local12++;
};
};
_local3++;
};
}
public function get sprite():Sprite{
if (_sprite != null){
return (_sprite);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_sprite = new Sprite();
APEngine.container.addChild(_sprite);
return (_sprite);
}
function checkInternalCollisions():void{
var _local3:AbstractParticle;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:AbstractParticle;
var _local8:SpringConstraint;
var _local1:int = _particles.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _particles[_local2];
if (!_local3.collidable){
} else {
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local7 = _particles[_local4];
if (_local7.collidable){
CollisionDetector.test(_local3, _local7);
};
_local4++;
};
_local5 = _constraints.length;
_local6 = 0;
while (_local6 < _local5) {
_local8 = _constraints[_local6];
if (((_local8.collidable) && (!(_local8.isConnectedTo(_local3))))){
_local8.scp.updatePosition();
CollisionDetector.test(_local3, _local8.scp);
};
_local6++;
};
};
_local2++;
};
}
public function addParticle(_arg1:AbstractParticle):void{
particles.push(_arg1);
if (isParented){
_arg1.init();
};
}
public function init():void{
var _local1:int;
while (_local1 < particles.length) {
particles[_local1].init();
_local1++;
};
_local1 = 0;
while (_local1 < constraints.length) {
constraints[_local1].init();
_local1++;
};
}
function satisfyConstraints():void{
var _local3:AbstractConstraint;
var _local1:int = _constraints.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _constraints[_local2];
_local3.resolve();
_local2++;
};
}
function get isParented():Boolean{
return (_isParented);
}
public function paint():void{
var _local1:AbstractParticle;
var _local4:SpringConstraint;
var _local2:int = _particles.length;
var _local3:int;
while (_local3 < _local2) {
_local1 = _particles[_local3];
if (((!(_local1.fixed)) || (_local1.alwaysRepaint))){
_local1.paint();
};
_local3++;
};
_local2 = _constraints.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _constraints[_local3];
if (((!(_local4.fixed)) || (_local4.alwaysRepaint))){
_local4.paint();
};
_local3++;
};
}
public function addConstraint(_arg1:AbstractConstraint):void{
constraints.push(_arg1);
if (isParented){
_arg1.init();
};
}
function set isParented(_arg1:Boolean):void{
_isParented = _arg1;
}
public function removeParticle(_arg1:AbstractParticle):void{
var _local2:int = particles.indexOf(_arg1);
if (_local2 == -1){
return;
};
particles.splice(_local2, 1);
_arg1.cleanup();
}
public function cleanup():void{
var _local1:int;
while (_local1 < particles.length) {
particles[_local1].cleanup();
_local1++;
};
_local1 = 0;
while (_local1 < constraints.length) {
constraints[_local1].cleanup();
_local1++;
};
}
public function get particles():Array{
return (_particles);
}
function integrate(_arg1:Number):void{
var _local4:AbstractParticle;
var _local2:int = _particles.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _particles[_local3];
_local4.update(_arg1);
_local3++;
};
}
public function get constraints():Array{
return (_constraints);
}
public function addParticleLeft(_arg1:AbstractParticle):void{
particles.unshift(_arg1);
if (isParented){
_arg1.init();
};
}
}
}//package org.cove.ape
Section 25
//AbstractConstraint (org.cove.ape.AbstractConstraint)
package org.cove.ape {
import flash.utils.*;
public class AbstractConstraint extends AbstractItem {
private var _stiffness:Number;
public function AbstractConstraint(_arg1:Number){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractConstraint"){
throw (new ArgumentError("AbstractConstraint can't be instantiated directly"));
};
this.stiffness = _arg1;
setStyle();
}
function resolve():void{
}
public function set stiffness(_arg1:Number):void{
_stiffness = _arg1;
}
public function get stiffness():Number{
return (_stiffness);
}
}
}//package org.cove.ape
Section 26
//AbstractItem (org.cove.ape.AbstractItem)
package org.cove.ape {
import flash.display.*;
public class AbstractItem {
var lineAlpha:Number;
private var _bitmap:Bitmap;
var lineColor:uint;
var displayObjectOffset:Vector;
var lineThickness:Number;
var displayObject:DisplayObject;
var fillAlpha:Number;
private var _sprite:Sprite;
var fillColor:uint;
private var _visible:Boolean;
private var _alwaysRepaint:Boolean;
var displayObjectRotation:Number;
public function AbstractItem(){
_visible = true;
_alwaysRepaint = false;
}
public function setLine(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1):void{
lineThickness = _arg1;
lineColor = _arg2;
lineAlpha = _arg3;
}
public function set visible(_arg1:Boolean):void{
_visible = _arg1;
sprite.visible = _arg1;
bitmap.visible = _arg1;
}
public function setFill(_arg1:uint=0xFFFFFF, _arg2:Number=1):void{
fillColor = _arg1;
fillAlpha = _arg2;
}
public function init():void{
}
public function get bitmap():Bitmap{
if (_bitmap != null){
return (_bitmap);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_bitmap = new Bitmap();
APEngine.container.addChild(_bitmap);
return (_bitmap);
}
public function get sprite():Sprite{
if (_sprite != null){
return (_sprite);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_sprite = new Sprite();
APEngine.container.addChild(_sprite);
return (_sprite);
}
public function paint():void{
}
public function cleanup():void{
sprite.graphics.clear();
var _local1:int;
while (_local1 < sprite.numChildren) {
sprite.removeChildAt(_local1);
_local1++;
};
}
public function set bitmap(_arg1:Bitmap):void{
this._bitmap = _arg1;
APEngine.container.addChild(_bitmap);
}
public function setStyle(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:uint=0xFFFFFF, _arg5:Number=1):void{
setLine(_arg1, _arg2, _arg3);
setFill(_arg4, _arg5);
}
public function get visible():Boolean{
return (_visible);
}
final public function set alwaysRepaint(_arg1:Boolean):void{
_alwaysRepaint = _arg1;
}
final public function get alwaysRepaint():Boolean{
return (_alwaysRepaint);
}
}
}//package org.cove.ape
Section 27
//AbstractParticle (org.cove.ape.AbstractParticle)
package org.cove.ape {
import flash.display.*;
import flash.utils.*;
public class AbstractParticle extends AbstractItem {
private var _collidable:Boolean;
private var _center:Vector;
private var collision:Collision;
var prev:Vector;
private var _kfr:Number;
var interval:Interval;
private var _invMass:Number;
var curr:Vector;
private var _mass:Number;
private var temp:Vector;
private var _friction:Number;
var samp:Vector;
private var _multisample:int;
private var _fixed:Boolean;
private var forces:Vector;
public function AbstractParticle(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:Number){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractParticle"){
throw (new ArgumentError("AbstractParticle can't be instantiated directly"));
};
interval = new Interval(0, 0);
curr = new Vector(_arg1, _arg2);
prev = new Vector(_arg1, _arg2);
samp = new Vector();
temp = new Vector();
fixed = _arg3;
forces = new Vector();
collision = new Collision(new Vector(), new Vector());
collidable = true;
this.mass = _arg4;
this.elasticity = _arg5;
this.friction = _arg6;
setStyle();
_center = new Vector();
_multisample = 0;
}
function get invMass():Number{
return ((fixed) ? 0 : _invMass);
}
public function get px():Number{
return (curr.x);
}
public function get py():Number{
return (curr.y);
}
public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
displayObject = _arg1;
displayObjectRotation = _arg4;
displayObjectOffset = new Vector(_arg2, _arg3);
}
public function set px(_arg1:Number):void{
curr.x = _arg1;
prev.x = _arg1;
}
public function set py(_arg1:Number):void{
curr.y = _arg1;
prev.y = _arg1;
}
function getComponents(_arg1:Vector):Collision{
var _local2:Vector = velocity;
var _local3:Number = _arg1.dot(_local2);
collision.vn = _arg1.mult(_local3);
collision.vt = _local2.minus(collision.vn);
return (collision);
}
public function get mass():Number{
return (_mass);
}
function initDisplay():void{
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
sprite.addChild(displayObject);
}
public function get multisample():int{
return (_multisample);
}
public function get position():Vector{
return (new Vector(curr.x, curr.y));
}
function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
curr.plusEquals(_arg1);
velocity = _arg2;
}
public function get elasticity():Number{
return (_kfr);
}
public function set velocity(_arg1:Vector):void{
prev = curr.minus(_arg1);
}
public function addMasslessForce(_arg1:Vector):void{
forces.plusEquals(_arg1);
}
public function set collidable(_arg1:Boolean):void{
_collidable = _arg1;
}
public function set multisample(_arg1:int):void{
_multisample = _arg1;
}
public function addForce(_arg1:Vector):void{
forces.plusEquals(_arg1.mult(invMass));
}
public function set position(_arg1:Vector):void{
curr.copy(_arg1);
prev.copy(_arg1);
}
public function get center():Vector{
_center.setTo(px, py);
return (_center);
}
public function update(_arg1:Number):void{
if (fixed){
return;
};
addForce(APEngine.force);
addMasslessForce(APEngine.masslessForce);
temp.copy(curr);
var _local2:Vector = velocity.plus(forces.multEquals(_arg1));
curr.plusEquals(_local2.multEquals(APEngine.damping));
prev.copy(temp);
forces.setTo(0, 0);
}
public function get velocity():Vector{
return (curr.minus(prev));
}
public function get collidable():Boolean{
return (_collidable);
}
public function set mass(_arg1:Number):void{
if (_arg1 <= 0){
throw (new ArgumentError("mass may not be set <= 0"));
};
_mass = _arg1;
_invMass = (1 / _mass);
}
public function set fixed(_arg1:Boolean):void{
_fixed = _arg1;
}
public function set elasticity(_arg1:Number):void{
_kfr = _arg1;
}
public function set friction(_arg1:Number):void{
if ((((_arg1 < 0)) || ((_arg1 > 1)))){
throw (new ArgumentError("Legal friction must be >= 0 and <=1"));
};
_friction = _arg1;
}
public function get friction():Number{
return (_friction);
}
public function get fixed():Boolean{
return (_fixed);
}
}
}//package org.cove.ape
Section 28
//APEngine (org.cove.ape.APEngine)
package org.cove.ape {
import flash.display.*;
public final class APEngine {
private static var _container:DisplayObjectContainer;
private static var _damping:Number;
private static var _constraintCollisionCycles:int;
private static var groups:Array;
static var masslessForce:Vector;
private static var _constraintCycles:int;
static var force:Vector;
private static var timeStep:Number;
private static var numGroups:int;
public static function get container():DisplayObjectContainer{
return (_container);
}
public static function get constraintCollisionCycles():int{
return (_constraintCollisionCycles);
}
public static function set damping(_arg1:Number):void{
_damping = _arg1;
}
public static function step():void{
integrate();
var _local1:int;
while (_local1 < _constraintCycles) {
satisfyConstraints();
_local1++;
};
var _local2:int;
while (_local2 < _constraintCollisionCycles) {
satisfyConstraints();
checkCollisions();
_local2++;
};
}
public static function init(_arg1:Number=0.25):void{
timeStep = (_arg1 * _arg1);
numGroups = 0;
groups = new Array();
force = new Vector(0, 0);
masslessForce = new Vector(0, 0);
damping = 1;
_constraintCycles = 0;
_constraintCollisionCycles = 1;
}
public static function get constraintCycles():int{
return (_constraintCycles);
}
public static function set constraintCollisionCycles(_arg1:int):void{
_constraintCollisionCycles = _arg1;
}
public static function set constraintCycles(_arg1:int):void{
_constraintCycles = _arg1;
}
public static function addForce(_arg1:Vector):void{
force.plusEquals(_arg1);
}
public static function get damping():Number{
return (_damping);
}
public static function set container(_arg1:DisplayObjectContainer):void{
_container = _arg1;
}
public static function addGroup(_arg1:Group):void{
groups.push(_arg1);
_arg1.isParented = true;
numGroups++;
_arg1.init();
}
public static function removeGroup(_arg1:Group):void{
var _local2:int = groups.indexOf(_arg1);
if (_local2 == -1){
return;
};
groups.splice(_local2, 1);
_arg1.isParented = false;
numGroups--;
_arg1.cleanup();
}
public static function paint():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.paint();
_local1++;
};
}
private static function checkCollisions():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.checkCollisions();
_local1++;
};
}
private static function integrate():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.integrate(timeStep);
_local1++;
};
}
private static function satisfyConstraints():void{
var _local2:Group;
var _local1:int;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.satisfyConstraints();
_local1++;
};
}
public static function addMasslessForce(_arg1:Vector):void{
masslessForce.plusEquals(_arg1);
}
}
}//package org.cove.ape
Section 29
//CircleParticle (org.cove.ape.CircleParticle)
package org.cove.ape {
public class CircleParticle extends AbstractParticle {
private var _radius:Number;
public function CircleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0){
super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7);
_radius = _arg3;
}
override public function init():void{
cleanup();
if (displayObject != null){
initDisplay();
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawCircle(0, 0, radius);
sprite.graphics.endFill();
};
paint();
}
public function set radius(_arg1:Number):void{
_radius = _arg1;
}
function getProjection(_arg1:Vector):Interval{
var _local2:Number = samp.dot(_arg1);
interval.min = (_local2 - _radius);
interval.max = (_local2 + _radius);
return (interval);
}
function getIntervalY():Interval{
interval.min = (curr.y - _radius);
interval.max = (curr.y + _radius);
return (interval);
}
public function get radius():Number{
return (_radius);
}
function getIntervalX():Interval{
interval.min = (curr.x - _radius);
interval.max = (curr.x + _radius);
return (interval);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
}
}
}//package org.cove.ape
Section 30
//Collision (org.cove.ape.Collision)
package org.cove.ape {
import org.cove.ape.*;
final class Collision {
var vn:Vector;
var vt:Vector;
function Collision(_arg1:Vector, _arg2:Vector){
this.vn = _arg1;
this.vt = _arg2;
}
}
}//package org.cove.ape
Section 31
//CollisionDetector (org.cove.ape.CollisionDetector)
package org.cove.ape {
import org.cove.ape.*;
final class CollisionDetector {
private static function testOBBvsCircle(_arg1:RectangleParticle, _arg2:CircleParticle):Boolean{
var _local3:Vector;
var _local8:Vector;
var _local9:Number;
var _local10:Vector;
var _local11:Number;
var _local4:Number = Number.POSITIVE_INFINITY;
var _local5:Array = new Array(2);
var _local6:int;
while (_local6 < 2) {
_local8 = _arg1.axes[_local6];
_local9 = testIntervals(_arg1.getProjection(_local8), _arg2.getProjection(_local8));
if (_local9 == 0){
return (false);
};
if (Math.abs(_local9) < Math.abs(_local4)){
_local3 = _local8;
_local4 = _local9;
};
_local5[_local6] = _local9;
_local6++;
};
var _local7:Number = _arg2.radius;
if ((((Math.abs(_local5[0]) < _local7)) && ((Math.abs(_local5[1]) < _local7)))){
_local10 = closestVertexOnOBB(_arg2.samp, _arg1);
_local3 = _local10.minus(_arg2.samp);
_local11 = _local3.magnitude();
_local4 = (_local7 - _local11);
if (_local4 > 0){
_local3.divEquals(_local11);
} else {
return (false);
};
};
CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local3, _local4);
return (true);
}
static function test(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
if (((_arg1.fixed) && (_arg2.fixed))){
return;
};
if ((((_arg1.multisample == 0)) && ((_arg2.multisample == 0)))){
normVsNorm(_arg1, _arg2);
} else {
if ((((_arg1.multisample > 0)) && ((_arg2.multisample == 0)))){
sampVsNorm(_arg1, _arg2);
} else {
if ((((_arg2.multisample > 0)) && ((_arg1.multisample == 0)))){
sampVsNorm(_arg2, _arg1);
} else {
if (_arg1.multisample == _arg2.multisample){
sampVsSamp(_arg1, _arg2);
} else {
normVsNorm(_arg1, _arg2);
};
};
};
};
}
private static function testIntervals(_arg1:Interval, _arg2:Interval):Number{
if (_arg1.max < _arg2.min){
return (0);
};
if (_arg2.max < _arg1.min){
return (0);
};
var _local3:Number = (_arg2.max - _arg1.min);
var _local4:Number = (_arg2.min - _arg1.max);
return (((Math.abs(_local3))<Math.abs(_local4)) ? _local3 : _local4);
}
private static function normVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
_arg1.samp.copy(_arg1.curr);
_arg2.samp.copy(_arg2.curr);
testTypes(_arg1, _arg2);
}
private static function testCirclevsCircle(_arg1:CircleParticle, _arg2:CircleParticle):Boolean{
var _local3:Number = testIntervals(_arg1.getIntervalX(), _arg2.getIntervalX());
if (_local3 == 0){
return (false);
};
var _local4:Number = testIntervals(_arg1.getIntervalY(), _arg2.getIntervalY());
if (_local4 == 0){
return (false);
};
var _local5:Vector = _arg1.samp.minus(_arg2.samp);
var _local6:Number = _local5.magnitude();
var _local7:Number = ((_arg1.radius + _arg2.radius) - _local6);
if (_local7 > 0){
_local5.divEquals(_local6);
CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local5, _local7);
return (true);
};
return (false);
}
private static function testTypes(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{
if ((((_arg1 is RectangleParticle)) && ((_arg2 is RectangleParticle)))){
return (testOBBvsOBB((_arg1 as RectangleParticle), (_arg2 as RectangleParticle)));
};
if ((((_arg1 is CircleParticle)) && ((_arg2 is CircleParticle)))){
return (testCirclevsCircle((_arg1 as CircleParticle), (_arg2 as CircleParticle)));
};
if ((((_arg1 is RectangleParticle)) && ((_arg2 is CircleParticle)))){
return (testOBBvsCircle((_arg1 as RectangleParticle), (_arg2 as CircleParticle)));
};
if ((((_arg1 is CircleParticle)) && ((_arg2 is RectangleParticle)))){
return (testOBBvsCircle((_arg2 as RectangleParticle), (_arg1 as CircleParticle)));
};
return (false);
}
private static function sampVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
var _local3:Number = (1 / (_arg1.multisample + 1));
var _local4:Number = _local3;
_arg2.samp.copy(_arg2.curr);
var _local5:int;
while (_local5 <= _arg1.multisample) {
_arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y))));
if (testTypes(_arg1, _arg2)){
return;
};
_local4 = (_local4 + _local3);
_local5++;
};
}
private static function closestVertexOnOBB(_arg1:Vector, _arg2:RectangleParticle):Vector{
var _local6:Number;
var _local3:Vector = _arg1.minus(_arg2.samp);
var _local4:Vector = new Vector(_arg2.samp.x, _arg2.samp.y);
var _local5:int;
while (_local5 < 2) {
_local6 = _local3.dot(_arg2.axes[_local5]);
if (_local6 >= 0){
_local6 = _arg2.extents[_local5];
} else {
if (_local6 < 0){
_local6 = -(_arg2.extents[_local5]);
};
};
_local4.plusEquals(_arg2.axes[_local5].mult(_local6));
_local5++;
};
return (_local4);
}
private static function testOBBvsOBB(_arg1:RectangleParticle, _arg2:RectangleParticle):Boolean{
var _local3:Vector;
var _local6:Vector;
var _local7:Number;
var _local8:Vector;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Boolean;
var _local4:Number = Number.POSITIVE_INFINITY;
var _local5:int;
while (_local5 < 2) {
_local6 = _arg1.axes[_local5];
_local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6));
if (_local7 == 0){
return (false);
};
_local8 = _arg2.axes[_local5];
_local9 = testIntervals(_arg1.getProjection(_local8), _arg2.getProjection(_local8));
if (_local9 == 0){
return (false);
};
_local10 = Math.abs(_local7);
_local11 = Math.abs(_local9);
if ((((_local10 < Math.abs(_local4))) || ((_local11 < Math.abs(_local4))))){
_local12 = (_local10 < _local11);
_local3 = (_local12) ? _local6 : _local8;
_local4 = (_local12) ? _local7 : _local9;
};
_local5++;
};
CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local3, _local4);
_arg1.sprite.dispatchEvent(new CollisionEvent(CollisionEvent.COLLIDE, false, false, _arg2));
_arg2.sprite.dispatchEvent(new CollisionEvent(CollisionEvent.COLLIDE, false, false, _arg1));
return (true);
}
private static function sampVsSamp(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
var _local3:Number = (1 / (_arg1.multisample + 1));
var _local4:Number = _local3;
var _local5:int;
while (_local5 <= _arg1.multisample) {
_arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y))));
_arg2.samp.setTo((_arg2.prev.x + (_local4 * (_arg2.curr.x - _arg2.prev.x))), (_arg2.prev.y + (_local4 * (_arg2.curr.y - _arg2.prev.y))));
if (testTypes(_arg1, _arg2)){
return;
};
_local4 = (_local4 + _local3);
_local5++;
};
}
}
}//package org.cove.ape
Section 32
//CollisionEvent (org.cove.ape.CollisionEvent)
package org.cove.ape {
import flash.events.*;
public class CollisionEvent extends Event {
private var _collidingItem:AbstractItem;
public static const COLLIDE:String = "collide";
public static const FIRST_COLLIDE:String = "firstCollide";
public function CollisionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:AbstractItem=null){
super(_arg1, _arg2, _arg3);
_collidingItem = _arg4;
}
public function get collidingItem():AbstractItem{
var _local1:SpringConstraintParticle;
if ((_collidingItem is SpringConstraintParticle)){
_local1 = (_collidingItem as SpringConstraintParticle);
return (_local1);
};
return (_collidingItem);
}
}
}//package org.cove.ape
Section 33
//CollisionResolver (org.cove.ape.CollisionResolver)
package org.cove.ape {
import org.cove.ape.*;
final class CollisionResolver {
static function resolveParticleParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Vector, _arg4:Number):void{
_arg1.curr.copy(_arg1.samp);
_arg2.curr.copy(_arg2.samp);
var _local5:Vector = _arg3.mult(_arg4);
var _local6:Number = (_arg1.elasticity + _arg2.elasticity);
var _local7:Number = (_arg1.invMass + _arg2.invMass);
var _local8:Number = clamp((1 - (_arg1.friction + _arg2.friction)), 0, 1);
var _local9:Collision = _arg1.getComponents(_arg3);
var _local10:Collision = _arg2.getComponents(_arg3);
var _local11:Vector = _local10.vn.mult(((_local6 + 1) * _arg1.invMass)).plus(_local9.vn.mult((_arg2.invMass - (_local6 * _arg1.invMass)))).divEquals(_local7);
var _local12:Vector = _local9.vn.mult(((_local6 + 1) * _arg2.invMass)).plus(_local10.vn.mult((_arg1.invMass - (_local6 * _arg2.invMass)))).divEquals(_local7);
_local9.vt.multEquals(_local8);
_local10.vt.multEquals(_local8);
var _local13:Vector = _local5.mult((_arg1.invMass / _local7));
var _local14:Vector = _local5.mult((-(_arg2.invMass) / _local7));
_local11.plusEquals(_local9.vt);
_local12.plusEquals(_local10.vt);
if (!_arg1.fixed){
_arg1.resolveCollision(_local13, _local11, _arg3, _arg4, -1, _arg2);
};
if (!_arg2.fixed){
_arg2.resolveCollision(_local14, _local12, _arg3, _arg4, 1, _arg1);
};
}
static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 > _arg3){
return (_arg3);
};
if (_arg1 < _arg2){
return (_arg2);
};
return (_arg1);
}
}
}//package org.cove.ape
Section 34
//Composite (org.cove.ape.Composite)
package org.cove.ape {
public class Composite extends AbstractCollection {
private var delta:Vector;
public function Composite(){
delta = new Vector();
}
public function rotateByAngle(_arg1:Number, _arg2:Vector):void{
var _local3:Number = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY);
rotateByRadian(_local3, _arg2);
}
public function rotateByRadian(_arg1:Number, _arg2:Vector):void{
var _local3:AbstractParticle;
var _local7:Number;
var _local8:Number;
var _local4:Array = particles;
var _local5:int = _local4.length;
var _local6:int;
while (_local6 < _local5) {
_local3 = _local4[_local6];
_local7 = _local3.center.distance(_arg2);
_local8 = (getRelativeAngle(_arg2, _local3.center) + _arg1);
_local3.px = ((Math.cos(_local8) * _local7) + _arg2.x);
_local3.py = ((Math.sin(_local8) * _local7) + _arg2.y);
_local6++;
};
}
public function get fixed():Boolean{
var _local1:int;
while (_local1 < particles.length) {
if (!particles[_local1].fixed){
return (false);
};
_local1++;
};
return (true);
}
private function getRelativeAngle(_arg1:Vector, _arg2:Vector):Number{
delta.setTo((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
return (Math.atan2(delta.y, delta.x));
}
public function set fixed(_arg1:Boolean):void{
var _local2:int;
while (_local2 < particles.length) {
particles[_local2].fixed = _arg1;
_local2++;
};
}
}
}//package org.cove.ape
Section 35
//Group (org.cove.ape.Group)
package org.cove.ape {
public class Group extends AbstractCollection {
private var _composites:Array;
private var _collisionList:Array;
private var _collideInternal:Boolean;
public function Group(_arg1:Boolean=false){
_composites = new Array();
_collisionList = new Array();
this.collideInternal = _arg1;
}
public function addCollidableList(_arg1:Array):void{
var _local3:Group;
var _local2:int;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
collisionList.push(_local3);
_local2++;
};
}
function checkCollisions():void{
var _local3:Group;
if (collideInternal){
checkCollisionGroupInternal();
};
var _local1:int = collisionList.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = collisionList[_local2];
checkCollisionVsGroup(_local3);
_local2++;
};
}
public function removeComposite(_arg1:Composite):void{
var _local2:int = composites.indexOf(_arg1);
if (_local2 == -1){
return;
};
composites.splice(_local2, 1);
_arg1.isParented = false;
_arg1.cleanup();
}
override public function cleanup():void{
super.cleanup();
var _local1:int;
while (_local1 < composites.length) {
composites[_local1].cleanup();
_local1++;
};
}
public function removeCollidable(_arg1:Group):void{
var _local2:int = collisionList.indexOf(_arg1);
if (_local2 == -1){
return;
};
collisionList.splice(_local2, 1);
}
public function addComposite(_arg1:Composite):void{
composites.push(_arg1);
_arg1.isParented = true;
if (isParented){
_arg1.init();
};
}
public function addCollidable(_arg1:Group):void{
collisionList.push(_arg1);
}
override function integrate(_arg1:Number):void{
var _local4:Composite;
super.integrate(_arg1);
var _local2:int = _composites.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _composites[_local3];
_local4.integrate(_arg1);
_local3++;
};
}
public function get composites():Array{
return (_composites);
}
override public function init():void{
super.init();
var _local1:int;
while (_local1 < composites.length) {
composites[_local1].init();
_local1++;
};
}
override public function getAll():Array{
return (particles.concat(constraints).concat(composites));
}
public function get collisionList():Array{
return (_collisionList);
}
private function checkCollisionGroupInternal():void{
var _local3:Composite;
var _local4:int;
var _local5:Composite;
checkInternalCollisions();
var _local1:int = _composites.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.checkCollisionsVsCollection(this);
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local5 = _composites[_local4];
_local3.checkCollisionsVsCollection(_local5);
_local4++;
};
_local2++;
};
}
override function satisfyConstraints():void{
var _local3:Composite;
super.satisfyConstraints();
var _local1:int = _composites.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.satisfyConstraints();
_local2++;
};
}
public function get collideInternal():Boolean{
return (_collideInternal);
}
public function set collideInternal(_arg1:Boolean):void{
_collideInternal = _arg1;
}
override public function paint():void{
var _local3:Composite;
super.paint();
var _local1:int = _composites.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.paint();
_local2++;
};
}
private function checkCollisionVsGroup(_arg1:Group):void{
var _local5:Composite;
var _local6:int;
var _local7:Composite;
checkCollisionsVsCollection(_arg1);
var _local2:int = _composites.length;
var _local3:int = _arg1.composites.length;
var _local4:int;
while (_local4 < _local2) {
_local5 = _composites[_local4];
_local5.checkCollisionsVsCollection(_arg1);
_local6 = 0;
while (_local6 < _local3) {
_local7 = _arg1.composites[_local6];
_local5.checkCollisionsVsCollection(_local7);
_local6++;
};
_local4++;
};
_local6 = 0;
while (_local6 < _local3) {
_local7 = _arg1.composites[_local6];
checkCollisionsVsCollection(_local7);
_local6++;
};
}
}
}//package org.cove.ape
Section 36
//Interval (org.cove.ape.Interval)
package org.cove.ape {
final class Interval {
var min:Number;
var max:Number;
function Interval(_arg1:Number, _arg2:Number){
this.min = _arg1;
this.max = _arg2;
}
function toString():String{
return (((min + " : ") + max));
}
}
}//package org.cove.ape
Section 37
//MathUtil (org.cove.ape.MathUtil)
package org.cove.ape {
final class MathUtil {
static var ONE_EIGHTY_OVER_PI:Number = 57.2957795130823;
static var PI_OVER_ONE_EIGHTY:Number = 0.0174532925199433;
static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 < _arg2){
return (_arg2);
};
if (_arg1 > _arg3){
return (_arg3);
};
return (_arg1);
}
static function sign(_arg1:Number):int{
if (_arg1 < 0){
return (-1);
};
return (1);
}
}
}//package org.cove.ape
Section 38
//RectangleParticle (org.cove.ape.RectangleParticle)
package org.cove.ape {
public class RectangleParticle extends AbstractParticle {
private var _axes:Array;
private var _radian:Number;
private var _extents:Array;
public var hitStr:String;
public function RectangleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0.3, _arg9:Number=0){
super(_arg1, _arg2, _arg6, _arg7, _arg8, _arg9);
_extents = new Array((_arg3 / 2), (_arg4 / 2));
_axes = new Array(new Vector(0, 0), new Vector(0, 0));
radian = _arg5;
}
public function get radian():Number{
return (_radian);
}
public function set radian(_arg1:Number):void{
_radian = _arg1;
setAxes(_arg1);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
sprite.rotation = angle;
}
public function set angle(_arg1:Number):void{
radian = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY);
}
function get extents():Array{
return (_extents);
}
public function set width(_arg1:Number):void{
_extents[0] = (_arg1 / 2);
}
public function get width():Number{
return ((_extents[0] * 2));
}
public function set height(_arg1:Number):void{
_extents[1] = (_arg1 / 2);
}
override public function init():void{
var _local1:Number;
var _local2:Number;
cleanup();
if (displayObject != null){
initDisplay();
} else {
_local1 = (extents[0] * 2);
_local2 = (extents[1] * 2);
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawRect((-(_local1) / 2), (-(_local2) / 2), _local1, _local2);
sprite.graphics.endFill();
};
paint();
}
function getProjection(_arg1:Vector):Interval{
var _local2:Number = ((extents[0] * Math.abs(_arg1.dot(axes[0]))) + (extents[1] * Math.abs(_arg1.dot(axes[1]))));
var _local3:Number = samp.dot(_arg1);
interval.min = (_local3 - _local2);
interval.max = (_local3 + _local2);
return (interval);
}
public function get height():Number{
return ((_extents[1] * 2));
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
function get axes():Array{
return (_axes);
}
private function setAxes(_arg1:Number):void{
var _local2:Number = Math.sin(_arg1);
var _local3:Number = Math.cos(_arg1);
axes[0].x = _local3;
axes[0].y = _local2;
axes[1].x = -(_local2);
axes[1].y = _local3;
}
}
}//package org.cove.ape
Section 39
//SpringConstraint (org.cove.ape.SpringConstraint)
package org.cove.ape {
import flash.display.*;
public class SpringConstraint extends AbstractConstraint {
private var _collidable:Boolean;
private var p1:AbstractParticle;
private var p2:AbstractParticle;
private var _scp:SpringConstraintParticle;
private var _restLength:Number;
public function SpringConstraint(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Number=0.5, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=1, _arg7:Boolean=false){
super(_arg3);
this.p1 = _arg1;
this.p2 = _arg2;
checkParticlesLocation();
_restLength = currLength;
setCollidable(_arg4, _arg5, _arg6, _arg7);
}
public function get fixed():Boolean{
return (((p1.fixed) && (p2.fixed)));
}
public function get rectScale():Number{
return (scp.rectScale);
}
public function set rectScale(_arg1:Number):void{
if (scp == null){
return;
};
scp.rectScale = _arg1;
}
public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
if (collidable){
scp.setDisplay(_arg1, _arg2, _arg3, _arg4);
} else {
displayObject = _arg1;
displayObjectRotation = _arg4;
displayObjectOffset = new Vector(_arg2, _arg3);
};
}
override public function init():void{
cleanup();
if (collidable){
scp.init();
} else {
if (displayObject != null){
initDisplay();
};
};
paint();
}
function initDisplay():void{
if (collidable){
scp.initDisplay();
} else {
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
sprite.addChild(displayObject);
};
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
public function get center():Vector{
return (p1.curr.plus(p2.curr).divEquals(2));
}
public function set rectHeight(_arg1:Number):void{
if (scp == null){
return;
};
scp.rectHeight = _arg1;
}
public function get restLength():Number{
return (_restLength);
}
override public function paint():void{
var _local1:Vector;
if (collidable){
scp.paint();
} else {
if (displayObject != null){
_local1 = center;
sprite.x = _local1.x;
sprite.y = _local1.y;
sprite.rotation = angle;
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.moveTo(p1.px, p1.py);
sprite.graphics.lineTo(p2.px, p2.py);
};
};
}
function get scp():SpringConstraintParticle{
return (_scp);
}
public function get collidable():Boolean{
return (_collidable);
}
public function setCollidable(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
_collidable = _arg1;
_scp = null;
if (_collidable){
_scp = new SpringConstraintParticle(p1, p2, this, _arg2, _arg3, _arg4);
};
}
public function isConnectedTo(_arg1:AbstractParticle):Boolean{
return ((((_arg1 == p1)) || ((_arg1 == p2))));
}
public function get rectHeight():Number{
return (scp.rectHeight);
}
override function resolve():void{
if (((p1.fixed) && (p2.fixed))){
return;
};
var _local1:Number = currLength;
var _local2:Number = ((_local1 - restLength) / (_local1 * (p1.invMass + p2.invMass)));
var _local3:Vector = delta.mult((_local2 * stiffness));
p1.curr.minusEquals(_local3.mult(p1.invMass));
p2.curr.plusEquals(_local3.mult(p2.invMass));
}
public function set fixedEndLimit(_arg1:Number):void{
if (scp == null){
return;
};
scp.fixedEndLimit = _arg1;
}
public function get radian():Number{
var _local1:Vector = delta;
return (Math.atan2(_local1.y, _local1.x));
}
public function set restLength(_arg1:Number):void{
if (_arg1 <= 0){
throw (new ArgumentError("restLength must be greater than 0"));
};
_restLength = _arg1;
}
public function get currLength():Number{
return (p1.curr.distance(p2.curr));
}
public function get fixedEndLimit():Number{
return (scp.fixedEndLimit);
}
private function checkParticlesLocation():void{
if ((((p1.curr.x == p2.curr.x)) && ((p1.curr.y == p2.curr.y)))){
p2.curr.x = (p2.curr.x + 0.0001);
};
}
function get delta():Vector{
return (p1.curr.minus(p2.curr));
}
}
}//package org.cove.ape
Section 40
//SpringConstraintParticle (org.cove.ape.SpringConstraintParticle)
package org.cove.ape {
import flash.display.*;
import org.cove.ape.*;
class SpringConstraintParticle extends RectangleParticle {
private var p1:AbstractParticle;
private var lambda:Vector;
private var p2:AbstractParticle;
private var _rectHeight:Number;
private var avgVelocity:Vector;
private var rca:Vector;
private var rcb:Vector;
private var _rectScale:Number;
private var parent:SpringConstraint;
private var scaleToLength:Boolean;
private var s:Number;
private var _fixedEndLimit:Number;
function SpringConstraintParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:SpringConstraint, _arg4:Number, _arg5:Number, _arg6:Boolean){
super(0, 0, 0, 0, 0, false);
this.p1 = _arg1;
this.p2 = _arg2;
lambda = new Vector(0, 0);
avgVelocity = new Vector(0, 0);
parent = _arg3;
this.rectScale = _arg5;
this.rectHeight = _arg4;
this.scaleToLength = _arg6;
fixedEndLimit = 0;
rca = new Vector();
rcb = new Vector();
}
private function setCorners(_arg1:RectangleParticle, _arg2:int):void{
var _local3:Number = _arg1.curr.x;
var _local4:Number = _arg1.curr.y;
var _local5:Array = _arg1.axes;
var _local6:Array = _arg1.extents;
var _local7:Number = (_local5[0].x * _local6[0]);
var _local8:Number = (_local5[0].y * _local6[0]);
var _local9:Number = (_local5[1].x * _local6[1]);
var _local10:Number = (_local5[1].y * _local6[1]);
var _local11:Number = (_local7 - _local9);
var _local12:Number = (_local8 - _local10);
var _local13:Number = (_local7 + _local9);
var _local14:Number = (_local8 + _local10);
if (_arg2 == 0){
rca.x = (_local3 - _local13);
rca.y = (_local4 - _local14);
rcb.x = (_local3 + _local11);
rcb.y = (_local4 + _local12);
} else {
if (_arg2 == 1){
rca.x = (_local3 + _local11);
rca.y = (_local4 + _local12);
rcb.x = (_local3 + _local13);
rcb.y = (_local4 + _local14);
} else {
if (_arg2 == 2){
rca.x = (_local3 + _local13);
rca.y = (_local4 + _local14);
rcb.x = (_local3 - _local11);
rcb.y = (_local4 - _local12);
} else {
if (_arg2 == 3){
rca.x = (_local3 - _local11);
rca.y = (_local4 - _local12);
rcb.x = (_local3 - _local13);
rcb.y = (_local4 - _local14);
};
};
};
};
}
override function get invMass():Number{
if (((p1.fixed) && (p2.fixed))){
return (0);
};
return ((1 / ((p1.mass + p2.mass) / 2)));
}
function get rectScale():Number{
return (_rectScale);
}
function set rectScale(_arg1:Number):void{
_rectScale = _arg1;
}
override public function get friction():Number{
return (((p1.friction + p2.friction) / 2));
}
override public function init():void{
var _local1:Sprite;
var _local2:Number;
var _local3:Number;
if (displayObject != null){
initDisplay();
} else {
_local1 = new Sprite();
parent.sprite.addChild(_local1);
_local1.name = "inner";
_local2 = (parent.currLength * rectScale);
_local3 = rectHeight;
_local1.graphics.clear();
_local1.graphics.lineStyle(parent.lineThickness, parent.lineColor, parent.lineAlpha);
_local1.graphics.beginFill(parent.fillColor, parent.fillAlpha);
_local1.graphics.drawRect((-(_local2) / 2), (-(_local3) / 2), _local2, _local3);
_local1.graphics.endFill();
};
paint();
}
override function initDisplay():void{
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
var _local1:Sprite = new Sprite();
_local1.name = "inner";
_local1.addChild(displayObject);
parent.sprite.addChild(_local1);
}
function set rectHeight(_arg1:Number):void{
_rectHeight = _arg1;
}
function updatePosition():void{
var _local1:Vector = parent.center;
curr.setTo(_local1.x, _local1.y);
width = (scaleToLength) ? (parent.currLength * rectScale) : (parent.restLength * rectScale);
height = rectHeight;
radian = parent.radian;
}
override public function get velocity():Vector{
var _local1:Vector = p1.velocity;
var _local2:Vector = p2.velocity;
avgVelocity.setTo(((_local1.x + _local2.x) / 2), ((_local1.y + _local2.y) / 2));
return (avgVelocity);
}
override public function paint():void{
var _local1:Vector = parent.center;
var _local2:Sprite = parent.sprite;
if (scaleToLength){
_local2.getChildByName("inner").width = (parent.currLength * rectScale);
} else {
if (displayObject != null){
_local2.getChildByName("inner").width = (parent.restLength * rectScale);
};
};
_local2.x = _local1.x;
_local2.y = _local1.y;
_local2.rotation = parent.angle;
}
private function getContactPointParam(_arg1:AbstractParticle):Number{
var _local2:Number;
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:int;
var _local7:Number;
if ((_arg1 is CircleParticle)){
_local2 = closestParamPoint(_arg1.curr);
} else {
if ((_arg1 is RectangleParticle)){
_local4 = new Array(4);
_local5 = Number.POSITIVE_INFINITY;
_local6 = 0;
while (_local6 < 4) {
setCorners((_arg1 as RectangleParticle), _local6);
_local7 = closestPtSegmentSegment();
if (_local7 < _local5){
_local5 = _local7;
_local3 = _local6;
_local4[_local6] = s;
};
_local6++;
};
_local2 = _local4[_local3];
};
};
return (_local2);
}
function set fixedEndLimit(_arg1:Number):void{
_fixedEndLimit = _arg1;
}
private function closestPtSegmentSegment():Number{
var _local8:Number;
var _local1:Vector = p1.curr;
var _local2:Vector = p2.curr;
var _local3:Vector = rca;
var _local4:Vector = rcb;
var _local5:Vector = _local2.minus(_local1);
var _local6:Vector = _local4.minus(_local3);
var _local7:Vector = _local1.minus(_local3);
var _local9:Number = _local5.dot(_local5);
var _local10:Number = _local6.dot(_local6);
var _local11:Number = _local6.dot(_local7);
var _local12:Number = _local5.dot(_local7);
var _local13:Number = _local5.dot(_local6);
var _local14:Number = ((_local9 * _local10) - (_local13 * _local13));
if (_local14 != 0){
s = MathUtil.clamp((((_local13 * _local11) - (_local12 * _local10)) / _local14), 0, 1);
} else {
s = 0.5;
};
_local8 = (((_local13 * s) + _local11) / _local10);
if (_local8 < 0){
_local8 = 0;
s = MathUtil.clamp((-(_local12) / _local9), 0, 1);
} else {
if (_local8 > 0){
_local8 = 1;
s = MathUtil.clamp(((_local13 - _local12) / _local9), 0, 1);
};
};
var _local15:Vector = _local1.plus(_local5.mult(s));
var _local16:Vector = _local3.plus(_local6.mult(_local8));
var _local17:Vector = _local15.minus(_local16);
return (_local15.minus(_local16).dot(_local17));
}
override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
var _local10:Number;
var _local11:AbstractParticle;
var _local7:Number = getContactPointParam(_arg6);
var _local8:Number = (1 - _local7);
var _local9:Number = _local7;
if (p1.fixed){
if (_local9 <= fixedEndLimit){
return;
};
lambda.setTo((_arg1.x / _local9), (_arg1.y / _local9));
p2.curr.plusEquals(lambda);
p2.velocity = _arg2;
} else {
if (p2.fixed){
if (_local8 <= fixedEndLimit){
return;
};
lambda.setTo((_arg1.x / _local8), (_arg1.y / _local8));
p1.curr.plusEquals(lambda);
p1.velocity = _arg2;
} else {
_local10 = ((_local8 * _local8) + (_local9 * _local9));
if (_local10 == 0){
return;
};
lambda.setTo((_arg1.x / _local10), (_arg1.y / _local10));
p1.curr.plusEquals(lambda.mult(_local8));
p2.curr.plusEquals(lambda.mult(_local9));
if (_local7 == 0.5){
p1.velocity = _arg2;
p2.velocity = _arg2;
} else {
_local11 = ((_local7)<0.5) ? p1 : p2;
_local11.velocity = _arg2;
};
};
};
}
function get rectHeight():Number{
return (_rectHeight);
}
function get fixedEndLimit():Number{
return (_fixedEndLimit);
}
override public function get elasticity():Number{
return (((p1.elasticity + p2.elasticity) / 2));
}
override public function get mass():Number{
return (((p1.mass + p2.mass) / 2));
}
private function closestParamPoint(_arg1:Vector):Number{
var _local2:Vector = p2.curr.minus(p1.curr);
var _local3:Number = (_local2.dot(_arg1.minus(p1.curr)) / _local2.dot(_local2));
return (MathUtil.clamp(_local3, 0, 1));
}
}
}//package org.cove.ape
Section 41
//Vector (org.cove.ape.Vector)
package org.cove.ape {
public class Vector {
public var x:Number;
public var y:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function cross(_arg1:Vector):Number{
return (((x * _arg1.y) - (y * _arg1.x)));
}
public function magnitude():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function divEquals(_arg1:Number):Vector{
if (_arg1 == 0){
_arg1 = 0.0001;
};
x = (x / _arg1);
y = (y / _arg1);
return (this);
}
public function times(_arg1:Vector):Vector{
return (new Vector((x * _arg1.x), (y * _arg1.y)));
}
public function plusEquals(_arg1:Vector):Vector{
x = (x + _arg1.x);
y = (y + _arg1.y);
return (this);
}
public function dot(_arg1:Vector):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function toString():String{
return (((x + " : ") + y));
}
public function normalize():Vector{
var _local1:Number = magnitude();
if (_local1 == 0){
_local1 = 0.0001;
};
return (mult((1 / _local1)));
}
public function minusEquals(_arg1:Vector):Vector{
x = (x - _arg1.x);
y = (y - _arg1.y);
return (this);
}
public function copy(_arg1:Vector):void{
x = _arg1.x;
y = _arg1.y;
}
public function multEquals(_arg1:Number):Vector{
x = (x * _arg1);
y = (y * _arg1);
return (this);
}
public function minus(_arg1:Vector):Vector{
return (new Vector((x - _arg1.x), (y - _arg1.y)));
}
public function plus(_arg1:Vector):Vector{
return (new Vector((x + _arg1.x), (y + _arg1.y)));
}
public function distance(_arg1:Vector):Number{
var _local2:Vector = this.minus(_arg1);
return (_local2.magnitude());
}
public function setTo(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
public function mult(_arg1:Number):Vector{
return (new Vector((x * _arg1), (y * _arg1)));
}
}
}//package org.cove.ape
Section 42
//BeginScene (scene.BeginScene)
package scene {
import flash.events.*;
import vo.*;
import flash.net.*;
public class BeginScene {
public function BeginScene(){
DesertSlide.instance.movie.gotoAndPlay(1, "begin");
DesertSlide.instance.addScriptToNextframe(init, DesertSlide.instance.movie.currentScene.numFrames);
}
private function init():void{
DesertSlide.instance.movie.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:Event):void{
switch (_arg1.target.name){
case "playBn":
this.destory();
new GateScene();
break;
case "moreBn":
navigateToURL(new URLRequest(def.URL), "_blank");
break;
case "towebBn":
navigateToURL(new URLRequest(def.TOWEBURL), "_blank");
break;
};
}
private function destory():void{
DesertSlide.instance.movie.removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package scene
Section 43
//GameScene (scene.GameScene)
package scene {
import flash.events.*;
import flash.display.*;
import org.cove.ape.*;
import GamesList.as3.*;
import vo.*;
import flash.text.*;
import flash.net.*;
public class GameScene extends Sprite {
private var _roadGroup:RoadGroup;
private var _lastX:Number;
private var INIT_VECTOR:Number;// = 20
private var _score:TextField;
private var _pauseFlag:Boolean;// = true
private var _moveOstrich:MovieClip;
private var _pauseBtn:MovieClip;
private var _soundBtn:MovieClip;
private var _backGround:MovieClip;
private var _cirbody:CirBody;
private var _replayBn:SimpleButton;
private var _ostrich:Ostrich;
private var _circle:MovieClip;
private var _backBn:SimpleButton;
private var _moveFlag:Boolean;
public static var stopGame:Boolean;
public static var valueX:Number;
public static var mainSprite:Sprite;
public function GameScene(_arg1:String){
def.isSound = true;
stopGame = false;
_pauseFlag = true;
_moveFlag = false;
mainSprite = new Sprite();
DesertSlide.instance.movie.gotoAndStop(1, _arg1);
DesertSlide.instance.addScriptToNextframe(init);
}
private function run(_arg1:Event):void{
if (stopGame){
selectSecne();
} else {
APEngine.step();
APEngine.paint();
_ostrich.update();
_score.text = (((_ostrich.px * 0.025) >> 0) + "");
APEngine.container.x = (-(_ostrich.px) + 280);
if ((APEngine.container.y + _ostrich.py) > 300){
APEngine.container.y = (-(_ostrich.py) + 300);
};
if ((APEngine.container.y + _ostrich.py) < 250){
APEngine.container.y = (-(_ostrich.py) + 250);
};
valueX = Math.abs((APEngine.container.x - _lastX));
_lastX = APEngine.container.x;
if (int(_score.text) > 1000){
selectSecne();
};
};
}
private function gameOver():void{
(DesertSlide.instance.getMovie("score") as TextField).text = "0";
_roadGroup.destroy();
APEngine.removeGroup(_roadGroup);
APEngine.removeGroup(_ostrich);
this.parent.removeChildAt(0);
this.parent.removeChild(mainSprite);
}
private function addAPEgine():void{
this.parent.addChildAt(mainSprite, 0);
this.parent.addChildAt((DesertSlide.instance.getMovie("show") as MovieClip), 0);
_moveFlag = true;
addEventListener(Event.ENTER_FRAME, run);
APEngine.init(0.25);
APEngine.container = mainSprite;
APEngine.addMasslessForce(new Vector(0, 5));
APEngine.addForce(new Vector(-4, 0));
var _local1:Number = ((_cirbody.getAngle() * Math.PI) / 180);
var _local2:Number = _cirbody.getDis();
_roadGroup = new RoadGroup(0, _backGround.width);
APEngine.addGroup(_roadGroup);
_ostrich = new Ostrich((((INIT_VECTOR * _local2) * Math.cos(_local1)) * 2), (((INIT_VECTOR * _local2) * Math.sin(_local1)) * 2.5), _local1);
APEngine.addGroup(_ostrich);
_lastX = APEngine.container.x;
_ostrich.addCollidable(_roadGroup);
_pauseBtn = DesertSlide.instance.getMovie("pause");
_pauseBtn.addEventListener(MouseEvent.CLICK, pauseBtnClick);
stage.addEventListener(MouseEvent.CLICK, mouseDownHandler);
}
private function init():void{
var _local1:SimpleButton = (DesertSlide.instance.getMovie("submitBtn") as SimpleButton);
_local1.visible = false;
var _local2:SimpleButton = (DesertSlide.instance.getMovie("playMoreBtn") as SimpleButton);
_local2.visible = false;
var _local3:SimpleButton = (DesertSlide.instance.getMovie("backBtn") as SimpleButton);
_local3.visible = false;
var _local4:SimpleButton = (DesertSlide.instance.getMovie("PlayMoreGamesBtn") as SimpleButton);
_local4.visible = false;
_circle = (DesertSlide.instance.getMovie("circle") as MovieClip);
_circle.visible = false;
_moveOstrich = (DesertSlide.instance.getMovie("move") as MovieClip);
_moveOstrich.visible = false;
var _local5:MovieClip = (DesertSlide.instance.getMovie("start") as MovieClip);
_local5.visible = true;
_local5.buttonMode = true;
_backGround = DesertSlide.instance.getMovie("backGround");
mainSprite.addChild(_backGround);
_score = DesertSlide.instance.getMovie("score");
_score.text = "0";
_replayBn = DesertSlide.instance.getMovie("replayBn");
_replayBn.addEventListener(MouseEvent.CLICK, repalyBtnClick);
_backBn = DesertSlide.instance.getMovie("backBn");
_backBn.addEventListener(MouseEvent.CLICK, backBnHandler);
_soundBtn = DesertSlide.instance.getMovie("soundBtn");
_soundBtn.addEventListener(MouseEvent.CLICK, soundBtnClick);
_local5.addEventListener(MouseEvent.MOUSE_DOWN, startOtrEvent);
}
private function PlayMoreGamesBtnClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gameslist.com"), "_blank");
}
private function playMoreBtnClick(_arg1:MouseEvent):void{
_arg1.target.removeEventListener(MouseEvent.CLICK, playMoreBtnClick);
gameOver();
new GateScene();
}
private function selectSecne():void{
removeEvent();
var _local1:SimpleButton = (DesertSlide.instance.getMovie("submitBtn") as SimpleButton);
_local1.visible = true;
var _local2:TextField = DesertSlide.instance.getMovie("result");
_local2.text = _score.text;
_local1.addEventListener(MouseEvent.CLICK, submitBtnClick);
var _local3:SimpleButton = (DesertSlide.instance.getMovie("playMoreBtn") as SimpleButton);
_local3.visible = true;
_local3.addEventListener(MouseEvent.CLICK, playMoreBtnClick);
var _local4:SimpleButton = (DesertSlide.instance.getMovie("backBtn") as SimpleButton);
_local4.visible = true;
_local4.addEventListener(MouseEvent.CLICK, backBtnClick);
var _local5:SimpleButton = (DesertSlide.instance.getMovie("PlayMoreGamesBtn") as SimpleButton);
_local5.visible = true;
_local5.addEventListener(MouseEvent.CLICK, PlayMoreGamesBtnClick);
}
private function repalyBtnClick(_arg1:MouseEvent):void{
removeEvent();
if (_moveFlag){
gameOver();
};
new GateScene();
}
private function pauseBtnClick(_arg1:MouseEvent):void{
_pauseBtn.play();
if (_pauseFlag){
removeEventListener(Event.ENTER_FRAME, run);
stage.removeEventListener(MouseEvent.CLICK, mouseDownHandler);
} else {
stage.addEventListener(MouseEvent.CLICK, mouseDownHandler);
addEventListener(Event.ENTER_FRAME, run);
};
_pauseFlag = !(_pauseFlag);
}
private function mouseDownHandler(_arg1:MouseEvent):void{
_ostrich.jumpForce();
}
private function mouseUpEvent(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpEvent);
_cirbody.stop();
_moveOstrich.visible = false;
_circle.visible = false;
var _local2:MovieClip = DesertSlide.instance.getMovie("moveScene");
mainSprite.addChild(_local2);
def.soundControl.lauchUp();
addAPEgine();
}
private function submitBtnClick(_arg1:MouseEvent):void{
GamesListAPIAS3.submitScore(Number(_score.text));
}
private function backBtnClick(_arg1:MouseEvent):void{
_arg1.target.removeEventListener(MouseEvent.CLICK, backBtnClick);
gameOver();
new BeginScene();
}
private function backBnHandler(_arg1:MouseEvent):void{
removeEvent();
if (_moveFlag){
gameOver();
};
new BeginScene();
}
private function soundBtnClick(_arg1:MouseEvent):void{
_soundBtn.play();
def.isSound = !(def.isSound);
}
private function removeEvent():void{
removeEventListener(Event.ENTER_FRAME, run);
if (_moveFlag){
_pauseBtn.removeEventListener(MouseEvent.CLICK, pauseBtnClick);
};
_soundBtn.removeEventListener(MouseEvent.CLICK, soundBtnClick);
_replayBn.removeEventListener(MouseEvent.CLICK, repalyBtnClick);
_backBn.removeEventListener(MouseEvent.CLICK, backBnHandler);
stage.removeEventListener(MouseEvent.CLICK, mouseDownHandler);
}
private function startOtrEvent(_arg1:MouseEvent):void{
(_arg1.currentTarget as MovieClip).visible = false;
_arg1.target.removeEventListener(MouseEvent.CLICK, startOtrEvent);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpEvent);
_circle.visible = true;
_moveOstrich.visible = true;
_cirbody = new CirBody(_moveOstrich, _circle);
}
}
}//package scene
Section 44
//GateScene (scene.GateScene)
package scene {
import flash.events.*;
public class GateScene {
public function GateScene(){
DesertSlide.instance.movie.gotoAndStop(1, "gate");
DesertSlide.instance.addScriptToNextframe(init);
}
private function init():void{
DesertSlide.instance.movie.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:Event):void{
this.destory();
switch (_arg1.target.name){
case "backBn":
new BeginScene();
break;
default:
DesertSlide.instance.movie.parent.addChild(new GameScene(_arg1.target.name));
};
}
private function destory():void{
DesertSlide.instance.movie.removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package scene
Section 45
//GameSound (util.GameSound)
package util {
import vo.*;
import flash.media.*;
public class GameSound {
private var soundAr:Array;
public function GameSound(){
soundAr = [];
var _local1 = 1;
while (_local1 < 4) {
soundAr[(_local1 - 1)] = (new (DesertSlide.instance.getClass(("sound" + _local1))) as Sound);
_local1++;
};
}
public function headDown():void{
if (def.isSound){
soundAr[0].play();
};
}
public function lauchUp():void{
if (def.isSound){
soundAr[1].play();
};
}
public function touchUp():void{
if (def.isSound){
soundAr[2].play();
};
}
}
}//package util
Section 46
//Barrier (vo.Barrier)
package vo {
import flash.display.*;
import org.cove.ape.*;
import scene.*;
public class Barrier extends RectangleParticle {
private var _showMC:MovieClip;
private var _mcStr:String;
private var _frame:int;// = 2
public function Barrier(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Number=0, _arg7:Boolean=false, _arg8:Number=0.1, _arg9:Number=0, _arg10:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg6, _arg7, _arg8, _arg9, _arg10);
setStyle(1, 0xFFFF00, 1, 5596740);
sprite.cacheAsBitmap = true;
_showMC = new (DesertSlide.instance.getClass(_arg5));
setDisplay(_showMC);
_mcStr = _arg5;
this.hitStr = _arg5;
if (_arg5 == "snake"){
_frame = 8;
} else {
if (_arg5 == "soil"){
_frame = 5;
this.friction = 0.1;
} else {
if (_arg5 == "barrier"){
_frame = 5;
this.friction = 0.2;
};
};
};
sprite.addEventListener(CollisionEvent.COLLIDE, hitHandler);
}
public function destroy():void{
sprite.removeEventListener(CollisionEvent.COLLIDE, hitHandler);
}
private function hitHandler(_arg1:CollisionEvent):void{
var _local2:RectangleParticle;
var _local3:Number;
_showMC.gotoAndPlay(_frame);
if ((_arg1.collidingItem is RectangleParticle)){
_local2 = (_arg1.collidingItem as RectangleParticle);
if (_local2.hitStr == "ostrich"){
sprite.removeEventListener(CollisionEvent.COLLIDE, hitHandler);
if (_local2.radian > 1.2){
_showMC.visible = false;
} else {
if (_mcStr == "snake"){
_local3 = (GameScene.valueX + 1);
_local3 = ((_local3 > 0)) ? _local3 : 0;
_local2.velocity = new Vector(_local3, -8);
};
};
};
};
}
public function changeFrame(_arg1:int):void{
_showMC.gotoAndStop(_arg1);
}
}
}//package vo
Section 47
//ChangeReferenceSystem (vo.ChangeReferenceSystem)
package vo {
import flash.geom.*;
public class ChangeReferenceSystem {
public static function ChangeReference(_arg1, _arg2):Point{
var _local3:Point;
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (null);
};
if (_arg1.parent != null){
_local3 = new Point(_arg1.x, _arg1.y);
_local3 = _arg1.parent.localToGlobal(_local3);
_local3 = _arg2.globalToLocal(_local3);
return (_local3);
};
return (null);
}
}
}//package vo
Section 48
//CirBody (vo.CirBody)
package vo {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.ui.*;
public class CirBody {
private var body:MovieClip;
private var drawb:MovieClip;
private var circleRio:Number;
private var hand:MovieClip;
private var circle:MovieClip;
private var mc:MovieClip;
private var drawa:MovieClip;
public function CirBody(_arg1:MovieClip, _arg2:MovieClip){
this.mc = _arg1;
this.circle = _arg2;
circleRio = _arg2.width;
DesertSlide.instance.addEventListener(Event.ENTER_FRAME, onEnter);
drawa = _arg1.drawa;
drawb = _arg1.drawb;
hand = _arg1.hand;
body = _arg1.body;
Mouse.hide();
}
public function destroy():void{
mc = null;
circle = null;
drawa = null;
drawb = null;
hand = null;
body = null;
}
public function stop():void{
DesertSlide.instance.removeEventListener(Event.ENTER_FRAME, onEnter);
Mouse.show();
}
private function draw():void{
var _local1:Point = ChangeReferenceSystem.ChangeReference(hand.a1, mc);
drawa.graphics.clear();
drawa.graphics.lineStyle(4);
drawa.graphics.lineGradientStyle(GradientType.LINEAR, [0, 11641112, 0], [1, 1, 1], [0, 128, 0xFF]);
drawa.graphics.moveTo(_local1.x, _local1.y);
drawa.graphics.lineTo(mc.a2.x, mc.a2.y);
_local1 = ChangeReferenceSystem.ChangeReference(hand.b1, mc);
drawb.graphics.clear();
drawb.graphics.lineStyle(6);
drawb.graphics.lineGradientStyle(GradientType.LINEAR, [0, 11641112, 0], [1, 1, 1], [0, 128, 0xFF]);
drawb.graphics.moveTo(_local1.x, _local1.y);
drawb.graphics.lineTo(mc.b2.x, mc.b2.y);
}
public function getAngle():Number{
var _local1:Point = ChangeReferenceSystem.ChangeReference(hand.b1, mc);
var _local2:Number = Math.atan2((mc.c.y - _local1.y), (mc.c.x - _local1.x));
return (((_local2 / Math.PI) * 180));
}
public function getDis():Number{
var _local1:Point = new Point(hand.x, hand.y);
var _local2:Point = new Point(mc.c.x, mc.c.y);
return (Point.distance(_local1, _local2));
}
private function onEnter(_arg1:Event):void{
var _local5:Number;
draw();
circle.rotation = (hand.rotation = getAngle());
if (circle.scaleX >= 0.6){
circle.scaleX = (circle.scaleY = (circle.scaleY - 0.002));
};
var _local2:Number = ((this.circleRio * circle.scaleX) * 0.5);
var _local3:Point = new Point(mc.mouseX, mc.mouseY);
var _local4:Point = ChangeReferenceSystem.ChangeReference(circle, mc);
if (Point.distance(_local3, _local4) > _local2){
_local5 = Math.atan2((_local3.y - _local4.y), (_local3.x - _local4.x));
hand.x = ((_local2 * Math.cos(_local5)) + _local4.x);
hand.y = ((_local2 * Math.sin(_local5)) + _local4.y);
} else {
hand.x = mc.mouseX;
hand.y = mc.mouseY;
};
body.x = hand.x;
body.y = hand.y;
}
}
}//package vo
Section 49
//def (vo.def)
package vo {
import util.*;
public class def {
public static const TOWEBURL:String = "http://www.gameslist.com/freegames";
public static const URL:String = "http://www.gameslist.com";
public static var isSound:Boolean = true;
public static var soundControl:GameSound = new GameSound();
}
}//package vo
Section 50
//Ostrich (vo.Ostrich)
package vo {
import flash.display.*;
import org.cove.ape.*;
import scene.*;
public class Ostrich extends Group {
private var _yVet:Number;
private var _hitSnake:Boolean;
private var _gravity:Number;// = 1
private var _hitSpeed:Number;
private var _angle:Number;
private var _hitFlag:Boolean;// = false
private var frontBody:RectangleParticle;
private var _xVet:Number;
private var _runVector:Vector;
private var _showMC:MovieClip;
private var _forceNum:Number;// = 1500
private var trainningBody:RectangleParticle;
public function Ostrich(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false){
super(_arg4);
_hitSnake = false;
_hitSpeed = 0;
_runVector = new Vector(_arg1, _arg2);
_angle = _arg3;
_xVet = _arg1;
_yVet = _arg2;
Init();
}
public function get px():Number{
return (frontBody.px);
}
public function update():void{
_yVet = (_yVet + _gravity++);
var _local1:Number = Math.atan2(_yVet, _xVet);
if (_hitFlag){
frontBody.radian = 0;
} else {
frontBody.radian = _local1;
};
}
public function set px(_arg1:Number):void{
frontBody.px = _arg1;
}
public function set py(_arg1:Number):void{
frontBody.py = _arg1;
}
private function collisonHandler(_arg1:CollisionEvent):void{
var _local2:RectangleParticle;
_hitFlag = true;
if ((_arg1.collidingItem is RectangleParticle)){
_local2 = (_arg1.collidingItem as RectangleParticle);
if (_local2.hitStr == "snake"){
_showMC.gotoAndStop(4);
def.soundControl.touchUp();
_hitSnake = true;
_hitSpeed = GameScene.valueX;
} else {
if (frontBody.radian > 1.2){
GameScene.stopGame = true;
_showMC.gotoAndStop(2);
def.soundControl.headDown();
frontBody.sprite.removeEventListener(CollisionEvent.COLLIDE, collisonHandler);
} else {
if (GameScene.valueX < 1){
GameScene.stopGame = true;
} else {
if (_hitSnake){
_hitSnake = false;
};
};
if (_showMC.currentFrame != 3){
_showMC.gotoAndStop(3);
};
};
};
};
}
public function get py():Number{
return (frontBody.py);
}
private function Init():void{
frontBody = new RectangleParticle(200, 200, 120, 40, ((_angle * Math.PI) / 180), false, 8, 0);
addParticle(frontBody);
frontBody.hitStr = "ostrich";
frontBody.setStyle(1, 0xFFFF00, 1, 5596740);
frontBody.sprite.cacheAsBitmap = true;
frontBody.angle = ((_angle * 180) / Math.PI);
frontBody.addForce(_runVector);
_showMC = DesertSlide.instance.getMovie("bodyMC");
frontBody.setDisplay(_showMC);
frontBody.sprite.addEventListener(CollisionEvent.COLLIDE, collisonHandler);
}
public function jumpForce():void{
var _local1:Number;
if (frontBody.py > 393){
def.soundControl.touchUp();
_local1 = GameScene.valueX;
_local1 = ((_local1 > 0)) ? _local1 : 0;
frontBody.velocity = new Vector(_local1, -9);
_showMC.gotoAndStop(1);
};
}
}
}//package vo
Section 51
//RoadGroup (vo.RoadGroup)
package vo {
import org.cove.ape.*;
public class RoadGroup extends Group {
private var _barrierArr:Array;
private var _RoadParticle:RectangleParticle;
private var DEFLAUT_HEIGHT:Number;// = 10
private var START_Y:Number;// = 420
public function RoadGroup(_arg1:Number=0, _arg2:Number=20000, _arg3:Boolean=false){
super(_arg3);
_barrierArr = new Array();
Init(_arg1, _arg2);
}
public function destroy():void{
while (_barrierArr.length > 0) {
(_barrierArr.pop() as Barrier).destroy();
};
}
private function UtilRandom():String{
var _local2:String;
var _local1 = ((Math.random() * 10) << 0);
if (_local1 < 4){
_local2 = "snake";
} else {
if (_local1 < 6){
_local2 = "barrier";
} else {
if (_local1 < 8){
_local2 = "soil";
} else {
_local2 = "no";
};
};
};
return (_local2);
}
public function get px():Number{
return (_RoadParticle.px);
}
public function get py():Number{
return (_RoadParticle.py);
}
private function Init(_arg1:Number, _arg2:Number):void{
_RoadParticle = new RectangleParticle((_arg1 + (_arg2 * 0.5)), START_Y, _arg2, DEFLAUT_HEIGHT, 0, true);
_RoadParticle.setStyle(1, 0xFFFF00, 1, 5596740);
_RoadParticle.sprite.cacheAsBitmap = true;
_RoadParticle.hitStr = "road";
_RoadParticle.elasticity = 0;
_RoadParticle.visible = false;
addParticle(_RoadParticle);
_RoadParticle.friction = 0.01;
addBarrier(_arg1, _arg2);
}
private function addBarrier(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Barrier;
var _local6:String;
var _local5:Number = 200;
while (_local5 < _arg2) {
_local3 = ((Math.random() * 50) + 550);
_local5 = (_local5 + _local3);
_local6 = UtilRandom();
if (_local6 != "no"){
_local4 = new Barrier(_local5, (START_Y + 4), 70, 20, _local6, 0, true);
addParticle(_local4);
_barrierArr.push(_local4);
};
};
}
public function set px(_arg1:Number):void{
_RoadParticle.px = _arg1;
}
public function set py(_arg1:Number):void{
_RoadParticle.px = _arg1;
}
}
}//package vo
Section 52
//barrier (barrier)
package {
import flash.display.*;
public dynamic class barrier extends MovieClip {
public function barrier(){
addFrameScript(0, frame1, 21, frame22);
}
function frame1(){
stop();
}
function frame22(){
stop();
}
}
}//package
Section 53
//DesertSlide (DesertSlide)
package {
import flash.events.*;
import flash.display.*;
import scene.*;
import GamesList.as3.*;
import flash.text.*;
public dynamic class DesertSlide extends MovieClip {
public var moreBn:SimpleButton;
public var pause:MovieClip;
public var slideMC:MovieClip;
public var playMoreBtn:SimpleButton;
public var score:TextField;
public var backBn:SimpleButton;
public var result:TextField;
public var towebBn:SimpleButton;
public var playBn:SimpleButton;
public var replayBn:SimpleButton;
public var movie:MovieClip;
public var submitBtn:SimpleButton;
public var camel:SimpleButton;
public var bodyMC:MovieClip;
public var moveScene:MovieClip;
public var loading:MovieClip;
public var robots:SimpleButton;
public var PlayMoreGamesBtn:SimpleButton;
public var soundBtn:MovieClip;
public var backGround:MovieClip;
public var circle:MovieClip;
public var move:MovieClip;
public var start:MovieClip;
public var backBtn:SimpleButton;
public var ostrich:SimpleButton;
public var show:MovieClip;
public static var instance:DesertSlide;
public function DesertSlide(){
addFrameScript(0, frame1, 4, frame5, 22, frame23, 24, frame25, 25, frame26, 26, frame27);
instance = this;
}
public function getMovie(_arg1:String){
return (this.movie.getChildByName(_arg1));
}
public function begin():void{
movie = this;
new BeginScene();
}
public function onEnter(_arg1:Event):void{
var _local2:int = int(((loaderInfo.bytesLoaded / loaderInfo.bytesTotal) * 100));
loading.loadMC.gotoAndStop(_local2);
if (_local2 == 100){
loading.play();
this.removeEventListener(Event.ENTER_FRAME, onEnter);
};
}
public function addScriptToNextframe(_arg1:Function, _arg2:int=2):void{
var frameNum:int;
var onEnter:Function;
var fun = _arg1;
var frame = _arg2;
onEnter = function (_arg1:Event):void{
frameNum++;
if (frameNum == frame){
fun();
removeEventListener(Event.ENTER_FRAME, onEnter);
};
};
this.addEventListener(Event.ENTER_FRAME, onEnter);
frameNum = 0;
}
public function getClass(_arg1:String):Class{
return ((this.loaderInfo.applicationDomain.getDefinition(_arg1) as Class));
}
function frame1(){
stop();
MochiBot.track(this, "659a581b");
this.addEventListener(Event.ENTER_FRAME, onEnter);
GamesListAPIAS3.config("Desert-Slide", "asdfasdf");
}
function frame5(){
begin();
}
function frame23(){
stop();
}
function frame26(){
GamesListAPIAS3.GenerateScoreID();
}
function frame27(){
GamesListAPIAS3.GenerateScoreID();
}
function frame25(){
GamesListAPIAS3.GenerateScoreID();
}
}
}//package
Section 54
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 55
//snake (snake)
package {
import flash.display.*;
public dynamic class snake extends MovieClip {
public function snake(){
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 56
//soil (soil)
package {
import flash.display.*;
public dynamic class soil extends MovieClip {
public function soil(){
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 57
//sound1 (sound1)
package {
import flash.media.*;
public dynamic class sound1 extends Sound {
}
}//package
Section 58
//sound2 (sound2)
package {
import flash.media.*;
public dynamic class sound2 extends Sound {
}
}//package
Section 59
//sound3 (sound3)
package {
import flash.media.*;
public dynamic class sound3 extends Sound {
}
}//package