Section 1
//AAspect (asp.aspects.AAspect)
package asp.aspects {
import flash.events.*;
import asp.entities.*;
public class AAspect extends EventDispatcher implements IAspect {
protected var _id:String;
protected var _entity:IEntity;
protected var _sn:uint;
protected var _exists:Boolean;
protected var _active:Boolean;
private static var _count:uint = 0;
public function AAspect(){
_sn = _count;
_count++;
_id = ("aspect_" + _sn);
_active = true;
_exists = true;
}
public function deactivate():void{
_active = false;
}
public function active():Boolean{
return (_active);
}
public function get id():String{
return (_id);
}
public function destroy():void{
var _local1:IEntity;
if (!_entity){
_entity = undefined;
_active = undefined;
_exists = undefined;
} else {
_local1 = _entity;
_entity = undefined;
_active = undefined;
_local1.removeAspect(this);
_exists = undefined;
};
}
public function activate():void{
_active = true;
}
public function get sn():uint{
return (_sn);
}
public function add(_arg1:IEntity):void{
if (_arg1){
if (!_entity){
_entity = _arg1;
if (!_entity.hasAspect(this)){
_entity.addAspect(this);
};
} else {
throw (new Error("[AAspect] : <add> : Aspect is already added to some entity."));
};
} else {
throw (new Error("[AAspect] : <add> : Can't add to non-existing entity."));
};
}
public function remove():void{
var _local1:IEntity;
if (_entity){
_local1 = _entity;
_entity = undefined;
if (_local1.hasAspect(this)){
_local1.removeAspect(this);
};
} else {
throw (new Error("[AAspect] : <remove> : Aspect isn't added to entity."));
};
}
public function get entity():IEntity{
return (_entity);
}
public function exists():Boolean{
return (_exists);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
}
}//package asp.aspects
Section 2
//IAspect (asp.aspects.IAspect)
package asp.aspects {
import flash.events.*;
import asp.entities.*;
public interface IAspect extends IEventDispatcher {
function add(_arg1:IEntity):void;
function activate():void;
function get entity():IEntity;
function deactivate():void;
function active():Boolean;
function remove():void;
function destroy():void;
function get id():String;
function exists():Boolean;
function set id(_arg1:String):void;
}
}//package asp.aspects
Section 3
//AEntity (asp.entities.AEntity)
package asp.entities {
import flash.events.*;
import asp.systems.*;
import asp.aspects.*;
import flash.utils.*;
public class AEntity extends EventDispatcher implements IEntity {
protected var _sn:uint;
protected var _id:String;
protected var _active:Boolean;
protected var _aspects:Dictionary;
protected var _systems:Dictionary;
protected var _exists:Boolean;
private static var _count:uint = 0;
public function AEntity(){
_sn = _count;
_count++;
_id = ("entity_" + _sn);
_aspects = new Dictionary();
_systems = new Dictionary();
_active = true;
_exists = true;
}
public function remove(_arg1:ISystem=null):void{
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
if (_arg1.hasEntity(this)){
_arg1.removeEntity(this);
};
} else {
throw (new Error("[AEntity] : <remove> : Isn't added to this system."));
};
} else {
for each (_arg1 in _systems) {
delete _systems[_arg1];
if (_arg1.hasEntity(this)){
_arg1.removeEntity(this);
};
};
};
}
public function hasAspectOfType(_arg1:Class):Boolean{
var _local2:IAspect;
for each (_local2 in _aspects) {
if ((_local2 is _arg1)){
return (true);
};
};
return (false);
}
public function active():Boolean{
return (_active);
}
public function getAllAspectsByType(_arg1:Class):Array{
var _local3:IAspect;
var _local2:Array = new Array();
for each (_local3 in _aspects) {
if ((_local3 is _arg1)){
_local2.push(_local3);
};
};
return ((_local2.length) ? _local2 : null);
}
public function hasAspect(_arg1:IAspect):Boolean{
return (Boolean(_aspects[_arg1]));
}
public function destroyAllAspects():void{
var _local1:IAspect;
for each (_local1 in _aspects) {
delete _aspects[_local1];
if (_local1.entity){
_local1.remove();
};
_local1.destroy();
};
refresh();
}
public function add(_arg1:ISystem):void{
if (_arg1){
if (!_systems[_arg1]){
_systems[_arg1] = _arg1;
if (!_arg1.hasEntity(this)){
_arg1.addEntity(this);
};
} else {
throw (new Error("[AEntity] : <add> : Already added to this system."));
};
} else {
throw (new Error("[AEntity] : <add> : Can't add to non-existing system."));
};
}
public function get id():String{
return (_id);
}
public function getSystem(_arg1:String):ISystem{
var _local2:ISystem;
for each (_local2 in _systems) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function dispose():void{
var _local1:ISystem;
var _local2:IAspect;
for each (_local1 in _systems) {
delete _systems[_local1];
if (_local1.hasEntity(this)){
_local1.removeEntity(this);
};
};
for each (_local2 in _aspects) {
delete _aspects[_local2];
if (_local2.entity){
_local2.remove();
};
_local2.destroy();
};
_aspects = undefined;
_systems = undefined;
_active = undefined;
_exists = undefined;
}
public function getAspectByType(_arg1:Class):IAspect{
var _local2:IAspect;
for each (_local2 in _aspects) {
if ((_local2 is _arg1)){
return (_local2);
};
};
return (null);
}
public function getAllAspects():Array{
var _local2:IAspect;
var _local1:Array = new Array();
for each (_local2 in _aspects) {
_local1.push(_local2);
};
return ((_local1.length) ? _local1 : null);
}
public function inSystem(_arg1:ISystem=null):Boolean{
if (_arg1){
return (Boolean(_systems[_arg1]));
};
for each (_arg1 in _systems) {
return (true);
};
return (false);
}
public function numAspects():uint{
var _local2:*;
var _local1:uint;
for (_local2 in _aspects) {
_local1++;
};
return (_local1);
}
public function getSystemByType(_arg1:Class):ISystem{
var _local2:ISystem;
for each (_local2 in _systems) {
if ((_local2 is _arg1)){
return (_local2);
};
};
return (null);
}
public function getAllSystems():Array{
var _local2:ISystem;
var _local1:Array = new Array();
for each (_local2 in _systems) {
_local1.push(_local2);
};
return ((_local1.length) ? _local1 : null);
}
public function addAspects(_arg1:Array):void{
var _local2:IAspect;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_aspects[_local2]){
_aspects[_local2] = _local2;
if (_local2.entity != this){
_local2.add(this);
};
} else {
throw (new Error("[AEntity] : <addAspects> : Aspect already added."));
};
} else {
throw (new Error("[AEntity] : <addAspects> : Can't add non-existing aspect."));
};
_local4++;
};
refresh();
} else {
throw (new Error("[AEntity] : <addAspects> : Wrong input."));
};
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function destroyAspects(_arg1:Array):void{
var _local2:IAspect;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_aspects[_local2]){
delete _aspects[_local2];
if (_local2.entity){
_local2.remove();
};
_local2.destroy();
} else {
throw (new Error("[AEntity] : <destroyAspects> : Aspect isn't added."));
};
} else {
throw (new Error("[AEntity] : <destroyAspects> : Can't destroy non-existing aspect."));
};
_local4++;
};
refresh();
} else {
throw (new Error("[AEntity] : <destroyAspects> : Wrong input."));
};
}
public function empty():Boolean{
var _local1:*;
for (_local1 in _aspects) {
return (false);
};
return (true);
}
public function getAspect(_arg1:String):IAspect{
var _local2:IAspect;
for each (_local2 in _aspects) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function getAllSystemsByType(_arg1:Class):Array{
var _local3:ISystem;
var _local2:Array = new Array();
for each (_local3 in _systems) {
if ((_local3 is _arg1)){
_local2.push(_local3);
};
};
return ((_local2.length) ? _local2 : null);
}
public function refresh(_arg1:ISystem=null):void{
if (_arg1){
if (_systems[_arg1]){
if (!_arg1.acceptsEntity(this)){
delete _systems[_arg1];
if (_arg1.hasEntity(this)){
_arg1.removeEntity(this);
};
};
} else {
if (_arg1.acceptsEntity(this)){
_systems[_arg1] = _arg1;
if (!_arg1.hasEntity(this)){
_arg1.addEntity(this);
};
};
};
} else {
for each (_arg1 in _systems) {
if (!_arg1.acceptsEntity(this)){
delete _systems[_arg1];
if (_arg1.hasEntity(this)){
_arg1.removeEntity(this);
};
};
};
};
}
public function exists():Boolean{
return (_exists);
}
public function removeAllAspects():void{
var _local1:IAspect;
for each (_local1 in _aspects) {
delete _aspects[_local1];
if (_local1.entity){
_local1.remove();
};
};
refresh();
}
public function addAspect(_arg1:IAspect):void{
if (_arg1){
if (!_aspects[_arg1]){
_aspects[_arg1] = _arg1;
if (_arg1.entity != this){
_arg1.add(this);
};
refresh();
} else {
throw (new Error("[AEntity] : <addAspect> : Aspect already added."));
};
} else {
throw (new Error("[AEntity] : <addAspect> : Can't add non-existing aspect."));
};
}
public function get sn():uint{
return (_sn);
}
public function destroyAspect(_arg1:IAspect):void{
if (_arg1){
if (_aspects[_arg1]){
delete _aspects[_arg1];
if (_arg1.entity){
_arg1.remove();
};
_arg1.destroy();
refresh();
} else {
throw (new Error("[AEntity] : <destroyAspect> : Aspect isn't added."));
};
} else {
throw (new Error("[AEntity] : <destroyAspect> : Can't destroy non-existing aspect."));
};
}
public function activate():void{
_active = true;
}
public function deactivate():void{
_active = false;
}
public function removeAspects(_arg1:Array):void{
var _local2:IAspect;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_aspects[_local2]){
delete _aspects[_local2];
if (_local2.entity){
_local2.remove();
};
} else {
throw (new Error("[AEntity] : <removeAspects> : Aspect isn't added."));
};
} else {
throw (new Error("[AEntity] : <removeAspects> : Can't remove non-existing aspect."));
};
_local4++;
};
refresh();
} else {
throw (new Error("[AEntity] : <removeAspects> : Wrong input."));
};
}
public function destroy():void{
var _local1:ISystem;
var _local2:IAspect;
for each (_local1 in _systems) {
delete _systems[_local1];
if (_local1.hasEntity(this)){
_local1.removeEntity(this);
};
};
for each (_local2 in _aspects) {
delete _aspects[_local2];
if (_local2.entity){
_local2.remove();
};
};
_aspects = undefined;
_systems = undefined;
_active = undefined;
_exists = undefined;
}
public function removeAspect(_arg1:IAspect):void{
if (_arg1){
if (_aspects[_arg1]){
delete _aspects[_arg1];
if (_arg1.entity){
_arg1.remove();
};
refresh();
} else {
throw (new Error("[AEntity] : <removeAspect> : Aspect isn't added."));
};
} else {
throw (new Error("[AEntity] : <removeAspect> : Can't remove non-existing aspect."));
};
}
}
}//package asp.entities
Section 4
//IEntity (asp.entities.IEntity)
package asp.entities {
import flash.events.*;
import asp.systems.*;
import asp.aspects.*;
public interface IEntity extends IEventDispatcher {
function destroyAspects(_arg1:Array):void;
function remove(_arg1:ISystem=null):void;
function active():Boolean;
function getAllAspectsByType(_arg1:Class):Array;
function destroy():void;
function getAllSystemsByType(_arg1:Class):Array;
function empty():Boolean;
function getAspect(_arg1:String):IAspect;
function hasAspect(_arg1:IAspect):Boolean;
function destroyAllAspects():void;
function addAspect(_arg1:IAspect):void;
function refresh(_arg1:ISystem=null):void;
function exists():Boolean;
function removeAllAspects():void;
function dispose():void;
function add(_arg1:ISystem):void;
function get id():String;
function hasAspectOfType(_arg1:Class):Boolean;
function getSystem(_arg1:String):ISystem;
function getAspectByType(_arg1:Class):IAspect;
function getAllAspects():Array;
function destroyAspect(_arg1:IAspect):void;
function activate():void;
function inSystem(_arg1:ISystem=null):Boolean;
function numAspects():uint;
function set id(_arg1:String):void;
function removeAspects(_arg1:Array):void;
function getAllSystems():Array;
function addAspects(_arg1:Array):void;
function deactivate():void;
function removeAspect(_arg1:IAspect):void;
function getSystemByType(_arg1:Class):ISystem;
}
}//package asp.entities
Section 5
//EngineEvent (asp.events.EngineEvent)
package asp.events {
import flash.events.*;
public class EngineEvent extends Event {
private var _data;
public static const FINISH_UPDATE:String = "finishUpdate";
public static const START_UPDATE:String = "startUpdate";
public function EngineEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4=null){
super(_arg1, _arg2, _arg3);
_data = _arg4;
}
public function get data(){
return (_data);
}
public function set data(_arg1):void{
_data = _arg1;
}
}
}//package asp.events
Section 6
//AManager (asp.managers.AManager)
package asp.managers {
import flash.events.*;
import asp.systems.*;
import asp.entities.*;
import flash.utils.*;
public class AManager extends EventDispatcher implements IManager {
protected var _entities:Dictionary;
protected var _systems:Dictionary;
protected var _exists:Boolean;
public function AManager(){
_entities = new Dictionary();
_systems = new Dictionary();
_exists = true;
}
public function disposeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
delete _entities[_local2];
_local2.dispose();
} else {
throw (new Error("[AManager] : <disposeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <disposeEntities> : Can't dispose non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <disposeEntities> : Wrong input."));
};
}
public function disposeAll():void{
var _local1:IEntity;
var _local2:ISystem;
for each (_local1 in _entities) {
delete _entities[_local1];
_local1.dispose();
};
for each (_local2 in _systems) {
delete _systems[_local2];
_local2.disposeAll();
};
_entities = undefined;
_systems = undefined;
_exists = undefined;
}
public function getAllSystemsByType(_arg1:Class):Array{
var _local3:ISystem;
var _local2:Array = new Array();
for each (_local3 in _systems) {
if ((_local3 is _arg1)){
_local2.push(_local3);
};
};
return ((_local2.length) ? _local2 : null);
}
public function destroyEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
delete _entities[_arg1];
_arg1.destroy();
} else {
throw (new Error("[AManager] : <destroyEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <destroyEntity> : Can't destroy non-existing entity."));
};
}
public function disposeSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
delete _systems[_local2];
_local2.dispose();
} else {
throw (new Error("[AManager] : <disposeSystems> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <disposeSystems> : Can't dispose non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <disposeSystems> : Wrong input."));
};
}
public function removeEntity(_arg1:IEntity):void{
var _local2:ISystem;
if (_arg1){
if (_entities[_arg1]){
delete _entities[_arg1];
for each (_local2 in _systems) {
if (_local2.hasEntity(_arg1)){
_local2.removeEntity(_arg1);
};
};
} else {
throw (new Error("[AManager] : <removeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <removeEntity> : Can't remove non-existing entity."));
};
}
public function hasSystemOfType(_arg1:Class):Boolean{
var _local2:ISystem;
for each (_local2 in _systems) {
if ((_local2 is _arg1)){
return (true);
};
};
return (false);
}
public function refreshSystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
_arg1.refresh();
} else {
throw (new Error("[AManager] : <refreshSystem> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <refreshSystem> : Can't refresh non-existing system."));
};
}
public function removeSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
var _local5:IEntity;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
delete _systems[_local2];
for each (_local5 in _entities) {
if (_local2.hasEntity(_local5)){
_local2.removeEntity(_local5);
};
};
} else {
throw (new Error("[AManager] : <removeSystems> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <removeSystems> : Can't remove non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <removeSystems> : Wrong input."));
};
}
public function addEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:ISystem;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_entities[_local2]){
_entities[_local2] = _local2;
for each (_local5 in _systems) {
if (_local5.acceptsEntity(_local2)){
_local5.addEntity(_local2);
};
};
} else {
throw (new Error("[AManager] : <addEntities> : Entity already added."));
};
} else {
throw (new Error("[AManager] : <addEntities> : Can't add non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <addEntities> : Wrong input."));
};
}
public function hasEntity(_arg1:IEntity):Boolean{
return (Boolean(_entities[_arg1]));
}
public function refreshEntity(_arg1:IEntity):void{
var _local2:ISystem;
if (_arg1){
if (_entities[_arg1]){
for each (_local2 in _systems) {
if (_local2.hasEntity(_arg1)){
if (!_local2.acceptsEntity(_arg1)){
_local2.removeEntity(_arg1);
};
} else {
if (_local2.acceptsEntity(_arg1)){
_local2.addEntity(_arg1);
};
};
};
} else {
throw (new Error("[AManager] : <refreshEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <refreshEntity> : Can't refresh non-existing entity."));
};
}
public function dispose():void{
var _local1:IEntity;
var _local2:ISystem;
for each (_local1 in _entities) {
delete _entities[_local1];
_local1.destroy();
};
for each (_local2 in _systems) {
delete _systems[_local2];
_local2.destroy();
};
_entities = undefined;
_systems = undefined;
_exists = undefined;
}
public function destroyAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
delete _entities[_local1];
_local1.destroy();
};
}
public function getAllEntitiesByType(_arg1:Class):Array{
var _local3:IEntity;
var _local2:Array = new Array();
for each (_local3 in _entities) {
if ((_local3 is _arg1)){
_local2.push(_local3);
};
};
return ((_local2.length) ? _local2 : null);
}
public function refreshAllEntities():void{
var _local1:IEntity;
var _local2:ISystem;
for each (_local1 in _entities) {
for each (_local2 in _systems) {
if (_local2.hasEntity(_local1)){
if (!_local2.acceptsEntity(_local1)){
_local2.removeEntity(_local1);
};
} else {
if (_local2.acceptsEntity(_local1)){
_local2.addEntity(_local1);
};
};
};
};
}
public function addSystem(_arg1:ISystem):void{
var _local2:IEntity;
if (_arg1){
if (!_systems[_arg1]){
_systems[_arg1] = _arg1;
for each (_local2 in _entities) {
if (_arg1.acceptsEntity(_local2)){
_arg1.addEntity(_local2);
};
};
} else {
throw (new Error("[AManager] : <addSystem> : System already added."));
};
} else {
throw (new Error("[AManager] : <addSystem> : Can't add non-existing system."));
};
}
public function getSystem(_arg1:String):ISystem{
var _local2:ISystem;
for each (_local2 in _systems) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function hasEntityOfType(_arg1:Class):Boolean{
var _local2:IEntity;
for each (_local2 in _entities) {
if ((_local2 is _arg1)){
return (true);
};
};
return (false);
}
public function getSystemByType(_arg1:Class):ISystem{
var _local2:ISystem;
for each (_local2 in _systems) {
if ((_local2 is _arg1)){
return (_local2);
};
};
return (null);
}
public function getAllSystems():Array{
var _local2:ISystem;
var _local1:Array = new Array();
for each (_local2 in _systems) {
_local1.push(_local2);
};
return ((_local1.length) ? _local1 : null);
}
public function numSystems():uint{
var _local2:*;
var _local1:uint;
for (_local2 in _systems) {
_local1++;
};
return (_local1);
}
public function disposeAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
delete _systems[_local1];
_local1.dispose();
};
}
public function refreshEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:ISystem;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
for each (_local5 in _systems) {
if (_local5.hasEntity(_local2)){
if (!_local5.acceptsEntity(_local2)){
_local5.removeEntity(_local2);
};
} else {
if (_local5.acceptsEntity(_local2)){
_local5.addEntity(_local2);
};
};
};
} else {
throw (new Error("[AManager] : <refreshEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <refreshEntities> : Can't refresh non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <refreshEntities> : Wrong input."));
};
}
public function disposeSystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
_arg1.dispose();
} else {
throw (new Error("[AManager] : <disposeSystem> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <disposeSystem> : Can't dispose non-existing system."));
};
}
public function destroySystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
_arg1.destroy();
} else {
throw (new Error("[AManager] : <destroySystem> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <destroySystem> : Can't destroy non-existing system."));
};
}
public function getAllEntities():Array{
var _local2:IEntity;
var _local1:Array = new Array();
for each (_local2 in _entities) {
_local1.push(_local2);
};
return ((_local1.length) ? _local1 : null);
}
public function empty():Boolean{
var _local1:*;
for (_local1 in _systems) {
return (false);
};
for (_local1 in _systems) {
return (false);
};
return (true);
}
public function destroySystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
delete _systems[_local2];
_local2.destroy();
} else {
throw (new Error("[AManager] : <destroySystems> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <destroySystems> : Can't destroy non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <destroySystems> : Wrong input."));
};
}
public function addSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
var _local5:IEntity;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_systems[_local2]){
_systems[_local2] = _local2;
for each (_local5 in _entities) {
if (_local2.acceptsEntity(_local5)){
_local2.addEntity(_local5);
};
};
} else {
throw (new Error("[AManager] : <addSystems> : System already added."));
};
} else {
throw (new Error("[AManager] : <addSystems> : Can't add non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <addSystems> : Wrong input."));
};
}
public function refreshSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
_local2.refresh();
} else {
throw (new Error("[AManager] : <refreshSystems> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <refreshSystems> : Can't refresh non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <refreshSystems> : Wrong input."));
};
}
public function getEntity(_arg1:String):IEntity{
var _local2:IEntity;
for each (_local2 in _entities) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function removeSystem(_arg1:ISystem):void{
var _local2:IEntity;
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
for each (_local2 in _entities) {
if (_arg1.hasEntity(_local2)){
_arg1.removeEntity(_local2);
};
};
} else {
throw (new Error("[AManager] : <removeSystem> : System isn't added."));
};
} else {
throw (new Error("[AManager] : <removeSystem> : Can't remove non-existing system."));
};
}
public function destroyEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
delete _entities[_local2];
_local2.destroy();
} else {
throw (new Error("[AManager] : <destroyEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <destroyEntities> : Can't destroy non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <destroyEntities> : Wrong input."));
};
}
public function exists():Boolean{
return (_exists);
}
public function destroyAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
delete _systems[_local1];
_local1.destroy();
};
}
public function removeAllEntities():void{
var _local1:IEntity;
var _local2:ISystem;
for each (_local1 in _entities) {
delete _entities[_local1];
for each (_local2 in _systems) {
if (_local2.hasEntity(_local1)){
_local2.removeEntity(_local1);
};
};
};
}
public function addEntity(_arg1:IEntity):void{
var _local2:ISystem;
if (_arg1){
if (!_entities[_arg1]){
_entities[_arg1] = _arg1;
for each (_local2 in _systems) {
if (_local2.acceptsEntity(_arg1)){
_local2.addEntity(_arg1);
};
};
} else {
throw (new Error("[AManager] : <addEntity> : Entity already added."));
};
} else {
throw (new Error("[AManager] : <addEntity> : Can't add non-existing entity."));
};
}
public function disposeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
delete _entities[_arg1];
_arg1.dispose();
} else {
throw (new Error("[AManager] : <disposeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <disposeEntity> : Can't dispose non-existing entity."));
};
}
public function disposeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
delete _entities[_local1];
_local1.dispose();
};
}
public function removeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:ISystem;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
delete _entities[_local2];
for each (_local5 in _systems) {
if (_local5.hasEntity(_local2)){
_local5.removeEntity(_local2);
};
};
} else {
throw (new Error("[AManager] : <removeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AManager] : <removeEntities> : Can't remove non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AManager] : <removeEntities> : Wrong input."));
};
}
public function numEntities():uint{
var _local2:*;
var _local1:uint;
for (_local2 in _entities) {
_local1++;
};
return (_local1);
}
public function hasSystem(_arg1:ISystem):Boolean{
return (Boolean(_systems[_arg1]));
}
public function getEntityByType(_arg1:Class):IEntity{
var _local2:IEntity;
for each (_local2 in _entities) {
if ((_local2 is _arg1)){
return (_local2);
};
};
return (null);
}
public function destroy():void{
var _local1:IEntity;
var _local2:ISystem;
for each (_local1 in _entities) {
delete _entities[_local1];
};
for each (_local2 in _systems) {
delete _systems[_local2];
};
_entities = undefined;
_systems = undefined;
_exists = undefined;
}
public function refreshAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
_local1.refresh();
};
}
public function removeAllSystems():void{
var _local1:ISystem;
var _local2:IEntity;
for each (_local1 in _systems) {
delete _systems[_local1];
for each (_local2 in _entities) {
if (_local1.hasEntity(_local2)){
_local1.removeEntity(_local2);
};
};
};
}
}
}//package asp.managers
Section 7
//AsyncManager (asp.managers.AsyncManager)
package asp.managers {
import asp.systems.*;
import asp.entities.*;
public class AsyncManager extends SyncManager {
protected var _operations:Array;
public function AsyncManager(){
_operations = new Array();
}
public function executeOperations():void{
var _local2:Object;
var _local1:uint = _operations.length;
while (_local1) {
_local2 = _operations.shift();
switch (_local2.command){
case "addEntity":
executeAddEntity(_local2.entity);
break;
case "removeEntity":
executeRemoveEntity(_local2.entity);
break;
case "destroyEntity":
executeDestroyEntity(_local2.entity);
break;
case "disposeEntity":
executeDisposeEntity(_local2.entity);
break;
case "refreshEntity":
executeRefreshEntity(_local2.entity);
break;
case "addSystem":
executeAddSystem(_local2.system);
break;
case "removeSystem":
executeRemoveSystem(_local2.system);
break;
case "destroySystem":
executeDestroySystem(_local2.system);
break;
case "disposeSystem":
executeDisposeSystem(_local2.system);
break;
case "refreshSystem":
executeRefreshSystem(_local2.system);
break;
default:
throw (new Error("[AsyncManager] : <executeOperations> : Unknown command."));
};
_local1--;
};
}
override public function disposeAll():void{
if (!_exists){
throw (new Error("[AsyncManager] : <disposeAll> : Manager not exists."));
};
var _local1:uint = _operations.length;
while (_local1) {
_operations.pop();
_local1--;
};
_operations = undefined;
super.disposeAll();
}
protected function executeDestroyEntity(_arg1:IEntity):void{
if (_entities[_arg1]){
delete _entities[_arg1];
_arg1.destroy();
};
}
override protected function requestRefreshEntity(_arg1:IEntity):void{
_operations.push({command:"refreshEntity", entity:_arg1});
}
override protected function requestRemoveSystem(_arg1:ISystem):void{
_operations.push({command:"removeSystem", system:_arg1});
}
override protected function requestDisposeEntity(_arg1:IEntity):void{
_operations.push({command:"disposeEntity", entity:_arg1});
}
protected function executeDestroySystem(_arg1:ISystem):void{
if (_systems[_arg1]){
delete _systems[_arg1];
_arg1.destroy();
};
}
override protected function requestAddEntity(_arg1:IEntity):void{
_operations.push({command:"addEntity", entity:_arg1});
}
override protected function requestRefreshSystem(_arg1:ISystem):void{
_operations.push({command:"refreshSystem", system:_arg1});
}
protected function executeRemoveEntity(_arg1:IEntity):void{
var _local2:ISystem;
if (_entities[_arg1]){
delete _entities[_arg1];
for each (_local2 in _systems) {
if (_local2.hasEntity(_arg1)){
_local2.removeEntity(_arg1);
};
};
};
}
override public function dispose():void{
if (!_exists){
throw (new Error("[AsyncManager] : <dispose> : Manager not exists."));
};
var _local1:uint = _operations.length;
while (_local1) {
_operations.pop();
_local1--;
};
_operations = undefined;
super.dispose();
}
override protected function requestAddSystem(_arg1:ISystem):void{
_operations.push({command:"addSystem", system:_arg1});
}
override protected function requestDisposeSystem(_arg1:ISystem):void{
_operations.push({command:"disposeSystem", system:_arg1});
}
override protected function requestDestroySystem(_arg1:ISystem):void{
_operations.push({command:"destroySystem", system:_arg1});
}
protected function executeRemoveSystem(_arg1:ISystem):void{
var _local2:IEntity;
if (_systems[_arg1]){
delete _systems[_arg1];
for each (_local2 in _entities) {
if (_arg1.hasEntity(_local2)){
_arg1.removeEntity(_local2);
};
};
};
}
protected function executeRefreshEntity(_arg1:IEntity):void{
var _local2:ISystem;
if (_entities[_arg1]){
for each (_local2 in _systems) {
if (_local2.hasEntity(_arg1)){
if (!_local2.acceptsEntity(_arg1)){
_local2.removeEntity(_arg1);
};
} else {
if (_local2.acceptsEntity(_arg1)){
_local2.addEntity(_arg1);
};
};
};
};
}
protected function executeDisposeEntity(_arg1:IEntity):void{
if (_entities[_arg1]){
delete _entities[_arg1];
_arg1.dispose();
};
}
override protected function requestDestroyEntity(_arg1:IEntity):void{
_operations.push({command:"destroyEntity", entity:_arg1});
}
protected function executeAddEntity(_arg1:IEntity):void{
var _local2:ISystem;
if (!_entities[_arg1]){
_entities[_arg1] = _arg1;
for each (_local2 in _systems) {
if (_local2.acceptsEntity(_arg1)){
_local2.addEntity(_arg1);
};
};
};
}
protected function executeRefreshSystem(_arg1:ISystem):void{
if (_systems[_arg1]){
_arg1.refresh();
};
}
override protected function requestRemoveEntity(_arg1:IEntity):void{
_operations.push({command:"removeEntity", entity:_arg1});
}
protected function executeDisposeSystem(_arg1:ISystem):void{
if (_systems[_arg1]){
delete _systems[_arg1];
_arg1.dispose();
};
}
override public function destroy():void{
if (!_exists){
throw (new Error("[AsyncManager] : <destroy> : Manager not exists."));
};
var _local1:uint = _operations.length;
while (_local1) {
_operations.pop();
_local1--;
};
_operations = undefined;
super.destroy();
}
protected function executeAddSystem(_arg1:ISystem):void{
var _local2:IEntity;
if (!_systems[_arg1]){
_systems[_arg1] = _arg1;
for each (_local2 in _entities) {
if (_arg1.acceptsEntity(_local2)){
_arg1.addEntity(_local2);
};
};
};
}
}
}//package asp.managers
Section 8
//IManager (asp.managers.IManager)
package asp.managers {
import flash.events.*;
import asp.systems.*;
import asp.entities.*;
public interface IManager extends IEventDispatcher {
function disposeEntities(_arg1:Array):void;
function hasSystemOfType(_arg1:Class):Boolean;
function disposeAll():void;
function addSystems(_arg1:Array):void;
function disposeSystems(_arg1:Array):void;
function disposeSystem(_arg1:ISystem):void;
function removeEntity(_arg1:IEntity):void;
function addEntities(_arg1:Array):void;
function destroySystems(_arg1:Array):void;
function getAllEntities():Array;
function empty():Boolean;
function getSystemByType(_arg1:Class):ISystem;
function removeSystems(_arg1:Array):void;
function destroySystem(_arg1:ISystem):void;
function disposeAllSystems():void;
function removeSystem(_arg1:ISystem):void;
function refreshAllSystems():void;
function refreshSystems(_arg1:Array):void;
function getEntity(_arg1:String):IEntity;
function destroyEntities(_arg1:Array):void;
function exists():Boolean;
function hasEntity(_arg1:IEntity):Boolean;
function refreshEntity(_arg1:IEntity):void;
function dispose():void;
function disposeEntity(_arg1:IEntity):void;
function disposeAllEntities():void;
function addEntity(_arg1:IEntity):void;
function removeEntities(_arg1:Array):void;
function refreshAllEntities():void;
function destroyAllEntities():void;
function hasSystem(_arg1:ISystem):Boolean;
function getEntityByType(_arg1:Class):IEntity;
function getAllEntitiesByType(_arg1:Class):Array;
function removeAllEntities():void;
function numEntities():uint;
function addSystem(_arg1:ISystem):void;
function refreshSystem(_arg1:ISystem):void;
function getSystem(_arg1:String):ISystem;
function hasEntityOfType(_arg1:Class):Boolean;
function removeAllSystems():void;
function getAllSystemsByType(_arg1:Class):Array;
function getAllSystems():Array;
function destroy():void;
function refreshEntities(_arg1:Array):void;
function destroyEntity(_arg1:IEntity):void;
function numSystems():uint;
function destroyAllSystems():void;
}
}//package asp.managers
Section 9
//SmartManager (asp.managers.SmartManager)
package asp.managers {
import asp.systems.*;
import asp.entities.*;
public class SmartManager extends AsyncManager {
override protected function requestAddSystem(_arg1:ISystem):void{
if (condition()){
_operations.push({command:"addSystem", system:_arg1});
} else {
executeAddSystem(_arg1);
};
}
override protected function requestRemoveSystem(_arg1:ISystem):void{
if (condition()){
_operations.push({command:"removeSystem", system:_arg1});
} else {
executeRemoveSystem(_arg1);
};
}
override protected function requestAddEntity(_arg1:IEntity):void{
if (condition()){
_operations.push({command:"addEntity", entity:_arg1});
} else {
executeAddEntity(_arg1);
};
}
override protected function requestRemoveEntity(_arg1:IEntity):void{
if (condition()){
_operations.push({command:"removeEntity", entity:_arg1});
} else {
executeRemoveEntity(_arg1);
};
}
override protected function requestDisposeSystem(_arg1:ISystem):void{
if (condition()){
_operations.push({command:"disposeSystem", system:_arg1});
} else {
executeDisposeSystem(_arg1);
};
}
override protected function requestDestroySystem(_arg1:ISystem):void{
if (condition()){
_operations.push({command:"destroySystem", system:_arg1});
} else {
executeDestroySystem(_arg1);
};
}
override protected function requestDisposeEntity(_arg1:IEntity):void{
if (condition()){
_operations.push({command:"disposeEntity", entity:_arg1});
} else {
executeDisposeEntity(_arg1);
};
}
protected function condition():Boolean{
return (true);
}
override protected function requestRefreshSystem(_arg1:ISystem):void{
if (condition()){
_operations.push({command:"refreshSystem", system:_arg1});
} else {
executeRefreshSystem(_arg1);
};
}
override protected function requestDestroyEntity(_arg1:IEntity):void{
if (condition()){
_operations.push({command:"destroyEntity", entity:_arg1});
} else {
executeDestroyEntity(_arg1);
};
}
override protected function requestRefreshEntity(_arg1:IEntity):void{
if (condition()){
_operations.push({command:"refreshEntity", entity:_arg1});
} else {
executeRefreshEntity(_arg1);
};
}
}
}//package asp.managers
Section 10
//SyncManager (asp.managers.SyncManager)
package asp.managers {
import asp.systems.*;
import asp.entities.*;
public class SyncManager extends AManager {
override public function disposeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
requestDisposeEntity(_local2);
} else {
throw (new Error("[SyncManager] : <disposeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <disposeEntities> : Can't dispose non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <disposeEntities> : Wrong input."));
};
}
override public function disposeSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
requestDisposeSystem(_local2);
} else {
throw (new Error("[SyncManager] : <disposeSystems> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <disposeSystems> : Can't dispose non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <disposeSystems> : Wrong input."));
};
}
override public function removeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
requestRemoveEntity(_arg1);
} else {
throw (new Error("[SyncManager] : <removeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <removeEntity> : Can't remove non-existing entity."));
};
}
override public function addEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_entities[_local2]){
requestAddEntity(_local2);
} else {
throw (new Error("[SyncManager] : <addEntities> : Entity already added."));
};
} else {
throw (new Error("[SyncManager] : <addEntities> : Can't add non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <addEntities> : Wrong input."));
};
}
protected function requestRemoveSystem(_arg1:ISystem):void{
var _local2:IEntity;
delete _systems[_arg1];
for each (_local2 in _entities) {
if (_arg1.hasEntity(_local2)){
_arg1.removeEntity(_local2);
};
};
}
protected function requestDisposeEntity(_arg1:IEntity):void{
delete _entities[_arg1];
_arg1.dispose();
}
protected function requestAddEntity(_arg1:IEntity):void{
var _local2:ISystem;
_entities[_arg1] = _arg1;
for each (_local2 in _systems) {
if (_local2.acceptsEntity(_arg1)){
_local2.addEntity(_arg1);
};
};
}
override public function removeSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
requestRemoveSystem(_local2);
} else {
throw (new Error("[SyncManager] : <removeSystems> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <removeSystems> : Can't remove non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <removeSystems> : Wrong input."));
};
}
protected function requestRefreshSystem(_arg1:ISystem):void{
_arg1.refresh();
}
override public function refreshEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
requestRefreshEntity(_arg1);
} else {
throw (new Error("[SyncManager] : <refreshEntity> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <refreshEntity> : Can't refresh non-existing entity."));
};
}
override public function refreshAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
requestRefreshEntity(_local1);
};
}
override public function destroyAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
requestDestroyEntity(_local1);
};
}
override public function disposeSystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
requestDisposeSystem(_arg1);
} else {
throw (new Error("[SyncManager] : <disposeSystem> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <disposeSystem> : Can't dispose non-existing system."));
};
}
override public function addSystem(_arg1:ISystem):void{
if (_arg1){
if (!_systems[_arg1]){
requestAddSystem(_arg1);
} else {
throw (new Error("[SyncManager] : <addSystem> : System already added."));
};
} else {
throw (new Error("[SyncManager] : <addSystem> : Can't add non-existing system."));
};
}
protected function requestRemoveEntity(_arg1:IEntity):void{
var _local2:ISystem;
delete _entities[_arg1];
for each (_local2 in _systems) {
if (_local2.hasEntity(_arg1)){
_local2.removeEntity(_arg1);
};
};
}
override public function addSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_systems[_local2]){
requestAddSystem(_local2);
} else {
throw (new Error("[SyncManager] : <addSystems> : System already added."));
};
} else {
throw (new Error("[SyncManager] : <addSystems> : Can't add non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <addSystems> : Wrong input."));
};
}
protected function requestDestroyEntity(_arg1:IEntity):void{
delete _entities[_arg1];
_arg1.destroy();
}
override public function destroySystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
requestDestroySystem(_arg1);
} else {
throw (new Error("[SyncManager] : <destroySystem> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <destroySystem> : Can't destroy non-existing system."));
};
}
override public function destroySystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
requestDestroySystem(_local2);
} else {
throw (new Error("[SyncManager] : <destroySystems> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <destroySystems> : Can't destroy non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <destroySystems> : Wrong input."));
};
}
override public function refreshEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
requestRefreshEntity(_local2);
} else {
throw (new Error("[SyncManager] : <refreshEntities> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <refreshEntities> : Can't refresh non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <refreshEntities> : Wrong input."));
};
}
protected function requestRefreshEntity(_arg1:IEntity):void{
var _local2:ISystem;
for each (_local2 in _systems) {
if (_local2.hasEntity(_arg1)){
if (!_local2.acceptsEntity(_arg1)){
_local2.removeEntity(_arg1);
};
} else {
if (_local2.acceptsEntity(_arg1)){
_local2.addEntity(_arg1);
};
};
};
}
override public function removeSystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
requestRemoveSystem(_arg1);
} else {
throw (new Error("[SyncManager] : <removeSystem> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <removeSystem> : Can't remove non-existing system."));
};
}
override public function refreshSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
requestRefreshSystem(_local2);
} else {
throw (new Error("[SyncManager] : <refreshSystems> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <refreshSystems> : Can't refresh non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <refreshSystems> : Wrong input."));
};
}
override public function destroyEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
requestDestroyEntity(_local2);
} else {
throw (new Error("[SyncManager] : <destroyEntities> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <destroyEntities> : Can't destroy non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <destroyEntities> : Wrong input."));
};
}
override public function destroyAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
requestDestroySystem(_local1);
};
}
protected function requestDisposeSystem(_arg1:ISystem):void{
delete _systems[_arg1];
_arg1.dispose();
}
override public function disposeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
requestDisposeEntity(_local1);
};
}
override public function addEntity(_arg1:IEntity):void{
if (_arg1){
if (!_entities[_arg1]){
requestAddEntity(_arg1);
} else {
throw (new Error("[SyncManager] : <addEntity> : Entity already added."));
};
} else {
throw (new Error("[SyncManager] : <addEntity> : Can't add non-existing entity."));
};
}
override public function removeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
requestRemoveEntity(_local1);
};
}
protected function requestAddSystem(_arg1:ISystem):void{
var _local2:IEntity;
_systems[_arg1] = _arg1;
for each (_local2 in _entities) {
if (_arg1.acceptsEntity(_local2)){
_arg1.addEntity(_local2);
};
};
}
override public function disposeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
requestDisposeEntity(_arg1);
} else {
throw (new Error("[SyncManager] : <disposeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <disposeEntity> : Can't dispose non-existing entity."));
};
}
override public function removeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
requestRemoveEntity(_local2);
} else {
throw (new Error("[SyncManager] : <removeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <removeEntities> : Can't remove non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[SyncManager] : <removeEntities> : Wrong input."));
};
}
override public function removeAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
requestRemoveSystem(_local1);
};
}
override public function disposeAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
requestDisposeSystem(_local1);
};
}
override public function refreshSystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
requestRefreshSystem(_arg1);
} else {
throw (new Error("[SyncManager] : <refreshSystem> : System isn't added."));
};
} else {
throw (new Error("[SyncManager] : <refreshSystem> : Can't refresh non-existing system."));
};
}
protected function requestDestroySystem(_arg1:ISystem):void{
delete _systems[_arg1];
_arg1.destroy();
}
override public function destroyEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
requestDestroyEntity(_arg1);
} else {
throw (new Error("[SyncManager] : <destroyEntity> : Entity isn't added."));
};
} else {
throw (new Error("[SyncManager] : <destroyEntity> : Can't destroy non-existing entity."));
};
}
override public function refreshAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
requestRefreshSystem(_local1);
};
}
}
}//package asp.managers
Section 11
//AAdapter (asp.systems.AAdapter)
package asp.systems {
import asp.entities.*;
import asp.*;
public class AAdapter extends ASystem {
override public function disposeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
onEntityDispose(_local2);
delete _entities[_local2];
_local2.dispose();
} else {
throw (new Error("[AAdapter] : <disposeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AAdapter] : <disposeEntities> : Can't dispose non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AAdapter] : <disposeEntities> : Wrong input."));
};
}
override public function destroy():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
onEntityRemove(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
override public function disposeAll():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
onEntityDispose(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
_local1.dispose();
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
override public function destroyEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
onEntityDestroy(_arg1);
delete _entities[_arg1];
_arg1.destroy();
} else {
throw (new Error("[AAdapter] : <destroyEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AAdapter] : <destroyEntity> : Can't destroy non-existing entity."));
};
}
protected function onEntityRemove(_arg1:IEntity):void{
}
override public function removeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
onEntityRemove(_arg1);
delete _entities[_arg1];
if (_arg1.inSystem(this)){
_arg1.remove(this);
};
} else {
throw (new Error("[AAdapter] : <removeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AAdapter] : <removeEntity> : Can't remove non-existing entity."));
};
}
override public function refresh():void{
var _local2:IEntity;
var _local3:uint;
var _local1:uint = _types.length;
for each (_local2 in _entities) {
_local3 = 0;
while (_local3 < _local1) {
if (!_local2.hasAspectOfType(_types[_local3])){
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
break;
};
_local3++;
};
};
}
override public function addEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_entities[_local2]){
_local5 = _types.length;
_local6 = 0;
while (_local6 < _local5) {
if (!_local2.hasAspectOfType(_types[_local6])){
throw (new Error("[AAdapter] : <addEntities> : Entity hasn't aspect of needed type."));
};
_local6++;
};
onEntityAdd(_local2);
_entities[_local2] = _local2;
if (_local2.inSystem(this)){
_local2.add(this);
};
} else {
throw (new Error("[AAdapter] : <addEntities> : Entity already added."));
};
} else {
throw (new Error("[AAdapter] : <addEntities> : Can't add non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AAdapter] : <addEntities> : Wrong input."));
};
}
override public function destroyEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
onEntityDestroy(_local2);
delete _entities[_local2];
_local2.destroy();
} else {
throw (new Error("[AAdapter] : <destroyEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AAdapter] : <destroyEntities> : Can't destroy non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AAdapter] : <destroyEntities> : Wrong input."));
};
}
protected function onEntityDispose(_arg1:IEntity):void{
}
override public function disposeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
onEntityDispose(_local1);
delete _entities[_local1];
_local1.dispose();
};
}
override public function addEntity(_arg1:IEntity):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
if (!_entities[_arg1]){
_local2 = _types.length;
_local3 = 0;
while (_local3 < _local2) {
if (!_arg1.hasAspectOfType(_types[_local3])){
throw (new Error("[AAdapter] : <addEntity> : Entity hasn't aspect of needed type."));
};
_local3++;
};
onEntityAdd(_arg1);
_entities[_arg1] = _arg1;
if (!_arg1.inSystem(this)){
_arg1.add(this);
};
} else {
throw (new Error("[AAdapter] : <addEntity> : Entity already added."));
};
} else {
throw (new Error("[AAdapter] : <addEntity> : Can't add non-existing entity."));
};
}
override public function removeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
} else {
throw (new Error("[AAdapter] : <removeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AAdapter] : <removeEntities> : Can't remove non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AAdapter] : <removeEntities> : Wrong input."));
};
}
override public function dispose():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
onEntityDestroy(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
_local1.destroy();
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
override public function refreshAllEntities():void{
var _local2:IEntity;
var _local3:uint;
var _local1:uint = _types.length;
for each (_local2 in _entities) {
_local3 = 0;
while (_local3 < _local1) {
if (!_local2.hasAspectOfType(_types[_local3])){
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
break;
};
_local3++;
};
};
}
override public function disposeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
onEntityDispose(_arg1);
delete _entities[_arg1];
_arg1.dispose();
} else {
throw (new Error("[AAdapter] : <disposeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AAdapter] : <disposeEntity> : Can't dispose non-existing entity."));
};
}
override public function removeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
onEntityRemove(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
};
}
override public function destroyAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
onEntityDestroy(_local1);
delete _entities[_local1];
_local1.destroy();
};
}
override public function refreshEntity(_arg1:IEntity):void{
var _local2:Boolean;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local2 = true;
_local3 = _types.length;
_local4 = 0;
while (_local4 < _local3) {
if (!_arg1.hasAspectOfType(_types[_local4])){
_local2 = false;
break;
};
_local4++;
};
if (_local2){
if (!_entities[_arg1]){
onEntityAdd(_arg1);
_entities[_arg1] = _arg1;
if (!_arg1.inSystem(this)){
_arg1.add(this);
};
};
} else {
if (_entities[_arg1]){
onEntityRemove(_arg1);
delete _entities[_arg1];
if (_arg1.inSystem(this)){
_arg1.remove(this);
};
};
};
} else {
throw (new Error("[AAdapter] : <refreshEntity> : Can't refresh non-existing entity."));
};
}
protected function onEntityAdd(_arg1:IEntity):void{
}
protected function onEntityDestroy(_arg1:IEntity):void{
}
override public function refreshEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Boolean;
var _local7:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = _types.length;
_local5 = 0;
while (_local5 < _local3) {
_local2 = _arg1[_local5];
if (_local2){
_local6 = true;
_local7 = 0;
while (_local7 < _local4) {
if (!_local2.hasAspectOfType(_types[_local7])){
_local6 = false;
break;
};
_local7++;
};
if (_local6){
if (!_entities[_local2]){
onEntityAdd(_local2);
_entities[_local2] = _local2;
if (!_local2.inSystem(this)){
_local2.add(this);
};
};
} else {
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
};
} else {
throw (new Error("[AAdapter] : <refreshEntities> : Can't refresh non-existing entity."));
};
_local5++;
};
} else {
throw (new Error("[AAdapter] : <refreshEntities> : Wrong input."));
};
}
}
}//package asp.systems
Section 12
//AControl (asp.systems.AControl)
package asp.systems {
import asp.entities.*;
import asp.*;
public class AControl extends ASystem {
override public function disposeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
onEntityDispose(_local2);
delete _entities[_local2];
_local2.dispose();
} else {
throw (new Error("[AControl] : <disposeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AControl] : <disposeEntities> : Can't dispose non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AControl] : <disposeEntities> : Wrong input."));
};
}
override public function destroy():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
onEntityRemove(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
override public function disposeAll():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
onEntityDispose(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
_local1.dispose();
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
override public function destroyEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
onEntityDestroy(_arg1);
delete _entities[_arg1];
_arg1.destroy();
} else {
throw (new Error("[AControl] : <destroyEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AControl] : <destroyEntity> : Can't destroy non-existing entity."));
};
}
protected function onEntityRemove(_arg1:IEntity):void{
}
override public function removeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
onEntityRemove(_arg1);
delete _entities[_arg1];
if (_arg1.inSystem(this)){
_arg1.remove(this);
};
} else {
throw (new Error("[AControl] : <removeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AControl] : <removeEntity> : Can't remove non-existing entity."));
};
}
override public function refresh():void{
var _local2:IEntity;
var _local3:uint;
var _local1:uint = _types.length;
for each (_local2 in _entities) {
_local3 = 0;
while (_local3 < _local1) {
if (!_local2.hasAspectOfType(_types[_local3])){
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
break;
};
_local3++;
};
};
}
override public function update():void{
}
override public function addEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_entities[_local2]){
_local5 = _types.length;
_local6 = 0;
while (_local6 < _local5) {
if (!_local2.hasAspectOfType(_types[_local6])){
throw (new Error("[AControl] : <addEntities> : Entity hasn't aspect of needed type."));
};
_local6++;
};
onEntityAdd(_local2);
_entities[_local2] = _local2;
if (_local2.inSystem(this)){
_local2.add(this);
};
} else {
throw (new Error("[AControl] : <addEntities> : Entity already added."));
};
} else {
throw (new Error("[AControl] : <addEntities> : Can't add non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AControl] : <addEntities> : Wrong input."));
};
}
protected function onEntityDispose(_arg1:IEntity):void{
}
override public function destroyEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
onEntityDestroy(_local2);
delete _entities[_local2];
_local2.destroy();
} else {
throw (new Error("[AControl] : <destroyEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AControl] : <destroyEntities> : Can't destroy non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AControl] : <destroyEntities> : Wrong input."));
};
}
override public function disposeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
onEntityDispose(_local1);
delete _entities[_local1];
_local1.dispose();
};
}
override public function addEntity(_arg1:IEntity):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
if (!_entities[_arg1]){
_local2 = _types.length;
_local3 = 0;
while (_local3 < _local2) {
if (!_arg1.hasAspectOfType(_types[_local3])){
throw (new Error("[AControl] : <addEntity> : Entity hasn't aspect of needed type."));
};
_local3++;
};
onEntityAdd(_arg1);
_entities[_arg1] = _arg1;
if (!_arg1.inSystem(this)){
_arg1.add(this);
};
} else {
throw (new Error("[AControl] : <addEntity> : Entity already added."));
};
} else {
throw (new Error("[AControl] : <addEntity> : Can't add non-existing entity."));
};
}
override public function removeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
} else {
throw (new Error("[AControl] : <removeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[AControl] : <removeEntities> : Can't remove non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[AControl] : <removeEntities> : Wrong input."));
};
}
override public function dispose():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
onEntityDestroy(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
_local1.destroy();
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
override public function refreshAllEntities():void{
var _local2:IEntity;
var _local3:uint;
var _local1:uint = _types.length;
for each (_local2 in _entities) {
_local3 = 0;
while (_local3 < _local1) {
if (!_local2.hasAspectOfType(_types[_local3])){
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
break;
};
_local3++;
};
};
}
override public function destroyAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
onEntityDestroy(_local1);
delete _entities[_local1];
_local1.destroy();
};
}
override public function disposeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
onEntityDispose(_arg1);
delete _entities[_arg1];
_arg1.dispose();
} else {
throw (new Error("[AControl] : <disposeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[AControl] : <disposeEntity> : Can't dispose non-existing entity."));
};
}
override public function removeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
onEntityRemove(_local1);
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
};
}
override public function refreshEntity(_arg1:IEntity):void{
var _local2:Boolean;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local2 = true;
_local3 = _types.length;
_local4 = 0;
while (_local4 < _local3) {
if (!_arg1.hasAspectOfType(_types[_local4])){
_local2 = false;
break;
};
_local4++;
};
if (_local2){
if (!_entities[_arg1]){
onEntityAdd(_arg1);
_entities[_arg1] = _arg1;
if (!_arg1.inSystem(this)){
_arg1.add(this);
};
};
} else {
if (_entities[_arg1]){
onEntityRemove(_arg1);
delete _entities[_arg1];
if (_arg1.inSystem(this)){
_arg1.remove(this);
};
};
};
} else {
throw (new Error("[AControl] : <refreshEntity> : Can't refresh non-existing entity."));
};
}
protected function onEntityAdd(_arg1:IEntity):void{
}
protected function onEntityDestroy(_arg1:IEntity):void{
}
override public function refreshEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Boolean;
var _local7:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = _types.length;
_local5 = 0;
while (_local5 < _local3) {
_local2 = _arg1[_local5];
if (_local2){
_local6 = true;
_local7 = 0;
while (_local7 < _local4) {
if (!_local2.hasAspectOfType(_types[_local7])){
_local6 = false;
break;
};
_local7++;
};
if (_local6){
if (!_entities[_local2]){
onEntityAdd(_local2);
_entities[_local2] = _local2;
if (!_local2.inSystem(this)){
_local2.add(this);
};
};
} else {
if (_entities[_local2]){
onEntityRemove(_local2);
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
};
} else {
throw (new Error("[AControl] : <refreshEntities> : Can't refresh non-existing entity."));
};
_local5++;
};
} else {
throw (new Error("[AControl] : <refreshEntities> : Wrong input."));
};
}
}
}//package asp.systems
Section 13
//AProcess (asp.systems.AProcess)
package asp.systems {
import asp.entities.*;
public class AProcess extends ASystem {
override public function disposeEntities(_arg1:Array):void{
throw (new Error("[AProcess] : <disposeEntities> : Illegal operation."));
}
override public function disposeAll():void{
_priority = undefined;
_entities = undefined;
_types = undefined;
_exists = undefined;
}
override public function destroyEntity(_arg1:IEntity):void{
throw (new Error("[AProcess] : <destroyEntity> : Illegal operation."));
}
override public function removeEntity(_arg1:IEntity):void{
throw (new Error("[AProcess] : <removeEntity> : Illegal operation."));
}
override public function addEntities(_arg1:Array):void{
throw (new Error("[AProcess] : <addEntities> : Illegal operation."));
}
override public function hasEntity(_arg1:IEntity):Boolean{
return (false);
}
override public function refreshEntity(_arg1:IEntity):void{
throw (new Error("[AProcess] : <refreshEntity> : Illegal operation."));
}
override public function dispose():void{
_priority = undefined;
_entities = undefined;
_types = undefined;
_exists = undefined;
}
override public function destroyAllEntities():void{
throw (new Error("[AProcess] : <destroyAllEntities> : Illegal operation."));
}
override public function getAllEntitiesByType(_arg1:Class):Array{
return (null);
}
override public function hasEntityOfType(_arg1:Class):Boolean{
return (false);
}
override public function refreshAllEntities():void{
throw (new Error("[AProcess] : <refreshAllEntities> : Illegal operation."));
}
override public function acceptsEntity(_arg1:IEntity):Boolean{
return (false);
}
override public function refreshEntities(_arg1:Array):void{
throw (new Error("[AProcess] : <refreshEntities> : Illegal operation."));
}
override public function update():void{
trace("Plugin update.");
}
override public function getAllEntities():Array{
return (null);
}
override public function empty():Boolean{
return (true);
}
override public function getEntity(_arg1:String):IEntity{
return (null);
}
override public function disposeAllEntities():void{
throw (new Error("[AProcess] : <disposeAllEntities> : Illegal operation."));
}
override public function addEntity(_arg1:IEntity):void{
throw (new Error("[AProcess] : <addEntity> : Illegal operation."));
}
override public function removeEntities(_arg1:Array):void{
throw (new Error("[AProcess] : <removeEntities> : Illegal operation."));
}
override public function numEntities():uint{
return (0);
}
override public function disposeEntity(_arg1:IEntity):void{
throw (new Error("[AProcess] : <disposeEntity> : Illegal operation."));
}
override public function refresh():void{
}
override public function removeAllEntities():void{
throw (new Error("[AProcess] : <removeAllEntities> : Illegal operation."));
}
override public function destroyEntities(_arg1:Array):void{
throw (new Error("[AProcess] : <destroyEntities> : Illegal operation."));
}
override public function getEntityByType(_arg1:Class):IEntity{
return (null);
}
override public function destroy():void{
_priority = undefined;
_entities = undefined;
_types = undefined;
_exists = undefined;
}
}
}//package asp.systems
Section 14
//ASystem (asp.systems.ASystem)
package asp.systems {
import flash.events.*;
import asp.entities.*;
import asp.*;
import flash.utils.*;
public class ASystem extends EventDispatcher implements ISystem {
protected var _sn:uint;
protected var _priority:uint;
protected var _entities:Dictionary;
protected var _active:Boolean;
protected var _id:String;
protected var _engine:IEngine;
protected var _types:Array;
protected var _exists:Boolean;
private static var _count:uint = 0;
public function ASystem(){
_sn = _count;
_count++;
_id = ("system_" + _sn);
_priority = 0;
_entities = new Dictionary();
_types = new Array();
_active = true;
_exists = true;
}
public function remove():void{
var _local1:IEngine;
if (_engine){
_local1 = _engine;
_engine = undefined;
if (_local1.hasSystem(this)){
_local1.removeSystem(this);
};
} else {
throw (new Error("[ASystem] : <remove> : System isn't added to engine."));
};
}
public function removeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
delete _entities[_arg1];
if (_arg1.inSystem(this)){
_arg1.remove(this);
};
} else {
throw (new Error("[ASystem] : <removeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[ASystem] : <removeEntity> : Can't remove non-existing entity."));
};
}
public function destroyEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
delete _entities[_local2];
_local2.destroy();
} else {
throw (new Error("[ASystem] : <destroyEntities> : Entity isn't added."));
};
} else {
throw (new Error("[ASystem] : <destroyEntities> : Can't destroy non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[ASystem] : <destroyEntities> : Wrong input."));
};
}
public function destroy():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
public function active():Boolean{
return (_active);
}
public function disposeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
delete _entities[_local2];
_local2.dispose();
} else {
throw (new Error("[ASystem] : <disposeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[ASystem] : <disposeEntities> : Can't dispose non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[ASystem] : <disposeEntities> : Wrong input."));
};
}
public function disposeAll():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
_local1.dispose();
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
public function deactivate():void{
_active = false;
}
public function addEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_entities[_local2]){
_local5 = _types.length;
_local6 = 0;
while (_local6 < _local5) {
if (!_local2.hasAspectOfType(_types[_local6])){
throw (new Error("[ASystem] : <addEntities> : Entity hasn't aspect of needed type."));
};
_local6++;
};
_entities[_local2] = _local2;
if (_local2.inSystem(this)){
_local2.add(this);
};
} else {
throw (new Error("[ASystem] : <addEntities> : Entity already added."));
};
} else {
throw (new Error("[ASystem] : <addEntities> : Can't add non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[ASystem] : <addEntities> : Wrong input."));
};
}
public function get id():String{
return (_id);
}
public function hasEntity(_arg1:IEntity):Boolean{
return (Boolean(_entities[_arg1]));
}
public function refreshEntity(_arg1:IEntity):void{
var _local2:Boolean;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local2 = true;
_local3 = _types.length;
_local4 = 0;
while (_local4 < _local3) {
if (!_arg1.hasAspectOfType(_types[_local4])){
_local2 = false;
break;
};
_local4++;
};
if (_local2){
if (!_entities[_arg1]){
_entities[_arg1] = _arg1;
if (!_arg1.inSystem(this)){
_arg1.add(this);
};
};
} else {
if (_entities[_arg1]){
delete _entities[_arg1];
if (_arg1.inSystem(this)){
_arg1.remove(this);
};
};
};
} else {
throw (new Error("[ASystem] : <refreshEntity> : Can't refresh non-existing entity."));
};
}
public function dispose():void{
var _local1:IEntity;
var _local2:uint;
var _local3:IEngine;
for each (_local1 in _entities) {
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
_local1.destroy();
};
_local2 = _types.length;
if (!_engine){
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_exists = undefined;
} else {
_local3 = _engine;
_engine = undefined;
_priority = undefined;
_entities = undefined;
while (_local2) {
_types.pop();
_local2--;
};
_types = undefined;
_active = undefined;
_local3.removeSystem(this);
_exists = undefined;
};
}
public function get priority():uint{
return (_priority);
}
public function refreshAllEntities():void{
var _local2:IEntity;
var _local3:uint;
var _local1:uint = _types.length;
for each (_local2 in _entities) {
_local3 = 0;
while (_local3 < _local1) {
if (!_local2.hasAspectOfType(_types[_local3])){
if (_entities[_local2]){
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
break;
};
_local3++;
};
};
}
public function add(_arg1:IEngine):void{
if (!_engine){
_engine = _arg1;
if (!_engine.hasSystem(this)){
_engine.addSystem(this);
};
} else {
throw (new Error("[ASystem] : <add> : System is already added to some engine."));
};
}
public function acceptsEntity(_arg1:IEntity):Boolean{
var _local2:uint = _types.length;
var _local3:uint;
while (_local3 < _local2) {
if (!_arg1.hasAspectOfType(_types[_local3])){
return (false);
};
_local3++;
};
return (true);
}
public function hasEntityOfType(_arg1:Class):Boolean{
var _local2:IEntity;
for each (_local2 in _entities) {
if ((_local2 is _arg1)){
return (true);
};
};
return (false);
}
public function destroyAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
delete _entities[_local1];
_local1.destroy();
};
}
public function refreshEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Boolean;
var _local7:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = _types.length;
_local5 = 0;
while (_local5 < _local3) {
_local2 = _arg1[_local5];
if (_local2){
_local6 = true;
_local7 = 0;
while (_local7 < _local4) {
if (!_local2.hasAspectOfType(_types[_local7])){
_local6 = false;
break;
};
_local7++;
};
if (_local6){
if (!_entities[_local2]){
_entities[_local2] = _local2;
if (!_local2.inSystem(this)){
_local2.add(this);
};
};
} else {
if (_entities[_local2]){
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
};
} else {
throw (new Error("[ASystem] : <refreshEntities> : Can't refresh non-existing entity."));
};
_local5++;
};
} else {
throw (new Error("[ASystem] : <refreshEntities> : Wrong input."));
};
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function getAllEntitiesByType(_arg1:Class):Array{
var _local3:IEntity;
var _local2:Array = new Array();
for each (_local3 in _entities) {
if ((_local3 is _arg1)){
_local2.push(_local3);
};
};
return ((_local2.length) ? _local2 : null);
}
public function set priority(_arg1:uint):void{
_priority = _arg1;
}
public function update():void{
var _local1:IEntity;
if (!_active){
return;
};
for each (_local1 in _entities) {
if (_local1.active()){
trace((("Entity " + _local1) + " updated."));
};
};
}
public function getAllEntities():Array{
var _local2:IEntity;
var _local1:Array = new Array();
for each (_local2 in _entities) {
_local1.push(_local2);
};
return ((_local1.length) ? _local1 : null);
}
public function empty():Boolean{
var _local1:*;
for (_local1 in _entities) {
return (false);
};
return (true);
}
public function get engine():IEngine{
return (_engine);
}
public function reset():void{
}
public function getEntity(_arg1:String):IEntity{
var _local2:IEntity;
for each (_local2 in _entities) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function exists():Boolean{
return (_exists);
}
public function get sn():uint{
return (_sn);
}
public function addEntity(_arg1:IEntity):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
if (!_entities[_arg1]){
_local2 = _types.length;
_local3 = 0;
while (_local3 < _local2) {
if (!_arg1.hasAspectOfType(_types[_local3])){
throw (new Error("[ASystem] : <addEntity> : Entity hasn't aspect of needed type."));
};
_local3++;
};
_entities[_arg1] = _arg1;
if (!_arg1.inSystem(this)){
_arg1.add(this);
};
} else {
throw (new Error("[ASystem] : <addEntity> : Entity already added."));
};
} else {
throw (new Error("[ASystem] : <addEntity> : Can't add non-existing entity."));
};
}
public function removeEntities(_arg1:Array):void{
var _local2:IEntity;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_entities[_local2]){
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
} else {
throw (new Error("[ASystem] : <removeEntities> : Entity isn't added."));
};
} else {
throw (new Error("[ASystem] : <removeEntities> : Can't remove non-existing entity."));
};
_local4++;
};
} else {
throw (new Error("[ASystem] : <removeEntities> : Wrong input."));
};
}
public function numEntities():uint{
var _local2:*;
var _local1:uint;
for (_local2 in _entities) {
_local1++;
};
return (_local1);
}
public function disposeEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
delete _entities[_arg1];
_arg1.dispose();
} else {
throw (new Error("[ASystem] : <disposeEntity> : Entity isn't added."));
};
} else {
throw (new Error("[ASystem] : <disposeEntity> : Can't dispose non-existing entity."));
};
}
public function refresh():void{
var _local2:IEntity;
var _local3:uint;
var _local1:uint = _types.length;
for each (_local2 in _entities) {
_local3 = 0;
while (_local3 < _local1) {
if (!_local2.hasAspectOfType(_types[_local3])){
if (_entities[_local2]){
delete _entities[_local2];
if (_local2.inSystem(this)){
_local2.remove(this);
};
};
break;
};
_local3++;
};
};
}
public function removeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
delete _entities[_local1];
if (_local1.inSystem(this)){
_local1.remove(this);
};
};
}
public function disposeAllEntities():void{
var _local1:IEntity;
for each (_local1 in _entities) {
delete _entities[_local1];
_local1.dispose();
};
}
public function activate():void{
_active = true;
}
public function getEntityByType(_arg1:Class):IEntity{
var _local2:IEntity;
for each (_local2 in _entities) {
if ((_local2 is _arg1)){
return (_local2);
};
};
return (null);
}
public function destroyEntity(_arg1:IEntity):void{
if (_arg1){
if (_entities[_arg1]){
delete _entities[_arg1];
_arg1.destroy();
} else {
throw (new Error("[ASystem] : <destroyEntity> : Entity isn't added."));
};
} else {
throw (new Error("[ASystem] : <destroyEntity> : Can't destroy non-existing entity."));
};
}
}
}//package asp.systems
Section 15
//ISystem (asp.systems.ISystem)
package asp.systems {
import flash.events.*;
import asp.entities.*;
import asp.*;
public interface ISystem extends IEventDispatcher {
function disposeEntities(_arg1:Array):void;
function get engine():IEngine;
function remove():void;
function active():Boolean;
function removeEntity(_arg1:IEntity):void;
function set priority(_arg1:uint):void;
function addEntities(_arg1:Array):void;
function getAllEntities():Array;
function empty():Boolean;
function reset():void;
function update():void;
function disposeAll():void;
function getEntity(_arg1:String):IEntity;
function refresh():void;
function exists():Boolean;
function hasEntity(_arg1:IEntity):Boolean;
function removeAllEntities():void;
function dispose():void;
function add(_arg1:IEngine):void;
function get id():String;
function disposeAllEntities():void;
function get priority():uint;
function removeEntities(_arg1:Array):void;
function numEntities():uint;
function destroyAllEntities():void;
function disposeEntity(_arg1:IEntity):void;
function destroyEntities(_arg1:Array):void;
function addEntity(_arg1:IEntity):void;
function getAllEntitiesByType(_arg1:Class):Array;
function refreshEntity(_arg1:IEntity):void;
function refreshAllEntities():void;
function getEntityByType(_arg1:Class):IEntity;
function acceptsEntity(_arg1:IEntity):Boolean;
function activate():void;
function deactivate():void;
function hasEntityOfType(_arg1:Class):Boolean;
function set id(_arg1:String):void;
function destroy():void;
function refreshEntities(_arg1:Array):void;
function destroyEntity(_arg1:IEntity):void;
}
}//package asp.systems
Section 16
//AEngine (asp.AEngine)
package asp {
import flash.events.*;
import asp.systems.*;
import asp.managers.*;
import asp.entities.*;
import asp.events.*;
import flash.utils.*;
public class AEngine extends EventDispatcher implements IEngine {
protected var _updating:Boolean;
protected var _active:Boolean;
protected var _order:Array;
protected var _systems:Dictionary;
protected var _exists:Boolean;
public function AEngine(){
_systems = new Dictionary();
_order = new Array();
_active = true;
_exists = true;
}
public function removeSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
delete _systems[_local2];
_local5 = _order.length;
_local6 = 0;
while (_local6 < _local5) {
if (_order[_local6] == _local2){
_order.splice(_local6, 1);
break;
};
_local6++;
};
if (_local2.engine){
_local2.remove();
};
} else {
throw (new Error("[AEngine] : <removeSystems> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <removeSystems> : Can't remove non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AEngine] : <removeSystems> : Wrong input."));
};
}
public function disposeAll():void{
var _local2:ISystem;
var _local1:uint = _order.length;
while (_local1) {
_order.pop();
_local1--;
};
for each (_local2 in _systems) {
delete _systems[_local2];
_local2.disposeAll();
};
_order = undefined;
_systems = undefined;
_updating = undefined;
_active = undefined;
_exists = undefined;
}
public function disposeSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
delete _systems[_local2];
_local5 = _order.length;
_local6 = 0;
while (_local6 < _local5) {
if (_order[_local6] == _local2){
_order.splice(_local6, 1);
break;
};
_local6++;
};
_local2.dispose();
} else {
throw (new Error("[AEngine] : <disposeSystems> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <disposeSystems> : Can't dispose non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AEngine] : <destroySystems> : Wrong input."));
};
}
public function active():Boolean{
return (_active);
}
public function getManagerOfType(_arg1:Class):IManager{
var _local3:ISystem;
var _local2:IManager = (new (_arg1) as IManager);
if (_local2){
for each (_local3 in _systems) {
_local2.addSystem(_local3);
};
return (_local2);
//unresolved jump
};
throw (new Error("[AEngine] : <getManagerOfType> : Manager class must implement IManager or extend AManager."));
}
public function hasSystemOfType(_arg1:Class):Boolean{
var _local2:ISystem;
for each (_local2 in _systems) {
if ((_local2 is _arg1)){
return (true);
};
};
return (false);
}
public function getManager():IManager{
var _local2:ISystem;
var _local1:IManager = new AManager();
for each (_local2 in _systems) {
_local1.addSystem(_local2);
};
return (_local1);
}
public function dispose():void{
var _local2:ISystem;
var _local1:uint = _order.length;
while (_local1) {
_order.pop();
_local1--;
};
for each (_local2 in _systems) {
delete _systems[_local2];
_local2.destroy();
};
_order = undefined;
_systems = undefined;
_updating = undefined;
_active = undefined;
_exists = undefined;
}
public function disposeSystem(_arg1:ISystem):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
_local2 = _order.length;
_local3 = 0;
while (_local3 < _local2) {
if (_order[_local3] == _arg1){
_order.splice(_local3, 1);
break;
};
_local3++;
};
_arg1.dispose();
} else {
throw (new Error("[AEngine] : <disposeSystem> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <disposeSystem> : Can't dispose non-existing system."));
};
}
public function addSystem(_arg1:ISystem):void{
if (_arg1){
if (!_systems[_arg1]){
_systems[_arg1] = _arg1;
_order.push(_arg1);
_order.sortOn("priority", Array.DESCENDING);
if (_arg1.engine != this){
_arg1.add(this);
};
} else {
throw (new Error("[AEngine] : <addSystem> : System already added."));
};
} else {
throw (new Error("[AEngine] : <addSystem> : Can't add non-existing system."));
};
}
public function getSystem(_arg1:String):ISystem{
var _local2:ISystem;
for each (_local2 in _systems) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function getSystemByType(_arg1:Class):ISystem{
var _local2:ISystem;
for each (_local2 in _systems) {
if ((_local2 is _arg1)){
return (_local2);
};
};
return (null);
}
public function getAllSystems():Array{
var _local2:ISystem;
var _local1:Array = new Array();
for each (_local2 in _systems) {
_local1.push(_local2);
};
return ((_local1.length) ? _local1 : null);
}
public function disposeAllSystems():void{
var _local1:ISystem;
var _local2:uint;
var _local3:uint;
for each (_local1 in _systems) {
delete _systems[_local1];
_local2 = _order.length;
_local3 = 0;
while (_local3 < _local2) {
if (_order[_local3] == _local1){
_order.splice(_local3, 1);
break;
};
_local3++;
};
_local1.dispose();
};
}
public function addSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (!_systems[_local2]){
_systems[_local2] = _local2;
_order.push(_local2);
if (_local2.engine != this){
_local2.add(this);
};
} else {
throw (new Error("[AEngine] : <addSystems> : System already added."));
};
} else {
throw (new Error("[AEngine] : <addSystems> : Can't add non-existing system."));
};
_local4++;
};
_order.sortOn("priority", Array.DESCENDING);
} else {
throw (new Error("[AEngine] : <addSystems> : Wrong input."));
};
}
public function numSystems():uint{
var _local2:*;
var _local1:uint;
for (_local2 in _systems) {
_local1++;
};
return (_local1);
}
public function updating():Boolean{
return (_updating);
}
public function update():void{
var _local1:ISystem;
if (!_active){
return;
};
_updating = true;
dispatchEvent(new EngineEvent(EngineEvent.START_UPDATE));
var _local2:uint = _order.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = _order[_local3];
if (_local1.active()){
_local1.update();
};
_local3++;
};
_updating = false;
dispatchEvent(new EngineEvent(EngineEvent.FINISH_UPDATE));
}
public function empty():Boolean{
var _local1:*;
for (_local1 in _systems) {
return (false);
};
return (true);
}
public function removeSystem(_arg1:ISystem):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
_local2 = _order.length;
_local3 = 0;
while (_local3 < _local2) {
if (_order[_local3] == _arg1){
_order.splice(_local3, 1);
break;
};
_local3++;
};
if (_arg1.engine){
_arg1.remove();
};
} else {
throw (new Error("[AEngine] : <removeSystem> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <removeSystem> : Can't remove non-existing system."));
};
}
public function reset():void{
var _local1:ISystem;
for each (_local1 in _systems) {
_local1.reset();
};
}
public function refresh():void{
var _local1:ISystem;
var _local3:Array;
var _local4:IEntity;
var _local5:uint;
var _local6:uint;
var _local2:Dictionary = new Dictionary();
for each (_local1 in _systems) {
_local1.refresh();
_local3 = _local1.getAllEntities();
if (_local3){
_local5 = _local3.length;
_local6 = 0;
while (_local6 < _local5) {
_local4 = _local3[_local6];
if (!_local2[_local4]){
_local2[_local4] = _local4;
};
_local6++;
};
};
};
for each (_local1 in _systems) {
for each (_local4 in _local2) {
if (!_local1.hasEntity(_local4)){
if (_local1.acceptsEntity(_local4)){
_local1.addEntity(_local4);
};
};
};
};
}
public function destroyAllSystems():void{
var _local1:ISystem;
var _local2:uint;
var _local3:uint;
for each (_local1 in _systems) {
delete _systems[_local1];
_local2 = _order.length;
_local3 = 0;
while (_local3 < _local2) {
if (_order[_local3] == _local1){
_order.splice(_local3, 1);
break;
};
_local3++;
};
_local1.destroy();
};
}
public function destroySystem(_arg1:ISystem):void{
var _local2:uint;
var _local3:uint;
if (_arg1){
if (_systems[_arg1]){
delete _systems[_arg1];
_local2 = _order.length;
_local3 = 0;
while (_local3 < _local2) {
if (_order[_local3] == _arg1){
_order.splice(_local3, 1);
break;
};
_local3++;
};
_arg1.destroy();
} else {
throw (new Error("[AEngine] : <destroySystem> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <destroySystem> : Can't destroy non-existing system."));
};
}
public function exists():Boolean{
return (_exists);
}
public function hasSystem(_arg1:ISystem):Boolean{
return (Boolean(_systems[_arg1]));
}
public function refreshSystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
_local2.refresh();
} else {
throw (new Error("[AEngine] : <refreshSystems> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <refreshSystems> : Can't refresh non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AEngine] : <refreshSystems> : Wrong input."));
};
}
public function destroySystems(_arg1:Array):void{
var _local2:ISystem;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg1){
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if (_local2){
if (_systems[_local2]){
delete _systems[_local2];
_local5 = _order.length;
_local6 = 0;
while (_local6 < _local5) {
if (_order[_local6] == _local2){
_order.splice(_local6, 1);
break;
};
_local6++;
};
_local2.destroy();
} else {
throw (new Error("[AEngine] : <destroySystems> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <destroySystems> : Can't destroy non-existing system."));
};
_local4++;
};
} else {
throw (new Error("[AEngine] : <destroySystems> : Wrong input."));
};
}
public function removeAllSystems():void{
var _local1:ISystem;
var _local2:uint;
var _local3:uint;
for each (_local1 in _systems) {
delete _systems[_local1];
_local2 = _order.length;
_local3 = 0;
while (_local3 < _local2) {
if (_order[_local3] == _local1){
_order.splice(_local3, 1);
break;
};
_local3++;
};
if (_local1.engine){
_local1.remove();
};
};
}
public function refreshSystem(_arg1:ISystem):void{
if (_arg1){
if (_systems[_arg1]){
_arg1.refresh();
} else {
throw (new Error("[AEngine] : <refreshSystem> : System isn't added."));
};
} else {
throw (new Error("[AEngine] : <refreshSystem> : Can't refresh non-existing system."));
};
}
public function activate():void{
_active = true;
}
public function deactivate():void{
_active = false;
}
public function getAllSystemsByType(_arg1:Class):Array{
var _local3:ISystem;
var _local2:Array = new Array();
for each (_local3 in _systems) {
if ((_local3 is _arg1)){
_local2.push(_local3);
};
};
return ((_local2.length) ? _local2 : null);
}
public function destroy():void{
var _local2:ISystem;
var _local1:uint = _order.length;
while (_local1) {
_order.pop();
_local1--;
};
for each (_local2 in _systems) {
delete _systems[_local2];
};
_order = undefined;
_systems = undefined;
_updating = undefined;
_active = undefined;
_exists = undefined;
}
public function refreshAllSystems():void{
var _local1:ISystem;
for each (_local1 in _systems) {
_local1.refresh();
};
}
}
}//package asp
Section 17
//IEngine (asp.IEngine)
package asp {
import flash.events.*;
import asp.systems.*;
import asp.managers.*;
public interface IEngine extends IEventDispatcher {
function removeSystems(_arg1:Array):void;
function hasSystemOfType(_arg1:Class):Boolean;
function disposeAll():void;
function addSystems(_arg1:Array):void;
function disposeSystems(_arg1:Array):void;
function updating():Boolean;
function getManagerOfType(_arg1:Class):IManager;
function update():void;
function destroySystems(_arg1:Array):void;
function empty():Boolean;
function reset():void;
function destroySystem(_arg1:ISystem):void;
function disposeAllSystems():void;
function removeSystem(_arg1:ISystem):void;
function active():Boolean;
function refreshAllSystems():void;
function refreshSystems(_arg1:Array):void;
function getAllSystemsByType(_arg1:Class):Array;
function refresh():void;
function exists():Boolean;
function destroyAllSystems():void;
function dispose():void;
function getSystem(_arg1:String):ISystem;
function removeAllSystems():void;
function hasSystem(_arg1:ISystem):Boolean;
function refreshSystem(_arg1:ISystem):void;
function disposeSystem(_arg1:ISystem):void;
function addSystem(_arg1:ISystem):void;
function activate():void;
function deactivate():void;
function getSystemByType(_arg1:Class):ISystem;
function getManager():IManager;
function getAllSystems():Array;
function destroy():void;
function numSystems():uint;
}
}//package asp
Section 18
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
b2internal var m_p:b2Vec2;
public function b2CircleShape(_arg1:Number=0){
m_p = new b2Vec2();
super();
m_type = e_circleShape;
m_radius = _arg1;
}
override public function ComputeSubmergedArea(_arg1:b2Vec2, _arg2:Number, _arg3:b2Transform, _arg4:b2Vec2):Number{
var _local9:Number;
var _local5:b2Vec2 = b2Math.MulX(_arg3, m_p);
var _local6:Number = -((b2Math.Dot(_arg1, _local5) - _arg2));
if (_local6 < (-(m_radius) + Number.MIN_VALUE)){
return (0);
};
if (_local6 > m_radius){
_arg4.SetV(_local5);
return (((Math.PI * m_radius) * m_radius));
};
var _local7:Number = (m_radius * m_radius);
var _local8:Number = (_local6 * _local6);
_local9 = ((_local7 * (Math.asin((_local6 / m_radius)) + (Math.PI / 2))) + (_local6 * Math.sqrt((_local7 - _local8))));
var _local10:Number = (((-2 / 3) * Math.pow((_local7 - _local8), 1.5)) / _local9);
_arg4.x = (_local5.x + (_arg1.x * _local10));
_arg4.y = (_local5.y + (_arg1.y * _local10));
return (_local9);
}
override public function TestPoint(_arg1:b2Transform, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22 = _arg1.R;
var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_p.x) + (_local3.col2.x * m_p.y)));
var _local5:Number = (_arg1.position.y + ((_local3.col1.y * m_p.x) + (_local3.col2.y * m_p.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
public function GetRadius():Number{
return (m_radius);
}
override public function Set(_arg1:b2Shape):void{
var _local2:b2CircleShape;
super.Set(_arg1);
if ((_arg1 is b2CircleShape)){
_local2 = (_arg1 as b2CircleShape);
m_p.SetV(_local2.m_p);
};
}
override public function ComputeMass(_arg1:b2MassData, _arg2:Number):void{
_arg1.mass = (((_arg2 * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_p);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_p.x * m_p.x) + (m_p.y * m_p.y))));
}
override public function RayCast(_arg1:b2RayCastOutput, _arg2:b2RayCastInput, _arg3:b2Transform):Boolean{
var _local8:Number;
var _local4:b2Mat22 = _arg3.R;
var _local5:Number = (_arg3.position.x + ((_local4.col1.x * m_p.x) + (_local4.col2.x * m_p.y)));
var _local6:Number = (_arg3.position.y + ((_local4.col1.y * m_p.x) + (_local4.col2.y * m_p.y)));
var _local7:Number = (_arg2.p1.x - _local5);
_local8 = (_arg2.p1.y - _local6);
var _local9:Number = (((_local7 * _local7) + (_local8 * _local8)) - (m_radius * m_radius));
var _local10:Number = (_arg2.p2.x - _arg2.p1.x);
var _local11:Number = (_arg2.p2.y - _arg2.p1.y);
var _local12:Number = ((_local7 * _local10) + (_local8 * _local11));
var _local13:Number = ((_local10 * _local10) + (_local11 * _local11));
var _local14:Number = ((_local12 * _local12) - (_local13 * _local9));
if ((((_local14 < 0)) || ((_local13 < Number.MIN_VALUE)))){
return (false);
};
var _local15:Number = -((_local12 + Math.sqrt(_local14)));
if ((((0 <= _local15)) && ((_local15 <= (_arg2.maxFraction * _local13))))){
_local15 = (_local15 / _local13);
_arg1.fraction = _local15;
_arg1.normal.x = (_local7 + (_local15 * _local10));
_arg1.normal.y = (_local8 + (_local15 * _local11));
_arg1.normal.Normalize();
return (true);
};
return (false);
}
public function SetLocalPosition(_arg1:b2Vec2):void{
m_p.SetV(_arg1);
}
public function SetRadius(_arg1:Number):void{
m_radius = _arg1;
}
override public function Copy():b2Shape{
var _local1:b2Shape = new b2CircleShape();
_local1.Set(this);
return (_local1);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2Transform):void{
var _local3:b2Mat22 = _arg2.R;
var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_p.x) + (_local3.col2.x * m_p.y)));
var _local5:Number = (_arg2.position.y + ((_local3.col1.y * m_p.x) + (_local3.col2.y * m_p.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
public function GetLocalPosition():b2Vec2{
return (m_p);
}
}
}//package Box2D.Collision.Shapes
Section 19
//b2EdgeShape (Box2D.Collision.Shapes.b2EdgeShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2EdgeShape extends b2Shape {
b2internal var m_normal:b2Vec2;
b2internal var m_cornerConvex1:Boolean;
b2internal var m_cornerConvex2:Boolean;
b2internal var m_cornerDir1:b2Vec2;
b2internal var m_v1:b2Vec2;
b2internal var m_v2:b2Vec2;
private var s_supportVec:b2Vec2;
b2internal var m_coreV1:b2Vec2;
b2internal var m_coreV2:b2Vec2;
b2internal var m_cornerDir2:b2Vec2;
b2internal var m_nextEdge:b2EdgeShape;
b2internal var m_direction:b2Vec2;
b2internal var m_prevEdge:b2EdgeShape;
b2internal var m_length:Number;
public function b2EdgeShape(_arg1:b2Vec2, _arg2:b2Vec2){
s_supportVec = new b2Vec2();
m_v1 = new b2Vec2();
m_v2 = new b2Vec2();
m_coreV1 = new b2Vec2();
m_coreV2 = new b2Vec2();
m_normal = new b2Vec2();
m_direction = new b2Vec2();
m_cornerDir1 = new b2Vec2();
m_cornerDir2 = new b2Vec2();
super();
m_type = e_edgeShape;
m_prevEdge = null;
m_nextEdge = null;
m_v1 = _arg1;
m_v2 = _arg2;
m_direction.Set((m_v2.x - m_v1.x), (m_v2.y - m_v1.y));
m_length = m_direction.Normalize();
m_normal.Set(m_direction.y, -(m_direction.x));
m_coreV1.Set(((-(b2Settings.b2_toiSlop) * (m_normal.x - m_direction.x)) + m_v1.x), ((-(b2Settings.b2_toiSlop) * (m_normal.y - m_direction.y)) + m_v1.y));
m_coreV2.Set(((-(b2Settings.b2_toiSlop) * (m_normal.x + m_direction.x)) + m_v2.x), ((-(b2Settings.b2_toiSlop) * (m_normal.y + m_direction.y)) + m_v2.y));
m_cornerDir1 = m_normal;
m_cornerDir2.Set(-(m_normal.x), -(m_normal.y));
}
override public function ComputeSubmergedArea(_arg1:b2Vec2, _arg2:Number, _arg3:b2Transform, _arg4:b2Vec2):Number{
var _local5:b2Vec2 = new b2Vec2((_arg1.x * _arg2), (_arg1.y * _arg2));
var _local6:b2Vec2 = b2Math.MulX(_arg3, m_v1);
var _local7:b2Vec2 = b2Math.MulX(_arg3, m_v2);
var _local8:Number = (b2Math.Dot(_arg1, _local6) - _arg2);
var _local9:Number = (b2Math.Dot(_arg1, _local7) - _arg2);
if (_local8 > 0){
if (_local9 > 0){
return (0);
};
_local6.x = (((-(_local9) / (_local8 - _local9)) * _local6.x) + ((_local8 / (_local8 - _local9)) * _local7.x));
_local6.y = (((-(_local9) / (_local8 - _local9)) * _local6.y) + ((_local8 / (_local8 - _local9)) * _local7.y));
} else {
if (_local9 > 0){
_local7.x = (((-(_local9) / (_local8 - _local9)) * _local6.x) + ((_local8 / (_local8 - _local9)) * _local7.x));
_local7.y = (((-(_local9) / (_local8 - _local9)) * _local6.y) + ((_local8 / (_local8 - _local9)) * _local7.y));
};
};
_arg4.x = (((_local5.x + _local6.x) + _local7.x) / 3);
_arg4.y = (((_local5.y + _local6.y) + _local7.y) / 3);
return ((0.5 * (((_local6.x - _local5.x) * (_local7.y - _local5.y)) - ((_local6.y - _local5.y) * (_local7.x - _local5.x)))));
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2Transform):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local3:b2Mat22 = _arg2.R;
_local4 = (_arg2.position.x + ((_local3.col1.x * m_v1.x) + (_local3.col2.x * m_v1.y)));
_local5 = (_arg2.position.y + ((_local3.col1.y * m_v1.x) + (_local3.col2.y * m_v1.y)));
_local6 = (_arg2.position.x + ((_local3.col1.x * m_v2.x) + (_local3.col2.x * m_v2.y)));
_local7 = (_arg2.position.y + ((_local3.col1.y * m_v2.x) + (_local3.col2.y * m_v2.y)));
if (_local4 < _local6){
_arg1.lowerBound.x = _local4;
_arg1.upperBound.x = _local6;
} else {
_arg1.lowerBound.x = _local6;
_arg1.upperBound.x = _local4;
};
if (_local5 < _local7){
_arg1.lowerBound.y = _local5;
_arg1.upperBound.y = _local7;
} else {
_arg1.lowerBound.y = _local7;
_arg1.upperBound.y = _local5;
};
}
public function GetCorner1Vector():b2Vec2{
return (m_cornerDir1);
}
public function GetCorner2Vector():b2Vec2{
return (m_cornerDir2);
}
public function GetDirectionVector():b2Vec2{
return (m_direction);
}
public function GetCoreVertex1():b2Vec2{
return (m_coreV1);
}
public function GetCoreVertex2():b2Vec2{
return (m_coreV2);
}
public function GetFirstVertex(_arg1:b2Transform):b2Vec2{
var _local2:b2Mat22 = _arg1.R;
return (new b2Vec2((_arg1.position.x + ((_local2.col1.x * m_coreV1.x) + (_local2.col2.x * m_coreV1.y))), (_arg1.position.y + ((_local2.col1.y * m_coreV1.x) + (_local2.col2.y * m_coreV1.y)))));
}
public function GetNormalVector():b2Vec2{
return (m_normal);
}
public function GetNextEdge():b2EdgeShape{
return (m_nextEdge);
}
override public function RayCast(_arg1:b2RayCastOutput, _arg2:b2RayCastInput, _arg3:b2Transform):Boolean{
var _local4:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local5:Number = (_arg2.p2.x - _arg2.p1.x);
var _local6:Number = (_arg2.p2.y - _arg2.p1.y);
_local4 = _arg3.R;
var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_v1.x) + (_local4.col2.x * m_v1.y)));
var _local8:Number = (_arg3.position.y + ((_local4.col1.y * m_v1.x) + (_local4.col2.y * m_v1.y)));
var _local9:Number = ((_arg3.position.y + ((_local4.col1.y * m_v2.x) + (_local4.col2.y * m_v2.y))) - _local8);
var _local10:Number = -(((_arg3.position.x + ((_local4.col1.x * m_v2.x) + (_local4.col2.x * m_v2.y))) - _local7));
var _local11:Number = (100 * Number.MIN_VALUE);
var _local12:Number = -(((_local5 * _local9) + (_local6 * _local10)));
if (_local12 > _local11){
_local13 = (_arg2.p1.x - _local7);
_local14 = (_arg2.p1.y - _local8);
_local15 = ((_local13 * _local9) + (_local14 * _local10));
if ((((0 <= _local15)) && ((_local15 <= (_arg2.maxFraction * _local12))))){
_local16 = ((-(_local5) * _local14) + (_local6 * _local13));
if (((((-(_local11) * _local12) <= _local16)) && ((_local16 <= (_local12 * (1 + _local11)))))){
_local15 = (_local15 / _local12);
_arg1.fraction = _local15;
_local17 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_arg1.normal.x = (_local9 / _local17);
_arg1.normal.y = (_local10 / _local17);
return (true);
};
};
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData, _arg2:Number):void{
_arg1.mass = 0;
_arg1.center.SetV(m_v1);
_arg1.I = 0;
}
public function Corner1IsConvex():Boolean{
return (m_cornerConvex1);
}
public function Corner2IsConvex():Boolean{
return (m_cornerConvex2);
}
public function Support(_arg1:b2Transform, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Mat22 = _arg1.R;
var _local5:Number = (_arg1.position.x + ((_local4.col1.x * m_coreV1.x) + (_local4.col2.x * m_coreV1.y)));
var _local6:Number = (_arg1.position.y + ((_local4.col1.y * m_coreV1.x) + (_local4.col2.y * m_coreV1.y)));
var _local7:Number = (_arg1.position.x + ((_local4.col1.x * m_coreV2.x) + (_local4.col2.x * m_coreV2.y)));
var _local8:Number = (_arg1.position.y + ((_local4.col1.y * m_coreV2.x) + (_local4.col2.y * m_coreV2.y)));
if (((_local5 * _arg2) + (_local6 * _arg3)) > ((_local7 * _arg2) + (_local8 * _arg3))){
s_supportVec.x = _local5;
s_supportVec.y = _local6;
} else {
s_supportVec.x = _local7;
s_supportVec.y = _local8;
};
return (s_supportVec);
}
b2internal function SetNextEdge(_arg1:b2EdgeShape, _arg2:b2Vec2, _arg3:b2Vec2, _arg4:Boolean):void{
m_nextEdge = _arg1;
m_coreV2 = _arg2;
m_cornerDir2 = _arg3;
m_cornerConvex2 = _arg4;
}
public function GetPrevEdge():b2EdgeShape{
return (m_prevEdge);
}
public function GetVertex1():b2Vec2{
return (m_v1);
}
public function GetVertex2():b2Vec2{
return (m_v2);
}
b2internal function SetPrevEdge(_arg1:b2EdgeShape, _arg2:b2Vec2, _arg3:b2Vec2, _arg4:Boolean):void{
m_prevEdge = _arg1;
m_coreV1 = _arg2;
m_cornerDir1 = _arg3;
m_cornerConvex1 = _arg4;
}
public function GetLength():Number{
return (m_length);
}
override public function TestPoint(_arg1:b2Transform, _arg2:b2Vec2):Boolean{
return (false);
}
}
}//package Box2D.Collision.Shapes
Section 20
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
center = new b2Vec2(0, 0);
super();
}
}
}//package Box2D.Collision.Shapes
Section 21
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
b2internal var m_vertexCount:int;
b2internal var m_vertices:Array;
b2internal var m_centroid:b2Vec2;
b2internal var m_normals:Array;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonShape(){
m_type = e_polygonShape;
m_centroid = new b2Vec2();
m_vertices = new Array();
m_normals = new Array();
}
override public function Set(_arg1:b2Shape):void{
var _local2:b2PolygonShape;
var _local3:int;
super.Set(_arg1);
if ((_arg1 is b2PolygonShape)){
_local2 = (_arg1 as b2PolygonShape);
m_centroid.SetV(_local2.m_centroid);
m_vertexCount = _local2.m_vertexCount;
Reserve(m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3].SetV(_local2.m_vertices[_local3]);
m_normals[_local3].SetV(_local2.m_normals[_local3]);
_local3++;
};
};
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2Transform):void{
var _local10:Number;
var _local11:Number;
var _local3:b2Mat22 = _arg2.R;
var _local4:b2Vec2 = m_vertices[0];
var _local5:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
var _local6:Number = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
var _local7:Number = _local5;
var _local8:Number = _local6;
var _local9 = 1;
while (_local9 < m_vertexCount) {
_local4 = m_vertices[_local9];
_local10 = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
_local11 = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_local5 = ((_local5 < _local10)) ? _local5 : _local10;
_local6 = ((_local6 < _local11)) ? _local6 : _local11;
_local7 = ((_local7 > _local10)) ? _local7 : _local10;
_local8 = ((_local8 > _local11)) ? _local8 : _local11;
_local9++;
};
_arg1.lowerBound.x = (_local5 - m_radius);
_arg1.lowerBound.y = (_local6 - m_radius);
_arg1.upperBound.x = (_local7 + m_radius);
_arg1.upperBound.y = (_local8 + m_radius);
}
override public function ComputeSubmergedArea(_arg1:b2Vec2, _arg2:Number, _arg3:b2Transform, _arg4:b2Vec2):Number{
var _local12:int;
var _local22:b2Vec2;
var _local23:Boolean;
var _local24:b2MassData;
var _local25:Number;
var _local5:b2Vec2 = b2Math.MulTMV(_arg3.R, _arg1);
var _local6:Number = (_arg2 - b2Math.Dot(_arg1, _arg3.position));
var _local7:Array = new Array();
var _local8:int;
var _local9 = -1;
var _local10 = -1;
var _local11:Boolean;
_local12 = 0;
while (_local12 < m_vertexCount) {
_local7[_local12] = (b2Math.Dot(_local5, m_vertices[_local12]) - _local6);
_local23 = (_local7[_local12] < -(Number.MIN_VALUE));
if (_local12 > 0){
if (_local23){
if (!_local11){
_local9 = (_local12 - 1);
_local8++;
};
} else {
if (_local11){
_local10 = (_local12 - 1);
_local8++;
};
};
};
_local11 = _local23;
_local12++;
};
switch (_local8){
case 0:
if (_local11){
_local24 = new b2MassData();
ComputeMass(_local24, 1);
_arg4.SetV(b2Math.MulX(_arg3, _local24.center));
return (_local24.mass);
};
return (0);
case 1:
if (_local9 == -1){
_local9 = (m_vertexCount - 1);
} else {
_local10 = (m_vertexCount - 1);
};
break;
};
var _local13:int = ((_local9 + 1) % m_vertexCount);
var _local14:int = ((_local10 + 1) % m_vertexCount);
var _local15:Number = ((0 - _local7[_local9]) / (_local7[_local13] - _local7[_local9]));
var _local16:Number = ((0 - _local7[_local10]) / (_local7[_local14] - _local7[_local10]));
var _local17:b2Vec2 = new b2Vec2(((m_vertices[_local9].x * (1 - _local15)) + (m_vertices[_local13].x * _local15)), ((m_vertices[_local9].y * (1 - _local15)) + (m_vertices[_local13].y * _local15)));
var _local18:b2Vec2 = new b2Vec2(((m_vertices[_local10].x * (1 - _local16)) + (m_vertices[_local14].x * _local16)), ((m_vertices[_local10].y * (1 - _local16)) + (m_vertices[_local14].y * _local16)));
var _local19:Number = 0;
var _local20:b2Vec2 = new b2Vec2();
var _local21:b2Vec2 = m_vertices[_local13];
_local12 = _local13;
while (_local12 != _local14) {
_local12 = ((_local12 + 1) % m_vertexCount);
if (_local12 == _local14){
_local22 = _local18;
} else {
_local22 = m_vertices[_local12];
};
_local25 = (0.5 * (((_local21.x - _local17.x) * (_local22.y - _local17.y)) - ((_local21.y - _local17.y) * (_local22.x - _local17.x))));
_local19 = (_local19 + _local25);
_local20.x = (_local20.x + ((_local25 * ((_local17.x + _local21.x) + _local22.x)) / 3));
_local20.y = (_local20.y + ((_local25 * ((_local17.y + _local21.y) + _local22.y)) / 3));
_local21 = _local22;
};
_local20.Multiply((1 / _local19));
_arg4.SetV(b2Math.MulX(_arg3, _local20));
return (_local19);
}
public function GetVertices():Array{
return (m_vertices);
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
m_vertexCount = 4;
Reserve(4);
m_vertices[0].Set(-(_arg1), -(_arg2));
m_vertices[1].Set(_arg1, -(_arg2));
m_vertices[2].Set(_arg1, _arg2);
m_vertices[3].Set(-(_arg1), _arg2);
m_normals[0].Set(0, -1);
m_normals[1].Set(1, 0);
m_normals[2].Set(0, 1);
m_normals[3].Set(-1, 0);
m_centroid = _arg3;
var _local5:b2Transform = new b2Transform();
_local5.position = _arg3;
_local5.R.Set(_arg4);
var _local6:int;
while (_local6 < m_vertexCount) {
m_vertices[_local6] = b2Math.MulX(_local5, m_vertices[_local6]);
m_normals[_local6] = b2Math.MulMV(_local5.R, m_normals[_local6]);
_local6++;
};
}
override public function Copy():b2Shape{
var _local1:b2PolygonShape = new b2PolygonShape();
_local1.Set(this);
return (_local1);
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
m_vertexCount = 4;
Reserve(4);
m_vertices[0].Set(-(_arg1), -(_arg2));
m_vertices[1].Set(_arg1, -(_arg2));
m_vertices[2].Set(_arg1, _arg2);
m_vertices[3].Set(-(_arg1), _arg2);
m_normals[0].Set(0, -1);
m_normals[1].Set(1, 0);
m_normals[2].Set(0, 1);
m_normals[3].Set(-1, 0);
m_centroid.SetZero();
}
private function Reserve(_arg1:int):void{
var _local2:int = m_vertices.length;
while (_local2 < _arg1) {
m_vertices[_local2] = new b2Vec2();
m_normals[_local2] = new b2Vec2();
_local2++;
};
}
public function GetNormals():Array{
return (m_normals);
}
public function SetAsArray(_arg1:Array, _arg2:Number=0):void{
var _local4:b2Vec2;
var _local3:Array = new Array();
for each (_local4 in _arg1) {
_local3.push(_local4);
};
SetAsVector(_local3, _arg2);
}
override public function RayCast(_arg1:b2RayCastOutput, _arg2:b2RayCastInput, _arg3:b2Transform):Boolean{
var _local6:Number;
var _local7:Number;
var _local8:b2Mat22;
var _local9:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local4:Number = 0;
var _local5:Number = _arg2.maxFraction;
_local6 = (_arg2.p1.x - _arg3.position.x);
_local7 = (_arg2.p1.y - _arg3.position.y);
_local8 = _arg3.R;
var _local10:Number = ((_local6 * _local8.col1.x) + (_local7 * _local8.col1.y));
var _local11:Number = ((_local6 * _local8.col2.x) + (_local7 * _local8.col2.y));
_local6 = (_arg2.p2.x - _arg3.position.x);
_local7 = (_arg2.p2.y - _arg3.position.y);
_local8 = _arg3.R;
var _local12:Number = ((_local6 * _local8.col1.x) + (_local7 * _local8.col1.y));
var _local13:Number = ((_local6 * _local8.col2.x) + (_local7 * _local8.col2.y));
var _local14:Number = (_local12 - _local10);
var _local15:Number = (_local13 - _local11);
var _local16 = -1;
var _local17:int;
while (_local17 < m_vertexCount) {
_local9 = m_vertices[_local17];
_local6 = (_local9.x - _local10);
_local7 = (_local9.y - _local11);
_local9 = m_normals[_local17];
_local18 = ((_local9.x * _local6) + (_local9.y * _local7));
_local19 = ((_local9.x * _local14) + (_local9.y * _local15));
if (_local19 == 0){
if (_local18 < 0){
return (false);
};
} else {
if ((((_local19 < 0)) && ((_local18 < (_local4 * _local19))))){
_local4 = (_local18 / _local19);
_local16 = _local17;
} else {
if ((((_local19 > 0)) && ((_local18 < (_local5 * _local19))))){
_local5 = (_local18 / _local19);
};
};
};
if (_local5 < (_local4 - Number.MIN_VALUE)){
return (false);
};
_local17++;
};
if (_local16 >= 0){
_arg1.fraction = _local4;
_local8 = _arg3.R;
_local9 = m_normals[_local16];
_arg1.normal.x = ((_local8.col1.x * _local9.x) + (_local8.col2.x * _local9.y));
_arg1.normal.y = ((_local8.col1.y * _local9.x) + (_local8.col2.y * _local9.y));
return (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData, _arg2:Number):void{
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
if (m_vertexCount == 2){
_arg1.center.x = (0.5 * (m_vertices[0].x + m_vertices[1].x));
_arg1.center.y = (0.5 * (m_vertices[0].y + m_vertices[1].y));
_arg1.mass = 0;
_arg1.I = 0;
return;
};
var _local3:Number = 0;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8:Number = 0;
var _local9:Number = (1 / 3);
var _local10:int;
while (_local10 < m_vertexCount) {
_local11 = m_vertices[_local10];
_local12 = (((_local10 + 1) < m_vertexCount)) ? m_vertices[int((_local10 + 1))] : m_vertices[0];
_local13 = (_local11.x - _local7);
_local14 = (_local11.y - _local8);
_local15 = (_local12.x - _local7);
_local16 = (_local12.y - _local8);
_local17 = ((_local13 * _local16) - (_local14 * _local15));
_local18 = (0.5 * _local17);
_local5 = (_local5 + _local18);
_local3 = (_local3 + ((_local18 * _local9) * ((_local7 + _local11.x) + _local12.x)));
_local4 = (_local4 + ((_local18 * _local9) * ((_local8 + _local11.y) + _local12.y)));
_local19 = _local7;
_local20 = _local8;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = _local16;
_local25 = ((_local9 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local26 = ((_local9 * ((0.25 * (((_local22 * _local22) + (_local24 * _local22)) + (_local24 * _local24))) + ((_local20 * _local22) + (_local20 * _local24)))) + ((0.5 * _local20) * _local20));
_local6 = (_local6 + (_local17 * (_local25 + _local26)));
_local10++;
};
_arg1.mass = (_arg2 * _local5);
_local3 = (_local3 * (1 / _local5));
_local4 = (_local4 * (1 / _local5));
_arg1.center.Set(_local3, _local4);
_arg1.I = (_arg2 * _local6);
}
public function SetAsEdge(_arg1:b2Vec2, _arg2:b2Vec2):void{
m_vertexCount = 2;
Reserve(2);
m_vertices[0].SetV(_arg1);
m_vertices[1].SetV(_arg2);
m_centroid.x = (0.5 * (_arg1.x + _arg2.x));
m_centroid.y = (0.5 * (_arg1.y + _arg2.y));
m_normals[0] = b2Math.CrossVF(b2Math.SubtractVV(_arg2, _arg1), 1);
m_normals[0].Normalize();
m_normals[1].x = -(m_normals[0].x);
m_normals[1].y = -(m_normals[0].y);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
private function Validate():Boolean{
return (false);
}
public function SetAsVector(_arg1:Array, _arg2:Number=0):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:b2Vec2;
if (_arg2 == 0){
_arg2 = _arg1.length;
};
b2Settings.b2Assert((2 <= _arg2));
m_vertexCount = _arg2;
Reserve(_arg2);
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3].SetV(_arg1[_local3]);
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = b2Math.SubtractVV(m_vertices[_local5], m_vertices[_local4]);
b2Settings.b2Assert((_local6.LengthSquared() > Number.MIN_VALUE));
m_normals[_local3].SetV(b2Math.CrossVF(_local6, 1));
m_normals[_local3].Normalize();
_local3++;
};
m_centroid = ComputeCentroid(m_vertices, m_vertexCount);
}
public function GetSupport(_arg1:b2Vec2):int{
var _local5:Number;
var _local2:int;
var _local3:Number = ((m_vertices[0].x * _arg1.x) + (m_vertices[0].y * _arg1.y));
var _local4 = 1;
while (_local4 < m_vertexCount) {
_local5 = ((m_vertices[_local4].x * _arg1.x) + (m_vertices[_local4].y * _arg1.y));
if (_local5 > _local3){
_local2 = _local4;
_local3 = _local5;
};
_local4++;
};
return (_local2);
}
public function GetSupportVertex(_arg1:b2Vec2):b2Vec2{
var _local5:Number;
var _local2:int;
var _local3:Number = ((m_vertices[0].x * _arg1.x) + (m_vertices[0].y * _arg1.y));
var _local4 = 1;
while (_local4 < m_vertexCount) {
_local5 = ((m_vertices[_local4].x * _arg1.x) + (m_vertices[_local4].y * _arg1.y));
if (_local5 > _local3){
_local2 = _local4;
_local3 = _local5;
};
_local4++;
};
return (m_vertices[_local2]);
}
override public function TestPoint(_arg1:b2Transform, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local10:Number;
var _local4:b2Mat22 = _arg1.R;
var _local5:Number = (_arg2.x - _arg1.position.x);
var _local6:Number = (_arg2.y - _arg1.position.y);
var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
var _local9:int;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
b2internal static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
var _local5:Array = new Array((_arg3 + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
var _local6:Number = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
public static function AsVector(_arg1:Array, _arg2:Number):b2PolygonShape{
var _local3:b2PolygonShape = new (b2PolygonShape);
_local3.SetAsVector(_arg1, _arg2);
return (_local3);
}
public static function AsArray(_arg1:Array, _arg2:Number):b2PolygonShape{
var _local3:b2PolygonShape = new (b2PolygonShape);
_local3.SetAsArray(_arg1, _arg2);
return (_local3);
}
public static function AsBox(_arg1:Number, _arg2:Number):b2PolygonShape{
var _local3:b2PolygonShape = new (b2PolygonShape);
_local3.SetAsBox(_arg1, _arg2);
return (_local3);
}
public static function AsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):b2PolygonShape{
var _local5:b2PolygonShape = new (b2PolygonShape);
_local5.SetAsOrientedBox(_arg1, _arg2, _arg3, _arg4);
return (_local5);
}
public static function ComputeCentroid(_arg1:Array, _arg2:uint):b2Vec2{
var _local3:b2Vec2;
var _local7:Number;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
_local7 = (1 / 3);
var _local8:int;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function AsEdge(_arg1:b2Vec2, _arg2:b2Vec2):b2PolygonShape{
var _local3:b2PolygonShape = new (b2PolygonShape);
_local3.SetAsEdge(_arg1, _arg2);
return (_local3);
}
}
}//package Box2D.Collision.Shapes
Section 22
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Shape {
b2internal var m_radius:Number;
b2internal var m_type:int;
b2internal static const e_polygonShape:int = 1;
public static const e_hitCollide:int = 1;
public static const e_missCollide:int = 0;
b2internal static const e_edgeShape:int = 2;
b2internal static const e_shapeTypeCount:int = 3;
b2internal static const e_unknownShape:int = -1;
b2internal static const e_circleShape:int = 0;
public static const e_startsInsideCollide:int = -1;
public function b2Shape(){
m_type = e_unknownShape;
m_radius = b2Settings.b2_linearSlop;
}
public function RayCast(_arg1:b2RayCastOutput, _arg2:b2RayCastInput, _arg3:b2Transform):Boolean{
return (false);
}
public function ComputeSubmergedArea(_arg1:b2Vec2, _arg2:Number, _arg3:b2Transform, _arg4:b2Vec2):Number{
return (0);
}
public function Set(_arg1:b2Shape):void{
m_radius = _arg1.m_radius;
}
public function ComputeMass(_arg1:b2MassData, _arg2:Number):void{
}
public function GetType():int{
return (m_type);
}
public function Copy():b2Shape{
return (null);
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2Transform):void{
}
public function TestPoint(_arg1:b2Transform, _arg2:b2Vec2):Boolean{
return (false);
}
public static function TestOverlap(_arg1:b2Shape, _arg2:b2Transform, _arg3:b2Shape, _arg4:b2Transform):Boolean{
var _local5:b2DistanceInput = new b2DistanceInput();
_local5.proxyA = new b2DistanceProxy();
_local5.proxyA.Set(_arg1);
_local5.proxyB = new b2DistanceProxy();
_local5.proxyB.Set(_arg3);
_local5.transformA = _arg2;
_local5.transformB = _arg4;
_local5.useRadii = true;
var _local6:b2SimplexCache = new b2SimplexCache();
_local6.count = 0;
var _local7:b2DistanceOutput = new b2DistanceOutput();
b2Distance.Distance(_local7, _local6, _local5);
return ((_local7.distance < (10 * Number.MIN_VALUE)));
}
}
}//package Box2D.Collision.Shapes
Section 23
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function Contains(_arg1:b2AABB):Boolean{
var _local2:Boolean;
_local2 = ((_local2) && ((lowerBound.x <= _arg1.lowerBound.x)));
_local2 = ((_local2) && ((lowerBound.y <= _arg1.lowerBound.y)));
_local2 = ((_local2) && ((_arg1.upperBound.x <= upperBound.x)));
_local2 = ((_local2) && ((_arg1.upperBound.y <= upperBound.y)));
return (_local2);
}
public function RayCast(_arg1:b2RayCastOutput, _arg2:b2RayCastInput):Boolean{
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local3:Number = -(Number.MAX_VALUE);
var _local4:Number = Number.MAX_VALUE;
var _local5:Number = _arg2.p1.x;
var _local6:Number = _arg2.p1.y;
var _local7:Number = (_arg2.p2.x - _arg2.p1.x);
var _local8:Number = (_arg2.p2.y - _arg2.p1.y);
var _local9:Number = Math.abs(_local7);
var _local10:Number = Math.abs(_local8);
_local11 = _arg1.normal;
if (_local9 < Number.MIN_VALUE){
if ((((_local5 < lowerBound.x)) || ((upperBound.x < _local5)))){
return (false);
};
} else {
_local12 = (1 / _local7);
_local13 = ((lowerBound.x - _local5) * _local12);
_local14 = ((upperBound.x - _local5) * _local12);
_local16 = -1;
if (_local13 > _local14){
_local15 = _local13;
_local13 = _local14;
_local14 = _local15;
_local16 = 1;
};
if (_local13 > _local3){
_local11.x = _local16;
_local11.y = 0;
_local3 = _local13;
};
_local4 = Math.min(_local4, _local14);
if (_local3 > _local4){
return (false);
};
};
if (_local10 < Number.MIN_VALUE){
if ((((_local6 < lowerBound.y)) || ((upperBound.y < _local6)))){
return (false);
};
} else {
_local12 = (1 / _local8);
_local13 = ((lowerBound.y - _local6) * _local12);
_local14 = ((upperBound.y - _local6) * _local12);
_local16 = -1;
if (_local13 > _local14){
_local15 = _local13;
_local13 = _local14;
_local14 = _local15;
_local16 = 1;
};
if (_local13 > _local3){
_local11.y = _local16;
_local11.x = 0;
_local3 = _local13;
};
_local4 = Math.min(_local4, _local14);
if (_local3 > _local4){
return (false);
};
};
_arg1.fraction = _local3;
return (true);
}
public function GetCenter():b2Vec2{
return (new b2Vec2(((lowerBound.x + upperBound.x) / 2), ((lowerBound.y + upperBound.y) / 2)));
}
public function IsValid():Boolean{
var _local1:Number = (upperBound.x - lowerBound.x);
var _local2:Number = (upperBound.y - lowerBound.y);
var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
public function TestOverlap(_arg1:b2AABB):Boolean{
var _local2:Number = (_arg1.lowerBound.x - upperBound.x);
var _local3:Number = (_arg1.lowerBound.y - upperBound.y);
var _local4:Number = (lowerBound.x - _arg1.upperBound.x);
var _local5:Number = (lowerBound.y - _arg1.upperBound.y);
if ((((_local2 > 0)) || ((_local3 > 0)))){
return (false);
};
if ((((_local4 > 0)) || ((_local5 > 0)))){
return (false);
};
return (true);
}
public function GetExtents():b2Vec2{
return (new b2Vec2(((upperBound.x - lowerBound.x) / 2), ((upperBound.y - lowerBound.y) / 2)));
}
public function Combine(_arg1:b2AABB, _arg2:b2AABB):void{
lowerBound.x = Math.min(_arg1.lowerBound.x, _arg2.lowerBound.x);
lowerBound.y = Math.min(_arg1.lowerBound.y, _arg2.lowerBound.y);
upperBound.x = Math.max(_arg1.upperBound.x, _arg2.upperBound.x);
upperBound.y = Math.max(_arg1.upperBound.y, _arg2.upperBound.y);
}
public static function Combine(_arg1:b2AABB, _arg2:b2AABB):b2AABB{
var _local3:b2AABB = new (b2AABB);
_local3.Combine(_arg1, _arg2);
return (_local3);
}
}
}//package Box2D.Collision
Section 24
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
private static var s_v12:b2Vec2 = new b2Vec2();
private static var s_v11:b2Vec2 = new b2Vec2();
private static var s_edgeBO:Array = new Array(1);
private static var s_tangent2:b2Vec2 = new b2Vec2();
private static var s_planePoint:b2Vec2 = new b2Vec2();
private static var s_localTangent:b2Vec2 = new b2Vec2();
private static var s_clipPoints1:Array = MakeClipPointVector();
private static var s_clipPoints2:Array = MakeClipPointVector();
private static var s_localNormal:b2Vec2 = new b2Vec2();
private static var s_edgeAO:Array = new Array(1);
private static var s_tangent:b2Vec2 = new b2Vec2();
private static var s_normal:b2Vec2 = new b2Vec2();
private static var s_incidentEdge:Array = MakeClipPointVector();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2Transform, _arg3:int, _arg4:b2PolygonShape, _arg5:b2Transform):Number{
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local25:Number;
var _local6:int = _arg1.m_vertexCount;
var _local7:Array = _arg1.m_vertices;
var _local8:Array = _arg1.m_normals;
var _local9:int = _arg4.m_vertexCount;
var _local10:Array = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
var _local13:Number = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
var _local14:Number = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
var _local15:Number = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
var _local16:Number = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
var _local20:Number = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local21:Number = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
var _local22:Number = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local23:Number = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
var _local24:Number = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local9:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
var _local8:b2Vec2 = _local5.v;
_local9 = (((_arg3.x * _local7.x) + (_arg3.y * _local7.y)) - _arg4);
var _local10:Number = (((_arg3.x * _local8.x) + (_arg3.y * _local8.y)) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
_arg1[_temp1].Set(_arg2[0]);
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_arg1[_temp2].Set(_arg2[1]);
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
private static function MakeClipPointVector():Array{
var _local1:Array = new Array(2);
_local1[0] = new ClipVertex();
_local1[1] = new ClipVertex();
return (_local1);
}
public static function CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2Transform, _arg4:b2CircleShape, _arg5:b2Transform):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
_arg1.m_pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_p;
var _local8:Number = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local9:Number = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_p;
var _local10:Number = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local11:Number = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
var _local12:Number = (_local10 - _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local15:Number = (_arg2.m_radius + _arg4.m_radius);
if (_local14 > (_local15 * _local15)){
return;
};
_arg1.m_type = b2Manifold.e_circles;
_arg1.m_localPoint.SetV(_arg2.m_p);
_arg1.m_localPlaneNormal.SetZero();
_arg1.m_pointCount = 1;
_arg1.m_points[0].m_localPoint.SetV(_arg4.m_p);
_arg1.m_points[0].m_id.key = 0;
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2Transform, _arg4:int, _arg5:b2PolygonShape, _arg6:b2Transform):void{
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local20:ClipVertex;
var _local23:Number;
var _local7:int = _arg2.m_vertexCount;
var _local8:Array = _arg2.m_normals;
var _local9:int = _arg5.m_vertexCount;
var _local10:Array = _arg5.m_vertices;
var _local11:Array = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
var _local14:Number = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
var _local15:Number = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
var _local16:Number = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
var _local21:int = _local17;
var _local22:int = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2Transform, _arg4:b2CircleShape, _arg5:b2Transform):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local17:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
_arg1.m_pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_p;
var _local13:Number = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
var _local14:Number = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
var _local15:Number = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
var _local16:Number = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
var _local18:int;
var _local19:Number = -(Number.MAX_VALUE);
var _local20:Number = (_arg2.m_radius + _arg4.m_radius);
var _local21:int = _arg2.m_vertexCount;
var _local22:Array = _arg2.m_vertices;
var _local23:Array = _arg2.m_normals;
var _local24:int;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local31 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local31 > _local20){
return;
};
if (_local31 > _local19){
_local19 = _local31;
_local18 = _local24;
};
_local24++;
};
var _local25:int = _local18;
var _local26:int = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
var _local27:b2Vec2 = _local22[_local25];
var _local28:b2Vec2 = _local22[_local26];
if (_local19 < Number.MIN_VALUE){
_arg1.m_pointCount = 1;
_arg1.m_type = b2Manifold.e_faceA;
_arg1.m_localPlaneNormal.SetV(_local23[_local18]);
_arg1.m_localPoint.x = (0.5 * (_local27.x + _local28.x));
_arg1.m_localPoint.y = (0.5 * (_local27.y + _local28.y));
_arg1.m_points[0].m_localPoint.SetV(_arg4.m_p);
_arg1.m_points[0].m_id.key = 0;
return;
};
var _local29:Number = (((_local15 - _local27.x) * (_local28.x - _local27.x)) + ((_local16 - _local27.y) * (_local28.y - _local27.y)));
var _local30:Number = (((_local15 - _local28.x) * (_local27.x - _local28.x)) + ((_local16 - _local28.y) * (_local27.y - _local28.y)));
if (_local29 <= 0){
if ((((_local15 - _local27.x) * (_local15 - _local27.x)) + ((_local16 - _local27.y) * (_local16 - _local27.y))) > (_local20 * _local20)){
return;
};
_arg1.m_pointCount = 1;
_arg1.m_type = b2Manifold.e_faceA;
_arg1.m_localPlaneNormal.x = (_local15 - _local27.x);
_arg1.m_localPlaneNormal.y = (_local16 - _local27.y);
_arg1.m_localPlaneNormal.Normalize();
_arg1.m_localPoint.SetV(_local27);
_arg1.m_points[0].m_localPoint.SetV(_arg4.m_p);
_arg1.m_points[0].m_id.key = 0;
} else {
if (_local30 <= 0){
if ((((_local15 - _local28.x) * (_local15 - _local28.x)) + ((_local16 - _local28.y) * (_local16 - _local28.y))) > (_local20 * _local20)){
return;
};
_arg1.m_pointCount = 1;
_arg1.m_type = b2Manifold.e_faceA;
_arg1.m_localPlaneNormal.x = (_local15 - _local28.x);
_arg1.m_localPlaneNormal.y = (_local16 - _local28.y);
_arg1.m_localPlaneNormal.Normalize();
_arg1.m_localPoint.SetV(_local28);
_arg1.m_points[0].m_localPoint.SetV(_arg4.m_p);
_arg1.m_points[0].m_id.key = 0;
} else {
_local32 = (0.5 * (_local27.x + _local28.x));
_local33 = (0.5 * (_local27.y + _local28.y));
_local19 = (((_local15 - _local32) * _local23[_local25].x) + ((_local16 - _local33) * _local23[_local25].y));
if (_local19 > _local20){
return;
};
_arg1.m_pointCount = 1;
_arg1.m_type = b2Manifold.e_faceA;
_arg1.m_localPlaneNormal.x = _local23[_local25].x;
_arg1.m_localPlaneNormal.y = _local23[_local25].y;
_arg1.m_localPlaneNormal.Normalize();
_arg1.m_localPoint.Set(_local32, _local33);
_arg1.m_points[0].m_localPoint.SetV(_arg4.m_p);
_arg1.m_points[0].m_id.key = 0;
};
};
}
public static function CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2Transform, _arg4:b2PolygonShape, _arg5:b2Transform):void{
var _local6:ClipVertex;
var _local12:b2PolygonShape;
var _local13:b2PolygonShape;
var _local14:b2Transform;
var _local15:b2Transform;
var _local16:int;
var _local17:uint;
var _local20:b2Mat22;
var _local25:b2Vec2;
var _local39:int;
var _local42:Number;
var _local43:b2ManifoldPoint;
var _local44:Number;
var _local45:Number;
_arg1.m_pointCount = 0;
var _local7:Number = (_arg2.m_radius + _arg4.m_radius);
var _local8:int;
s_edgeAO[0] = _local8;
var _local9:Number = FindMaxSeparation(s_edgeAO, _arg2, _arg3, _arg4, _arg5);
_local8 = s_edgeAO[0];
if (_local9 > _local7){
return;
};
var _local10:int;
s_edgeBO[0] = _local10;
var _local11:Number = FindMaxSeparation(s_edgeBO, _arg4, _arg5, _arg2, _arg3);
_local10 = s_edgeBO[0];
if (_local11 > _local7){
return;
};
var _local18:Number = 0.98;
var _local19:Number = 0.001;
if (_local11 > ((_local18 * _local9) + _local19)){
_local12 = _arg4;
_local13 = _arg2;
_local14 = _arg5;
_local15 = _arg3;
_local16 = _local10;
_arg1.m_type = b2Manifold.e_faceB;
_local17 = 1;
} else {
_local12 = _arg2;
_local13 = _arg4;
_local14 = _arg3;
_local15 = _arg5;
_local16 = _local8;
_arg1.m_type = b2Manifold.e_faceA;
_local17 = 0;
};
var _local21:Array = s_incidentEdge;
FindIncidentEdge(_local21, _local12, _local14, _local16, _local13, _local15);
var _local22:int = _local12.m_vertexCount;
var _local23:Array = _local12.m_vertices;
var _local24:b2Vec2 = _local23[_local16];
if ((_local16 + 1) < _local22){
_local25 = _local23[int((_local16 + 1))];
} else {
_local25 = _local23[0];
};
var _local26:b2Vec2 = s_localTangent;
_local26.Set((_local25.x - _local24.x), (_local25.y - _local24.y));
_local26.Normalize();
var _local27:b2Vec2 = s_localNormal;
_local27.x = _local26.y;
_local27.y = -(_local26.x);
var _local28:b2Vec2 = s_planePoint;
_local28.Set((0.5 * (_local24.x + _local25.x)), (0.5 * (_local24.y + _local25.y)));
var _local29:b2Vec2 = s_tangent;
_local20 = _local14.R;
_local29.x = ((_local20.col1.x * _local26.x) + (_local20.col2.x * _local26.y));
_local29.y = ((_local20.col1.y * _local26.x) + (_local20.col2.y * _local26.y));
var _local30:b2Vec2 = s_tangent2;
_local30.x = -(_local29.x);
_local30.y = -(_local29.y);
var _local31:b2Vec2 = s_normal;
_local31.x = _local29.y;
_local31.y = -(_local29.x);
var _local32:b2Vec2 = s_v11;
var _local33:b2Vec2 = s_v12;
_local32.x = (_local14.position.x + ((_local20.col1.x * _local24.x) + (_local20.col2.x * _local24.y)));
_local32.y = (_local14.position.y + ((_local20.col1.y * _local24.x) + (_local20.col2.y * _local24.y)));
_local33.x = (_local14.position.x + ((_local20.col1.x * _local25.x) + (_local20.col2.x * _local25.y)));
_local33.y = (_local14.position.y + ((_local20.col1.y * _local25.x) + (_local20.col2.y * _local25.y)));
var _local34:Number = ((_local31.x * _local32.x) + (_local31.y * _local32.y));
var _local35:Number = (((-(_local29.x) * _local32.x) - (_local29.y * _local32.y)) + _local7);
var _local36:Number = (((_local29.x * _local33.x) + (_local29.y * _local33.y)) + _local7);
var _local37:Array = s_clipPoints1;
var _local38:Array = s_clipPoints2;
_local39 = ClipSegmentToLine(_local37, _local21, _local30, _local35);
if (_local39 < 2){
return;
};
_local39 = ClipSegmentToLine(_local38, _local37, _local29, _local36);
if (_local39 < 2){
return;
};
_arg1.m_localPlaneNormal.SetV(_local27);
_arg1.m_localPoint.SetV(_local28);
var _local40:int;
var _local41:int;
while (_local41 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local38[_local41];
_local42 = (((_local31.x * _local6.v.x) + (_local31.y * _local6.v.y)) - _local34);
if (_local42 <= _local7){
_local43 = _arg1.m_points[_local40];
_local20 = _local15.R;
_local44 = (_local6.v.x - _local15.position.x);
_local45 = (_local6.v.y - _local15.position.y);
_local43.m_localPoint.x = ((_local44 * _local20.col1.x) + (_local45 * _local20.col1.y));
_local43.m_localPoint.y = ((_local44 * _local20.col2.x) + (_local45 * _local20.col2.y));
_local43.m_id.Set(_local6.id);
_local43.m_id.features.flip = _local17;
_local40++;
};
_local41++;
};
_arg1.m_pointCount = _local40;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2Transform, _arg4:b2PolygonShape, _arg5:b2Transform):Number{
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
var _local6:int = _arg2.m_vertexCount;
var _local7:Array = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
var _local10:Number = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
var _local11:Number = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
var _local12:Number = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
var _local13:Number = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
var _local14:int;
var _local15:Number = -(Number.MAX_VALUE);
var _local16:int;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
var _local17:Number = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
var _local18:int = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
var _local19:Number = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
var _local20:int = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
var _local21:Number = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2 = _arg2.lowerBound;
var _local4:b2Vec2 = _arg1.upperBound;
var _local5:Number = (_local3.x - _local4.x);
var _local6:Number = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
var _local7:Number = (_local3.x - _local4.x);
var _local8:Number = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
}
}//package Box2D.Collision
Section 25
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
import Box2D.Common.*;
public class b2ContactID {
b2internal var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
public function get key():uint{
return (_key);
}
}
}//package Box2D.Collision
Section 26
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2ContactPoint {
public var friction:Number;
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 27
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Distance {
private static var b2_gjkIters:int;
private static var b2_gjkMaxIters:int;
private static var s_saveB:Array = new Array(3);
private static var s_simplex:b2Simplex = new b2Simplex();
private static var b2_gjkCalls:int;
private static var s_saveA:Array = new Array(3);
public static function Distance(_arg1:b2DistanceOutput, _arg2:b2SimplexCache, _arg3:b2DistanceInput):void{
var _local17:int;
var _local18:b2Vec2;
var _local20:b2Vec2;
var _local21:b2SimplexVertex;
var _local22:Boolean;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
b2_gjkCalls++;
var _local4:b2DistanceProxy = _arg3.proxyA;
var _local5:b2DistanceProxy = _arg3.proxyB;
var _local6:b2Transform = _arg3.transformA;
var _local7:b2Transform = _arg3.transformB;
var _local8:b2Simplex = s_simplex;
_local8.ReadCache(_arg2, _local4, _local6, _local5, _local7);
var _local9:Array = _local8.m_vertices;
var _local10 = 20;
var _local11:Array = s_saveA;
var _local12:Array = s_saveB;
var _local13:int;
var _local14:b2Vec2 = _local8.GetClosestPoint();
var _local15:Number = _local14.LengthSquared();
var _local16:Number = _local15;
var _local19:int;
while (_local19 < _local10) {
_local13 = _local8.m_count;
_local17 = 0;
while (_local17 < _local13) {
_local11[_local17] = _local9[_local17].indexA;
_local12[_local17] = _local9[_local17].indexB;
_local17++;
};
switch (_local8.m_count){
case 1:
break;
case 2:
_local8.Solve2();
break;
case 3:
_local8.Solve3();
break;
default:
b2Settings.b2Assert(false);
};
if (_local8.m_count == 3){
break;
};
_local18 = _local8.GetClosestPoint();
_local16 = _local18.LengthSquared();
if (_local16 > _local15){
};
_local15 = _local16;
_local20 = _local8.GetSearchDirection();
if (_local20.LengthSquared() < (Number.MIN_VALUE * Number.MIN_VALUE)){
break;
};
_local21 = _local9[_local8.m_count];
_local21.indexA = _local4.GetSupport(b2Math.MulTMV(_local6.R, _local20.GetNegative()));
_local21.wA = b2Math.MulX(_local6, _local4.GetVertex(_local21.indexA));
_local21.indexB = _local5.GetSupport(b2Math.MulTMV(_local7.R, _local20));
_local21.wB = b2Math.MulX(_local7, _local5.GetVertex(_local21.indexB));
_local21.w = b2Math.SubtractVV(_local21.wB, _local21.wA);
_local19++;
b2_gjkIters++;
_local22 = false;
_local17 = 0;
while (_local17 < _local13) {
if ((((_local21.indexA == _local11[_local17])) && ((_local21.indexB == _local12[_local17])))){
_local22 = true;
break;
};
_local17++;
};
if (_local22){
break;
};
_local8.m_count++;
};
b2_gjkMaxIters = b2Math.Max(b2_gjkMaxIters, _local19);
_local8.GetWitnessPoints(_arg1.pointA, _arg1.pointB);
_arg1.distance = b2Math.SubtractVV(_arg1.pointA, _arg1.pointB).Length();
_arg1.iterations = _local19;
_local8.WriteCache(_arg2);
if (_arg3.useRadii){
_local23 = _local4.m_radius;
_local24 = _local5.m_radius;
if ((((_arg1.distance > (_local23 + _local24))) && ((_arg1.distance > Number.MIN_VALUE)))){
_arg1.distance = (_arg1.distance - (_local23 + _local24));
_local25 = b2Math.SubtractVV(_arg1.pointB, _arg1.pointA);
_local25.Normalize();
_arg1.pointA.x = (_arg1.pointA.x + (_local23 * _local25.x));
_arg1.pointA.y = (_arg1.pointA.y + (_local23 * _local25.y));
_arg1.pointB.x = (_arg1.pointB.x - (_local24 * _local25.x));
_arg1.pointB.y = (_arg1.pointB.y - (_local24 * _local25.y));
} else {
_local18 = new b2Vec2();
_local18.x = (0.5 * (_arg1.pointA.x + _arg1.pointB.x));
_local18.y = (0.5 * (_arg1.pointA.y + _arg1.pointB.y));
_arg1.pointA.x = (_arg1.pointB.x = _local18.x);
_arg1.pointA.y = (_arg1.pointB.y = _local18.y);
_arg1.distance = 0;
};
};
}
}
}//package Box2D.Collision
Section 28
//b2DistanceInput (Box2D.Collision.b2DistanceInput)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2DistanceInput {
public var proxyA:b2DistanceProxy;
public var proxyB:b2DistanceProxy;
public var transformA:b2Transform;
public var transformB:b2Transform;
public var useRadii:Boolean;
}
}//package Box2D.Collision
Section 29
//b2DistanceOutput (Box2D.Collision.b2DistanceOutput)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2DistanceOutput {
public var pointA:b2Vec2;
public var distance:Number;
public var iterations:int;
public var pointB:b2Vec2;
public function b2DistanceOutput(){
pointA = new b2Vec2();
pointB = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 30
//b2DistanceProxy (Box2D.Collision.b2DistanceProxy)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2DistanceProxy {
public var m_radius:Number;
public var m_vertices:Array;
public var m_count:int;
public function GetVertex(_arg1:int):b2Vec2{
b2Settings.b2Assert((((0 <= _arg1)) && ((_arg1 < m_count))));
return (m_vertices[_arg1]);
}
public function Set(_arg1:b2Shape):void{
var _local2:b2CircleShape;
var _local3:b2PolygonShape;
switch (_arg1.GetType()){
case b2Shape.e_circleShape:
_local2 = (_arg1 as b2CircleShape);
m_vertices = new Array(1, true);
m_vertices[0] = _local2.m_p;
m_count = 1;
m_radius = _local2.m_radius;
break;
case b2Shape.e_polygonShape:
_local3 = (_arg1 as b2PolygonShape);
m_vertices = _local3.m_vertices;
m_count = _local3.m_vertexCount;
m_radius = _local3.m_radius;
break;
default:
b2Settings.b2Assert(false);
};
}
public function GetSupportVertex(_arg1:b2Vec2):b2Vec2{
var _local5:Number;
var _local2:int;
var _local3:Number = ((m_vertices[0].x * _arg1.x) + (m_vertices[0].y * _arg1.y));
var _local4 = 1;
while (_local4 < m_count) {
_local5 = ((m_vertices[_local4].x * _arg1.x) + (m_vertices[_local4].y * _arg1.y));
if (_local5 > _local3){
_local2 = _local4;
_local3 = _local5;
};
_local4++;
};
return (m_vertices[_local2]);
}
public function GetVertexCount():int{
return (m_count);
}
public function GetSupport(_arg1:b2Vec2):Number{
var _local5:Number;
var _local2:int;
var _local3:Number = ((m_vertices[0].x * _arg1.x) + (m_vertices[0].y * _arg1.y));
var _local4 = 1;
while (_local4 < m_count) {
_local5 = ((m_vertices[_local4].x * _arg1.x) + (m_vertices[_local4].y * _arg1.y));
if (_local5 > _local3){
_local2 = _local4;
_local3 = _local5;
};
_local4++;
};
return (_local2);
}
}
}//package Box2D.Collision
Section 31
//b2DynamicTree (Box2D.Collision.b2DynamicTree)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2DynamicTree {
private var m_insertionCount:int;
private var m_root:b2DynamicTreeNode;
private var m_freeList:b2DynamicTreeNode;
private var m_path:uint;
public function b2DynamicTree(){
m_root = null;
m_freeList = null;
m_path = 0;
m_insertionCount = 0;
}
private function RemoveLeaf(_arg1:b2DynamicTreeNode):void{
var _local4:b2DynamicTreeNode;
var _local5:b2AABB;
if (_arg1 == m_root){
m_root = null;
return;
};
var _local2:b2DynamicTreeNode = _arg1.parent;
var _local3:b2DynamicTreeNode = _local2.parent;
if (_local2.child1 == _arg1){
_local4 = _local2.child2;
} else {
_local4 = _local2.child1;
};
if (_local3){
if (_local3.child1 == _local2){
_local3.child1 = _local4;
} else {
_local3.child2 = _local4;
};
_local4.parent = _local3;
FreeNode(_local2);
while (_local3) {
_local5 = _local3.aabb;
_local3.aabb = b2AABB.Combine(_local3.child1.aabb, _local3.child2.aabb);
if (_local5.Contains(_local3.aabb)){
break;
};
_local3 = _local3.parent;
};
} else {
m_root = _local4;
_local4.parent = null;
FreeNode(_local2);
};
}
public function GetFatAABB(_arg1:b2DynamicTreeNode):b2AABB{
return (_arg1.aabb);
}
public function Query(_arg1:Function, _arg2:b2AABB):void{
var _local5:b2DynamicTreeNode;
var _local6:Boolean;
if (m_root == null){
return;
};
var _local3:Array = new Array();
var _local4:int;
var _temp1 = _local4;
_local4 = (_local4 + 1);
var _local7 = _temp1;
_local3[_local7] = m_root;
while (_local4 > 0) {
--_local4;
_local5 = _local3[_local4];
if (_local5.aabb.TestOverlap(_arg2)){
if (_local5.IsLeaf()){
_local6 = _arg1(_local5);
if (!_local6){
return;
};
} else {
var _temp2 = _local4;
_local4 = (_local4 + 1);
var _local8 = _temp2;
_local3[_local8] = _local5.child1;
var _temp3 = _local4;
_local4 = (_local4 + 1);
var _local9 = _temp3;
_local3[_local9] = _local5.child2;
};
};
};
}
public function RayCast(_arg1:Function, _arg2:b2RayCastInput):void{
var _local3:b2Vec2;
var _local9:b2AABB;
var _local10:Number;
var _local11:Number;
var _local14:b2DynamicTreeNode;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local17:Number;
var _local18:b2RayCastInput;
if (m_root == null){
return;
};
_local3 = _arg2.p1;
var _local4:b2Vec2 = _arg2.p2;
var _local5:b2Vec2 = b2Math.SubtractVV(_local3, _local4);
_local5.Normalize();
var _local6:b2Vec2 = b2Math.CrossFV(1, _local5);
var _local7:b2Vec2 = b2Math.AbsV(_local6);
var _local8:Number = _arg2.maxFraction;
_local9 = new b2AABB();
_local10 = (_local3.x + (_local8 * (_local4.x - _local3.x)));
_local11 = (_local3.y + (_local8 * (_local4.y - _local3.y)));
_local9.lowerBound.x = Math.min(_local3.x, _local10);
_local9.lowerBound.y = Math.min(_local3.y, _local11);
_local9.upperBound.x = Math.max(_local3.x, _local10);
_local9.upperBound.y = Math.max(_local3.y, _local11);
var _local12:Array = new Array();
var _local13:int;
var _temp1 = _local13;
_local13 = (_local13 + 1);
var _local19 = _temp1;
_local12[_local19] = m_root;
while (_local13 > 0) {
--_local13;
_local14 = _local12[_local13];
if (_local14.aabb.TestOverlap(_local9) == false){
} else {
_local15 = _local14.aabb.GetCenter();
_local16 = _local14.aabb.GetExtents();
_local17 = ((Math.abs(((_local6.x * (_local3.x - _local15.x)) + (_local6.y * (_local3.y - _local15.y)))) - (_local7.x * _local16.x)) - (_local7.y * _local16.y));
if (_local17 > 0){
} else {
if (_local14.IsLeaf()){
_local18 = new b2RayCastInput();
_local18.p1 = _arg2.p1;
_local18.p2 = _arg2.p2;
_local18.maxFraction = _arg2.maxFraction;
_local8 = _arg1(_local18, _local14);
if (_local8 == 0){
return;
};
_local10 = (_local3.x + (_local8 * (_local4.x - _local3.x)));
_local11 = (_local3.y + (_local8 * (_local4.y - _local3.y)));
_local9.lowerBound.x = Math.min(_local3.x, _local10);
_local9.lowerBound.y = Math.min(_local3.y, _local11);
_local9.upperBound.x = Math.max(_local3.x, _local10);
_local9.upperBound.y = Math.max(_local3.y, _local11);
} else {
var _temp2 = _local13;
_local13 = (_local13 + 1);
var _local20 = _temp2;
_local12[_local20] = _local14.child1;
var _temp3 = _local13;
_local13 = (_local13 + 1);
var _local21 = _temp3;
_local12[_local21] = _local14.child2;
};
};
};
};
}
public function GetUserData(_arg1:b2DynamicTreeNode){
return (_arg1.userData);
}
private function FreeNode(_arg1:b2DynamicTreeNode):void{
_arg1.parent = m_freeList;
m_freeList = _arg1;
}
public function Rebalance(_arg1:int):void{
var _local3:b2DynamicTreeNode;
var _local4:uint;
if (m_root == null){
return;
};
var _local2:int;
while (_local2 < _arg1) {
_local3 = m_root;
_local4 = 0;
while (_local3.IsLeaf() == false) {
_local3 = (((m_path >> _local4) & 1)) ? _local3.child2 : _local3.child1;
_local4 = ((_local4 + 1) & 31);
};
m_path++;
RemoveLeaf(_local3);
InsertLeaf(_local3);
_local2++;
};
}
public function CreateProxy(_arg1:b2AABB, _arg2):b2DynamicTreeNode{
var _local3:b2DynamicTreeNode;
var _local4:Number;
var _local5:Number;
_local3 = AllocateNode();
_local4 = b2Settings.b2_aabbExtension;
_local5 = b2Settings.b2_aabbExtension;
_local3.aabb.lowerBound.x = (_arg1.lowerBound.x - _local4);
_local3.aabb.lowerBound.y = (_arg1.lowerBound.y - _local5);
_local3.aabb.upperBound.x = (_arg1.upperBound.x + _local4);
_local3.aabb.upperBound.y = (_arg1.upperBound.y + _local5);
_local3.userData = _arg2;
InsertLeaf(_local3);
return (_local3);
}
public function DestroyProxy(_arg1:b2DynamicTreeNode):void{
RemoveLeaf(_arg1);
FreeNode(_arg1);
}
private function InsertLeaf(_arg1:b2DynamicTreeNode):void{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
m_insertionCount++;
if (m_root == null){
m_root = _arg1;
m_root.parent = null;
return;
};
var _local2:b2Vec2 = _arg1.aabb.GetCenter();
var _local3:b2DynamicTreeNode = m_root;
if (_local3.IsLeaf() == false){
do {
_local6 = _local3.child1;
_local7 = _local3.child2;
_local8 = (Math.abs((((_local6.aabb.lowerBound.x + _local6.aabb.upperBound.x) / 2) - _local2.x)) + Math.abs((((_local6.aabb.lowerBound.y + _local6.aabb.upperBound.y) / 2) - _local2.y)));
_local9 = (Math.abs((((_local7.aabb.lowerBound.x + _local7.aabb.upperBound.x) / 2) - _local2.x)) + Math.abs((((_local7.aabb.lowerBound.y + _local7.aabb.upperBound.y) / 2) - _local2.y)));
if (_local8 < _local9){
_local3 = _local6;
} else {
_local3 = _local7;
};
} while (_local3.IsLeaf() == false);
};
var _local4:b2DynamicTreeNode = _local3.parent;
var _local5:b2DynamicTreeNode = AllocateNode();
_local5.parent = _local4;
_local5.userData = null;
_local5.aabb.Combine(_arg1.aabb, _local3.aabb);
if (_local4){
if (_local3.parent.child1 == _local3){
_local4.child1 = _local5;
} else {
_local4.child2 = _local5;
};
_local5.child1 = _local3;
_local5.child2 = _arg1;
_local3.parent = _local5;
_arg1.parent = _local5;
do {
} while (!(_local4.aabb.Contains(_local5.aabb)));
} else {
_local5.child1 = _local3;
_local5.child2 = _arg1;
_local3.parent = _local5;
_arg1.parent = _local5;
m_root = _local5;
};
}
public function MoveProxy(_arg1:b2DynamicTreeNode, _arg2:b2AABB, _arg3:b2Vec2):Boolean{
var _local4:Number;
var _local5:Number;
b2Settings.b2Assert(_arg1.IsLeaf());
if (_arg1.aabb.Contains(_arg2)){
return (false);
};
RemoveLeaf(_arg1);
_local4 = (b2Settings.b2_aabbExtension + (b2Settings.b2_aabbMultiplier * ((_arg3.x > 0)) ? _arg3.x : -(_arg3.x)));
_local5 = (b2Settings.b2_aabbExtension + (b2Settings.b2_aabbMultiplier * ((_arg3.y > 0)) ? _arg3.y : -(_arg3.y)));
_arg1.aabb.lowerBound.x = (_arg2.lowerBound.x - _local4);
_arg1.aabb.lowerBound.y = (_arg2.lowerBound.y - _local5);
_arg1.aabb.upperBound.x = (_arg2.upperBound.x + _local4);
_arg1.aabb.upperBound.y = (_arg2.upperBound.y + _local5);
InsertLeaf(_arg1);
return (true);
}
private function AllocateNode():b2DynamicTreeNode{
var _local1:b2DynamicTreeNode;
if (m_freeList){
_local1 = m_freeList;
m_freeList = _local1.parent;
_local1.parent = null;
_local1.child1 = null;
_local1.child2 = null;
return (_local1);
};
return (new b2DynamicTreeNode());
}
}
}//package Box2D.Collision
Section 32
//b2DynamicTreeBroadPhase (Box2D.Collision.b2DynamicTreeBroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2DynamicTreeBroadPhase implements IBroadPhase {
private var m_moveBuffer:Array;
private var m_tree:b2DynamicTree;
private var m_pairBuffer:Array;
private var m_pairCount:int;// = 0
private var m_proxyCount:int;
public function b2DynamicTreeBroadPhase(){
m_tree = new b2DynamicTree();
m_moveBuffer = new Array();
m_pairBuffer = new Array();
super();
}
public function Validate():void{
}
private function UnBufferMove(_arg1:b2DynamicTreeNode):void{
var _local2:int = m_moveBuffer.indexOf(_arg1);
m_moveBuffer.splice(_local2, 1);
}
private function BufferMove(_arg1:b2DynamicTreeNode):void{
m_moveBuffer[m_moveBuffer.length] = _arg1;
}
private function ComparePairs(_arg1:b2DynamicTreePair, _arg2:b2DynamicTreePair):int{
return (0);
}
public function GetProxyCount():int{
return (m_proxyCount);
}
public function GetFatAABB(_arg1):b2AABB{
return (m_tree.GetFatAABB(_arg1));
}
public function Query(_arg1:Function, _arg2:b2AABB):void{
m_tree.Query(_arg1, _arg2);
}
public function Rebalance(_arg1:int):void{
m_tree.Rebalance(_arg1);
}
public function TestOverlap(_arg1, _arg2):Boolean{
var _local3:b2AABB = m_tree.GetFatAABB(_arg1);
var _local4:b2AABB = m_tree.GetFatAABB(_arg2);
return (_local3.TestOverlap(_local4));
}
public function UpdatePairs(_arg1:Function):void{
var queryProxy:b2DynamicTreeNode;
var i:int;
var fatAABB:b2AABB;
var primaryPair:b2DynamicTreePair;
var userDataA:*;
var userDataB:*;
var pair:b2DynamicTreePair;
var callback = _arg1;
m_pairCount = 0;
for each (queryProxy in m_moveBuffer) {
var QueryCallback:Function = function (_arg1:b2DynamicTreeNode):Boolean{
if (_arg1 == queryProxy){
return (true);
};
if (m_pairCount == m_pairBuffer.length){
m_pairBuffer[m_pairCount] = new b2DynamicTreePair();
};
var _local2:b2DynamicTreePair = m_pairBuffer[m_pairCount];
_local2.proxyA = ((_arg1 < queryProxy)) ? _arg1 : queryProxy;
_local2.proxyB = ((_arg1 >= queryProxy)) ? _arg1 : queryProxy;
m_pairCount++;
return (true);
};
fatAABB = m_tree.GetFatAABB(queryProxy);
m_tree.Query(QueryCallback, fatAABB);
};
m_moveBuffer.length = 0;
i = 0;
while (i < m_pairCount) {
primaryPair = m_pairBuffer[i];
userDataA = m_tree.GetUserData(primaryPair.proxyA);
userDataB = m_tree.GetUserData(primaryPair.proxyB);
callback(userDataA, userDataB);
i = (i + 1);
while (i < m_pairCount) {
pair = m_pairBuffer[i];
if (((!((pair.proxyA == primaryPair.proxyA))) || (!((pair.proxyB == primaryPair.proxyB))))){
break;
};
i = (i + 1);
};
};
}
public function RayCast(_arg1:Function, _arg2:b2RayCastInput):void{
m_tree.RayCast(_arg1, _arg2);
}
public function CreateProxy(_arg1:b2AABB, _arg2){
var _local3:b2DynamicTreeNode = m_tree.CreateProxy(_arg1, _arg2);
m_proxyCount++;
BufferMove(_local3);
return (_local3);
}
public function GetUserData(_arg1){
return (m_tree.GetUserData(_arg1));
}
public function DestroyProxy(_arg1):void{
UnBufferMove(_arg1);
m_proxyCount--;
m_tree.DestroyProxy(_arg1);
}
public function MoveProxy(_arg1, _arg2:b2AABB, _arg3:b2Vec2):void{
var _local4:Boolean = m_tree.MoveProxy(_arg1, _arg2, _arg3);
if (_local4){
BufferMove(_arg1);
};
}
}
}//package Box2D.Collision
Section 33
//b2DynamicTreeNode (Box2D.Collision.b2DynamicTreeNode)
package Box2D.Collision {
public class b2DynamicTreeNode {
public var aabb:b2AABB;
public var parent:b2DynamicTreeNode;
public var userData;
public var child2:b2DynamicTreeNode;
public var child1:b2DynamicTreeNode;
public function b2DynamicTreeNode(){
aabb = new b2AABB();
super();
}
public function IsLeaf():Boolean{
return ((child1 == null));
}
}
}//package Box2D.Collision
Section 34
//b2DynamicTreePair (Box2D.Collision.b2DynamicTreePair)
package Box2D.Collision {
public class b2DynamicTreePair {
public var proxyA:b2DynamicTreeNode;
public var proxyB:b2DynamicTreeNode;
}
}//package Box2D.Collision
Section 35
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var m_pointCount:int;// = 0
public var m_localPlaneNormal:b2Vec2;
public var m_type:int;
public var m_points:Array;
public var m_localPoint:b2Vec2;
public static const e_circles:int = 1;
public static const e_faceA:int = 2;
public static const e_faceB:int = 4;
public function b2Manifold(){
m_points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
m_points[_local1] = new b2ManifoldPoint();
_local1++;
};
m_localPlaneNormal = new b2Vec2();
m_localPoint = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
m_pointCount = _arg1.m_pointCount;
var _local2:int;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(m_points[_local2] as b2ManifoldPoint).Set(_arg1.m_points[_local2]);
_local2++;
};
m_localPlaneNormal.SetV(_arg1.m_localPlaneNormal);
m_localPoint.SetV(_arg1.m_localPoint);
m_type = _arg1.m_type;
}
public function Reset():void{
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(m_points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
m_localPlaneNormal.SetZero();
m_localPoint.SetZero();
m_type = 0;
m_pointCount = 0;
}
public function Copy():b2Manifold{
var _local1:b2Manifold = new b2Manifold();
_local1.Set(this);
return (_local1);
}
}
}//package Box2D.Collision
Section 36
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var m_localPoint:b2Vec2;
public var m_tangentImpulse:Number;
public var m_normalImpulse:Number;
public var m_id:b2ContactID;
public function b2ManifoldPoint(){
m_localPoint = new b2Vec2();
m_id = new b2ContactID();
super();
Reset();
}
public function Set(_arg1:b2ManifoldPoint):void{
m_localPoint.SetV(_arg1.m_localPoint);
m_normalImpulse = _arg1.m_normalImpulse;
m_tangentImpulse = _arg1.m_tangentImpulse;
m_id.Set(_arg1.m_id);
}
public function Reset():void{
m_localPoint.SetZero();
m_normalImpulse = 0;
m_tangentImpulse = 0;
m_id.key = 0;
}
}
}//package Box2D.Collision
Section 37
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 38
//b2RayCastInput (Box2D.Collision.b2RayCastInput)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2RayCastInput {
public var p1:b2Vec2;
public var maxFraction:Number;
public var p2:b2Vec2;
public function b2RayCastInput(_arg1:b2Vec2=null, _arg2:b2Vec2=null, _arg3:Number=1){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
if (_arg1){
this.p1.SetV(_arg1);
};
if (_arg2){
this.p2.SetV(_arg2);
};
this.maxFraction = _arg3;
}
}
}//package Box2D.Collision
Section 39
//b2RayCastOutput (Box2D.Collision.b2RayCastOutput)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2RayCastOutput {
public var fraction:Number;
public var normal:b2Vec2;
public function b2RayCastOutput(){
normal = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 40
//b2SeparationFunction (Box2D.Collision.b2SeparationFunction)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
class b2SeparationFunction {
public var m_proxyA:b2DistanceProxy;
public var m_proxyB:b2DistanceProxy;
public var m_type:int;
public var m_axis:b2Vec2;
public var m_localPoint:b2Vec2;
public static const e_faceA:int = 2;
public static const e_faceB:int = 4;
public static const e_points:int = 1;
function b2SeparationFunction(){
m_localPoint = new b2Vec2();
m_axis = new b2Vec2();
super();
}
public function Initialize(_arg1:b2SimplexCache, _arg2:b2DistanceProxy, _arg3:b2Transform, _arg4:b2DistanceProxy, _arg5:b2Transform):void{
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2Mat22;
var _local20:b2Vec2;
var _local21:Number;
var _local22:Number;
var _local23:b2Vec2;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:b2Vec2;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
m_proxyA = _arg2;
m_proxyB = _arg4;
var _local6:int = _arg1.count;
b2Settings.b2Assert((((0 < _local6)) && ((_local6 < 3))));
if (_local6 == 1){
m_type = e_points;
_local7 = m_proxyA.GetVertex(_arg1.indexA[0]);
_local10 = m_proxyB.GetVertex(_arg1.indexB[0]);
_local20 = _local7;
_local19 = _arg3.R;
_local13 = (_arg3.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local14 = (_arg3.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local20 = _local10;
_local19 = _arg5.R;
_local15 = (_arg5.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local16 = (_arg5.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
m_axis.x = (_local15 - _local13);
m_axis.y = (_local16 - _local14);
m_axis.Normalize();
} else {
if (_arg1.indexB[0] == _arg1.indexB[1]){
m_type = e_faceA;
_local8 = m_proxyA.GetVertex(_arg1.indexA[0]);
_local9 = m_proxyA.GetVertex(_arg1.indexA[1]);
_local10 = m_proxyB.GetVertex(_arg1.indexB[0]);
m_localPoint.x = (0.5 * (_local8.x + _local9.x));
m_localPoint.y = (0.5 * (_local8.y + _local9.y));
m_axis = b2Math.CrossVF(b2Math.SubtractVV(_local9, _local8), 1);
m_axis.Normalize();
_local20 = m_axis;
_local19 = _arg3.R;
_local17 = ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y));
_local18 = ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y));
_local20 = m_localPoint;
_local19 = _arg3.R;
_local13 = (_arg3.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local14 = (_arg3.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local20 = _local10;
_local19 = _arg5.R;
_local15 = (_arg5.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local16 = (_arg5.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local21 = (((_local15 - _local13) * _local17) + ((_local16 - _local14) * _local18));
if (_local21 < 0){
m_axis.NegativeSelf();
};
} else {
if (_arg1.indexA[0] == _arg1.indexA[0]){
m_type = e_faceB;
_local11 = m_proxyB.GetVertex(_arg1.indexB[0]);
_local12 = m_proxyB.GetVertex(_arg1.indexB[1]);
_local7 = m_proxyA.GetVertex(_arg1.indexA[0]);
m_localPoint.x = (0.5 * (_local11.x + _local12.x));
m_localPoint.y = (0.5 * (_local11.y + _local12.y));
m_axis = b2Math.CrossVF(b2Math.SubtractVV(_local12, _local11), 1);
m_axis.Normalize();
_local20 = m_axis;
_local19 = _arg5.R;
_local17 = ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y));
_local18 = ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y));
_local20 = m_localPoint;
_local19 = _arg5.R;
_local15 = (_arg5.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local16 = (_arg5.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local20 = _local7;
_local19 = _arg3.R;
_local13 = (_arg3.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local14 = (_arg3.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local21 = (((_local13 - _local15) * _local17) + ((_local14 - _local16) * _local18));
if (_local21 < 0){
m_axis.NegativeSelf();
};
} else {
_local8 = m_proxyA.GetVertex(_arg1.indexA[0]);
_local9 = m_proxyA.GetVertex(_arg1.indexA[1]);
_local11 = m_proxyB.GetVertex(_arg1.indexB[0]);
_local12 = m_proxyB.GetVertex(_arg1.indexB[1]);
_local23 = b2Math.MulX(_arg3, _local7);
_local24 = b2Math.MulMV(_arg3.R, b2Math.SubtractVV(_local9, _local8));
_local25 = b2Math.MulX(_arg5, _local10);
_local26 = b2Math.MulMV(_arg5.R, b2Math.SubtractVV(_local12, _local11));
_local27 = ((_local24.x * _local24.x) + (_local24.y * _local24.y));
_local28 = ((_local26.x * _local26.x) + (_local26.y * _local26.y));
_local29 = b2Math.SubtractVV(_local26, _local24);
_local30 = ((_local24.x * _local29.x) + (_local24.y * _local29.y));
_local31 = ((_local26.x * _local29.x) + (_local26.y * _local29.y));
_local32 = ((_local24.x * _local26.x) + (_local24.y * _local26.y));
_local33 = ((_local27 * _local28) - (_local32 * _local32));
_local21 = 0;
if (_local33 != 0){
_local21 = b2Math.Clamp((((_local32 * _local31) - (_local30 * _local28)) / _local33), 0, 1);
};
_local34 = (((_local32 * _local21) + _local31) / _local28);
if (_local34 < 0){
_local34 = 0;
_local21 = b2Math.Clamp(((_local32 - _local30) / _local27), 0, 1);
};
_local7 = new b2Vec2();
_local7.x = (_local8.x + (_local21 * (_local9.x - _local8.x)));
_local7.y = (_local8.y + (_local21 * (_local9.y - _local8.y)));
_local10 = new b2Vec2();
_local10.x = (_local11.x + (_local21 * (_local12.x - _local11.x)));
_local10.y = (_local11.y + (_local21 * (_local12.y - _local11.y)));
if ((((_local21 == 0)) || ((_local21 == 1)))){
m_type = e_faceB;
m_axis = b2Math.CrossVF(b2Math.SubtractVV(_local12, _local11), 1);
m_axis.Normalize();
m_localPoint = _local10;
_local20 = m_axis;
_local19 = _arg5.R;
_local17 = ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y));
_local18 = ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y));
_local20 = m_localPoint;
_local19 = _arg5.R;
_local15 = (_arg5.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local16 = (_arg5.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local20 = _local7;
_local19 = _arg3.R;
_local13 = (_arg3.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local14 = (_arg3.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local22 = (((_local13 - _local15) * _local17) + ((_local14 - _local16) * _local18));
if (_local21 < 0){
m_axis.NegativeSelf();
};
} else {
m_type = e_faceA;
m_axis = b2Math.CrossVF(b2Math.SubtractVV(_local9, _local8), 1);
m_localPoint = _local7;
_local20 = m_axis;
_local19 = _arg3.R;
_local17 = ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y));
_local18 = ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y));
_local20 = m_localPoint;
_local19 = _arg3.R;
_local13 = (_arg3.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local14 = (_arg3.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local20 = _local10;
_local19 = _arg5.R;
_local15 = (_arg5.position.x + ((_local19.col1.x * _local20.x) + (_local19.col2.x * _local20.y)));
_local16 = (_arg5.position.y + ((_local19.col1.y * _local20.x) + (_local19.col2.y * _local20.y)));
_local22 = (((_local15 - _local13) * _local17) + ((_local16 - _local14) * _local18));
if (_local21 < 0){
m_axis.NegativeSelf();
};
};
};
};
};
}
public function Evaluate(_arg1:b2Transform, _arg2:b2Transform):Number{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:b2Vec2;
switch (m_type){
case e_points:
_local3 = b2Math.MulTMV(_arg1.R, m_axis);
_local4 = b2Math.MulTMV(_arg2.R, m_axis.GetNegative());
_local5 = m_proxyA.GetSupportVertex(_local3);
_local6 = m_proxyB.GetSupportVertex(_local4);
_local7 = b2Math.MulX(_arg1, _local5);
_local8 = b2Math.MulX(_arg2, _local6);
_local9 = (((_local8.x - _local7.x) * m_axis.x) + ((_local8.y - _local7.y) * m_axis.y));
return (_local9);
case e_faceA:
_local10 = b2Math.MulMV(_arg1.R, m_axis);
_local7 = b2Math.MulX(_arg1, m_localPoint);
_local4 = b2Math.MulTMV(_arg2.R, _local10.GetNegative());
_local6 = m_proxyB.GetSupportVertex(_local4);
_local8 = b2Math.MulX(_arg2, _local6);
_local9 = (((_local8.x - _local7.x) * _local10.x) + ((_local8.y - _local7.y) * _local10.y));
return (_local9);
case e_faceB:
_local10 = b2Math.MulMV(_arg2.R, m_axis);
_local8 = b2Math.MulX(_arg2, m_localPoint);
_local3 = b2Math.MulTMV(_arg1.R, _local10.GetNegative());
_local5 = m_proxyA.GetSupportVertex(_local3);
_local7 = b2Math.MulX(_arg1, _local5);
_local9 = (((_local7.x - _local8.x) * _local10.x) + ((_local7.y - _local8.y) * _local10.y));
return (_local9);
default:
b2Settings.b2Assert(false);
return (0);
};
}
}
}//package Box2D.Collision
Section 41
//b2Simplex (Box2D.Collision.b2Simplex)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
class b2Simplex {
public var m_v1:b2SimplexVertex;
public var m_v2:b2SimplexVertex;
public var m_v3:b2SimplexVertex;
public var m_vertices:Array;
public var m_count:int;
function b2Simplex(){
m_v1 = new b2SimplexVertex();
m_v2 = new b2SimplexVertex();
m_v3 = new b2SimplexVertex();
m_vertices = new Array(3);
super();
m_vertices[0] = m_v1;
m_vertices[1] = m_v2;
m_vertices[2] = m_v3;
}
public function GetSearchDirection():b2Vec2{
var _local1:b2Vec2;
var _local2:Number;
switch (m_count){
case 1:
return (m_v1.w.GetNegative());
case 2:
_local1 = b2Math.SubtractVV(m_v2.w, m_v1.w);
_local2 = b2Math.CrossVV(_local1, m_v1.w.GetNegative());
if (_local2 > 0){
return (b2Math.CrossFV(1, _local1));
};
return (b2Math.CrossVF(_local1, 1));
default:
b2Settings.b2Assert(false);
return (new b2Vec2());
};
}
public function WriteCache(_arg1:b2SimplexCache):void{
_arg1.metric = GetMetric();
_arg1.count = uint(m_count);
var _local2:Array = m_vertices;
var _local3:int;
while (_local3 < m_count) {
_arg1.indexA[_local3] = uint(_local2[_local3].indexA);
_arg1.indexB[_local3] = uint(_local2[_local3].indexB);
_local3++;
};
}
public function GetMetric():Number{
switch (m_count){
case 0:
b2Settings.b2Assert(false);
return (0);
case 1:
return (0);
case 2:
return (b2Math.SubtractVV(m_v1.w, m_v2.w).Length());
case 3:
return (b2Math.CrossVV(b2Math.SubtractVV(m_v2.w, m_v1.w), b2Math.SubtractVV(m_v3.w, m_v1.w)));
default:
b2Settings.b2Assert(false);
return (0);
};
}
public function ReadCache(_arg1:b2SimplexCache, _arg2:b2DistanceProxy, _arg3:b2Transform, _arg4:b2DistanceProxy, _arg5:b2Transform):void{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local10:b2SimplexVertex;
var _local11:Number;
var _local12:Number;
b2Settings.b2Assert((((0 <= _arg1.count)) && ((_arg1.count <= 3))));
m_count = _arg1.count;
var _local8:Array = m_vertices;
var _local9:int;
while (_local9 < m_count) {
_local10 = _local8[_local9];
_local10.indexA = _arg1.indexA[_local9];
_local10.indexB = _arg1.indexB[_local9];
_local6 = _arg2.GetVertex(_local10.indexA);
_local7 = _arg4.GetVertex(_local10.indexB);
_local10.wA = b2Math.MulX(_arg3, _local6);
_local10.wB = b2Math.MulX(_arg5, _local7);
_local10.w = b2Math.SubtractVV(_local10.wB, _local10.wA);
_local10.a = 0;
_local9++;
};
if (m_count > 1){
_local11 = _arg1.metric;
_local12 = GetMetric();
if ((((((_local12 < (0.5 * _local11))) || (((2 * _local11) < _local12)))) || ((_local12 < Number.MIN_VALUE)))){
m_count = 0;
};
};
if (m_count == 0){
_local10 = _local8[0];
_local10.indexA = 0;
_local10.indexB = 0;
_local6 = _arg2.GetVertex(0);
_local7 = _arg4.GetVertex(0);
_local10.wA = b2Math.MulX(_arg3, _local6);
_local10.wB = b2Math.MulX(_arg5, _local7);
_local10.w = b2Math.SubtractVV(_local10.wB, _local10.wA);
m_count = 1;
};
}
public function GetWitnessPoints(_arg1:b2Vec2, _arg2:b2Vec2):void{
switch (m_count){
case 0:
b2Settings.b2Assert(false);
break;
case 1:
_arg1.SetV(m_v1.wA);
_arg2.SetV(m_v1.wB);
break;
case 2:
_arg1.x = ((m_v1.a * m_v1.wA.x) + (m_v2.a * m_v2.wA.x));
_arg1.y = ((m_v1.a * m_v1.wA.y) + (m_v2.a * m_v2.wA.y));
_arg2.x = ((m_v1.a * m_v1.wB.x) + (m_v2.a * m_v2.wB.x));
_arg2.y = ((m_v1.a * m_v1.wB.y) + (m_v2.a * m_v2.wB.y));
break;
case 3:
_arg2.x = (_arg1.x = (((m_v1.a * m_v1.wA.x) + (m_v2.a * m_v2.wA.x)) + (m_v3.a * m_v3.wA.x)));
_arg2.y = (_arg1.y = (((m_v1.a * m_v1.wA.y) + (m_v2.a * m_v2.wA.y)) + (m_v3.a * m_v3.wA.y)));
break;
default:
b2Settings.b2Assert(false);
break;
};
}
public function Solve2():void{
var _local1:b2Vec2 = m_v1.w;
var _local2:b2Vec2 = m_v2.w;
var _local3:b2Vec2 = b2Math.SubtractVV(_local2, _local1);
var _local4:Number = -(((_local1.x * _local3.x) + (_local1.y * _local3.y)));
if (_local4 <= 0){
m_v1.a = 1;
m_count = 1;
return;
};
var _local5:Number = ((_local2.x * _local3.x) + (_local2.y * _local3.y));
if (_local5 <= 0){
m_v2.a = 1;
m_count = 1;
m_v1.Set(m_v2);
return;
};
var _local6:Number = (1 / (_local5 + _local4));
m_v1.a = (_local5 * _local6);
m_v2.a = (_local4 * _local6);
m_count = 2;
}
public function Solve3():void{
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local1:b2Vec2 = m_v1.w;
var _local2:b2Vec2 = m_v2.w;
var _local3:b2Vec2 = m_v3.w;
var _local4:b2Vec2 = b2Math.SubtractVV(_local2, _local1);
var _local5:Number = b2Math.Dot(_local1, _local4);
var _local6:Number = b2Math.Dot(_local2, _local4);
var _local7:Number = _local6;
var _local8:Number = -(_local5);
var _local9:b2Vec2 = b2Math.SubtractVV(_local3, _local1);
var _local10:Number = b2Math.Dot(_local1, _local9);
var _local11:Number = b2Math.Dot(_local3, _local9);
var _local12:Number = _local11;
var _local13:Number = -(_local10);
var _local14:b2Vec2 = b2Math.SubtractVV(_local3, _local2);
var _local15:Number = b2Math.Dot(_local2, _local14);
var _local16:Number = b2Math.Dot(_local3, _local14);
var _local17:Number = _local16;
var _local18:Number = -(_local15);
var _local19:Number = b2Math.CrossVV(_local4, _local9);
var _local20:Number = (_local19 * b2Math.CrossVV(_local2, _local3));
var _local21:Number = (_local19 * b2Math.CrossVV(_local3, _local1));
var _local22:Number = (_local19 * b2Math.CrossVV(_local1, _local2));
if ((((_local8 <= 0)) && ((_local13 <= 0)))){
m_v1.a = 1;
m_count = 1;
return;
};
if ((((((_local7 > 0)) && ((_local8 > 0)))) && ((_local22 <= 0)))){
_local24 = (1 / (_local7 + _local8));
m_v1.a = (_local7 * _local24);
m_v2.a = (_local8 * _local24);
m_count = 2;
return;
};
if ((((((_local12 > 0)) && ((_local13 > 0)))) && ((_local21 <= 0)))){
_local25 = (1 / (_local12 + _local13));
m_v1.a = (_local12 * _local25);
m_v3.a = (_local13 * _local25);
m_count = 2;
m_v2.Set(m_v3);
return;
};
if ((((_local7 <= 0)) && ((_local18 <= 0)))){
m_v2.a = 1;
m_count = 1;
m_v1.Set(m_v2);
return;
};
if ((((_local12 <= 0)) && ((_local17 <= 0)))){
m_v3.a = 1;
m_count = 1;
m_v1.Set(m_v3);
return;
};
if ((((((_local17 > 0)) && ((_local18 > 0)))) && ((_local20 <= 0)))){
_local26 = (1 / (_local17 + _local18));
m_v2.a = (_local17 * _local26);
m_v3.a = (_local18 * _local26);
m_count = 2;
m_v1.Set(m_v3);
return;
};
var _local23:Number = (1 / ((_local20 + _local21) + _local22));
m_v1.a = (_local20 * _local23);
m_v2.a = (_local21 * _local23);
m_v3.a = (_local22 * _local23);
m_count = 3;
}
public function GetClosestPoint():b2Vec2{
switch (m_count){
case 0:
b2Settings.b2Assert(false);
return (new b2Vec2());
case 1:
return (m_v1.w);
case 2:
return (new b2Vec2(((m_v1.a * m_v1.w.x) + (m_v2.a * m_v2.w.x)), ((m_v1.a * m_v1.w.y) + (m_v2.a * m_v2.w.y))));
default:
b2Settings.b2Assert(false);
return (new b2Vec2());
};
}
}
}//package Box2D.Collision
Section 42
//b2SimplexCache (Box2D.Collision.b2SimplexCache)
package Box2D.Collision {
public class b2SimplexCache {
public var metric:Number;
public var count:uint;
public var indexB:Array;
public var indexA:Array;
public function b2SimplexCache(){
indexA = new Array(3);
indexB = new Array(3);
super();
}
}
}//package Box2D.Collision
Section 43
//b2SimplexVertex (Box2D.Collision.b2SimplexVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
class b2SimplexVertex {
public var a:Number;
public var wA:b2Vec2;
public var wB:b2Vec2;
public var indexA:int;
public var indexB:int;
public var w:b2Vec2;
public function Set(_arg1:b2SimplexVertex):void{
wA.SetV(_arg1.wA);
wB.SetV(_arg1.wB);
w.SetV(_arg1.w);
a = _arg1.a;
indexA = _arg1.indexA;
indexB = _arg1.indexB;
}
}
}//package Box2D.Collision
Section 44
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
private static var b2_toiCalls:int = 0;
private static var s_xfA:b2Transform = new b2Transform();
private static var s_distanceInput:b2DistanceInput = new b2DistanceInput();
private static var s_xfB:b2Transform = new b2Transform();
private static var s_distanceOutput:b2DistanceOutput = new b2DistanceOutput();
private static var b2_toiMaxRootIters:int = 0;
private static var s_cache:b2SimplexCache = new b2SimplexCache();
private static var b2_toiRootIters:int = 0;
private static var b2_toiIters:int = 0;
private static var b2_toiMaxIters:int = 0;
private static var s_fcn:b2SeparationFunction = new b2SeparationFunction();
public static function TimeOfImpact(_arg1:b2TOIInput):Number{
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
b2_toiCalls++;
var _local2:b2DistanceProxy = _arg1.proxyA;
var _local3:b2DistanceProxy = _arg1.proxyB;
var _local4:b2Sweep = _arg1.sweepA;
var _local5:b2Sweep = _arg1.sweepB;
b2Settings.b2Assert((_local4.t0 == _local5.t0));
b2Settings.b2Assert(((1 - _local4.t0) > Number.MIN_VALUE));
var _local6:Number = (_local2.m_radius + _local3.m_radius);
var _local7:Number = _arg1.tolerance;
var _local8:Number = 0;
var _local9 = 1000;
var _local10:int;
var _local11:Number = 0;
s_cache.count = 0;
s_distanceInput.useRadii = false;
while (true) {
_local4.GetTransform(s_xfA, _local8);
_local5.GetTransform(s_xfB, _local8);
s_distanceInput.proxyA = _local2;
s_distanceInput.proxyB = _local3;
s_distanceInput.transformA = s_xfA;
s_distanceInput.transformB = s_xfB;
b2Distance.Distance(s_distanceOutput, s_cache, s_distanceInput);
if (s_distanceOutput.distance <= 0){
_local8 = 1;
break;
};
s_fcn.Initialize(s_cache, _local2, s_xfA, _local3, s_xfB);
_local12 = s_fcn.Evaluate(s_xfA, s_xfB);
if (_local12 <= 0){
_local8 = 1;
break;
};
if (_local10 == 0){
if (_local12 > _local6){
_local11 = b2Math.Max((_local6 - _local7), (0.75 * _local6));
} else {
_local11 = b2Math.Max((_local12 - _local7), (0.02 * _local6));
};
};
if ((_local12 - _local11) < (0.5 * _local7)){
if (_local10 == 0){
_local8 = 1;
break;
};
break;
};
_local13 = _local8;
_local14 = _local8;
_local15 = 1;
_local16 = _local12;
_local4.GetTransform(s_xfA, _local15);
_local5.GetTransform(s_xfB, _local15);
_local17 = s_fcn.Evaluate(s_xfA, s_xfB);
if (_local17 >= _local11){
_local8 = 1;
break;
};
_local18 = 0;
while (true) {
if ((_local18 & 1)){
_local19 = (_local14 + (((_local11 - _local16) * (_local15 - _local14)) / (_local17 - _local16)));
} else {
_local19 = (0.5 * (_local14 + _local15));
};
_local4.GetTransform(s_xfA, _local19);
_local5.GetTransform(s_xfB, _local19);
_local20 = s_fcn.Evaluate(s_xfA, s_xfB);
if (b2Math.Abs((_local20 - _local11)) < (0.025 * _local7)){
_local13 = _local19;
break;
};
if (_local20 > _local11){
_local14 = _local19;
_local16 = _local20;
} else {
_local15 = _local19;
_local17 = _local20;
};
_local18++;
b2_toiRootIters++;
if (_local18 == 50){
break;
};
};
b2_toiMaxRootIters = b2Math.Max(b2_toiMaxRootIters, _local18);
if (_local13 < ((1 + (100 * Number.MIN_VALUE)) * _local8)){
break;
};
_local8 = _local13;
_local10++;
b2_toiIters++;
if (_local10 == _local9){
break;
};
};
b2_toiMaxIters = b2Math.Max(b2_toiMaxIters, _local10);
return (_local8);
}
}
}//package Box2D.Collision
Section 45
//b2TOIInput (Box2D.Collision.b2TOIInput)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2TOIInput {
public var proxyA:b2DistanceProxy;
public var proxyB:b2DistanceProxy;
public var sweepA:b2Sweep;
public var sweepB:b2Sweep;
public var tolerance:Number;
public function b2TOIInput(){
proxyA = new b2DistanceProxy();
proxyB = new b2DistanceProxy();
sweepA = new b2Sweep();
sweepB = new b2Sweep();
super();
}
}
}//package Box2D.Collision
Section 46
//b2WorldManifold (Box2D.Collision.b2WorldManifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2WorldManifold {
public var m_normal:b2Vec2;
public var m_points:Array;
public function b2WorldManifold(){
m_normal = new b2Vec2();
super();
m_points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
m_points[_local1] = new b2Vec2();
_local1++;
};
}
public function Initialize(_arg1:b2Manifold, _arg2:b2Transform, _arg3:Number, _arg4:b2Transform, _arg5:Number):void{
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
if (_arg1.m_pointCount == 0){
return;
};
switch (_arg1.m_type){
case b2Manifold.e_circles:
_local8 = _arg2.R;
_local7 = _arg1.m_localPoint;
_local15 = ((_arg2.position.x + (_local8.col1.x * _local7.x)) + (_local8.col2.x * _local7.y));
_local16 = ((_arg2.position.y + (_local8.col1.y * _local7.x)) + (_local8.col2.y * _local7.y));
_local8 = _arg4.R;
_local7 = _arg1.m_points[0].m_localPoint;
_local17 = ((_arg4.position.x + (_local8.col1.x * _local7.x)) + (_local8.col2.x * _local7.y));
_local18 = ((_arg4.position.y + (_local8.col1.y * _local7.x)) + (_local8.col2.y * _local7.y));
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local21 = ((_local19 * _local19) + (_local20 * _local20));
if (_local21 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local26 = Math.sqrt(_local21);
m_normal.x = (_local19 / _local26);
m_normal.y = (_local20 / _local26);
} else {
m_normal.x = 1;
m_normal.y = 0;
};
_local22 = (_local15 + (_arg3 * m_normal.x));
_local23 = (_local16 + (_arg3 * m_normal.y));
_local24 = (_local17 - (_arg5 * m_normal.x));
_local25 = (_local18 - (_arg5 * m_normal.y));
m_points[0].x = (0.5 * (_local22 + _local24));
m_points[0].y = (0.5 * (_local23 + _local25));
break;
case b2Manifold.e_faceA:
_local8 = _arg2.R;
_local7 = _arg1.m_localPlaneNormal;
_local9 = ((_local8.col1.x * _local7.x) + (_local8.col2.x * _local7.y));
_local10 = ((_local8.col1.y * _local7.x) + (_local8.col2.y * _local7.y));
_local8 = _arg2.R;
_local7 = _arg1.m_localPoint;
_local11 = ((_arg2.position.x + (_local8.col1.x * _local7.x)) + (_local8.col2.x * _local7.y));
_local12 = ((_arg2.position.y + (_local8.col1.y * _local7.x)) + (_local8.col2.y * _local7.y));
m_normal.x = _local9;
m_normal.y = _local10;
_local6 = 0;
while (_local6 < _arg1.m_pointCount) {
_local8 = _arg4.R;
_local7 = _arg1.m_points[_local6].m_localPoint;
_local13 = ((_arg4.position.x + (_local8.col1.x * _local7.x)) + (_local8.col2.x * _local7.y));
_local14 = ((_arg4.position.y + (_local8.col1.y * _local7.x)) + (_local8.col2.y * _local7.y));
m_points[_local6].x = (_local13 + ((0.5 * (((_arg3 - ((_local13 - _local11) * _local9)) - ((_local14 - _local12) * _local10)) - _arg5)) * _local9));
m_points[_local6].y = (_local14 + ((0.5 * (((_arg3 - ((_local13 - _local11) * _local9)) - ((_local14 - _local12) * _local10)) - _arg5)) * _local10));
_local6++;
};
break;
case b2Manifold.e_faceB:
_local8 = _arg4.R;
_local7 = _arg1.m_localPlaneNormal;
_local9 = ((_local8.col1.x * _local7.x) + (_local8.col2.x * _local7.y));
_local10 = ((_local8.col1.y * _local7.x) + (_local8.col2.y * _local7.y));
_local8 = _arg4.R;
_local7 = _arg1.m_localPoint;
_local11 = ((_arg4.position.x + (_local8.col1.x * _local7.x)) + (_local8.col2.x * _local7.y));
_local12 = ((_arg4.position.y + (_local8.col1.y * _local7.x)) + (_local8.col2.y * _local7.y));
m_normal.x = -(_local9);
m_normal.y = -(_local10);
_local6 = 0;
while (_local6 < _arg1.m_pointCount) {
_local8 = _arg2.R;
_local7 = _arg1.m_points[_local6].m_localPoint;
_local13 = ((_arg2.position.x + (_local8.col1.x * _local7.x)) + (_local8.col2.x * _local7.y));
_local14 = ((_arg2.position.y + (_local8.col1.y * _local7.x)) + (_local8.col2.y * _local7.y));
m_points[_local6].x = (_local13 + ((0.5 * (((_arg5 - ((_local13 - _local11) * _local9)) - ((_local14 - _local12) * _local10)) - _arg3)) * _local9));
m_points[_local6].y = (_local14 + ((0.5 * (((_arg5 - ((_local13 - _local11) * _local9)) - ((_local14 - _local12) * _local10)) - _arg3)) * _local10));
_local6++;
};
break;
};
}
}
}//package Box2D.Collision
Section 47
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var id:b2ContactID;
public var v:b2Vec2;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:ClipVertex):void{
v.SetV(_arg1.v);
id.Set(_arg1.id);
}
}
}//package Box2D.Collision
Section 48
//Features (Box2D.Collision.Features)
package Box2D.Collision {
import Box2D.Common.*;
public class Features {
b2internal var _referenceEdge:int;
b2internal var _incidentEdge:int;
b2internal var _flip:int;
b2internal var _incidentVertex:int;
b2internal var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 49
//IBroadPhase (Box2D.Collision.IBroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
public interface IBroadPhase {
function GetFatAABB(_arg1):b2AABB;
function Query(_arg1:Function, _arg2:b2AABB):void;
function Rebalance(_arg1:int):void;
function GetUserData(_arg1);
function UpdatePairs(_arg1:Function):void;
function CreateProxy(_arg1:b2AABB, _arg2);
function DestroyProxy(_arg1):void;
function TestOverlap(_arg1, _arg2):Boolean;
function Validate():void;
function GetProxyCount():int;
function RayCast(_arg1:Function, _arg2:b2RayCastInput):void;
function MoveProxy(_arg1, _arg2:b2AABB, _arg3:b2Vec2):void;
}
}//package Box2D.Collision
Section 50
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(){
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
col1.x = (col2.y = 1);
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function Set(_arg1:Number):void{
var _local2:Number;
_local2 = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
var _local1:b2Mat22 = new b2Mat22();
_local1.SetM(this);
return (_local1);
}
public function GetInverse(_arg1:b2Mat22):b2Mat22{
var _local3:Number;
var _local6:Number;
var _local2:Number = col1.x;
_local3 = col2.x;
var _local4:Number = col1.y;
var _local5:Number = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
if (_local6 != 0){
_local6 = (1 / _local6);
};
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number = col1.x;
var _local5:Number = col2.x;
var _local6:Number = col1.y;
var _local7:Number = col2.y;
var _local8:Number = ((_local4 * _local7) - (_local5 * _local6));
if (_local8 != 0){
_local8 = (1 / _local8);
};
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
public static function FromAngle(_arg1:Number):b2Mat22{
var _local2:b2Mat22 = new (b2Mat22);
_local2.Set(_arg1);
return (_local2);
}
public static function FromVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Mat22{
var _local3:b2Mat22 = new (b2Mat22);
_local3.SetVV(_arg1, _arg2);
return (_local3);
}
}
}//package Box2D.Common.Math
Section 51
//b2Mat33 (Box2D.Common.Math.b2Mat33)
package Box2D.Common.Math {
public class b2Mat33 {
public var col1:b2Vec3;
public var col2:b2Vec3;
public var col3:b2Vec3;
public function b2Mat33(_arg1:b2Vec3=null, _arg2:b2Vec3=null, _arg3:b2Vec3=null){
col1 = new b2Vec3();
col2 = new b2Vec3();
col3 = new b2Vec3();
super();
if (((((!(_arg1)) && (!(_arg2)))) && (!(_arg3)))){
col1.SetZero();
col2.SetZero();
col3.SetZero();
} else {
col1.SetV(_arg1);
col2.SetV(_arg2);
col3.SetV(_arg3);
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col3.x = 0;
col1.y = 0;
col2.y = 1;
col3.y = 0;
col1.z = 0;
col2.z = 0;
col3.z = 1;
}
public function Solve22(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local6:Number;
_local4 = col1.x;
var _local5:Number = col2.x;
_local6 = col1.y;
var _local7:Number = col2.y;
var _local8:Number = ((_local4 * _local7) - (_local5 * _local6));
if (_local8 != 0){
_local8 = (1 / _local8);
};
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col3.x = 0;
col1.y = 0;
col2.y = 0;
col3.y = 0;
col1.z = 0;
col2.z = 0;
col3.z = 0;
}
public function SetM(_arg1:b2Mat33):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
col3.SetV(_arg1.col3);
}
public function AddM(_arg1:b2Mat33):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col1.z = (col1.z + _arg1.col1.z);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
col2.z = (col2.z + _arg1.col2.z);
col3.x = (col3.x + _arg1.col3.x);
col3.y = (col3.y + _arg1.col3.y);
col3.z = (col3.z + _arg1.col3.z);
}
public function SetVVV(_arg1:b2Vec3, _arg2:b2Vec3, _arg3:b2Vec3):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
col3.SetV(_arg3);
}
public function Copy():b2Mat33{
return (new b2Mat33(col1, col2, col3));
}
public function Solve33(_arg1:b2Vec3, _arg2:Number, _arg3:Number, _arg4:Number):b2Vec3{
var _local5:Number = col1.x;
var _local6:Number = col1.y;
var _local7:Number = col1.z;
var _local8:Number = col2.x;
var _local9:Number = col2.y;
var _local10:Number = col2.z;
var _local11:Number = col3.x;
var _local12:Number = col3.y;
var _local13:Number = col3.z;
var _local14:Number = (((_local5 * ((_local9 * _local13) - (_local10 * _local12))) + (_local6 * ((_local10 * _local11) - (_local8 * _local13)))) + (_local7 * ((_local8 * _local12) - (_local9 * _local11))));
if (_local14 != 0){
_local14 = (1 / _local14);
};
_arg1.x = (_local14 * (((_arg2 * ((_local9 * _local13) - (_local10 * _local12))) + (_arg3 * ((_local10 * _local11) - (_local8 * _local13)))) + (_arg4 * ((_local8 * _local12) - (_local9 * _local11)))));
_arg1.y = (_local14 * (((_local5 * ((_arg3 * _local13) - (_arg4 * _local12))) + (_local6 * ((_arg4 * _local11) - (_arg2 * _local13)))) + (_local7 * ((_arg2 * _local12) - (_arg3 * _local11)))));
_arg1.z = (_local14 * (((_local5 * ((_local9 * _arg4) - (_local10 * _arg3))) + (_local6 * ((_local10 * _arg2) - (_local8 * _arg4)))) + (_local7 * ((_local8 * _arg3) - (_local9 * _arg2)))));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 52
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Transform_identity:b2Transform = new b2Transform(b2Vec2_zero, b2Mat22_identity);
public static const b2Mat22_identity:b2Mat22 = b2Mat22.FromVV(new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22 = b2Mat22.FromVV(AbsV(_arg1.col1), AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = b2Mat22.FromVV(MulMV(_arg1, _arg2.col1), MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
public static function CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(Max(_arg1.x, _arg2.x), Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2 = new b2Vec2(Abs(_arg1.x), Abs(_arg1.y));
return (_local2);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2 = new b2Vec2(Dot(_arg1.col1, _arg2.col1), Dot(_arg1.col2, _arg2.col1));
var _local4:b2Vec2 = new b2Vec2(Dot(_arg1.col1, _arg2.col2), Dot(_arg1.col2, _arg2.col2));
var _local5:b2Mat22 = b2Mat22.FromVV(_local3, _local4);
return (_local5);
}
public static function DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (((_arg1 < _arg2)) ? _arg2 : ((_arg1 > _arg3)) ? _arg3 : _arg1);
}
public static function MulXT(_arg1:b2Transform, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = b2Mat22.FromVV(AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function Random():Number{
return (((Math.random() * 2) - 1));
}
public static function MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(Min(_arg1.x, _arg2.x), Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(Dot(_arg2, _arg1.col1), Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (MaxV(_arg2, MinV(_arg1, _arg3)));
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function Swap(_arg1:Array, _arg2:Array):void{
var _local3:* = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function MulX(_arg1:b2Transform, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
}
}//package Box2D.Common.Math
Section 53
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var a:Number;
public var c:b2Vec2;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function Set(_arg1:b2Sweep):void{
localCenter.SetV(_arg1.localCenter);
c0.SetV(_arg1.c0);
c.SetV(_arg1.c);
a0 = _arg1.a0;
a = _arg1.a;
t0 = _arg1.t0;
}
public function Copy():b2Sweep{
var _local1:b2Sweep = new b2Sweep();
_local1.localCenter.SetV(localCenter);
_local1.c0.SetV(c0);
_local1.c.SetV(c);
_local1.a0 = a0;
_local1.a = a;
_local1.t0 = t0;
return (_local1);
}
public function GetTransform(_arg1:b2Transform, _arg2:Number):void{
_arg1.position.x = (((1 - _arg2) * c0.x) + (_arg2 * c.x));
_arg1.position.y = (((1 - _arg2) * c0.y) + (_arg2 * c.y));
var _local3:Number = (((1 - _arg2) * a0) + (_arg2 * a));
_arg1.R.Set(_local3);
var _local4:b2Mat22 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local4.col1.x * localCenter.x) + (_local4.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local4.col1.y * localCenter.x) + (_local4.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 54
//b2Transform (Box2D.Common.Math.b2Transform)
package Box2D.Common.Math {
public class b2Transform {
public var position:b2Vec2;
public var R:b2Mat22;
public function b2Transform(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2Transform):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
public function GetAngle():Number{
return (Math.atan2(R.col1.y, R.col1.x));
}
}
}//package Box2D.Common.Math
Section 55
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var y:Number;
public var x:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function NegativeSelf():void{
x = -(x);
y = -(y);
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function GetNegative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function Normalize():Number{
var _local1:Number = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
var _local2:Number = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function CrossVF(_arg1:Number):void{
var _local2:Number = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function CrossFV(_arg1:Number):void{
var _local2:Number = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number = b2Math.Dot(this, _arg1.col1);
y = b2Math.Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.IsValid(x)) && (b2Math.IsValid(y))));
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 56
//b2Vec3 (Box2D.Common.Math.b2Vec3)
package Box2D.Common.Math {
public class b2Vec3 {
public var x:Number;
public var y:Number;
public var z:Number;
public function b2Vec3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function NegativeSelf():void{
x = -(x);
y = -(y);
z = -(z);
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function Add(_arg1:b2Vec3):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function SetZero():void{
x = (y = (z = 0));
}
public function GetNegative():b2Vec3{
return (new b2Vec3(-(x), -(y), -(z)));
}
public function SetV(_arg1:b2Vec3):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function Copy():b2Vec3{
return (new b2Vec3(x, y, z));
}
public function Subtract(_arg1:b2Vec3):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
}
}//package Box2D.Common.Math
Section 57
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _r:uint;// = 0
private var _g:uint;// = 0
private var _b:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = uint((0xFF * b2Math.Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.Clamp(_arg3, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.Clamp(_arg1, 0, 1)));
}
public function get color():uint{
return ((((_r << 16) | (_g << 8)) | _b));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 58
//b2internal (Box2D.Common.b2internal)
package Box2D.Common {
public namespace b2internal = "http://www.box2d.org/ns/b2internal";
}//package Box2D.Common
Section 59
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
public class b2Settings {
public static const b2_polygonRadius:Number = (2 * b2_linearSlop);
public static const b2_pi:Number = Math.PI;
public static const b2_aabbExtension:Number = 0.1;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_maxTranslationSquared:Number = 4;
public static const b2_angularSlop:Number = ((2 / 180) * b2_pi);
public static const b2_linearSlop:Number = 0.005;
public static const b2_maxRotation:Number = (0.5 * b2_pi);
public static const b2_maxRotationSquared:Number = (b2_maxRotation * b2_maxRotation);
public static const b2_angularSleepTolerance:Number = ((2 / 180) * b2Settings.b2_pi);
public static const b2_timeToSleep:Number = 0.5;
public static const b2_maxTOIJointsPerIsland:int = 32;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxTOIContactsPerIsland:int = 32;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_maxAngularCorrection:Number = ((8 / 180) * b2_pi);
public static const b2_velocityThreshold:Number = 1;
public static const USHRT_MAX:int = 0xFFFF;
public static const VERSION:String = "2.1alpha";
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxTranslation:Number = 2;
public static const b2_aabbMultiplier:Number = 2;
public static const b2_maxLinearCorrection:Number = 0.2;
public static function b2MixFriction(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt((_arg1 * _arg2)));
}
public static function b2MixRestitution(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2Assert(_arg1:Boolean):void{
if (!_arg1){
throw ("Assertion Failed");
};
}
}
}//package Box2D.Common
Section 60
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
override b2internal function Evaluate():void{
var _local1:b2Body = m_fixtureA.GetBody();
var _local2:b2Body = m_fixtureB.GetBody();
b2Collision.CollideCircles(m_manifold, (m_fixtureA.GetShape() as b2CircleShape), _local1.m_xf, (m_fixtureB.GetShape() as b2CircleShape), _local2.m_xf);
}
public function Reset(_arg1:b2Fixture, _arg2:b2Fixture):void{
super.Reset(_arg1, _arg2);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1):b2Contact{
return (new (b2CircleContact));
}
}
}//package Box2D.Dynamics.Contacts
Section 61
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
b2internal var m_prev:b2Contact;
b2internal var m_next:b2Contact;
b2internal var m_oldManifold:b2Manifold;
b2internal var m_manifold:b2Manifold;
b2internal var m_fixtureA:b2Fixture;
b2internal var m_fixtureB:b2Fixture;
b2internal var m_nodeA:b2ContactEdge;
b2internal var m_flags:uint;
b2internal var m_toi:Number;
b2internal var m_nodeB:b2ContactEdge;
b2internal static var e_sensorFlag:uint = 1;
private static var s_input:b2TOIInput = new b2TOIInput();
b2internal static var e_touchingFlag:uint = 16;
b2internal static var e_enabledFlag:uint = 32;
b2internal static var e_continuousFlag:uint = 2;
b2internal static var e_kinematicFlag:uint = 128;
b2internal static var e_toiFlag:uint = 8;
b2internal static var e_islandFlag:uint = 4;
b2internal static var e_filterFlag:uint = 64;
public function b2Contact(){
m_nodeA = new b2ContactEdge();
m_nodeB = new b2ContactEdge();
m_manifold = new b2Manifold();
m_oldManifold = new b2Manifold();
super();
}
public function IsContinuous():Boolean{
return (((m_flags & e_continuousFlag) == e_continuousFlag));
}
public function GetNext():b2Contact{
return (m_next);
}
public function FlagForFiltering():void{
m_flags = (m_flags | e_filterFlag);
}
public function IsEnabled():Boolean{
return (((m_flags & e_enabledFlag) == e_enabledFlag));
}
public function IsKinematic():Boolean{
return (((m_flags & e_kinematicFlag) == e_kinematicFlag));
}
public function SetSensor(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_sensorFlag);
} else {
m_flags = (m_flags & ~(e_sensorFlag));
};
}
public function SetEnabled(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_enabledFlag);
} else {
m_flags = (m_flags & ~(e_enabledFlag));
};
}
public function SetKinematic(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_kinematicFlag);
} else {
m_flags = (m_flags & ~(e_kinematicFlag));
};
}
public function IsSensor():Boolean{
return (((m_flags & e_sensorFlag) == e_sensorFlag));
}
public function GetManifold():b2Manifold{
return (m_manifold);
}
b2internal function Update(_arg1:b2ContactListener):void{
var _local8:b2Shape;
var _local9:b2Shape;
var _local10:b2Transform;
var _local11:b2Transform;
var _local12:int;
var _local13:b2ManifoldPoint;
var _local14:b2ContactID;
var _local15:int;
var _local16:b2ManifoldPoint;
var _local2:b2Manifold = m_oldManifold;
m_oldManifold = m_manifold;
m_manifold = _local2;
m_flags = (m_flags | e_enabledFlag);
var _local3:Boolean;
var _local4 = ((m_flags & e_touchingFlag) == e_touchingFlag);
var _local5:b2Body = m_fixtureA.m_body;
var _local6:b2Body = m_fixtureB.m_body;
var _local7:Boolean = m_fixtureA.m_aabb.TestOverlap(m_fixtureB.m_aabb);
if ((((m_flags & e_kinematicFlag)) || ((m_flags & e_sensorFlag)))){
if (_local7){
_local8 = m_fixtureA.GetShape();
_local9 = m_fixtureB.GetShape();
_local10 = _local5.GetTransform();
_local11 = _local6.GetTransform();
_local3 = b2Shape.TestOverlap(_local8, _local10, _local9, _local11);
};
m_manifold.m_pointCount = 0;
} else {
if (((((((!((_local5.GetType() == b2Body.b2_dynamicBody))) || (_local5.IsBullet()))) || (!((_local6.GetType() == b2Body.b2_dynamicBody))))) || (_local6.IsBullet()))){
m_flags = (m_flags | e_continuousFlag);
} else {
m_flags = (m_flags & ~(e_continuousFlag));
};
if (_local7){
Evaluate();
_local3 = (m_manifold.m_pointCount > 0);
_local12 = 0;
while (_local12 < m_manifold.m_pointCount) {
_local13 = m_manifold.m_points[_local12];
_local13.m_normalImpulse = 0;
_local13.m_tangentImpulse = 0;
_local14 = _local13.m_id;
_local15 = 0;
while (_local15 < m_oldManifold.m_pointCount) {
_local16 = m_oldManifold.m_points[_local15];
if (_local16.m_id.key == _local14.key){
_local13.m_normalImpulse = _local16.m_normalImpulse;
_local13.m_tangentImpulse = _local16.m_tangentImpulse;
break;
};
_local15++;
};
_local12++;
};
} else {
m_manifold.m_pointCount = 0;
};
if (_local3 != _local4){
_local5.SetAwake(true);
_local6.SetAwake(true);
};
};
if (_local3){
m_flags = (m_flags | e_touchingFlag);
} else {
m_flags = (m_flags & ~(e_touchingFlag));
};
if ((((_local4 == false)) && ((_local3 == true)))){
_arg1.BeginContact(this);
};
if ((((_local4 == true)) && ((_local3 == false)))){
_arg1.EndContact(this);
};
if (((((m_flags & e_kinematicFlag) == 0)) && (((m_flags & e_sensorFlag) == 0)))){
_arg1.PreSolve(this, m_oldManifold);
};
}
public function GetWorldManifold(_arg1:b2WorldManifold):void{
var _local2:b2Body = m_fixtureA.GetBody();
var _local3:b2Body = m_fixtureB.GetBody();
var _local4:b2Shape = m_fixtureA.GetShape();
var _local5:b2Shape = m_fixtureB.GetShape();
_arg1.Initialize(m_manifold, _local2.GetTransform(), _local4.m_radius, _local3.GetTransform(), _local5.m_radius);
}
public function IsTouching():Boolean{
return (((m_flags & e_touchingFlag) == e_touchingFlag));
}
public function GetFixtureA():b2Fixture{
return (m_fixtureA);
}
public function GetFixtureB():b2Fixture{
return (m_fixtureB);
}
b2internal function Reset(_arg1:b2Fixture=null, _arg2:b2Fixture=null):void{
m_flags = e_enabledFlag;
if (((!(_arg1)) || (!(_arg2)))){
m_fixtureA = null;
m_fixtureB = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_sensorFlag);
};
var _local3:b2Body = _arg1.GetBody();
var _local4:b2Body = _arg2.GetBody();
if (((((((!((_local3.GetType() == b2Body.b2_dynamicBody))) || (_local3.IsBullet()))) || (!((_local4.GetType() == b2Body.b2_dynamicBody))))) || (_local4.IsBullet()))){
m_flags = (m_flags | e_continuousFlag);
};
if (((!((_local3.GetType() == b2Body.b2_dynamicBody))) && (!((_local4.GetType() == b2Body.b2_dynamicBody))))){
m_flags = (m_flags | e_kinematicFlag);
};
m_fixtureA = _arg1;
m_fixtureB = _arg2;
m_manifold.m_pointCount = 0;
m_prev = null;
m_next = null;
m_nodeA.contact = null;
m_nodeA.prev = null;
m_nodeA.next = null;
m_nodeA.other = null;
m_nodeB.contact = null;
m_nodeB.prev = null;
m_nodeB.next = null;
m_nodeB.other = null;
}
b2internal function ComputeTOI(_arg1:b2Sweep, _arg2:b2Sweep):Number{
s_input.proxyA.Set(m_fixtureA.GetShape());
s_input.proxyB.Set(m_fixtureB.GetShape());
s_input.sweepA = _arg1;
s_input.sweepB = _arg2;
s_input.tolerance = b2Settings.b2_linearSlop;
return (b2TimeOfImpact.TimeOfImpact(s_input));
}
b2internal function Evaluate():void{
}
}
}//package Box2D.Dynamics.Contacts
Section 62
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var type:int;
public var normalMass:b2Mat22;
public var K:b2Mat22;
public var manifold:b2Manifold;
public var radius:Number;
public var bodyA:b2Body;
public var bodyB:b2Body;
public var points:Array;
public var localPoint:b2Vec2;
public var pointCount:int;
public var normal:b2Vec2;
public var restitution:Number;
public var localPlaneNormal:b2Vec2;
public var friction:Number;
public function b2ContactConstraint(){
localPlaneNormal = new b2Vec2();
localPoint = new b2Vec2();
normal = new b2Vec2();
normalMass = new b2Mat22();
K = new b2Mat22();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 63
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var localPoint:b2Vec2;
public var normalImpulse:Number;
public var rA:b2Vec2;
public var rB:b2Vec2;
public var tangentImpulse:Number;
public var equalizedMass:Number;
public var tangentMass:Number;
public var normalMass:Number;
public var velocityBias:Number;
public function b2ContactConstraintPoint(){
localPoint = new b2Vec2();
rA = new b2Vec2();
rB = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 64
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var other:b2Body;
public var prev:b2ContactEdge;
public var contact:b2Contact;
public var next:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 65
//b2ContactFactory (Box2D.Dynamics.Contacts.b2ContactFactory)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactFactory {
private var m_allocator;
private var m_registers:Array;
public function b2ContactFactory(_arg1){
m_allocator = _arg1;
InitializeRegisters();
}
b2internal function InitializeRegisters():void{
var _local2:int;
m_registers = new Array(b2Shape.e_shapeTypeCount);
var _local1:int;
while (_local1 < b2Shape.e_shapeTypeCount) {
m_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
m_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
AddType(b2EdgeAndCircleContact.Create, b2EdgeAndCircleContact.Destroy, b2Shape.e_edgeShape, b2Shape.e_circleShape);
AddType(b2PolyAndEdgeContact.Create, b2PolyAndEdgeContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_edgeShape);
}
public function Destroy(_arg1:b2Contact):void{
if (_arg1.m_manifold.m_pointCount > 0){
_arg1.m_fixtureA.m_body.SetAwake(true);
_arg1.m_fixtureB.m_body.SetAwake(true);
};
var _local2:int = _arg1.m_fixtureA.GetType();
var _local3:int = _arg1.m_fixtureB.GetType();
var _local4:b2ContactRegister = m_registers[_local2][_local3];
_local4.poolCount++;
_arg1.m_next = _local4.pool;
_local4.pool = _arg1;
var _local5:Function = _local4.destroyFcn;
_local5(_arg1, m_allocator);
}
b2internal function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
m_registers[_arg3][_arg4].createFcn = _arg1;
m_registers[_arg3][_arg4].destroyFcn = _arg2;
m_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
m_registers[_arg4][_arg3].createFcn = _arg1;
m_registers[_arg4][_arg3].destroyFcn = _arg2;
m_registers[_arg4][_arg3].primary = false;
};
}
public function Create(_arg1:b2Fixture, _arg2:b2Fixture):b2Contact{
var _local6:b2Contact;
var _local3:int = _arg1.GetType();
var _local4:int = _arg2.GetType();
var _local5:b2ContactRegister = m_registers[_local3][_local4];
if (_local5.pool){
_local6 = _local5.pool;
_local5.pool = _local6.m_next;
_local5.poolCount--;
_local6.Reset(_arg1, _arg2);
return (_local6);
};
var _local7:Function = _local5.createFcn;
if (_local7 != null){
if (_local5.primary){
_local6 = _local7(m_allocator);
_local6.Reset(_arg1, _arg2);
return (_local6);
};
_local6 = _local7(m_allocator);
_local6.Reset(_arg2, _arg1);
return (_local6);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 66
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var poolCount:int;
public var createFcn:Function;
public var destroyFcn:Function;
public var pool:b2Contact;
}
}//package Box2D.Dynamics.Contacts
Section 67
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
private var m_constraintCount:int;
b2internal var m_constraints:Array;
private var m_allocator;
private var m_step:b2TimeStep;
private static var s_psm:b2PositionSolverManifold = new b2PositionSolverManifold();
private static var s_worldManifold:b2WorldManifold = new b2WorldManifold();
public function b2ContactSolver(){
m_step = new b2TimeStep();
m_constraints = new Array();
super();
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.bodyA;
_local8 = _local6.bodyB;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.rA.x * _local22) - (_local20.rA.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.rB.x * _local22) - (_local20.rB.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local4:b2ContactConstraint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:int;
var _local13:b2ContactConstraintPoint;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local2:Number = 0;
var _local3:int;
while (_local3 < m_constraintCount) {
_local4 = m_constraints[_local3];
_local5 = _local4.bodyA;
_local6 = _local4.bodyB;
_local7 = (_local5.m_mass * _local5.m_invMass);
_local8 = (_local5.m_mass * _local5.m_invI);
_local9 = (_local6.m_mass * _local6.m_invMass);
_local10 = (_local6.m_mass * _local6.m_invI);
s_psm.Initialize(_local4);
_local11 = s_psm.m_normal;
_local12 = 0;
while (_local12 < _local4.pointCount) {
_local13 = _local4.points[_local12];
_local14 = s_psm.m_points[_local12];
_local15 = s_psm.m_separations[_local12];
_local16 = (_local14.x - _local5.m_sweep.c.x);
_local17 = (_local14.y - _local5.m_sweep.c.y);
_local18 = (_local14.x - _local6.m_sweep.c.x);
_local19 = (_local14.y - _local6.m_sweep.c.y);
_local2 = ((_local2 < _local15)) ? _local2 : _local15;
_local20 = b2Math.Clamp((_arg1 * (_local15 + b2Settings.b2_linearSlop)), -(b2Settings.b2_maxLinearCorrection), 0);
_local21 = (-(_local13.equalizedMass) * _local20);
_local22 = (_local21 * _local11.x);
_local23 = (_local21 * _local11.y);
_local5.m_sweep.c.x = (_local5.m_sweep.c.x - (_local7 * _local22));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y - (_local7 * _local23));
_local5.m_sweep.a = (_local5.m_sweep.a - (_local8 * ((_local16 * _local23) - (_local17 * _local22))));
_local5.SynchronizeTransform();
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_local9 * _local22));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_local9 * _local23));
_local6.m_sweep.a = (_local6.m_sweep.a + (_local10 * ((_local18 * _local23) - (_local19 * _local22))));
_local6.SynchronizeTransform();
_local12++;
};
_local3++;
};
return ((_local2 > (-1.5 * b2Settings.b2_linearSlop)));
}
public function Initialize(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4):void{
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:b2Fixture;
var _local10:b2Fixture;
var _local11:b2Shape;
var _local12:b2Shape;
var _local13:Number;
var _local14:Number;
var _local15:b2Body;
var _local16:b2Body;
var _local17:b2Manifold;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:b2ContactConstraint;
var _local29:uint;
var _local30:b2ManifoldPoint;
var _local31:b2ContactConstraintPoint;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
var _local48:b2ContactConstraintPoint;
var _local49:b2ContactConstraintPoint;
var _local50:Number;
var _local51:Number;
var _local52:Number;
var _local53:Number;
var _local54:Number;
var _local55:Number;
var _local56:Number;
var _local57:Number;
var _local58:Number;
var _local59:Number;
var _local60:Number;
var _local61:Number;
m_step.Set(_arg1);
m_allocator = _arg4;
m_constraintCount = _arg3;
while (m_constraints.length < m_constraintCount) {
m_constraints[m_constraints.length] = new b2ContactConstraint();
};
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local9 = _local5.m_fixtureA;
_local10 = _local5.m_fixtureB;
_local11 = _local9.m_shape;
_local12 = _local10.m_shape;
_local13 = _local11.m_radius;
_local14 = _local12.m_radius;
_local15 = _local9.m_body;
_local16 = _local10.m_body;
_local17 = _local5.GetManifold();
_local18 = b2Settings.b2MixFriction(_local9.GetFriction(), _local10.GetFriction());
_local19 = b2Settings.b2MixRestitution(_local9.GetRestitution(), _local10.GetRestitution());
_local20 = _local15.m_linearVelocity.x;
_local21 = _local15.m_linearVelocity.y;
_local22 = _local16.m_linearVelocity.x;
_local23 = _local16.m_linearVelocity.y;
_local24 = _local15.m_angularVelocity;
_local25 = _local16.m_angularVelocity;
b2Settings.b2Assert((_local17.m_pointCount > 0));
s_worldManifold.Initialize(_local17, _local15.m_xf, _local13, _local16.m_xf, _local14);
_local26 = s_worldManifold.m_normal.x;
_local27 = s_worldManifold.m_normal.y;
_local28 = m_constraints[_local6];
_local28.bodyA = _local15;
_local28.bodyB = _local16;
_local28.manifold = _local17;
_local28.normal.x = _local26;
_local28.normal.y = _local27;
_local28.pointCount = _local17.m_pointCount;
_local28.friction = _local18;
_local28.restitution = _local19;
_local28.localPlaneNormal.x = _local17.m_localPlaneNormal.x;
_local28.localPlaneNormal.y = _local17.m_localPlaneNormal.y;
_local28.localPoint.x = _local17.m_localPoint.x;
_local28.localPoint.y = _local17.m_localPoint.y;
_local28.radius = (_local13 + _local14);
_local28.type = _local17.m_type;
_local29 = 0;
while (_local29 < _local28.pointCount) {
_local30 = _local17.m_points[_local29];
_local31 = _local28.points[_local29];
_local31.normalImpulse = _local30.m_normalImpulse;
_local31.tangentImpulse = _local30.m_tangentImpulse;
_local31.localPoint.SetV(_local30.m_localPoint);
_local32 = (_local31.rA.x = (s_worldManifold.m_points[_local29].x - _local15.m_sweep.c.x));
_local33 = (_local31.rA.y = (s_worldManifold.m_points[_local29].y - _local15.m_sweep.c.y));
_local34 = (_local31.rB.x = (s_worldManifold.m_points[_local29].x - _local16.m_sweep.c.x));
_local35 = (_local31.rB.y = (s_worldManifold.m_points[_local29].y - _local16.m_sweep.c.y));
_local36 = ((_local32 * _local27) - (_local33 * _local26));
_local37 = ((_local34 * _local27) - (_local35 * _local26));
_local36 = (_local36 * _local36);
_local37 = (_local37 * _local37);
_local38 = (((_local15.m_invMass + _local16.m_invMass) + (_local15.m_invI * _local36)) + (_local16.m_invI * _local37));
_local31.normalMass = (1 / _local38);
_local39 = ((_local15.m_mass * _local15.m_invMass) + (_local16.m_mass * _local16.m_invMass));
_local39 = (_local39 + (((_local15.m_mass * _local15.m_invI) * _local36) + ((_local16.m_mass * _local16.m_invI) * _local37)));
_local31.equalizedMass = (1 / _local39);
_local40 = _local27;
_local41 = -(_local26);
_local42 = ((_local32 * _local41) - (_local33 * _local40));
_local43 = ((_local34 * _local41) - (_local35 * _local40));
_local42 = (_local42 * _local42);
_local43 = (_local43 * _local43);
_local44 = (((_local15.m_invMass + _local16.m_invMass) + (_local15.m_invI * _local42)) + (_local16.m_invI * _local43));
_local31.tangentMass = (1 / _local44);
_local31.velocityBias = 0;
_local45 = (((_local22 + (-(_local25) * _local35)) - _local20) - (-(_local24) * _local33));
_local46 = (((_local23 + (_local25 * _local34)) - _local21) - (_local24 * _local32));
_local47 = ((_local28.normal.x * _local45) + (_local28.normal.y * _local46));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local31.velocityBias = (_local31.velocityBias + (-(_local28.restitution) * _local47));
};
_local29++;
};
if (_local28.pointCount == 2){
_local48 = _local28.points[0];
_local49 = _local28.points[1];
_local50 = _local15.m_invMass;
_local51 = _local15.m_invI;
_local52 = _local16.m_invMass;
_local53 = _local16.m_invI;
_local54 = ((_local48.rA.x * _local27) - (_local48.rA.y * _local26));
_local55 = ((_local48.rB.x * _local27) - (_local48.rB.y * _local26));
_local56 = ((_local49.rA.x * _local27) - (_local49.rA.y * _local26));
_local57 = ((_local49.rB.x * _local27) - (_local49.rB.y * _local26));
_local58 = (((_local50 + _local52) + ((_local51 * _local54) * _local54)) + ((_local53 * _local55) * _local55));
_local59 = (((_local50 + _local52) + ((_local51 * _local56) * _local56)) + ((_local53 * _local57) * _local57));
_local60 = (((_local50 + _local52) + ((_local51 * _local54) * _local56)) + ((_local53 * _local55) * _local57));
_local61 = 100;
if ((_local58 * _local58) < (_local61 * ((_local58 * _local59) - (_local60 * _local60)))){
_local28.K.col1.Set(_local58, _local60);
_local28.K.col2.Set(_local60, _local59);
_local28.K.GetInverse(_local28.normalMass);
} else {
_local28.pointCount = 1;
};
};
_local6++;
};
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
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;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:b2Mat22;
var _local23:b2Vec2;
var _local25:b2ContactConstraint;
var _local26:b2Body;
var _local27:b2Body;
var _local28:Number;
var _local29:Number;
var _local30:b2Vec2;
var _local31:b2Vec2;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:int;
var _local43:b2ContactConstraintPoint;
var _local44:b2ContactConstraintPoint;
var _local45:Number;
var _local46:Number;
var _local47:Number;
var _local48:Number;
var _local49:Number;
var _local50:Number;
var _local51:Number;
var _local52:Number;
var _local53:Number;
var _local54:Number;
var _local55:Number;
var _local56:Number;
var _local57:Number;
var _local24:int;
while (_local24 < m_constraintCount) {
_local25 = m_constraints[_local24];
_local26 = _local25.bodyA;
_local27 = _local25.bodyB;
_local28 = _local26.m_angularVelocity;
_local29 = _local27.m_angularVelocity;
_local30 = _local26.m_linearVelocity;
_local31 = _local27.m_linearVelocity;
_local32 = _local26.m_invMass;
_local33 = _local26.m_invI;
_local34 = _local27.m_invMass;
_local35 = _local27.m_invI;
_local36 = _local25.normal.x;
_local37 = _local25.normal.y;
_local38 = _local37;
_local39 = -(_local36);
_local40 = _local25.friction;
_local1 = 0;
while (_local1 < _local25.pointCount) {
_local2 = _local25.points[_local1];
_local7 = (((_local31.x - (_local29 * _local2.rB.y)) - _local30.x) + (_local28 * _local2.rA.y));
_local8 = (((_local31.y + (_local29 * _local2.rB.x)) - _local30.y) - (_local28 * _local2.rA.x));
_local10 = ((_local7 * _local38) + (_local8 * _local39));
_local11 = (_local2.tangentMass * -(_local10));
_local12 = (_local40 * _local2.normalImpulse);
_local13 = b2Math.Clamp((_local2.tangentImpulse + _local11), -(_local12), _local12);
_local11 = (_local13 - _local2.tangentImpulse);
_local14 = (_local11 * _local38);
_local15 = (_local11 * _local39);
_local30.x = (_local30.x - (_local32 * _local14));
_local30.y = (_local30.y - (_local32 * _local15));
_local28 = (_local28 - (_local33 * ((_local2.rA.x * _local15) - (_local2.rA.y * _local14))));
_local31.x = (_local31.x + (_local34 * _local14));
_local31.y = (_local31.y + (_local34 * _local15));
_local29 = (_local29 + (_local35 * ((_local2.rB.x * _local15) - (_local2.rB.y * _local14))));
_local2.tangentImpulse = _local13;
_local1++;
};
_local42 = _local25.pointCount;
if (_local25.pointCount == 1){
_local2 = _local25.points[0];
_local7 = (((_local31.x + (-(_local29) * _local2.rB.y)) - _local30.x) - (-(_local28) * _local2.rA.y));
_local8 = (((_local31.y + (_local29 * _local2.rB.x)) - _local30.y) - (_local28 * _local2.rA.x));
_local9 = ((_local7 * _local36) + (_local8 * _local37));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local13 = (_local2.normalImpulse + _local11);
_local13 = ((_local13 > 0)) ? _local13 : 0;
_local11 = (_local13 - _local2.normalImpulse);
_local14 = (_local11 * _local36);
_local15 = (_local11 * _local37);
_local30.x = (_local30.x - (_local32 * _local14));
_local30.y = (_local30.y - (_local32 * _local15));
_local28 = (_local28 - (_local33 * ((_local2.rA.x * _local15) - (_local2.rA.y * _local14))));
_local31.x = (_local31.x + (_local34 * _local14));
_local31.y = (_local31.y + (_local34 * _local15));
_local29 = (_local29 + (_local35 * ((_local2.rB.x * _local15) - (_local2.rB.y * _local14))));
_local2.normalImpulse = _local13;
} else {
_local43 = _local25.points[0];
_local44 = _local25.points[1];
_local45 = _local43.normalImpulse;
_local46 = _local44.normalImpulse;
_local47 = (((_local31.x - (_local29 * _local43.rB.y)) - _local30.x) + (_local28 * _local43.rA.y));
_local48 = (((_local31.y + (_local29 * _local43.rB.x)) - _local30.y) - (_local28 * _local43.rA.x));
_local49 = (((_local31.x - (_local29 * _local44.rB.y)) - _local30.x) + (_local28 * _local44.rA.y));
_local50 = (((_local31.y + (_local29 * _local44.rB.x)) - _local30.y) - (_local28 * _local44.rA.x));
_local51 = ((_local47 * _local36) + (_local48 * _local37));
_local52 = ((_local49 * _local36) + (_local50 * _local37));
_local53 = (_local51 - _local43.velocityBias);
_local54 = (_local52 - _local44.velocityBias);
_local22 = _local25.K;
_local53 = (_local53 - ((_local22.col1.x * _local45) + (_local22.col2.x * _local46)));
_local54 = (_local54 - ((_local22.col1.y * _local45) + (_local22.col2.y * _local46)));
_local55 = 0.001;
while (true) {
_local22 = _local25.normalMass;
_local56 = -(((_local22.col1.x * _local53) + (_local22.col2.x * _local54)));
_local57 = -(((_local22.col1.y * _local53) + (_local22.col2.y * _local54)));
if ((((_local56 >= 0)) && ((_local57 >= 0)))){
_local16 = (_local56 - _local45);
_local17 = (_local57 - _local46);
_local18 = (_local16 * _local36);
_local19 = (_local16 * _local37);
_local20 = (_local17 * _local36);
_local21 = (_local17 * _local37);
_local30.x = (_local30.x - (_local32 * (_local18 + _local20)));
_local30.y = (_local30.y - (_local32 * (_local19 + _local21)));
_local28 = (_local28 - (_local33 * ((((_local43.rA.x * _local19) - (_local43.rA.y * _local18)) + (_local44.rA.x * _local21)) - (_local44.rA.y * _local20))));
_local31.x = (_local31.x + (_local34 * (_local18 + _local20)));
_local31.y = (_local31.y + (_local34 * (_local19 + _local21)));
_local29 = (_local29 + (_local35 * ((((_local43.rB.x * _local19) - (_local43.rB.y * _local18)) + (_local44.rB.x * _local21)) - (_local44.rB.y * _local20))));
_local43.normalImpulse = _local56;
_local44.normalImpulse = _local57;
break;
};
_local56 = (-(_local43.normalMass) * _local53);
_local57 = 0;
_local51 = 0;
_local52 = ((_local25.K.col1.y * _local56) + _local54);
if ((((_local56 >= 0)) && ((_local52 >= 0)))){
_local16 = (_local56 - _local45);
_local17 = (_local57 - _local46);
_local18 = (_local16 * _local36);
_local19 = (_local16 * _local37);
_local20 = (_local17 * _local36);
_local21 = (_local17 * _local37);
_local30.x = (_local30.x - (_local32 * (_local18 + _local20)));
_local30.y = (_local30.y - (_local32 * (_local19 + _local21)));
_local28 = (_local28 - (_local33 * ((((_local43.rA.x * _local19) - (_local43.rA.y * _local18)) + (_local44.rA.x * _local21)) - (_local44.rA.y * _local20))));
_local31.x = (_local31.x + (_local34 * (_local18 + _local20)));
_local31.y = (_local31.y + (_local34 * (_local19 + _local21)));
_local29 = (_local29 + (_local35 * ((((_local43.rB.x * _local19) - (_local43.rB.y * _local18)) + (_local44.rB.x * _local21)) - (_local44.rB.y * _local20))));
_local43.normalImpulse = _local56;
_local44.normalImpulse = _local57;
break;
};
_local56 = 0;
_local57 = (-(_local44.normalMass) * _local54);
_local51 = ((_local25.K.col2.x * _local57) + _local53);
_local52 = 0;
if ((((_local57 >= 0)) && ((_local51 >= 0)))){
_local16 = (_local56 - _local45);
_local17 = (_local57 - _local46);
_local18 = (_local16 * _local36);
_local19 = (_local16 * _local37);
_local20 = (_local17 * _local36);
_local21 = (_local17 * _local37);
_local30.x = (_local30.x - (_local32 * (_local18 + _local20)));
_local30.y = (_local30.y - (_local32 * (_local19 + _local21)));
_local28 = (_local28 - (_local33 * ((((_local43.rA.x * _local19) - (_local43.rA.y * _local18)) + (_local44.rA.x * _local21)) - (_local44.rA.y * _local20))));
_local31.x = (_local31.x + (_local34 * (_local18 + _local20)));
_local31.y = (_local31.y + (_local34 * (_local19 + _local21)));
_local29 = (_local29 + (_local35 * ((((_local43.rB.x * _local19) - (_local43.rB.y * _local18)) + (_local44.rB.x * _local21)) - (_local44.rB.y * _local20))));
_local43.normalImpulse = _local56;
_local44.normalImpulse = _local57;
break;
};
_local56 = 0;
_local57 = 0;
_local51 = _local53;
_local52 = _local54;
if ((((_local51 >= 0)) && ((_local52 >= 0)))){
_local16 = (_local56 - _local45);
_local17 = (_local57 - _local46);
_local18 = (_local16 * _local36);
_local19 = (_local16 * _local37);
_local20 = (_local17 * _local36);
_local21 = (_local17 * _local37);
_local30.x = (_local30.x - (_local32 * (_local18 + _local20)));
_local30.y = (_local30.y - (_local32 * (_local19 + _local21)));
_local28 = (_local28 - (_local33 * ((((_local43.rA.x * _local19) - (_local43.rA.y * _local18)) + (_local44.rA.x * _local21)) - (_local44.rA.y * _local20))));
_local31.x = (_local31.x + (_local34 * (_local18 + _local20)));
_local31.y = (_local31.y + (_local34 * (_local19 + _local21)));
_local29 = (_local29 + (_local35 * ((((_local43.rB.x * _local19) - (_local43.rB.y * _local18)) + (_local44.rB.x * _local21)) - (_local44.rB.y * _local20))));
_local43.normalImpulse = _local56;
_local44.normalImpulse = _local57;
break;
};
break;
};
};
_local26.m_angularVelocity = _local28;
_local27.m_angularVelocity = _local29;
_local24++;
};
}
public function FinalizeVelocityConstraints():void{
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
var _local1:int;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.m_points[_local4];
_local6 = _local2.points[_local4];
_local5.m_normalImpulse = _local6.normalImpulse;
_local5.m_tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 68
//b2EdgeAndCircleContact (Box2D.Dynamics.Contacts.b2EdgeAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2EdgeAndCircleContact extends b2Contact {
override b2internal function Evaluate():void{
var _local1:b2Body = m_fixtureA.GetBody();
var _local2:b2Body = m_fixtureB.GetBody();
b2CollideEdgeAndCircle(m_manifold, (m_fixtureA.GetShape() as b2EdgeShape), _local1.m_xf, (m_fixtureB.GetShape() as b2CircleShape), _local2.m_xf);
}
private function b2CollideEdgeAndCircle(_arg1:b2Manifold, _arg2:b2EdgeShape, _arg3:b2Transform, _arg4:b2CircleShape, _arg5:b2Transform):void{
}
public function Reset(_arg1:b2Fixture, _arg2:b2Fixture):void{
super.Reset(_arg1, _arg2);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1):b2Contact{
return (new (b2EdgeAndCircleContact));
}
}
}//package Box2D.Dynamics.Contacts
Section 69
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
override b2internal function Evaluate():void{
var _local1:b2Body = m_fixtureA.m_body;
var _local2:b2Body = m_fixtureB.m_body;
b2Collision.CollidePolygonAndCircle(m_manifold, (m_fixtureA.GetShape() as b2PolygonShape), _local1.m_xf, (m_fixtureB.GetShape() as b2CircleShape), _local2.m_xf);
}
public function Reset(_arg1:b2Fixture, _arg2:b2Fixture):void{
super.Reset(_arg1, _arg2);
b2Settings.b2Assert((_arg1.GetType() == b2Shape.e_polygonShape));
b2Settings.b2Assert((_arg2.GetType() == b2Shape.e_circleShape));
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1):b2Contact{
return (new (b2PolyAndCircleContact));
}
}
}//package Box2D.Dynamics.Contacts
Section 70
//b2PolyAndEdgeContact (Box2D.Dynamics.Contacts.b2PolyAndEdgeContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndEdgeContact extends b2Contact {
override b2internal function Evaluate():void{
var _local1:b2Body = m_fixtureA.GetBody();
var _local2:b2Body = m_fixtureB.GetBody();
b2CollidePolyAndEdge(m_manifold, (m_fixtureA.GetShape() as b2PolygonShape), _local1.m_xf, (m_fixtureB.GetShape() as b2EdgeShape), _local2.m_xf);
}
private function b2CollidePolyAndEdge(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2Transform, _arg4:b2EdgeShape, _arg5:b2Transform):void{
}
public function Reset(_arg1:b2Fixture, _arg2:b2Fixture):void{
super.Reset(_arg1, _arg2);
b2Settings.b2Assert((_arg1.GetType() == b2Shape.e_polygonShape));
b2Settings.b2Assert((_arg2.GetType() == b2Shape.e_edgeShape));
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1):b2Contact{
return (new (b2PolyAndEdgeContact));
}
}
}//package Box2D.Dynamics.Contacts
Section 71
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonContact extends b2Contact {
override b2internal function Evaluate():void{
var _local1:b2Body = m_fixtureA.GetBody();
var _local2:b2Body = m_fixtureB.GetBody();
b2Collision.CollidePolygons(m_manifold, (m_fixtureA.GetShape() as b2PolygonShape), _local1.m_xf, (m_fixtureB.GetShape() as b2PolygonShape), _local2.m_xf);
}
public function Reset(_arg1:b2Fixture, _arg2:b2Fixture):void{
super.Reset(_arg1, _arg2);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1):b2Contact{
return (new (b2PolygonContact));
}
}
}//package Box2D.Dynamics.Contacts
Section 72
//b2PositionSolverManifold (Box2D.Dynamics.Contacts.b2PositionSolverManifold)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
class b2PositionSolverManifold {
public var m_points:Array;
public var m_normal:b2Vec2;
public var m_separations:Array;
private static var circlePointA:b2Vec2 = new b2Vec2();
private static var circlePointB:b2Vec2 = new b2Vec2();
function b2PositionSolverManifold(){
m_normal = new b2Vec2();
m_separations = new Array(b2Settings.b2_maxManifoldPoints);
m_points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
m_points[_local1] = new b2Vec2();
_local1++;
};
}
public function Initialize(_arg1:b2ContactConstraint):void{
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
b2Settings.b2Assert((_arg1.pointCount > 0));
switch (_arg1.type){
case b2Manifold.e_circles:
_local5 = _arg1.bodyA.m_xf.R;
_local6 = _arg1.localPoint;
_local9 = (_arg1.bodyA.m_xf.position.x + ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)));
_local10 = (_arg1.bodyA.m_xf.position.y + ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)));
_local5 = _arg1.bodyB.m_xf.R;
_local6 = _arg1.points[0].localPoint;
_local11 = (_arg1.bodyB.m_xf.position.x + ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)));
_local12 = (_arg1.bodyB.m_xf.position.y + ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local16 = Math.sqrt(_local15);
m_normal.x = (_local13 / _local16);
m_normal.y = (_local14 / _local16);
} else {
m_normal.x = 1;
m_normal.y = 0;
};
m_points[0].x = (0.5 * (_local9 + _local11));
m_points[0].y = (0.5 * (_local10 + _local12));
m_separations[0] = (((_local13 * m_normal.x) + (_local14 * m_normal.y)) - _arg1.radius);
break;
case b2Manifold.e_faceA:
_local5 = _arg1.bodyA.m_xf.R;
_local6 = _arg1.localPlaneNormal;
m_normal.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_normal.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
_local5 = _arg1.bodyA.m_xf.R;
_local6 = _arg1.localPoint;
_local7 = (_arg1.bodyA.m_xf.position.x + ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)));
_local8 = (_arg1.bodyA.m_xf.position.y + ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)));
_local5 = _arg1.bodyB.m_xf.R;
_local2 = 0;
while (_local2 < _arg1.pointCount) {
_local6 = _arg1.points[_local2].localPoint;
_local3 = (_arg1.bodyB.m_xf.position.x + ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)));
_local4 = (_arg1.bodyB.m_xf.position.y + ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)));
m_separations[_local2] = ((((_local3 - _local7) * m_normal.x) + ((_local4 - _local8) * m_normal.y)) - _arg1.radius);
m_points[_local2].x = _local3;
m_points[_local2].y = _local4;
_local2++;
};
break;
case b2Manifold.e_faceB:
_local5 = _arg1.bodyB.m_xf.R;
_local6 = _arg1.localPlaneNormal;
m_normal.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_normal.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
_local5 = _arg1.bodyB.m_xf.R;
_local6 = _arg1.localPoint;
_local7 = (_arg1.bodyB.m_xf.position.x + ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)));
_local8 = (_arg1.bodyB.m_xf.position.y + ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)));
_local5 = _arg1.bodyA.m_xf.R;
_local2 = 0;
while (_local2 < _arg1.pointCount) {
_local6 = _arg1.points[_local2].localPoint;
_local3 = (_arg1.bodyA.m_xf.position.x + ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)));
_local4 = (_arg1.bodyA.m_xf.position.y + ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)));
m_separations[_local2] = ((((_local3 - _local7) * m_normal.x) + ((_local4 - _local8) * m_normal.y)) - _arg1.radius);
m_points[_local2].Set(_local3, _local4);
_local2++;
};
m_normal.x = (m_normal.x * -1);
m_normal.y = (m_normal.y * -1);
break;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 73
//b2Controller (Box2D.Dynamics.Controllers.b2Controller)
package Box2D.Dynamics.Controllers {
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2Controller {
b2internal var m_world:b2World;
b2internal var m_prev:b2Controller;
b2internal var m_next:b2Controller;
protected var m_bodyList:b2ControllerEdge;
protected var m_bodyCount:int;
public function AddBody(_arg1:b2Body):void{
var _local2:b2ControllerEdge = new b2ControllerEdge();
_local2.controller = this;
_local2.body = _arg1;
_local2.nextBody = m_bodyList;
_local2.prevBody = null;
m_bodyList = _local2;
if (_local2.nextBody){
_local2.nextBody.prevBody = _local2;
};
m_bodyCount++;
_local2.nextController = _arg1.m_controllerList;
_local2.prevController = null;
_arg1.m_controllerList = _local2;
if (_local2.nextController){
_local2.nextController.prevController = _local2;
};
_arg1.m_controllerCount++;
}
public function Draw(_arg1:b2DebugDraw):void{
}
public function RemoveBody(_arg1:b2Body):void{
var _local2:b2ControllerEdge = _arg1.m_controllerList;
while (((_local2) && (!((_local2.controller == this))))) {
_local2 = _local2.nextController;
};
if (_local2.prevBody){
_local2.prevBody.nextBody = _local2.nextBody;
};
if (_local2.nextBody){
_local2.nextBody.prevBody = _local2.prevBody;
};
if (_local2.nextController){
_local2.nextController.prevController = _local2.prevController;
};
if (_local2.prevController){
_local2.prevController.nextController = _local2.nextController;
};
if (m_bodyList == _local2){
m_bodyList = _local2.nextBody;
};
if (_arg1.m_controllerList == _local2){
_arg1.m_controllerList = _local2.nextController;
};
_arg1.m_controllerCount--;
m_bodyCount--;
}
public function GetNext():b2Controller{
return (m_next);
}
public function Clear():void{
while (m_bodyList) {
RemoveBody(m_bodyList.body);
};
}
public function Step(_arg1:b2TimeStep):void{
}
public function GetBodyList():b2ControllerEdge{
return (m_bodyList);
}
public function GetWorld():b2World{
return (m_world);
}
}
}//package Box2D.Dynamics.Controllers
Section 74
//b2ControllerEdge (Box2D.Dynamics.Controllers.b2ControllerEdge)
package Box2D.Dynamics.Controllers {
import Box2D.Dynamics.*;
public class b2ControllerEdge {
public var body:b2Body;
public var nextBody:b2ControllerEdge;
public var nextController:b2ControllerEdge;
public var prevBody:b2ControllerEdge;
public var prevController:b2ControllerEdge;
public var controller:b2Controller;
}
}//package Box2D.Dynamics.Controllers
Section 75
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
private var m_localAnchor1:b2Vec2;
private var m_localAnchor2:b2Vec2;
private var m_length:Number;
private var m_mass:Number;
private var m_bias:Number;
private var m_gamma:Number;
private var m_u:b2Vec2;
private var m_impulse:Number;
private var m_dampingRatio:Number;
private var m_frequencyHz:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchorA);
m_localAnchor2.SetV(_arg1.localAnchorB);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
}
public function SetFrequency(_arg1:Number):void{
m_frequencyHz = _arg1;
}
public function GetFrequency():Number{
return (m_frequencyHz);
}
public function SetLength(_arg1:Number):void{
m_length = _arg1;
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local7:Number;
var _local9:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local4 = m_bodyA;
_local5 = m_bodyB;
_local2 = _local4.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
var _local10:Number = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
var _local11:Number = ((_local6 * m_u.y) - (_local7 * m_u.x));
var _local12:Number = ((_local8 * m_u.y) - (_local9 * m_u.x));
var _local13:Number = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = ((_local13)!=0) ? (1 / _local13) : 0;
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (_arg1.dt * (_local16 + (_arg1.dt * _local17)));
m_gamma = ((m_gamma)!=0) ? (1 / m_gamma) : 0;
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (_local13 + m_gamma);
m_mass = ((m_mass)!=0) ? (1 / m_mass) : 0;
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
public function SetDampingRatio(_arg1:Number):void{
m_dampingRatio = _arg1;
}
public function GetLength():Number{
return (m_length);
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2(((_arg1 * m_impulse) * m_u.x), ((_arg1 * m_impulse) * m_u.y)));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:b2Mat22;
if (m_frequencyHz > 0){
return (true);
};
var _local3:b2Body = m_bodyA;
var _local4:b2Body = m_bodyB;
_local2 = _local3.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (((_local4.m_sweep.c.x + _local8) - _local3.m_sweep.c.x) - _local5);
var _local11:Number = (((_local4.m_sweep.c.y + _local9) - _local3.m_sweep.c.y) - _local6);
var _local12:Number = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local12);
_local11 = (_local11 / _local12);
var _local13:Number = (_local12 - m_length);
_local13 = b2Math.Clamp(_local13, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local14:Number = (-(m_mass) * _local13);
m_u.Set(_local10, _local11);
var _local15:Number = (_local14 * m_u.x);
var _local16:Number = (_local14 * m_u.y);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local15));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local16));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local5 * _local16) - (_local6 * _local15))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local15));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local16));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
return ((b2Math.Abs(_local13) < b2Settings.b2_linearSlop));
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body = m_bodyA;
var _local4:b2Body = m_bodyB;
_local2 = _local3.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
var _local11:Number = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
var _local12:Number = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
var _local13:Number = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
var _local14:Number = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
var _local15:Number = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
var _local16:Number = (_local15 * m_u.x);
var _local17:Number = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
public function GetDampingRatio():Number{
return (m_dampingRatio);
}
}
}//package Box2D.Dynamics.Joints
Section 76
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2DistanceJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var length:Number;
public var dampingRatio:Number;
public var localAnchorB:b2Vec2;
public var frequencyHz:Number;
public function b2DistanceJointDef(){
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
bodyA = _arg1;
bodyB = _arg2;
localAnchorA.SetV(bodyA.GetLocalPoint(_arg3));
localAnchorB.SetV(bodyB.GetLocalPoint(_arg4));
var _local5:Number = (_arg4.x - _arg3.x);
var _local6:Number = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 77
//b2FrictionJoint (Box2D.Dynamics.Joints.b2FrictionJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2FrictionJoint extends b2Joint {
private var m_maxTorque:Number;
private var m_angularImpulse:Number;
public var m_linearMass:b2Mat22;
private var m_localAnchorA:b2Vec2;
private var m_localAnchorB:b2Vec2;
public var m_angularMass:Number;
private var m_maxForce:Number;
private var m_linearImpulse:b2Vec2;
public function b2FrictionJoint(_arg1:b2FrictionJointDef){
m_localAnchorA = new b2Vec2();
m_localAnchorB = new b2Vec2();
m_linearMass = new b2Mat22();
m_linearImpulse = new b2Vec2();
super(_arg1);
m_localAnchorA.SetV(_arg1.localAnchorA);
m_localAnchorB.SetV(_arg1.localAnchorB);
m_linearMass.SetZero();
m_angularMass = 0;
m_linearImpulse.SetZero();
m_angularImpulse = 0;
m_maxForce = _arg1.maxForce;
m_maxTorque = _arg1.maxTorque;
}
public function SetMaxForce(_arg1:Number):void{
m_maxForce = _arg1;
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local8:Number;
var _local10:Number;
var _local12:Number;
var _local13:Number;
var _local14:b2Mat22;
var _local15:b2Vec2;
_local4 = m_bodyA;
_local5 = m_bodyB;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchorA.x - _local4.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchorA.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchorB.x - _local5.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchorB.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
_local10 = _local4.m_invMass;
var _local11:Number = _local5.m_invMass;
_local12 = _local4.m_invI;
_local13 = _local5.m_invI;
_local14 = new b2Mat22();
_local14.col1.x = (_local10 + _local11);
_local14.col2.x = 0;
_local14.col1.y = 0;
_local14.col2.y = (_local10 + _local11);
_local14.col1.x = (_local14.col1.x + ((_local12 * _local7) * _local7));
_local14.col2.x = (_local14.col2.x + ((-(_local12) * _local6) * _local7));
_local14.col1.y = (_local14.col1.y + ((-(_local12) * _local6) * _local7));
_local14.col2.y = (_local14.col2.y + ((_local12 * _local6) * _local6));
_local14.col1.x = (_local14.col1.x + ((_local13 * _local9) * _local9));
_local14.col2.x = (_local14.col2.x + ((-(_local13) * _local8) * _local9));
_local14.col1.y = (_local14.col1.y + ((-(_local13) * _local8) * _local9));
_local14.col2.y = (_local14.col2.y + ((_local13 * _local8) * _local8));
_local14.GetInverse(m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > 0){
m_angularMass = (1 / m_angularMass);
};
if (_arg1.warmStarting){
m_linearImpulse.x = (m_linearImpulse.x * _arg1.dtRatio);
m_linearImpulse.y = (m_linearImpulse.y * _arg1.dtRatio);
m_angularImpulse = (m_angularImpulse * _arg1.dtRatio);
_local15 = m_linearImpulse;
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local10 * _local15.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local10 * _local15.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local12 * (((_local6 * _local15.y) - (_local7 * _local15.x)) + m_angularImpulse)));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local11 * _local15.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local11 * _local15.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local13 * (((_local8 * _local15.y) - (_local9 * _local15.x)) + m_angularImpulse)));
} else {
m_linearImpulse.SetZero();
m_angularImpulse = 0;
};
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchorB));
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchorA));
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_angularImpulse));
}
public function SetMaxTorque(_arg1:Number):void{
m_maxTorque = _arg1;
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
return (true);
}
public function GetMaxTorque():Number{
return (m_maxTorque);
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local18:Number;
var _local4:b2Body = m_bodyA;
var _local5:b2Body = m_bodyB;
var _local6:b2Vec2 = _local4.m_linearVelocity;
var _local7:Number = _local4.m_angularVelocity;
var _local8:b2Vec2 = _local5.m_linearVelocity;
var _local9:Number = _local5.m_angularVelocity;
var _local10:Number = _local4.m_invMass;
var _local11:Number = _local5.m_invMass;
var _local12:Number = _local4.m_invI;
var _local13:Number = _local5.m_invI;
_local2 = _local4.m_xf.R;
var _local14:Number = (m_localAnchorA.x - _local4.m_sweep.localCenter.x);
var _local15:Number = (m_localAnchorA.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local14) + (_local2.col2.x * _local15));
_local15 = ((_local2.col1.y * _local14) + (_local2.col2.y * _local15));
_local14 = _local3;
_local2 = _local5.m_xf.R;
var _local16:Number = (m_localAnchorB.x - _local5.m_sweep.localCenter.x);
var _local17:Number = (m_localAnchorB.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local16) + (_local2.col2.x * _local17));
_local17 = ((_local2.col1.y * _local16) + (_local2.col2.y * _local17));
_local16 = _local3;
var _local19:Number = (_local9 - _local7);
var _local20:Number = (-(m_angularMass) * _local19);
var _local21:Number = m_angularImpulse;
_local18 = (_arg1.dt * m_maxTorque);
m_angularImpulse = b2Math.Clamp((m_angularImpulse + _local20), -(_local18), _local18);
_local20 = (m_angularImpulse - _local21);
_local7 = (_local7 - (_local12 * _local20));
_local9 = (_local9 + (_local13 * _local20));
var _local22:Number = (((_local8.x - (_local9 * _local17)) - _local6.x) + (_local7 * _local15));
var _local23:Number = (((_local8.y + (_local9 * _local16)) - _local6.y) - (_local7 * _local14));
var _local24:b2Vec2 = b2Math.MulMV(m_linearMass, new b2Vec2(-(_local22), -(_local23)));
var _local25:b2Vec2 = m_linearImpulse.Copy();
m_linearImpulse.Add(_local24);
_local18 = (_arg1.dt * m_maxForce);
if (m_linearImpulse.LengthSquared() > (_local18 * _local18)){
m_linearImpulse.Normalize();
m_linearImpulse.Multiply(_local18);
};
_local24 = b2Math.SubtractVV(m_linearImpulse, _local25);
_local6.x = (_local6.x - (_local10 * _local24.x));
_local6.y = (_local6.y - (_local10 * _local24.y));
_local7 = (_local7 - (_local12 * ((_local14 * _local24.y) - (_local15 * _local24.x))));
_local8.x = (_local8.x + (_local11 * _local24.x));
_local8.y = (_local8.y + (_local11 * _local24.y));
_local9 = (_local9 + (_local13 * ((_local16 * _local24.y) - (_local17 * _local24.x))));
_local4.m_angularVelocity = _local7;
_local5.m_angularVelocity = _local9;
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2((_arg1 * m_linearImpulse.x), (_arg1 * m_linearImpulse.y)));
}
public function GetMaxForce():Number{
return (m_maxForce);
}
}
}//package Box2D.Dynamics.Joints
Section 78
//b2FrictionJointDef (Box2D.Dynamics.Joints.b2FrictionJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2FrictionJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var maxTorque:Number;
public var maxForce:Number;
public var localAnchorB:b2Vec2;
public function b2FrictionJointDef(){
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
super();
type = b2Joint.e_frictionJoint;
maxForce = 0;
maxTorque = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
bodyA = _arg1;
bodyB = _arg2;
localAnchorA.SetV(bodyA.GetLocalPoint(_arg3));
localAnchorB.SetV(bodyB.GetLocalPoint(_arg3));
}
}
}//package Box2D.Dynamics.Joints
Section 79
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
private var m_ground2:b2Body;
private var m_groundAnchor1:b2Vec2;
private var m_groundAnchor2:b2Vec2;
private var m_localAnchor1:b2Vec2;
private var m_localAnchor2:b2Vec2;
private var m_ratio:Number;
private var m_mass:Number;
private var m_impulse:Number;
private var m_prismatic2:b2PrismaticJoint;
private var m_ground1:b2Body;
private var m_revolute1:b2RevoluteJoint;
private var m_revolute2:b2RevoluteJoint;
private var m_prismatic1:b2PrismaticJoint;
private var m_constant:Number;
private var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
var _local2:int = _arg1.joint1.m_type;
var _local3:int = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.GetBodyA();
m_bodyA = _arg1.joint1.GetBodyB();
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.GetBodyA();
m_bodyB = _arg1.joint2.GetBodyB();
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_impulse = 0;
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local2:b2Body = m_ground1;
var _local3:b2Body = m_ground2;
_local4 = m_bodyA;
var _local5:b2Body = m_bodyB;
var _local14:Number = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angularA = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linearA.Set(-(_local6), -(_local7));
m_J.angularA = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angularB = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linearB.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angularB = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = ((_local14 > 0)) ? (1 / _local14) : 0;
if (_arg1.warmStarting){
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * m_impulse) * m_J.linearA.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * m_impulse) * m_J.linearA.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * m_impulse) * m_J.angularA));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * m_impulse) * m_J.linearB.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * m_impulse) * m_J.linearB.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * m_impulse) * m_J.angularB));
} else {
m_impulse = 0;
};
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
var _local4:Number = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local5:Number = (-(m_mass) * _local4);
m_impulse = (m_impulse + _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local5) * m_J.linearA.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local5) * m_J.linearA.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local5) * m_J.angularA));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local5) * m_J.linearB.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local5) * m_J.linearB.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local5) * m_J.angularB));
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor2));
}
public function SetRatio(_arg1:Number):void{
m_ratio = _arg1;
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2(((_arg1 * m_impulse) * m_J.linearB.x), ((_arg1 * m_impulse) * m_J.linearB.y)));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local5:Number;
var _local6:Number;
var _local2:Number = 0;
var _local3:b2Body = m_bodyA;
var _local4:b2Body = m_bodyB;
if (m_revolute1){
_local5 = m_revolute1.GetJointAngle();
} else {
_local5 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local6 = m_revolute2.GetJointAngle();
} else {
_local6 = m_prismatic2.GetJointTranslation();
};
var _local7:Number = (m_constant - (_local5 + (m_ratio * _local6)));
var _local8:Number = (-(m_mass) * _local7);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local8) * m_J.linearA.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local8) * m_J.linearA.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local8) * m_J.angularA));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local4.m_invMass * _local8) * m_J.linearB.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local4.m_invMass * _local8) * m_J.linearB.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local4.m_invI * _local8) * m_J.angularB));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
return ((_local2 < b2Settings.b2_linearSlop));
}
override public function GetReactionTorque(_arg1:Number):Number{
var _local2:b2Mat22 = m_bodyB.m_xf.R;
var _local3:Number = (m_localAnchor1.x - m_bodyB.m_sweep.localCenter.x);
var _local4:Number = (m_localAnchor1.y - m_bodyB.m_sweep.localCenter.y);
var _local5:Number = ((_local2.col1.x * _local3) + (_local2.col2.x * _local4));
_local4 = ((_local2.col1.y * _local3) + (_local2.col2.y * _local4));
_local3 = _local5;
var _local6:Number = (m_impulse * m_J.linearB.x);
var _local7:Number = (m_impulse * m_J.linearB.y);
return ((_arg1 * (((m_impulse * m_J.angularB) - (_local3 * _local7)) + (_local4 * _local6))));
}
public function GetRatio():Number{
return (m_ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 80
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint1:b2Joint;
public var joint2:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 81
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var angularB:Number;
public var linearA:b2Vec2;
public var linearB:b2Vec2;
public var angularA:Number;
public function b2Jacobian(){
linearA = new b2Vec2();
linearB = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linearA.SetV(_arg1);
angularA = _arg2;
linearB.SetV(_arg3);
angularB = _arg4;
}
public function SetZero():void{
linearA.SetZero();
angularA = 0;
linearB.SetZero();
angularB = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linearA.x * _arg1.x) + (linearA.y * _arg1.y)) + (angularA * _arg2)) + ((linearB.x * _arg3.x) + (linearB.y * _arg3.y))) + (angularB * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 82
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Joint {
b2internal var m_islandFlag:Boolean;
b2internal var m_prev:b2Joint;
b2internal var m_invMassA:Number;
b2internal var m_localCenterA:b2Vec2;
b2internal var m_type:int;
b2internal var m_bodyA:b2Body;
b2internal var m_bodyB:b2Body;
b2internal var m_edgeA:b2JointEdge;
b2internal var m_edgeB:b2JointEdge;
b2internal var m_next:b2Joint;
private var m_userData;
b2internal var m_invMassB:Number;
b2internal var m_localCenterB:b2Vec2;
b2internal var m_invIB:Number;
b2internal var m_collideConnected:Boolean;
b2internal var m_invIA:Number;
b2internal static const e_prismaticJoint:int = 2;
b2internal static const e_weldJoint:int = 8;
b2internal static const e_equalLimits:int = 3;
b2internal static const e_frictionJoint:int = 9;
b2internal static const e_lineJoint:int = 7;
b2internal static const e_gearJoint:int = 6;
b2internal static const e_atUpperLimit:int = 2;
b2internal static const e_atLowerLimit:int = 1;
b2internal static const e_revoluteJoint:int = 1;
b2internal static const e_inactiveLimit:int = 0;
b2internal static const e_pulleyJoint:int = 4;
b2internal static const e_unknownJoint:int = 0;
b2internal static const e_distanceJoint:int = 3;
b2internal static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_edgeA = new b2JointEdge();
m_edgeB = new b2JointEdge();
m_localCenterA = new b2Vec2();
m_localCenterB = new b2Vec2();
super();
b2Settings.b2Assert(!((_arg1.bodyA == _arg1.bodyB)));
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_bodyA = _arg1.bodyA;
m_bodyB = _arg1.bodyB;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetBodyB():b2Body{
return (m_bodyB);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetAnchorA():b2Vec2{
return (null);
}
public function GetType():int{
return (m_type);
}
public function GetAnchorB():b2Vec2{
return (null);
}
public function GetBodyA():b2Body{
return (m_bodyA);
}
public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce(_arg1:Number):b2Vec2{
return (null);
}
b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
return (false);
}
public function IsActive():Boolean{
return (((m_bodyA.IsActive()) && (m_bodyB.IsActive())));
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
b2internal function FinalizeVelocityConstraints():void{
}
b2internal static function Destroy(_arg1:b2Joint, _arg2):void{
}
b2internal static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
case e_lineJoint:
_local3 = new b2LineJoint((_arg1 as b2LineJointDef));
break;
case e_weldJoint:
_local3 = new b2WeldJoint((_arg1 as b2WeldJointDef));
break;
case e_frictionJoint:
_local3 = new b2FrictionJoint((_arg1 as b2FrictionJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 83
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var bodyB:b2Body;
public var type:int;
public var userData;
public var collideConnected:Boolean;
public var bodyA:b2Body;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
bodyA = null;
bodyB = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 84
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
public var joint:b2Joint;
}
}//package Box2D.Dynamics.Joints
Section 85
//b2LineJoint (Box2D.Dynamics.Joints.b2LineJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2LineJoint extends b2Joint {
private var m_a1:Number;
private var m_a2:Number;
private var m_perp:b2Vec2;
private var m_lowerTranslation:Number;
b2internal var m_localXAxis1:b2Vec2;
private var m_impulse:b2Vec2;
private var m_enableLimit:Boolean;
private var m_maxMotorForce:Number;
private var m_localYAxis1:b2Vec2;
private var m_s2:Number;
private var m_axis:b2Vec2;
private var m_motorMass:Number;
private var m_s1:Number;
private var m_upperTranslation:Number;
b2internal var m_localAnchor1:b2Vec2;
b2internal var m_localAnchor2:b2Vec2;
private var m_limitState:int;
private var m_motorImpulse:Number;
private var m_motorSpeed:Number;
private var m_enableMotor:Boolean;
private var m_K:b2Mat22;
public function b2LineJoint(_arg1:b2LineJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_axis = new b2Vec2();
m_perp = new b2Vec2();
m_K = new b2Mat22();
m_impulse = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchorA);
m_localAnchor2.SetV(_arg1.localAnchorB);
m_localXAxis1.SetV(_arg1.localAxisA);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_impulse.SetZero();
m_motorMass = 0;
m_motorImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
m_limitState = e_inactiveLimit;
m_axis.SetZero();
m_perp.SetZero();
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:b2Vec2;
var _local19:b2Vec2;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
var _local4:b2Vec2 = _local2.m_linearVelocity;
var _local5:Number = _local2.m_angularVelocity;
var _local6:b2Vec2 = _local3.m_linearVelocity;
var _local7:Number = _local3.m_angularVelocity;
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local13 = ((((m_axis.x * (_local6.x - _local4.x)) + (m_axis.y * (_local6.y - _local4.y))) + (m_a2 * _local7)) - (m_a1 * _local5));
_local14 = (m_motorMass * (m_motorSpeed - _local13));
_local15 = m_motorImpulse;
_local16 = (_arg1.dt * m_maxMotorForce);
m_motorImpulse = b2Math.Clamp((m_motorImpulse + _local14), -(_local16), _local16);
_local14 = (m_motorImpulse - _local15);
_local8 = (_local14 * m_axis.x);
_local9 = (_local14 * m_axis.y);
_local10 = (_local14 * m_a1);
_local11 = (_local14 * m_a2);
_local4.x = (_local4.x - (m_invMassA * _local8));
_local4.y = (_local4.y - (m_invMassA * _local9));
_local5 = (_local5 - (m_invIA * _local10));
_local6.x = (_local6.x + (m_invMassB * _local8));
_local6.y = (_local6.y + (m_invMassB * _local9));
_local7 = (_local7 + (m_invIB * _local11));
};
var _local12:Number = ((((m_perp.x * (_local6.x - _local4.x)) + (m_perp.y * (_local6.y - _local4.y))) + (m_s2 * _local7)) - (m_s1 * _local5));
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local17 = ((((m_axis.x * (_local6.x - _local4.x)) + (m_axis.y * (_local6.y - _local4.y))) + (m_a2 * _local7)) - (m_a1 * _local5));
_local18 = m_impulse.Copy();
_local19 = m_K.Solve(new b2Vec2(), -(_local12), -(_local17));
m_impulse.Add(_local19);
if (m_limitState == e_atLowerLimit){
m_impulse.y = b2Math.Max(m_impulse.y, 0);
} else {
if (m_limitState == e_atUpperLimit){
m_impulse.y = b2Math.Min(m_impulse.y, 0);
};
};
_local20 = (-(_local12) - ((m_impulse.y - _local18.y) * m_K.col2.x));
if (m_K.col1.x != 0){
_local21 = ((_local20 / m_K.col1.x) + _local18.x);
} else {
_local21 = _local18.x;
};
m_impulse.x = _local21;
_local19.x = (m_impulse.x - _local18.x);
_local19.y = (m_impulse.y - _local18.y);
_local8 = ((_local19.x * m_perp.x) + (_local19.y * m_axis.x));
_local9 = ((_local19.x * m_perp.y) + (_local19.y * m_axis.y));
_local10 = ((_local19.x * m_s1) + (_local19.y * m_a1));
_local11 = ((_local19.x * m_s2) + (_local19.y * m_a2));
_local4.x = (_local4.x - (m_invMassA * _local8));
_local4.y = (_local4.y - (m_invMassA * _local9));
_local5 = (_local5 - (m_invIA * _local10));
_local6.x = (_local6.x + (m_invMassB * _local8));
_local6.y = (_local6.y + (m_invMassB * _local9));
_local7 = (_local7 + (m_invIB * _local11));
} else {
if (m_K.col1.x != 0){
_local22 = (-(_local12) / m_K.col1.x);
} else {
_local22 = 0;
};
m_impulse.x = (m_impulse.x + _local22);
_local8 = (_local22 * m_perp.x);
_local9 = (_local22 * m_perp.y);
_local10 = (_local22 * m_s1);
_local11 = (_local22 * m_s2);
_local4.x = (_local4.x - (m_invMassA * _local8));
_local4.y = (_local4.y - (m_invMassA * _local9));
_local5 = (_local5 - (m_invIA * _local10));
_local6.x = (_local6.x + (m_invMassB * _local8));
_local6.y = (_local6.y + (m_invMassB * _local9));
_local7 = (_local7 + (m_invIB * _local11));
};
_local2.m_linearVelocity.SetV(_local4);
_local2.m_angularVelocity = _local5;
_local3.m_linearVelocity.SetV(_local6);
_local3.m_angularVelocity = _local7;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function EnableMotor(_arg1:Boolean):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_enableMotor = _arg1;
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor2));
}
public function GetJointTranslation():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_bodyA;
var _local2:b2Body = m_bodyB;
var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1);
var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2);
var _local6:Number = (_local5.x - _local4.x);
var _local7:Number = (_local5.y - _local4.y);
var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2((_arg1 * ((m_impulse.x * m_perp.x) + ((m_motorImpulse + m_impulse.y) * m_axis.x))), (_arg1 * ((m_impulse.x * m_perp.y) + ((m_motorImpulse + m_impulse.y) * m_axis.y)))));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Number;
var _local10:b2Mat22;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local4:b2Body = m_bodyA;
var _local5:b2Body = m_bodyB;
var _local6:b2Vec2 = _local4.m_sweep.c;
var _local7:Number = _local4.m_sweep.a;
var _local8:b2Vec2 = _local5.m_sweep.c;
var _local9:Number = _local5.m_sweep.a;
var _local16:Number = 0;
var _local17:Number = 0;
var _local18:Boolean;
var _local19:Number = 0;
var _local20:b2Mat22 = b2Mat22.FromAngle(_local7);
var _local21:b2Mat22 = b2Mat22.FromAngle(_local9);
_local10 = _local20;
var _local22:Number = (m_localAnchor1.x - m_localCenterA.x);
var _local23:Number = (m_localAnchor1.y - m_localCenterA.y);
_local11 = ((_local10.col1.x * _local22) + (_local10.col2.x * _local23));
_local23 = ((_local10.col1.y * _local22) + (_local10.col2.y * _local23));
_local22 = _local11;
_local10 = _local21;
var _local24:Number = (m_localAnchor2.x - m_localCenterB.x);
var _local25:Number = (m_localAnchor2.y - m_localCenterB.y);
_local11 = ((_local10.col1.x * _local24) + (_local10.col2.x * _local25));
_local25 = ((_local10.col1.y * _local24) + (_local10.col2.y * _local25));
_local24 = _local11;
var _local26:Number = (((_local8.x + _local24) - _local6.x) - _local22);
var _local27:Number = (((_local8.y + _local25) - _local6.y) - _local23);
if (m_enableLimit){
m_axis = b2Math.MulMV(_local20, m_localXAxis1);
m_a1 = (((_local26 + _local22) * m_axis.y) - ((_local27 + _local23) * m_axis.x));
m_a2 = ((_local24 * m_axis.y) - (_local25 * m_axis.x));
_local34 = ((m_axis.x * _local26) + (m_axis.y * _local27));
if (b2Math.Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
_local19 = b2Math.Clamp(_local34, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local16 = b2Math.Abs(_local34);
_local18 = true;
} else {
if (_local34 <= m_lowerTranslation){
_local19 = b2Math.Clamp(((_local34 - m_lowerTranslation) + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local16 = (m_lowerTranslation - _local34);
_local18 = true;
} else {
if (_local34 >= m_upperTranslation){
_local19 = b2Math.Clamp(((_local34 - m_upperTranslation) + b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local16 = (_local34 - m_upperTranslation);
_local18 = true;
};
};
};
};
m_perp = b2Math.MulMV(_local20, m_localYAxis1);
m_s1 = (((_local26 + _local22) * m_perp.y) - ((_local27 + _local23) * m_perp.x));
m_s2 = ((_local24 * m_perp.y) - (_local25 * m_perp.x));
var _local28:b2Vec2 = new b2Vec2();
var _local29:Number = ((m_perp.x * _local26) + (m_perp.y * _local27));
_local16 = b2Math.Max(_local16, b2Math.Abs(_local29));
_local17 = 0;
if (_local18){
_local12 = m_invMassA;
_local13 = m_invMassB;
_local14 = m_invIA;
_local15 = m_invIB;
m_K.col1.x = (((_local12 + _local13) + ((_local14 * m_s1) * m_s1)) + ((_local15 * m_s2) * m_s2));
m_K.col1.y = (((_local14 * m_s1) * m_a1) + ((_local15 * m_s2) * m_a2));
m_K.col2.x = m_K.col1.y;
m_K.col2.y = (((_local12 + _local13) + ((_local14 * m_a1) * m_a1)) + ((_local15 * m_a2) * m_a2));
m_K.Solve(_local28, -(_local29), -(_local19));
} else {
_local12 = m_invMassA;
_local13 = m_invMassB;
_local14 = m_invIA;
_local15 = m_invIB;
_local35 = (((_local12 + _local13) + ((_local14 * m_s1) * m_s1)) + ((_local15 * m_s2) * m_s2));
if (_local35 != 0){
_local36 = (-(_local29) / _local35);
} else {
_local36 = 0;
};
_local28.x = _local36;
_local28.y = 0;
};
var _local30:Number = ((_local28.x * m_perp.x) + (_local28.y * m_axis.x));
var _local31:Number = ((_local28.x * m_perp.y) + (_local28.y * m_axis.y));
var _local32:Number = ((_local28.x * m_s1) + (_local28.y * m_a1));
var _local33:Number = ((_local28.x * m_s2) + (_local28.y * m_a2));
_local6.x = (_local6.x - (m_invMassA * _local30));
_local6.y = (_local6.y - (m_invMassA * _local31));
_local7 = (_local7 - (m_invIA * _local32));
_local8.x = (_local8.x + (m_invMassB * _local30));
_local8.y = (_local8.y + (m_invMassB * _local31));
_local9 = (_local9 + (m_invIB * _local33));
_local4.m_sweep.a = _local7;
_local5.m_sweep.a = _local9;
_local4.SynchronizeTransform();
_local5.SynchronizeTransform();
return ((((_local16 <= b2Settings.b2_linearSlop)) && ((_local17 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_bodyA;
var _local2:b2Body = m_bodyB;
_local3 = _local1.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
var _local9:Number = (_local1.m_sweep.c.x + _local4);
var _local10:Number = (_local1.m_sweep.c.y + _local5);
var _local11:Number = (_local2.m_sweep.c.x + _local7);
var _local12:Number = (_local2.m_sweep.c.y + _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local16:b2Vec2 = _local1.m_linearVelocity;
var _local17:b2Vec2 = _local2.m_linearVelocity;
var _local18:Number = _local1.m_angularVelocity;
var _local19:Number = _local2.m_angularVelocity;
var _local20:Number = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
m_localCenterA.SetV(_local2.GetLocalCenter());
m_localCenterB.SetV(_local3.GetLocalCenter());
var _local6:b2Transform = _local2.GetTransform();
var _local7:b2Transform = _local3.GetTransform();
_local4 = _local2.m_xf.R;
var _local8:Number = (m_localAnchor1.x - m_localCenterA.x);
var _local9:Number = (m_localAnchor1.y - m_localCenterA.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local4 = _local3.m_xf.R;
var _local10:Number = (m_localAnchor2.x - m_localCenterB.x);
var _local11:Number = (m_localAnchor2.y - m_localCenterB.y);
_local5 = ((_local4.col1.x * _local10) + (_local4.col2.x * _local11));
_local11 = ((_local4.col1.y * _local10) + (_local4.col2.y * _local11));
_local10 = _local5;
var _local12:Number = (((_local3.m_sweep.c.x + _local10) - _local2.m_sweep.c.x) - _local8);
var _local13:Number = (((_local3.m_sweep.c.y + _local11) - _local2.m_sweep.c.y) - _local9);
m_invMassA = _local2.m_invMass;
m_invMassB = _local3.m_invMass;
m_invIA = _local2.m_invI;
m_invIB = _local3.m_invI;
m_axis.SetV(b2Math.MulMV(_local6.R, m_localXAxis1));
m_a1 = (((_local12 + _local8) * m_axis.y) - ((_local13 + _local9) * m_axis.x));
m_a2 = ((_local10 * m_axis.y) - (_local11 * m_axis.x));
m_motorMass = (((m_invMassA + m_invMassB) + ((m_invIA * m_a1) * m_a1)) + ((m_invIB * m_a2) * m_a2));
m_motorMass = ((m_motorMass > Number.MIN_VALUE)) ? (1 / m_motorMass) : 0;
m_perp.SetV(b2Math.MulMV(_local6.R, m_localYAxis1));
m_s1 = (((_local12 + _local8) * m_perp.y) - ((_local13 + _local9) * m_perp.x));
m_s2 = ((_local10 * m_perp.y) - (_local11 * m_perp.x));
var _local14:Number = m_invMassA;
var _local15:Number = m_invMassB;
var _local16:Number = m_invIA;
var _local17:Number = m_invIB;
m_K.col1.x = (((_local14 + _local15) + ((_local16 * m_s1) * m_s1)) + ((_local17 * m_s2) * m_s2));
m_K.col1.y = (((_local16 * m_s1) * m_a1) + ((_local17 * m_s2) * m_a2));
m_K.col2.x = m_K.col1.y;
m_K.col2.y = (((_local14 + _local15) + ((_local16 * m_a1) * m_a1)) + ((_local17 * m_a2) * m_a2));
if (m_enableLimit){
_local18 = ((m_axis.x * _local12) + (m_axis.y * _local13));
if (b2Math.Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local18 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitState = e_atLowerLimit;
m_impulse.y = 0;
};
} else {
if (_local18 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitState = e_atUpperLimit;
m_impulse.y = 0;
};
} else {
m_limitState = e_inactiveLimit;
m_impulse.y = 0;
};
};
};
} else {
m_limitState = e_inactiveLimit;
};
if (m_enableMotor == false){
m_motorImpulse = 0;
};
if (_arg1.warmStarting){
m_impulse.x = (m_impulse.x * _arg1.dtRatio);
m_impulse.y = (m_impulse.y * _arg1.dtRatio);
m_motorImpulse = (m_motorImpulse * _arg1.dtRatio);
_local19 = ((m_impulse.x * m_perp.x) + ((m_motorImpulse + m_impulse.y) * m_axis.x));
_local20 = ((m_impulse.x * m_perp.y) + ((m_motorImpulse + m_impulse.y) * m_axis.y));
_local21 = ((m_impulse.x * m_s1) + ((m_motorImpulse + m_impulse.y) * m_a1));
_local22 = ((m_impulse.x * m_s2) + ((m_motorImpulse + m_impulse.y) * m_a2));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (m_invMassA * _local19));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (m_invMassA * _local20));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (m_invIA * _local21));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (m_invMassB * _local19));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (m_invMassB * _local20));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (m_invIB * _local22));
} else {
m_impulse.SetZero();
m_motorImpulse = 0;
};
}
public function GetMotorForce():Number{
return (m_motorImpulse);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_enableLimit = _arg1;
}
public function GetMaxMotorForce():Number{
return (m_maxMotorForce);
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_impulse.y));
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 86
//b2LineJointDef (Box2D.Dynamics.Joints.b2LineJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2LineJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var localAnchorB:b2Vec2;
public var upperTranslation:Number;
public var enableMotor:Boolean;
public var localAxisA:b2Vec2;
public var enableLimit:Boolean;
public var motorSpeed:Number;
public var maxMotorForce:Number;
public var lowerTranslation:Number;
public function b2LineJointDef(){
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
localAxisA = new b2Vec2();
super();
type = b2Joint.e_lineJoint;
localAxisA.Set(1, 0);
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
bodyA = _arg1;
bodyB = _arg2;
localAnchorA = bodyA.GetLocalPoint(_arg3);
localAnchorB = bodyB.GetLocalPoint(_arg3);
localAxisA = bodyA.GetLocalVector(_arg4);
}
}
}//package Box2D.Dynamics.Joints
Section 87
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
private var K2:b2Mat22;
private var K1:b2Mat22;
private var m_beta:Number;
private var K:b2Mat22;
private var m_target:b2Vec2;
private var m_gamma:Number;
private var m_mass:b2Mat22;
private var m_impulse:b2Vec2;
private var m_localAnchor:b2Vec2;
private var m_C:b2Vec2;
private var m_maxForce:Number;
private var m_dampingRatio:Number;
private var m_frequencyHz:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local4:b2Mat22;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_bodyB.m_xf.position.x);
var _local3:Number = (m_target.y - m_bodyB.m_xf.position.y);
_local4 = m_bodyB.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_beta = 0;
m_gamma = 0;
}
public function SetFrequency(_arg1:Number):void{
m_frequencyHz = _arg1;
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_bodyB.IsAwake() == false){
m_bodyB.SetAwake(true);
};
m_target = _arg1;
}
public function GetFrequency():Number{
return (m_frequencyHz);
}
public function SetMaxForce(_arg1:Number):void{
m_maxForce = _arg1;
}
public function SetDampingRatio(_arg1:Number):void{
m_dampingRatio = _arg1;
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local7:b2Mat22;
var _local11:Number;
var _local12:Number;
var _local2:b2Body = m_bodyB;
var _local3:Number = _local2.GetMass();
var _local4:Number = ((2 * Math.PI) * m_frequencyHz);
var _local5:Number = (((2 * _local3) * m_dampingRatio) * _local4);
var _local6:Number = ((_local3 * _local4) * _local4);
m_gamma = (_arg1.dt * (_local5 + (_arg1.dt * _local6)));
m_gamma = ((m_gamma)!=0) ? (1 / m_gamma) : 0;
m_beta = ((_arg1.dt * _local6) * m_gamma);
_local7 = _local2.m_xf.R;
var _local8:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
var _local10:Number = ((_local7.col1.x * _local8) + (_local7.col2.x * _local9));
_local9 = ((_local7.col1.y * _local8) + (_local7.col2.y * _local9));
_local8 = _local10;
_local11 = _local2.m_invMass;
_local12 = _local2.m_invI;
K1.col1.x = _local11;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local11;
K2.col1.x = ((_local12 * _local9) * _local9);
K2.col2.x = ((-(_local12) * _local8) * _local9);
K2.col1.y = ((-(_local12) * _local8) * _local9);
K2.col2.y = ((_local12 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.GetInverse(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local8) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local9) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
m_impulse.x = (m_impulse.x * _arg1.dtRatio);
m_impulse.y = (m_impulse.y * _arg1.dtRatio);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local11 * m_impulse.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local11 * m_impulse.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * ((_local8 * m_impulse.y) - (_local9 * m_impulse.x))));
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor));
}
override public function GetAnchorA():b2Vec2{
return (m_target);
}
public function GetTarget():b2Vec2{
return (m_target);
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2((_arg1 * m_impulse.x), (_arg1 * m_impulse.y)));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
return (true);
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local2:b2Body = m_bodyB;
_local3 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
var _local8:Number = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
var _local9:Number = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + (m_beta * m_C.x)) + (m_gamma * m_impulse.x));
_local5 = ((_local9 + (m_beta * m_C.y)) + (m_gamma * m_impulse.y));
var _local10:Number = -(((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
var _local11:Number = -(((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
var _local12:Number = m_impulse.x;
var _local13:Number = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
var _local14:Number = (_arg1.dt * m_maxForce);
if (m_impulse.LengthSquared() > (_local14 * _local14)){
m_impulse.Multiply((_local14 / m_impulse.Length()));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local10));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local11));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local11) - (_local7 * _local10))));
}
public function GetMaxForce():Number{
return (m_maxForce);
}
public function GetDampingRatio():Number{
return (m_dampingRatio);
}
}
}//package Box2D.Dynamics.Joints
Section 88
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var target:b2Vec2;
public var maxForce:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
}
}
}//package Box2D.Dynamics.Joints
Section 89
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
private var m_a1:Number;
private var m_a2:Number;
private var m_perp:b2Vec2;
private var m_lowerTranslation:Number;
b2internal var m_localXAxis1:b2Vec2;
private var m_refAngle:Number;
private var m_impulse:b2Vec3;
private var m_enableLimit:Boolean;
private var m_maxMotorForce:Number;
private var m_localYAxis1:b2Vec2;
private var m_s2:Number;
private var m_axis:b2Vec2;
private var m_motorMass:Number;
private var m_s1:Number;
private var m_upperTranslation:Number;
b2internal var m_localAnchor1:b2Vec2;
b2internal var m_localAnchor2:b2Vec2;
private var m_limitState:int;
private var m_motorImpulse:Number;
private var m_motorSpeed:Number;
private var m_enableMotor:Boolean;
private var m_K:b2Mat33;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_axis = new b2Vec2();
m_perp = new b2Vec2();
m_K = new b2Mat33();
m_impulse = new b2Vec3();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchorA);
m_localAnchor2.SetV(_arg1.localAnchorB);
m_localXAxis1.SetV(_arg1.localAxisA);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_impulse.SetZero();
m_motorMass = 0;
m_motorImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
m_limitState = e_inactiveLimit;
m_axis.SetZero();
m_perp.SetZero();
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2Vec3;
var _local20:b2Vec3;
var _local21:Number;
var _local22:Number;
var _local23:b2Vec2;
var _local24:b2Vec2;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
var _local4:b2Vec2 = _local2.m_linearVelocity;
var _local5:Number = _local2.m_angularVelocity;
var _local6:b2Vec2 = _local3.m_linearVelocity;
var _local7:Number = _local3.m_angularVelocity;
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local14 = ((((m_axis.x * (_local6.x - _local4.x)) + (m_axis.y * (_local6.y - _local4.y))) + (m_a2 * _local7)) - (m_a1 * _local5));
_local15 = (m_motorMass * (m_motorSpeed - _local14));
_local16 = m_motorImpulse;
_local17 = (_arg1.dt * m_maxMotorForce);
m_motorImpulse = b2Math.Clamp((m_motorImpulse + _local15), -(_local17), _local17);
_local15 = (m_motorImpulse - _local16);
_local8 = (_local15 * m_axis.x);
_local9 = (_local15 * m_axis.y);
_local10 = (_local15 * m_a1);
_local11 = (_local15 * m_a2);
_local4.x = (_local4.x - (m_invMassA * _local8));
_local4.y = (_local4.y - (m_invMassA * _local9));
_local5 = (_local5 - (m_invIA * _local10));
_local6.x = (_local6.x + (m_invMassB * _local8));
_local6.y = (_local6.y + (m_invMassB * _local9));
_local7 = (_local7 + (m_invIB * _local11));
};
var _local12:Number = ((((m_perp.x * (_local6.x - _local4.x)) + (m_perp.y * (_local6.y - _local4.y))) + (m_s2 * _local7)) - (m_s1 * _local5));
var _local13:Number = (_local7 - _local5);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = ((((m_axis.x * (_local6.x - _local4.x)) + (m_axis.y * (_local6.y - _local4.y))) + (m_a2 * _local7)) - (m_a1 * _local5));
_local19 = m_impulse.Copy();
_local20 = m_K.Solve33(new b2Vec3(), -(_local12), -(_local13), -(_local18));
m_impulse.Add(_local20);
if (m_limitState == e_atLowerLimit){
m_impulse.z = b2Math.Max(m_impulse.z, 0);
} else {
if (m_limitState == e_atUpperLimit){
m_impulse.z = b2Math.Min(m_impulse.z, 0);
};
};
_local21 = (-(_local12) - ((m_impulse.z - _local19.z) * m_K.col3.x));
_local22 = (-(_local13) - ((m_impulse.z - _local19.z) * m_K.col3.y));
_local23 = m_K.Solve22(new b2Vec2(), _local21, _local22);
m_K.Solve22(new b2Vec2(), _local21, _local22).x = (_local23.x + _local19.x);
_local23.y = (_local23.y + _local19.y);
m_impulse.x = _local23.x;
m_impulse.y = _local23.y;
_local20.x = (m_impulse.x - _local19.x);
_local20.y = (m_impulse.y - _local19.y);
_local20.z = (m_impulse.z - _local19.z);
_local8 = ((_local20.x * m_perp.x) + (_local20.z * m_axis.x));
_local9 = ((_local20.x * m_perp.y) + (_local20.z * m_axis.y));
_local10 = (((_local20.x * m_s1) + _local20.y) + (_local20.z * m_a1));
_local11 = (((_local20.x * m_s2) + _local20.y) + (_local20.z * m_a2));
_local4.x = (_local4.x - (m_invMassA * _local8));
_local4.y = (_local4.y - (m_invMassA * _local9));
_local5 = (_local5 - (m_invIA * _local10));
_local6.x = (_local6.x + (m_invMassB * _local8));
_local6.y = (_local6.y + (m_invMassB * _local9));
_local7 = (_local7 + (m_invIB * _local11));
} else {
_local24 = m_K.Solve22(new b2Vec2(), -(_local12), -(_local13));
m_impulse.x = (m_impulse.x + _local24.x);
m_impulse.y = (m_impulse.y + _local24.y);
_local8 = (_local24.x * m_perp.x);
_local9 = (_local24.x * m_perp.y);
_local10 = ((_local24.x * m_s1) + _local24.y);
_local11 = ((_local24.x * m_s2) + _local24.y);
_local4.x = (_local4.x - (m_invMassA * _local8));
_local4.y = (_local4.y - (m_invMassA * _local9));
_local5 = (_local5 - (m_invIA * _local10));
_local6.x = (_local6.x + (m_invMassB * _local8));
_local6.y = (_local6.y + (m_invMassB * _local9));
_local7 = (_local7 + (m_invIB * _local11));
};
_local2.m_linearVelocity.SetV(_local4);
_local2.m_angularVelocity = _local5;
_local3.m_linearVelocity.SetV(_local6);
_local3.m_angularVelocity = _local7;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function EnableMotor(_arg1:Boolean):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_enableMotor = _arg1;
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor2));
}
public function GetJointTranslation():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_bodyA;
var _local2:b2Body = m_bodyB;
var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1);
var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2);
var _local6:Number = (_local5.x - _local4.x);
var _local7:Number = (_local5.y - _local4.y);
var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2((_arg1 * ((m_impulse.x * m_perp.x) + ((m_motorImpulse + m_impulse.z) * m_axis.x))), (_arg1 * ((m_impulse.x * m_perp.y) + ((m_motorImpulse + m_impulse.z) * m_axis.y)))));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Number;
var _local10:b2Mat22;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:b2Vec2;
var _local4:b2Body = m_bodyA;
var _local5:b2Body = m_bodyB;
var _local6:b2Vec2 = _local4.m_sweep.c;
var _local7:Number = _local4.m_sweep.a;
var _local8:b2Vec2 = _local5.m_sweep.c;
var _local9:Number = _local5.m_sweep.a;
var _local16:Number = 0;
var _local17:Number = 0;
var _local18:Boolean;
var _local19:Number = 0;
var _local20:b2Mat22 = b2Mat22.FromAngle(_local7);
var _local21:b2Mat22 = b2Mat22.FromAngle(_local9);
_local10 = _local20;
var _local22:Number = (m_localAnchor1.x - m_localCenterA.x);
var _local23:Number = (m_localAnchor1.y - m_localCenterA.y);
_local11 = ((_local10.col1.x * _local22) + (_local10.col2.x * _local23));
_local23 = ((_local10.col1.y * _local22) + (_local10.col2.y * _local23));
_local22 = _local11;
_local10 = _local21;
var _local24:Number = (m_localAnchor2.x - m_localCenterB.x);
var _local25:Number = (m_localAnchor2.y - m_localCenterB.y);
_local11 = ((_local10.col1.x * _local24) + (_local10.col2.x * _local25));
_local25 = ((_local10.col1.y * _local24) + (_local10.col2.y * _local25));
_local24 = _local11;
var _local26:Number = (((_local8.x + _local24) - _local6.x) - _local22);
var _local27:Number = (((_local8.y + _local25) - _local6.y) - _local23);
if (m_enableLimit){
m_axis = b2Math.MulMV(_local20, m_localXAxis1);
m_a1 = (((_local26 + _local22) * m_axis.y) - ((_local27 + _local23) * m_axis.x));
m_a2 = ((_local24 * m_axis.y) - (_local25 * m_axis.x));
_local35 = ((m_axis.x * _local26) + (m_axis.y * _local27));
if (b2Math.Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
_local19 = b2Math.Clamp(_local35, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local16 = b2Math.Abs(_local35);
_local18 = true;
} else {
if (_local35 <= m_lowerTranslation){
_local19 = b2Math.Clamp(((_local35 - m_lowerTranslation) + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local16 = (m_lowerTranslation - _local35);
_local18 = true;
} else {
if (_local35 >= m_upperTranslation){
_local19 = b2Math.Clamp(((_local35 - m_upperTranslation) + b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local16 = (_local35 - m_upperTranslation);
_local18 = true;
};
};
};
};
m_perp = b2Math.MulMV(_local20, m_localYAxis1);
m_s1 = (((_local26 + _local22) * m_perp.y) - ((_local27 + _local23) * m_perp.x));
m_s2 = ((_local24 * m_perp.y) - (_local25 * m_perp.x));
var _local28:b2Vec3 = new b2Vec3();
var _local29:Number = ((m_perp.x * _local26) + (m_perp.y * _local27));
var _local30:Number = ((_local9 - _local7) - m_refAngle);
_local16 = b2Math.Max(_local16, b2Math.Abs(_local29));
_local17 = b2Math.Abs(_local30);
if (_local18){
_local12 = m_invMassA;
_local13 = m_invMassB;
_local14 = m_invIA;
_local15 = m_invIB;
m_K.col1.x = (((_local12 + _local13) + ((_local14 * m_s1) * m_s1)) + ((_local15 * m_s2) * m_s2));
m_K.col1.y = ((_local14 * m_s1) + (_local15 * m_s2));
m_K.col1.z = (((_local14 * m_s1) * m_a1) + ((_local15 * m_s2) * m_a2));
m_K.col2.x = m_K.col1.y;
m_K.col2.y = (_local14 + _local15);
m_K.col2.z = ((_local14 * m_a1) + (_local15 * m_a2));
m_K.col3.x = m_K.col1.z;
m_K.col3.y = m_K.col2.z;
m_K.col3.z = (((_local12 + _local13) + ((_local14 * m_a1) * m_a1)) + ((_local15 * m_a2) * m_a2));
m_K.Solve33(_local28, -(_local29), -(_local30), -(_local19));
} else {
_local12 = m_invMassA;
_local13 = m_invMassB;
_local14 = m_invIA;
_local15 = m_invIB;
_local36 = (((_local12 + _local13) + ((_local14 * m_s1) * m_s1)) + ((_local15 * m_s2) * m_s2));
_local37 = ((_local14 * m_s1) + (_local15 * m_s2));
_local38 = (_local14 + _local15);
m_K.col1.Set(_local36, _local37, 0);
m_K.col2.Set(_local37, _local38, 0);
_local39 = m_K.Solve22(new b2Vec2(), -(_local29), -(_local30));
_local28.x = _local39.x;
_local28.y = _local39.y;
_local28.z = 0;
};
var _local31:Number = ((_local28.x * m_perp.x) + (_local28.z * m_axis.x));
var _local32:Number = ((_local28.x * m_perp.y) + (_local28.z * m_axis.y));
var _local33:Number = (((_local28.x * m_s1) + _local28.y) + (_local28.z * m_a1));
var _local34:Number = (((_local28.x * m_s2) + _local28.y) + (_local28.z * m_a2));
_local6.x = (_local6.x - (m_invMassA * _local31));
_local6.y = (_local6.y - (m_invMassA * _local32));
_local7 = (_local7 - (m_invIA * _local33));
_local8.x = (_local8.x + (m_invMassB * _local31));
_local8.y = (_local8.y + (m_invMassB * _local32));
_local9 = (_local9 + (m_invIB * _local34));
_local4.m_sweep.a = _local7;
_local5.m_sweep.a = _local9;
_local4.SynchronizeTransform();
_local5.SynchronizeTransform();
return ((((_local16 <= b2Settings.b2_linearSlop)) && ((_local17 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_bodyA;
var _local2:b2Body = m_bodyB;
_local3 = _local1.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
var _local9:Number = (_local1.m_sweep.c.x + _local4);
var _local10:Number = (_local1.m_sweep.c.y + _local5);
var _local11:Number = (_local2.m_sweep.c.x + _local7);
var _local12:Number = (_local2.m_sweep.c.y + _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local16:b2Vec2 = _local1.m_linearVelocity;
var _local17:b2Vec2 = _local2.m_linearVelocity;
var _local18:Number = _local1.m_angularVelocity;
var _local19:Number = _local2.m_angularVelocity;
var _local20:Number = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
m_localCenterA.SetV(_local2.GetLocalCenter());
m_localCenterB.SetV(_local3.GetLocalCenter());
var _local6:b2Transform = _local2.GetTransform();
var _local7:b2Transform = _local3.GetTransform();
_local4 = _local2.m_xf.R;
var _local8:Number = (m_localAnchor1.x - m_localCenterA.x);
var _local9:Number = (m_localAnchor1.y - m_localCenterA.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local4 = _local3.m_xf.R;
var _local10:Number = (m_localAnchor2.x - m_localCenterB.x);
var _local11:Number = (m_localAnchor2.y - m_localCenterB.y);
_local5 = ((_local4.col1.x * _local10) + (_local4.col2.x * _local11));
_local11 = ((_local4.col1.y * _local10) + (_local4.col2.y * _local11));
_local10 = _local5;
var _local12:Number = (((_local3.m_sweep.c.x + _local10) - _local2.m_sweep.c.x) - _local8);
var _local13:Number = (((_local3.m_sweep.c.y + _local11) - _local2.m_sweep.c.y) - _local9);
m_invMassA = _local2.m_invMass;
m_invMassB = _local3.m_invMass;
m_invIA = _local2.m_invI;
m_invIB = _local3.m_invI;
m_axis.SetV(b2Math.MulMV(_local6.R, m_localXAxis1));
m_a1 = (((_local12 + _local8) * m_axis.y) - ((_local13 + _local9) * m_axis.x));
m_a2 = ((_local10 * m_axis.y) - (_local11 * m_axis.x));
m_motorMass = (((m_invMassA + m_invMassB) + ((m_invIA * m_a1) * m_a1)) + ((m_invIB * m_a2) * m_a2));
if (m_motorMass > Number.MIN_VALUE){
m_motorMass = (1 / m_motorMass);
};
m_perp.SetV(b2Math.MulMV(_local6.R, m_localYAxis1));
m_s1 = (((_local12 + _local8) * m_perp.y) - ((_local13 + _local9) * m_perp.x));
m_s2 = ((_local10 * m_perp.y) - (_local11 * m_perp.x));
var _local14:Number = m_invMassA;
var _local15:Number = m_invMassB;
var _local16:Number = m_invIA;
var _local17:Number = m_invIB;
m_K.col1.x = (((_local14 + _local15) + ((_local16 * m_s1) * m_s1)) + ((_local17 * m_s2) * m_s2));
m_K.col1.y = ((_local16 * m_s1) + (_local17 * m_s2));
m_K.col1.z = (((_local16 * m_s1) * m_a1) + ((_local17 * m_s2) * m_a2));
m_K.col2.x = m_K.col1.y;
m_K.col2.y = (_local16 + _local17);
m_K.col2.z = ((_local16 * m_a1) + (_local17 * m_a2));
m_K.col3.x = m_K.col1.z;
m_K.col3.y = m_K.col2.z;
m_K.col3.z = (((_local14 + _local15) + ((_local16 * m_a1) * m_a1)) + ((_local17 * m_a2) * m_a2));
if (m_enableLimit){
_local18 = ((m_axis.x * _local12) + (m_axis.y * _local13));
if (b2Math.Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local18 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitState = e_atLowerLimit;
m_impulse.z = 0;
};
} else {
if (_local18 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitState = e_atUpperLimit;
m_impulse.z = 0;
};
} else {
m_limitState = e_inactiveLimit;
m_impulse.z = 0;
};
};
};
} else {
m_limitState = e_inactiveLimit;
};
if (m_enableMotor == false){
m_motorImpulse = 0;
};
if (_arg1.warmStarting){
m_impulse.x = (m_impulse.x * _arg1.dtRatio);
m_impulse.y = (m_impulse.y * _arg1.dtRatio);
m_motorImpulse = (m_motorImpulse * _arg1.dtRatio);
_local19 = ((m_impulse.x * m_perp.x) + ((m_motorImpulse + m_impulse.z) * m_axis.x));
_local20 = ((m_impulse.x * m_perp.y) + ((m_motorImpulse + m_impulse.z) * m_axis.y));
_local21 = (((m_impulse.x * m_s1) + m_impulse.y) + ((m_motorImpulse + m_impulse.z) * m_a1));
_local22 = (((m_impulse.x * m_s2) + m_impulse.y) + ((m_motorImpulse + m_impulse.z) * m_a2));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (m_invMassA * _local19));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (m_invMassA * _local20));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (m_invIA * _local21));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (m_invMassB * _local19));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (m_invMassB * _local20));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (m_invIB * _local22));
} else {
m_impulse.SetZero();
m_motorImpulse = 0;
};
}
public function GetMotorForce():Number{
return (m_motorImpulse);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_enableLimit = _arg1;
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_impulse.y));
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 90
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2PrismaticJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var motorSpeed:Number;
public var referenceAngle:Number;
public var localAnchorB:b2Vec2;
public var upperTranslation:Number;
public var lowerTranslation:Number;
public var localAxisA:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var maxMotorForce:Number;
public function b2PrismaticJointDef(){
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
localAxisA = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxisA.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
bodyA = _arg1;
bodyB = _arg2;
localAnchorA = bodyA.GetLocalPoint(_arg3);
localAnchorB = bodyB.GetLocalPoint(_arg3);
localAxisA = bodyA.GetLocalVector(_arg4);
referenceAngle = (bodyB.GetAngle() - bodyA.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 91
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
private var m_limitState1:int;
private var m_limitState2:int;
private var m_ground:b2Body;
private var m_maxLength2:Number;
private var m_maxLength1:Number;
private var m_impulse:Number;
private var m_constant:Number;
private var m_state:int;
private var m_ratio:Number;
private var m_groundAnchor1:b2Vec2;
private var m_groundAnchor2:b2Vec2;
private var m_localAnchor1:b2Vec2;
private var m_localAnchor2:b2Vec2;
private var m_limitMass1:Number;
private var m_limitMass2:Number;
private var m_pulleyMass:Number;
private var m_limitImpulse1:Number;
private var m_limitImpulse2:Number;
private var m_u1:b2Vec2;
private var m_u2:b2Vec2;
b2internal static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_bodyA.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchorA.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchorA.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchorB.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchorB.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchorA);
m_localAnchor2.SetV(_arg1.localAnchorB);
m_ratio = _arg1.ratio;
m_constant = (_arg1.lengthA + (m_ratio * _arg1.lengthB));
m_maxLength1 = b2Math.Min(_arg1.maxLengthA, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.Min(_arg1.maxLengthB, ((m_constant - b2_minPulleyLength) / m_ratio));
m_impulse = 0;
m_limitImpulse1 = 0;
m_limitImpulse2 = 0;
}
public function GetGroundAnchorB():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
public function GetGroundAnchorA():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor2));
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchor1));
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2(((_arg1 * m_impulse) * m_u2.x), ((_arg1 * m_impulse) * m_u2.y)));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local4:b2Mat22;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
var _local5:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local6:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local7:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local8:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local24:Number = 0;
if (m_state == e_atUpperLimit){
_local4 = _local2.m_xf.R;
_local9 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local10 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local23 = ((_local4.col1.x * _local9) + (_local4.col2.x * _local10));
_local10 = ((_local4.col1.y * _local9) + (_local4.col2.y * _local10));
_local9 = _local23;
_local4 = _local3.m_xf.R;
_local11 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local23 = ((_local4.col1.x * _local11) + (_local4.col2.x * _local12));
_local12 = ((_local4.col1.y * _local11) + (_local4.col2.y * _local12));
_local11 = _local23;
_local13 = (_local2.m_sweep.c.x + _local9);
_local14 = (_local2.m_sweep.c.y + _local10);
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
m_u1.Set((_local13 - _local5), (_local14 - _local6));
m_u2.Set((_local15 - _local7), (_local16 - _local8));
_local17 = m_u1.Length();
_local18 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local17));
} else {
m_u1.SetZero();
};
if (_local18 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local18));
} else {
m_u2.SetZero();
};
_local19 = ((m_constant - _local17) - (m_ratio * _local18));
_local24 = b2Math.Max(_local24, -(_local19));
_local19 = b2Math.Clamp((_local19 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local20 = (-(m_pulleyMass) * _local19);
_local13 = (-(_local20) * m_u1.x);
_local14 = (-(_local20) * m_u1.y);
_local15 = ((-(m_ratio) * _local20) * m_u2.x);
_local16 = ((-(m_ratio) * _local20) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local13));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local14));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local9 * _local14) - (_local10 * _local13))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local15));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local16));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local11 * _local16) - (_local12 * _local15))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local4 = _local2.m_xf.R;
_local9 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local10 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local23 = ((_local4.col1.x * _local9) + (_local4.col2.x * _local10));
_local10 = ((_local4.col1.y * _local9) + (_local4.col2.y * _local10));
_local9 = _local23;
_local13 = (_local2.m_sweep.c.x + _local9);
_local14 = (_local2.m_sweep.c.y + _local10);
m_u1.Set((_local13 - _local5), (_local14 - _local6));
_local17 = m_u1.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local17));
m_u1.y = (m_u1.y * (1 / _local17));
} else {
m_u1.SetZero();
};
_local19 = (m_maxLength1 - _local17);
_local24 = b2Math.Max(_local24, -(_local19));
_local19 = b2Math.Clamp((_local19 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local20 = (-(m_limitMass1) * _local19);
_local13 = (-(_local20) * m_u1.x);
_local14 = (-(_local20) * m_u1.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local13));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local14));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local9 * _local14) - (_local10 * _local13))));
_local2.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local4 = _local3.m_xf.R;
_local11 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local23 = ((_local4.col1.x * _local11) + (_local4.col2.x * _local12));
_local12 = ((_local4.col1.y * _local11) + (_local4.col2.y * _local12));
_local11 = _local23;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
m_u2.Set((_local15 - _local7), (_local16 - _local8));
_local18 = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local18));
m_u2.y = (m_u2.y * (1 / _local18));
} else {
m_u2.SetZero();
};
_local19 = (m_maxLength2 - _local18);
_local24 = b2Math.Max(_local24, -(_local19));
_local19 = b2Math.Clamp((_local19 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local20 = (-(m_limitMass2) * _local19);
_local15 = (-(_local20) * m_u2.x);
_local16 = (-(_local20) * m_u2.y);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local15));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local16));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local11 * _local16) - (_local12 * _local15))));
_local3.SynchronizeTransform();
};
return ((_local24 < b2Settings.b2_linearSlop));
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local6:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local2 = m_bodyA;
_local3 = m_bodyB;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (_local2.m_sweep.c.x + _local5);
var _local11:Number = (_local2.m_sweep.c.y + _local6);
var _local12:Number = (_local3.m_sweep.c.x + _local8);
var _local13:Number = (_local3.m_sweep.c.y + _local9);
var _local14:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local15:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local16:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local17:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
var _local18:Number = m_u1.Length();
var _local19:Number = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
var _local20:Number = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_impulse = 0;
} else {
m_state = e_atUpperLimit;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitImpulse1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitImpulse2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
};
var _local21:Number = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
var _local22:Number = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
m_limitImpulse1 = (m_limitImpulse1 * _arg1.dtRatio);
m_limitImpulse2 = (m_limitImpulse2 * _arg1.dtRatio);
_local23 = ((-(m_impulse) - m_limitImpulse1) * m_u1.x);
_local24 = ((-(m_impulse) - m_limitImpulse1) * m_u1.y);
_local25 = (((-(m_ratio) * m_impulse) - m_limitImpulse2) * m_u2.x);
_local26 = (((-(m_ratio) * m_impulse) - m_limitImpulse2) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_impulse = 0;
m_limitImpulse1 = 0;
m_limitImpulse2 = 0;
};
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Vec2 = m_bodyB.GetWorldPoint(m_localAnchor2);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = (m_pulleyMass * -(_local18));
_local20 = m_impulse;
m_impulse = b2Math.Max(0, (m_impulse + _local19));
_local19 = (m_impulse - _local20);
_local14 = (-(_local19) * m_u1.x);
_local15 = (-(_local19) * m_u1.y);
_local16 = ((-(m_ratio) * _local19) * m_u2.x);
_local17 = ((-(m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = (-(m_limitMass1) * _local18);
_local20 = m_limitImpulse1;
m_limitImpulse1 = b2Math.Max(0, (m_limitImpulse1 + _local19));
_local19 = (m_limitImpulse1 - _local20);
_local14 = (-(_local19) * m_u1.x);
_local15 = (-(_local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = (-(m_limitMass2) * _local18);
_local20 = m_limitImpulse2;
m_limitImpulse2 = b2Math.Max(0, (m_limitImpulse2 + _local19));
_local19 = (m_limitImpulse2 - _local20);
_local16 = (-(_local19) * m_u2.x);
_local17 = (-(_local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2 = m_bodyA.GetWorldPoint(m_localAnchor1);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
}
}//package Box2D.Dynamics.Joints
Section 92
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2PulleyJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var groundAnchorA:b2Vec2;
public var groundAnchorB:b2Vec2;
public var localAnchorB:b2Vec2;
public var ratio:Number;
public var maxLengthA:Number;
public var lengthA:Number;
public var lengthB:Number;
public var maxLengthB:Number;
public function b2PulleyJointDef(){
groundAnchorA = new b2Vec2();
groundAnchorB = new b2Vec2();
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchorA.Set(-1, 1);
groundAnchorB.Set(1, 1);
localAnchorA.Set(-1, 0);
localAnchorB.Set(1, 0);
lengthA = 0;
maxLengthA = 0;
lengthB = 0;
maxLengthB = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
bodyA = _arg1;
bodyB = _arg2;
groundAnchorA.SetV(_arg3);
groundAnchorB.SetV(_arg4);
localAnchorA = bodyA.GetLocalPoint(_arg5);
localAnchorB = bodyB.GetLocalPoint(_arg6);
var _local8:Number = (_arg5.x - _arg3.x);
var _local9:Number = (_arg5.y - _arg3.y);
lengthA = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
var _local10:Number = (_arg6.x - _arg4.x);
var _local11:Number = (_arg6.y - _arg4.y);
lengthB = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
var _local12:Number = (lengthA + (ratio * lengthB));
maxLengthA = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLengthB = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 93
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
private var m_mass:b2Mat33;
private var m_impulse:b2Vec3;
private var m_enableLimit:Boolean;
private var m_limitState:int;
private var m_motorMass:Number;
private var reduced:b2Vec2;
b2internal var m_localAnchor1:b2Vec2;
b2internal var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
private var m_motorImpulse:Number;
private var impulse2:b2Vec2;
private var impulse3:b2Vec3;
private var m_enableMotor:Boolean;
private var m_referenceAngle:Number;
private var m_upperAngle:Number;
private var m_motorSpeed:Number;
private var m_lowerAngle:Number;
private var m_maxMotorTorque:Number;
private static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
impulse3 = new b2Vec3();
impulse2 = new b2Vec2();
reduced = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_impulse = new b2Vec3();
m_mass = new b2Mat33();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchorA);
m_localAnchor2.SetV(_arg1.localAnchorB);
m_referenceAngle = _arg1.referenceAngle;
m_impulse.SetZero();
m_motorImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
m_limitState = e_inactiveLimit;
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local2:b2Body = m_bodyA;
var _local3:b2Body = m_bodyB;
var _local11:b2Vec2 = _local2.m_linearVelocity;
var _local12:Number = _local2.m_angularVelocity;
var _local13:b2Vec2 = _local3.m_linearVelocity;
var _local14:Number = _local3.m_angularVelocity;
var _local15:Number = _local2.m_invMass;
var _local16:Number = _local3.m_invMass;
var _local17:Number = _local2.m_invI;
var _local18:Number = _local3.m_invI;
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local19 = ((_local14 - _local12) - m_motorSpeed);
_local20 = (m_motorMass * -(_local19));
_local21 = m_motorImpulse;
_local22 = (_arg1.dt * m_maxMotorTorque);
m_motorImpulse = b2Math.Clamp((m_motorImpulse + _local20), -(_local22), _local22);
_local20 = (m_motorImpulse - _local21);
_local12 = (_local12 - (_local17 * _local20));
_local14 = (_local14 + (_local18 * _local20));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local4 = _local2.m_xf.R;
_local7 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local7) + (_local4.col2.x * _local8));
_local8 = ((_local4.col1.y * _local7) + (_local4.col2.y * _local8));
_local7 = _local5;
_local4 = _local3.m_xf.R;
_local9 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local10 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local9) + (_local4.col2.x * _local10));
_local10 = ((_local4.col1.y * _local9) + (_local4.col2.y * _local10));
_local9 = _local5;
_local23 = (((_local13.x + (-(_local14) * _local10)) - _local11.x) - (-(_local12) * _local8));
_local24 = (((_local13.y + (_local14 * _local9)) - _local11.y) - (_local12 * _local7));
_local25 = (_local14 - _local12);
m_mass.Solve33(impulse3, -(_local23), -(_local24), -(_local25));
if (m_limitState == e_equalLimits){
m_impulse.Add(impulse3);
} else {
if (m_limitState == e_atLowerLimit){
_local6 = (m_impulse.z + impulse3.z);
if (_local6 < 0){
m_mass.Solve22(reduced, -(_local23), -(_local24));
impulse3.x = reduced.x;
impulse3.y = reduced.y;
impulse3.z = -(m_impulse.z);
m_impulse.x = (m_impulse.x + reduced.x);
m_impulse.y = (m_impulse.y + reduced.y);
m_impulse.z = 0;
};
} else {
if (m_limitState == e_atUpperLimit){
_local6 = (m_impulse.z + impulse3.z);
if (_local6 > 0){
m_mass.Solve22(reduced, -(_local23), -(_local24));
impulse3.x = reduced.x;
impulse3.y = reduced.y;
impulse3.z = -(m_impulse.z);
m_impulse.x = (m_impulse.x + reduced.x);
m_impulse.y = (m_impulse.y + reduced.y);
m_impulse.z = 0;
};
};
};
};
_local11.x = (_local11.x - (_local15 * impulse3.x));
_local11.y = (_local11.y - (_local15 * impulse3.y));
_local12 = (_local12 - (_local17 * (((_local7 * impulse3.y) - (_local8 * impulse3.x)) + impulse3.z)));
_local13.x = (_local13.x + (_local16 * impulse3.x));
_local13.y = (_local13.y + (_local16 * impulse3.y));
_local14 = (_local14 + (_local18 * (((_local9 * impulse3.y) - (_local10 * impulse3.x)) + impulse3.z)));
} else {
_local4 = _local2.m_xf.R;
_local7 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local7) + (_local4.col2.x * _local8));
_local8 = ((_local4.col1.y * _local7) + (_local4.col2.y * _local8));
_local7 = _local5;
_local4 = _local3.m_xf.R;
_local9 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local10 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local9) + (_local4.col2.x * _local10));
_local10 = ((_local4.col1.y * _local9) + (_local4.col2.y * _local10));
_local9 = _local5;
_local26 = (((_local13.x + (-(_local14) * _local10)) - _local11.x) - (-(_local12) * _local8));
_local27 = (((_local13.y + (_local14 * _local9)) - _local11.y) - (_local12 * _local7));
m_mass.Solve22(impulse2, -(_local26), -(_local27));
m_impulse.x = (m_impulse.x + impulse2.x);
m_impulse.y = (m_impulse.y + impulse2.y);
_local11.x = (_local11.x - (_local15 * impulse2.x));
_local11.y = (_local11.y - (_local15 * impulse2.y));
_local12 = (_local12 - (_local17 * ((_local7 * impulse2.y) - (_local8 * impulse2.x))));
_local13.x = (_local13.x + (_local16 * impulse2.x));
_local13.y = (_local13.y + (_local16 * impulse2.y));
_local14 = (_local14 + (_local18 * ((_local9 * impulse2.y) - (_local10 * impulse2.x))));
};
_local2.m_linearVelocity.SetV(_local11);
_local2.m_angularVelocity = _local12;
_local3.m_linearVelocity.SetV(_local13);
_local3.m_angularVelocity = _local14;
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchor2));
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchor1));
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2((_arg1 * m_impulse.x), (_arg1 * m_impulse.y)));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:b2Mat22;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local5:b2Body = m_bodyA;
var _local6:b2Body = m_bodyB;
var _local7:Number = 0;
var _local8:Number = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local6.m_sweep.a - _local5.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local3 = b2Math.Clamp((_local25 - m_lowerAngle), -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local3);
_local7 = b2Math.Abs(_local3);
} else {
if (m_limitState == e_atLowerLimit){
_local3 = (_local25 - m_lowerAngle);
_local7 = -(_local3);
_local3 = b2Math.Clamp((_local3 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local3);
} else {
if (m_limitState == e_atUpperLimit){
_local3 = (_local25 - m_upperAngle);
_local7 = _local3;
_local3 = b2Math.Clamp((_local3 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local3);
};
};
};
_local5.m_sweep.a = (_local5.m_sweep.a - (_local5.m_invI * _local26));
_local6.m_sweep.a = (_local6.m_sweep.a + (_local6.m_invI * _local26));
_local5.SynchronizeTransform();
_local6.SynchronizeTransform();
};
_local4 = _local5.m_xf.R;
var _local12:Number = (m_localAnchor1.x - _local5.m_sweep.localCenter.x);
var _local13:Number = (m_localAnchor1.y - _local5.m_sweep.localCenter.y);
_local9 = ((_local4.col1.x * _local12) + (_local4.col2.x * _local13));
_local13 = ((_local4.col1.y * _local12) + (_local4.col2.y * _local13));
_local12 = _local9;
_local4 = _local6.m_xf.R;
var _local14:Number = (m_localAnchor2.x - _local6.m_sweep.localCenter.x);
var _local15:Number = (m_localAnchor2.y - _local6.m_sweep.localCenter.y);
_local9 = ((_local4.col1.x * _local14) + (_local4.col2.x * _local15));
_local15 = ((_local4.col1.y * _local14) + (_local4.col2.y * _local15));
_local14 = _local9;
var _local16:Number = (((_local6.m_sweep.c.x + _local14) - _local5.m_sweep.c.x) - _local12);
var _local17:Number = (((_local6.m_sweep.c.y + _local15) - _local5.m_sweep.c.y) - _local13);
var _local18:Number = ((_local16 * _local16) + (_local17 * _local17));
var _local19:Number = Math.sqrt(_local18);
_local8 = _local19;
var _local20:Number = _local5.m_invMass;
var _local21:Number = _local6.m_invMass;
var _local22:Number = _local5.m_invI;
var _local23:Number = _local6.m_invI;
var _local24:Number = (10 * b2Settings.b2_linearSlop);
if (_local18 > (_local24 * _local24)){
_local27 = (_local16 / _local19);
_local28 = (_local17 / _local19);
_local29 = (_local20 + _local21);
_local30 = (1 / _local29);
_local10 = (_local30 * -(_local16));
_local11 = (_local30 * -(_local17));
_local31 = 0.5;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x - ((_local31 * _local20) * _local10));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y - ((_local31 * _local20) * _local11));
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + ((_local31 * _local21) * _local10));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + ((_local31 * _local21) * _local11));
_local16 = (((_local6.m_sweep.c.x + _local14) - _local5.m_sweep.c.x) - _local12);
_local17 = (((_local6.m_sweep.c.y + _local15) - _local5.m_sweep.c.y) - _local13);
};
K1.col1.x = (_local20 + _local21);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local20 + _local21);
K2.col1.x = ((_local22 * _local13) * _local13);
K2.col2.x = ((-(_local22) * _local12) * _local13);
K2.col1.y = ((-(_local22) * _local12) * _local13);
K2.col2.y = ((_local22 * _local12) * _local12);
K3.col1.x = ((_local23 * _local15) * _local15);
K3.col2.x = ((-(_local23) * _local14) * _local15);
K3.col1.y = ((-(_local23) * _local14) * _local15);
K3.col2.y = ((_local23 * _local14) * _local14);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
_local10 = tImpulse.x;
_local11 = tImpulse.y;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x - (_local5.m_invMass * _local10));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y - (_local5.m_invMass * _local11));
_local5.m_sweep.a = (_local5.m_sweep.a - (_local5.m_invI * ((_local12 * _local11) - (_local13 * _local10))));
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_local6.m_invMass * _local10));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_local6.m_invMass * _local11));
_local6.m_sweep.a = (_local6.m_sweep.a + (_local6.m_invI * ((_local14 * _local11) - (_local15 * _local10))));
_local5.SynchronizeTransform();
_local6.SynchronizeTransform();
return ((((_local8 <= b2Settings.b2_linearSlop)) && ((_local7 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
m_motorSpeed = _arg1;
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_bodyB.m_sweep.a - m_bodyA.m_sweep.a) - m_referenceAngle));
}
public function GetJointSpeed():Number{
return ((m_bodyB.m_angularVelocity - m_bodyA.m_angularVelocity));
}
public function GetMotorTorque():Number{
return (m_maxMotorTorque);
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local7:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = m_bodyA;
_local3 = m_bodyB;
if (((m_enableMotor) || (m_enableLimit))){
};
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _local3.m_invI;
m_mass.col1.x = (((_local10 + _local11) + ((_local7 * _local7) * _local12)) + ((_local9 * _local9) * _local13));
m_mass.col2.x = (((-(_local7) * _local6) * _local12) - ((_local9 * _local8) * _local13));
m_mass.col3.x = ((-(_local7) * _local12) - (_local9 * _local13));
m_mass.col1.y = m_mass.col2.x;
m_mass.col2.y = (((_local10 + _local11) + ((_local6 * _local6) * _local12)) + ((_local8 * _local8) * _local13));
m_mass.col3.y = ((_local6 * _local12) + (_local8 * _local13));
m_mass.col1.z = m_mass.col3.x;
m_mass.col2.z = m_mass.col3.y;
m_mass.col3.z = (_local12 + _local13);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorImpulse = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_impulse.z = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_impulse.z = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_impulse.z = 0;
};
};
};
} else {
m_limitState = e_inactiveLimit;
};
if (_arg1.warmStarting){
m_impulse.x = (m_impulse.x * _arg1.dtRatio);
m_impulse.y = (m_impulse.y * _arg1.dtRatio);
m_motorImpulse = (m_motorImpulse * _arg1.dtRatio);
_local15 = m_impulse.x;
_local16 = m_impulse.y;
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local10 * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local10 * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local12 * ((((_local6 * _local16) - (_local7 * _local15)) + m_motorImpulse) + m_impulse.z)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * ((((_local8 * _local16) - (_local9 * _local15)) + m_motorImpulse) + m_impulse.z)));
} else {
m_impulse.SetZero();
m_motorImpulse = 0;
};
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_impulse.z));
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
m_bodyA.SetAwake(true);
m_bodyB.SetAwake(true);
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 94
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2RevoluteJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var referenceAngle:Number;
public var localAnchorB:b2Vec2;
public var motorSpeed:Number;
public var upperAngle:Number;
public var lowerAngle:Number;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var maxMotorTorque:Number;
public function b2RevoluteJointDef(){
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchorA.Set(0, 0);
localAnchorB.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
bodyA = _arg1;
bodyB = _arg2;
localAnchorA = bodyA.GetLocalPoint(_arg3);
localAnchorB = bodyB.GetLocalPoint(_arg3);
referenceAngle = (bodyB.GetAngle() - bodyA.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 95
//b2WeldJoint (Box2D.Dynamics.Joints.b2WeldJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2WeldJoint extends b2Joint {
private var m_impulse:b2Vec3;
private var m_referenceAngle:Number;
private var m_localAnchorA:b2Vec2;
private var m_localAnchorB:b2Vec2;
private var m_mass:b2Mat33;
public function b2WeldJoint(_arg1:b2WeldJointDef){
m_localAnchorA = new b2Vec2();
m_localAnchorB = new b2Vec2();
m_impulse = new b2Vec3();
m_mass = new b2Mat33();
super(_arg1);
m_localAnchorA.SetV(_arg1.localAnchorA);
m_localAnchorB.SetV(_arg1.localAnchorB);
m_referenceAngle = _arg1.referenceAngle;
m_impulse.SetZero();
m_mass = new b2Mat33();
}
override b2internal function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body = m_bodyA;
var _local5:b2Body = m_bodyB;
var _local6:b2Vec2 = _local4.m_linearVelocity;
var _local7:Number = _local4.m_angularVelocity;
var _local8:b2Vec2 = _local5.m_linearVelocity;
var _local9:Number = _local5.m_angularVelocity;
var _local10:Number = _local4.m_invMass;
var _local11:Number = _local5.m_invMass;
var _local12:Number = _local4.m_invI;
var _local13:Number = _local5.m_invI;
_local2 = _local4.m_xf.R;
var _local14:Number = (m_localAnchorA.x - _local4.m_sweep.localCenter.x);
var _local15:Number = (m_localAnchorA.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local14) + (_local2.col2.x * _local15));
_local15 = ((_local2.col1.y * _local14) + (_local2.col2.y * _local15));
_local14 = _local3;
_local2 = _local5.m_xf.R;
var _local16:Number = (m_localAnchorB.x - _local5.m_sweep.localCenter.x);
var _local17:Number = (m_localAnchorB.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local16) + (_local2.col2.x * _local17));
_local17 = ((_local2.col1.y * _local16) + (_local2.col2.y * _local17));
_local16 = _local3;
var _local18:Number = (((_local8.x - (_local9 * _local17)) - _local6.x) + (_local7 * _local15));
var _local19:Number = (((_local8.y + (_local9 * _local16)) - _local6.y) - (_local7 * _local14));
var _local20:Number = (_local9 - _local7);
var _local21:b2Vec3 = new b2Vec3();
m_mass.Solve33(_local21, -(_local18), -(_local19), -(_local20));
m_impulse.Add(_local21);
_local6.x = (_local6.x - (_local10 * _local21.x));
_local6.y = (_local6.y - (_local10 * _local21.y));
_local7 = (_local7 - (_local12 * (((_local14 * _local21.y) - (_local15 * _local21.x)) + _local21.z)));
_local8.x = (_local8.x + (_local11 * _local21.x));
_local8.y = (_local8.y + (_local11 * _local21.y));
_local9 = (_local9 + (_local13 * (((_local16 * _local21.y) - (_local17 * _local21.x)) + _local21.z)));
_local4.m_angularVelocity = _local7;
_local5.m_angularVelocity = _local9;
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_impulse.z));
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2((_arg1 * m_impulse.x), (_arg1 * m_impulse.y)));
}
override b2internal function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body = m_bodyA;
var _local5:b2Body = m_bodyB;
_local2 = _local4.m_xf.R;
var _local6:Number = (m_localAnchorA.x - _local4.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchorA.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
var _local8:Number = (m_localAnchorB.x - _local5.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchorB.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
var _local10:Number = _local4.m_invMass;
var _local11:Number = _local5.m_invMass;
var _local12:Number = _local4.m_invI;
var _local13:Number = _local5.m_invI;
var _local14:Number = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
var _local15:Number = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
var _local16:Number = ((_local5.m_sweep.a - _local4.m_sweep.a) - m_referenceAngle);
var _local17:Number = (10 * b2Settings.b2_linearSlop);
var _local18:Number = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
var _local19:Number = b2Math.Abs(_local16);
if (_local18 > _local17){
_local12 = (_local12 * 1);
_local13 = (_local13 * 1);
};
m_mass.col1.x = (((_local10 + _local11) + ((_local7 * _local7) * _local12)) + ((_local9 * _local9) * _local13));
m_mass.col2.x = (((-(_local7) * _local6) * _local12) - ((_local9 * _local8) * _local13));
m_mass.col3.x = ((-(_local7) * _local12) - (_local9 * _local13));
m_mass.col1.y = m_mass.col2.x;
m_mass.col2.y = (((_local10 + _local11) + ((_local6 * _local6) * _local12)) + ((_local8 * _local8) * _local13));
m_mass.col3.y = ((_local6 * _local12) + (_local8 * _local13));
m_mass.col1.z = m_mass.col3.x;
m_mass.col2.z = m_mass.col3.y;
m_mass.col3.z = (_local12 + _local13);
var _local20:b2Vec3 = new b2Vec3();
m_mass.Solve33(_local20, -(_local14), -(_local15), -(_local16));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x - (_local10 * _local20.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y - (_local10 * _local20.y));
_local4.m_sweep.a = (_local4.m_sweep.a - (_local12 * (((_local6 * _local20.y) - (_local7 * _local20.x)) + _local20.z)));
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_local11 * _local20.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_local11 * _local20.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_local13 * (((_local8 * _local20.y) - (_local9 * _local20.x)) + _local20.z)));
_local4.SynchronizeTransform();
_local5.SynchronizeTransform();
return ((((_local18 <= b2Settings.b2_linearSlop)) && ((_local19 <= b2Settings.b2_angularSlop))));
}
override b2internal function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local4 = m_bodyA;
_local5 = m_bodyB;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchorA.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchorA.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchorB.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchorB.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
_local10 = _local4.m_invMass;
_local11 = _local5.m_invMass;
_local12 = _local4.m_invI;
_local13 = _local5.m_invI;
m_mass.col1.x = (((_local10 + _local11) + ((_local7 * _local7) * _local12)) + ((_local9 * _local9) * _local13));
m_mass.col2.x = (((-(_local7) * _local6) * _local12) - ((_local9 * _local8) * _local13));
m_mass.col3.x = ((-(_local7) * _local12) - (_local9 * _local13));
m_mass.col1.y = m_mass.col2.x;
m_mass.col2.y = (((_local10 + _local11) + ((_local6 * _local6) * _local12)) + ((_local8 * _local8) * _local13));
m_mass.col3.y = ((_local6 * _local12) + (_local8 * _local13));
m_mass.col1.z = m_mass.col3.x;
m_mass.col2.z = m_mass.col3.y;
m_mass.col3.z = (_local12 + _local13);
if (_arg1.warmStarting){
m_impulse.x = (m_impulse.x * _arg1.dtRatio);
m_impulse.y = (m_impulse.y * _arg1.dtRatio);
m_impulse.z = (m_impulse.z * _arg1.dtRatio);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local10 * m_impulse.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local10 * m_impulse.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local12 * (((_local6 * m_impulse.y) - (_local7 * m_impulse.x)) + m_impulse.z)));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local11 * m_impulse.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local11 * m_impulse.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local13 * (((_local8 * m_impulse.y) - (_local9 * m_impulse.x)) + m_impulse.z)));
} else {
m_impulse.SetZero();
};
}
override public function GetAnchorA():b2Vec2{
return (m_bodyA.GetWorldPoint(m_localAnchorA));
}
override public function GetAnchorB():b2Vec2{
return (m_bodyB.GetWorldPoint(m_localAnchorB));
}
}
}//package Box2D.Dynamics.Joints
Section 96
//b2WeldJointDef (Box2D.Dynamics.Joints.b2WeldJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2WeldJointDef extends b2JointDef {
public var localAnchorA:b2Vec2;
public var referenceAngle:Number;
public var localAnchorB:b2Vec2;
public function b2WeldJointDef(){
localAnchorA = new b2Vec2();
localAnchorB = new b2Vec2();
super();
type = b2Joint.e_weldJoint;
referenceAngle = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
bodyA = _arg1;
bodyB = _arg2;
localAnchorA.SetV(bodyA.GetLocalPoint(_arg3));
localAnchorB.SetV(bodyB.GetLocalPoint(_arg3));
referenceAngle = (bodyB.GetAngle() - bodyA.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 97
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Controllers.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Body {
b2internal var m_xf:b2Transform;
b2internal var m_controllerCount:int;
b2internal var m_contactList:b2ContactEdge;
b2internal var m_invI:Number;
b2internal var m_fixtureCount:int;
b2internal var m_torque:Number;
b2internal var m_angularVelocity:Number;
b2internal var m_flags:uint;
b2internal var m_linearVelocity:b2Vec2;
b2internal var m_world:b2World;
b2internal var m_inertiaScale:Number;
b2internal var m_controllerList:b2ControllerEdge;
b2internal var m_fixtureList:b2Fixture;
b2internal var m_mass:Number;
b2internal var m_next:b2Body;
b2internal var m_force:b2Vec2;
b2internal var m_sweep:b2Sweep;
private var m_userData;
b2internal var m_invMass:Number;
b2internal var m_prev:b2Body;
b2internal var m_linearDamping:Number;
b2internal var m_type:int;
b2internal var m_angularDamping:Number;
b2internal var m_islandIndex:int;
b2internal var m_jointList:b2JointEdge;
b2internal var m_sleepTime:Number;
b2internal var m_I:Number;
b2internal static var e_fixedRotationFlag:uint = 16;
public static var b2_kinematicBody:uint = 1;
b2internal static var e_bulletFlag:uint = 8;
b2internal static var e_activeFlag:uint = 32;
b2internal static var e_allowSleepFlag:uint = 4;
b2internal static var e_awakeFlag:uint = 2;
public static var b2_dynamicBody:uint = 2;
b2internal static var e_islandFlag:uint = 1;
private static var s_xf1:b2Transform = new b2Transform();
public static var b2_staticBody:uint = 0;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
m_xf = new b2Transform();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.bullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.awake){
m_flags = (m_flags | e_awakeFlag);
};
if (_arg1.active){
m_flags = (m_flags | e_activeFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetZero();
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_controllerList = null;
m_contactList = null;
m_controllerCount = 0;
m_prev = null;
m_next = null;
m_linearVelocity.SetV(_arg1.linearVelocity);
m_angularVelocity = _arg1.angularVelocity;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_sleepTime = 0;
m_type = _arg1.type;
if (m_type == b2_dynamicBody){
m_mass = 1;
m_invMass = 1;
} else {
m_mass = 0;
m_invMass = 0;
};
m_I = 0;
m_invI = 0;
m_inertiaScale = _arg1.inertiaScale;
m_userData = _arg1.userData;
m_fixtureList = null;
m_fixtureCount = 0;
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
if (m_type == b2_staticBody){
return;
};
m_linearVelocity.SetV(_arg1);
}
public function ResetMassData():void{
var _local4:b2MassData;
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_sweep.localCenter.SetZero();
if ((((m_type == b2_staticBody)) || ((m_type == b2_kinematicBody)))){
return;
};
var _local1:b2Vec2 = b2Vec2.Make(0, 0);
var _local2:b2Fixture = m_fixtureList;
while (_local2) {
if (_local2.m_density == 0){
} else {
_local4 = _local2.GetMassData();
m_mass = (m_mass + _local4.mass);
_local1.x = (_local1.x + (_local4.center.x * _local4.mass));
_local1.y = (_local1.y + (_local4.center.y * _local4.mass));
m_I = (m_I + _local4.I);
};
_local2 = _local2.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local1.x = (_local1.x * m_invMass);
_local1.y = (_local1.y * m_invMass);
} else {
m_mass = 1;
m_invMass = 1;
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local1.x * _local1.x) + (_local1.y * _local1.y))));
m_I = (m_I * m_inertiaScale);
b2Settings.b2Assert((m_I > 0));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
var _local3:b2Vec2 = m_sweep.c.Copy();
m_sweep.localCenter.SetV(_local1);
m_sweep.c0.SetV(b2Math.MulX(m_xf, m_sweep.localCenter));
m_sweep.c.SetV(m_sweep.c0);
m_linearVelocity.x = (m_linearVelocity.x + (m_angularVelocity * -((m_sweep.c.y - _local3.y))));
m_linearVelocity.y = (m_linearVelocity.y + (m_angularVelocity * (m_sweep.c.x - _local3.x)));
}
public function GetMassData(_arg1:b2MassData):void{
_arg1.mass = m_mass;
_arg1.I = m_I;
_arg1.center.SetV(m_sweep.localCenter);
}
public function Merge(_arg1:b2Body):void{
var _local2:b2Fixture;
var _local3:b2Body;
var _local4:b2Body;
var _local11:b2Fixture;
_local2 = _arg1.m_fixtureList;
while (_local2) {
_local11 = _local2.m_next;
_arg1.m_fixtureCount--;
_local2.m_next = m_fixtureList;
m_fixtureList = _local2;
m_fixtureCount++;
_local2.m_body = _local4;
_local2 = _local11;
};
_local3.m_fixtureCount = 0;
_local3 = this;
_local4 = _arg1;
var _local5:b2Vec2 = _local3.GetWorldCenter();
var _local6:b2Vec2 = _local4.GetWorldCenter();
var _local7:b2Vec2 = _local3.GetLinearVelocity().Copy();
var _local8:b2Vec2 = _local4.GetLinearVelocity().Copy();
var _local9:Number = _local3.GetAngularVelocity();
var _local10:Number = _local4.GetAngularVelocity();
_local3.ResetMassData();
SynchronizeFixtures();
}
b2internal function SynchronizeTransform():void{
m_xf.R.Set(m_sweep.a);
var _local1:b2Mat22 = m_xf.R;
var _local2:b2Vec2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function SetMassData(_arg1:b2MassData):void{
b2Settings.b2Assert((m_world.IsLocked() == false));
if (m_world.IsLocked() == true){
return;
};
if (m_type != b2_dynamicBody){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass <= 0){
m_mass = 1;
};
m_invMass = (1 / m_mass);
if ((((_arg1.I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (_arg1.I - (m_mass * ((_arg1.center.x * _arg1.center.x) + (_arg1.center.y * _arg1.center.y))));
m_invI = (1 / m_I);
};
var _local2:b2Vec2 = m_sweep.c.Copy();
m_sweep.localCenter.SetV(_arg1.center);
m_sweep.c0.SetV(b2Math.MulX(m_xf, m_sweep.localCenter));
m_sweep.c.SetV(m_sweep.c0);
m_linearVelocity.x = (m_linearVelocity.x + (m_angularVelocity * -((m_sweep.c.y - _local2.y))));
m_linearVelocity.y = (m_linearVelocity.y + (m_angularVelocity * (m_sweep.c.x - _local2.x)));
}
public function GetDefinition():b2BodyDef{
var _local1:b2BodyDef = new b2BodyDef();
_local1.type = GetType();
_local1.allowSleep = ((m_flags & e_allowSleepFlag) == e_allowSleepFlag);
_local1.angle = GetAngle();
_local1.angularDamping = m_angularDamping;
_local1.angularVelocity = m_angularVelocity;
_local1.fixedRotation = ((m_flags & e_fixedRotationFlag) == e_fixedRotationFlag);
_local1.bullet = ((m_flags & e_bulletFlag) == e_bulletFlag);
_local1.awake = ((m_flags & e_awakeFlag) == e_awakeFlag);
_local1.linearDamping = m_linearDamping;
_local1.linearVelocity.SetV(GetLinearVelocity());
_local1.position = GetPosition();
_local1.userData = GetUserData();
return (_local1);
}
public function GetControllerList():b2ControllerEdge{
return (m_controllerList);
}
public function GetFixtureList():b2Fixture{
return (m_fixtureList);
}
public function SetAngularVelocity(_arg1:Number):void{
if (m_type == b2_staticBody){
return;
};
m_angularVelocity = _arg1;
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (m_type != b2_dynamicBody){
return;
};
if (IsAwake() == false){
SetAwake(true);
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function CreateFixture(_arg1:b2FixtureDef):b2Fixture{
var _local3:IBroadPhase;
if (m_world.IsLocked() == true){
return (null);
};
var _local2:b2Fixture = new b2Fixture();
_local2.Create(this, m_xf, _arg1);
if ((m_flags & e_activeFlag)){
_local3 = m_world.m_contactManager.m_broadPhase;
_local2.CreateProxy(_local3, m_xf);
};
_local2.m_next = m_fixtureList;
m_fixtureList = _local2;
m_fixtureCount++;
_local2.m_body = this;
if (_local2.m_density > 0){
ResetMassData();
};
m_world.m_flags = (m_world.m_flags | b2World.e_newFixture);
return (_local2);
}
public function SetTransform(_arg1:b2Transform):void{
SetPositionAndAngle(_arg1.position, _arg1.GetAngle());
}
public function IsAwake():Boolean{
return (((m_flags & e_awakeFlag) == e_awakeFlag));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.MulMV(m_xf.R, _arg1));
}
b2internal function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetAwake(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_awakeFlag);
m_sleepTime = 0;
} else {
m_flags = (m_flags & ~(e_awakeFlag));
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
};
}
public function GetUserData(){
return (m_userData);
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.MulTMV(m_xf.R, _arg1));
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function CreateFixture2(_arg1:b2Shape, _arg2:Number=0):b2Fixture{
var _local3:b2FixtureDef = new b2FixtureDef();
_local3.shape = _arg1;
_local3.density = _arg2;
return (CreateFixture(_local3));
}
public function GetLinearDamping():Number{
return (m_linearDamping);
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function SetPosition(_arg1:b2Vec2):void{
SetPositionAndAngle(_arg1, GetAngle());
}
private function connectEdges(_arg1:b2EdgeShape, _arg2:b2EdgeShape, _arg3:Number):Number{
var _local4:Number = Math.atan2(_arg2.GetDirectionVector().y, _arg2.GetDirectionVector().x);
var _local5:Number = Math.tan(((_local4 - _arg3) * 0.5));
var _local6:b2Vec2 = b2Math.MulFV(_local5, _arg2.GetDirectionVector());
_local6 = b2Math.SubtractVV(_local6, _arg2.GetNormalVector());
_local6 = b2Math.MulFV(b2Settings.b2_toiSlop, _local6);
_local6 = b2Math.AddVV(_local6, _arg2.GetVertex1());
var _local7:b2Vec2 = b2Math.AddVV(_arg1.GetDirectionVector(), _arg2.GetDirectionVector());
_local7.Normalize();
var _local8 = (b2Math.Dot(_arg1.GetDirectionVector(), _arg2.GetNormalVector()) > 0);
_arg1.SetNextEdge(_arg2, _local6, _local7, _local8);
_arg2.SetPrevEdge(_arg1, _local6, _local7, _local8);
return (_local4);
}
public function GetType():uint{
return (m_type);
}
public function GetAngularDamping():Number{
return (m_angularDamping);
}
public function SetType(_arg1:uint):void{
if (m_type == _arg1){
return;
};
m_type = _arg1;
ResetMassData();
if (m_type == b2_staticBody){
m_linearVelocity.SetZero();
m_angularVelocity = 0;
};
SetAwake(true);
m_force.SetZero();
m_torque = 0;
var _local2:b2ContactEdge = m_contactList;
while (_local2) {
_local2.contact.FlagForFiltering();
_local2 = _local2.next;
};
}
public function SetAngularDamping(_arg1:Number):void{
m_angularDamping = _arg1;
}
public function GetInertia():Number{
return (m_I);
}
public function SetAngle(_arg1:Number):void{
SetPositionAndAngle(GetPosition(), _arg1);
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.MulXT(m_xf, _arg1));
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (m_type != b2_dynamicBody){
return;
};
if (IsAwake() == false){
SetAwake(true);
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetContactList():b2ContactEdge{
return (m_contactList);
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function DestroyFixture(_arg1:b2Fixture):void{
var _local6:b2Contact;
var _local7:b2Fixture;
var _local8:b2Fixture;
var _local9:IBroadPhase;
if (m_world.IsLocked() == true){
return;
};
var _local2:b2Fixture = m_fixtureList;
var _local3:b2Fixture;
var _local4:Boolean;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_fixtureList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
var _local5:b2ContactEdge = m_contactList;
while (_local5) {
_local6 = _local5.contact;
_local5 = _local5.next;
_local7 = _local6.GetFixtureA();
_local8 = _local6.GetFixtureB();
if ((((_arg1 == _local7)) || ((_arg1 == _local8)))){
m_world.m_contactManager.Destroy(_local6);
};
};
if ((m_flags & e_activeFlag)){
_local9 = m_world.m_contactManager.m_broadPhase;
_arg1.DestroyProxy(_local9);
};
_arg1.Destroy();
_arg1.m_body = null;
_arg1.m_next = null;
m_fixtureCount--;
ResetMassData();
}
public function IsSleepingAllowed():Boolean{
return (((m_flags & e_allowSleepFlag) == e_allowSleepFlag));
}
public function GetTransform():b2Transform{
return (m_xf);
}
b2internal function SynchronizeFixtures():void{
var _local4:b2Fixture;
var _local1:b2Transform = s_xf1;
_local1.R.Set(m_sweep.a0);
var _local2:b2Mat22 = _local1.R;
var _local3:b2Vec2 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
var _local5:IBroadPhase = m_world.m_contactManager.m_broadPhase;
_local4 = m_fixtureList;
while (_local4) {
_local4.Synchronize(_local5, _local1, m_xf);
_local4 = _local4.m_next;
};
}
public function SetSleepingAllowed(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
SetAwake(true);
};
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function SetPositionAndAngle(_arg1:b2Vec2, _arg2:Number):void{
var _local3:b2Fixture;
if (m_world.IsLocked() == true){
return;
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
var _local4:b2Mat22 = m_xf.R;
var _local5:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
var _local6:IBroadPhase = m_world.m_contactManager.m_broadPhase;
_local3 = m_fixtureList;
while (_local3) {
_local3.Synchronize(_local6, m_xf, m_xf);
_local3 = _local3.m_next;
};
m_world.m_contactManager.FindNewContacts();
}
public function IsFixedRotation():Boolean{
return (((m_flags & e_fixedRotationFlag) == e_fixedRotationFlag));
}
public function SetActive(_arg1:Boolean):void{
var _local2:IBroadPhase;
var _local3:b2Fixture;
var _local4:b2ContactEdge;
var _local5:b2ContactEdge;
if (_arg1 == IsActive()){
return;
};
if (_arg1){
m_flags = (m_flags | e_activeFlag);
_local2 = m_world.m_contactManager.m_broadPhase;
_local3 = m_fixtureList;
while (_local3) {
_local3.CreateProxy(_local2, m_xf);
_local3 = _local3.m_next;
};
} else {
m_flags = (m_flags & ~(e_activeFlag));
_local2 = m_world.m_contactManager.m_broadPhase;
_local3 = m_fixtureList;
while (_local3) {
_local3.DestroyProxy(_local2);
_local3 = _local3.m_next;
};
_local4 = m_contactList;
while (_local4) {
_local5 = _local4;
_local4 = _local4.next;
m_world.m_contactManager.Destroy(_local5.contact);
};
m_contactList = null;
};
}
public function IsActive():Boolean{
return (((m_flags & e_activeFlag) == e_activeFlag));
}
b2internal function ShouldCollide(_arg1:b2Body):Boolean{
if ((((m_type == b2_staticBody)) && ((_arg1.m_type == b2_staticBody)))){
return (false);
};
var _local2:b2JointEdge = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
if (_local2.joint.m_collideConnected == false){
return (false);
};
};
_local2 = _local2.next;
};
return (true);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function SetFixedRotation(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_fixedRotationFlag);
} else {
m_flags = (m_flags & ~(e_fixedRotationFlag));
};
ResetMassData();
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function Split(_arg1:Function):b2Body{
var _local7:b2Fixture;
var _local13:b2Fixture;
var _local2:b2Vec2 = GetLinearVelocity().Copy();
var _local3:Number = GetAngularVelocity();
var _local4:b2Vec2 = GetWorldCenter();
var _local5:b2Body = this;
var _local6:b2Body = m_world.CreateBody(GetDefinition());
var _local8:b2Fixture = _local5.m_fixtureList;
while (_local8) {
if (_arg1(_local8)){
_local13 = _local8.m_next;
if (_local7){
_local7.m_next = _local13;
} else {
_local5.m_fixtureList = _local13;
};
_local5.m_fixtureCount--;
_local8.m_next = _local6.m_fixtureList;
_local6.m_fixtureList = _local8;
_local6.m_fixtureCount++;
_local8.m_body = _local6;
_local8 = _local13;
} else {
_local7 = _local8;
_local8 = _local8.m_next;
};
};
_local5.ResetMassData();
_local6.ResetMassData();
var _local9:b2Vec2 = _local5.GetWorldCenter();
var _local10:b2Vec2 = _local6.GetWorldCenter();
var _local11:b2Vec2 = b2Math.AddVV(_local2, b2Math.CrossFV(_local3, b2Math.SubtractVV(_local9, _local4)));
var _local12:b2Vec2 = b2Math.AddVV(_local2, b2Math.CrossFV(_local3, b2Math.SubtractVV(_local10, _local4)));
_local5.SetLinearVelocity(_local11);
_local6.SetLinearVelocity(_local12);
_local5.SetAngularVelocity(_local3);
_local6.SetAngularVelocity(_local3);
_local5.SynchronizeFixtures();
_local6.SynchronizeFixtures();
return (_local6);
}
public function SetLinearDamping(_arg1:Number):void{
m_linearDamping = _arg1;
}
public function GetWorld():b2World{
return (m_world);
}
public function ApplyTorque(_arg1:Number):void{
if (m_type != b2_dynamicBody){
return;
};
if (IsAwake() == false){
SetAwake(true);
};
m_torque = (m_torque + _arg1);
}
}
}//package Box2D.Dynamics
Section 98
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
public class b2BodyDef {
public var angularDamping:Number;
public var bullet:Boolean;
public var awake:Boolean;
public var active:Boolean;
public var allowSleep:Boolean;
public var angle:Number;
public var userData;
public var fixedRotation:Boolean;
public var linearDamping:Number;
public var angularVelocity:Number;
public var linearVelocity:b2Vec2;
public var position:b2Vec2;
public var inertiaScale:Number;
public var type:uint;
public function b2BodyDef(){
position = new b2Vec2();
linearVelocity = new b2Vec2();
super();
userData = null;
position.Set(0, 0);
angle = 0;
linearVelocity.Set(0, 0);
angularVelocity = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
awake = true;
fixedRotation = false;
bullet = false;
type = b2Body.b2_staticBody;
active = true;
inertiaScale = 1;
}
}
}//package Box2D.Dynamics
Section 99
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Common.*;
public class b2ContactFilter {
b2internal static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Fixture, _arg2:b2Fixture):Boolean{
var _local3:b2FilterData = _arg1.GetFilterData();
var _local4:b2FilterData = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
public function RayCollide(_arg1, _arg2:b2Fixture):Boolean{
if (!_arg1){
return (true);
};
return (ShouldCollide((_arg1 as b2Fixture), _arg2));
}
}
}//package Box2D.Dynamics
Section 100
//b2ContactImpulse (Box2D.Dynamics.b2ContactImpulse)
package Box2D.Dynamics {
import Box2D.Common.*;
public class b2ContactImpulse {
public var tangentImpulses:Array;
public var normalImpulses:Array;
public function b2ContactImpulse(){
normalImpulses = new Array(b2Settings.b2_maxManifoldPoints);
tangentImpulses = new Array(b2Settings.b2_maxManifoldPoints);
super();
}
}
}//package Box2D.Dynamics
Section 101
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactListener {
b2internal static var b2_defaultListener:b2ContactListener = new (b2ContactListener);
;
public function PreSolve(_arg1:b2Contact, _arg2:b2Manifold):void{
}
public function EndContact(_arg1:b2Contact):void{
}
public function PostSolve(_arg1:b2Contact, _arg2:b2ContactImpulse):void{
}
public function BeginContact(_arg1:b2Contact):void{
}
}
}//package Box2D.Dynamics
Section 102
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactManager {
b2internal var m_world:b2World;
b2internal var m_contactCount:int;
b2internal var m_contactFactory:b2ContactFactory;
b2internal var m_contactFilter:b2ContactFilter;
b2internal var m_broadPhase:IBroadPhase;
b2internal var m_contactList:b2Contact;
b2internal var m_contactListener:b2ContactListener;
b2internal var m_allocator;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_world = null;
m_contactCount = 0;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = b2ContactListener.b2_defaultListener;
m_contactFactory = new b2ContactFactory(m_allocator);
m_broadPhase = new b2DynamicTreeBroadPhase();
}
public function FindNewContacts():void{
m_broadPhase.UpdatePairs(AddPair);
}
public function Destroy(_arg1:b2Contact):void{
var _local2:b2Fixture = _arg1.GetFixtureA();
var _local3:b2Fixture = _arg1.GetFixtureB();
var _local4:b2Body = _local2.GetBody();
var _local5:b2Body = _local3.GetBody();
if (_arg1.IsTouching()){
m_contactListener.EndContact(_arg1);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
if (_arg1.m_nodeA.prev){
_arg1.m_nodeA.prev.next = _arg1.m_nodeA.next;
};
if (_arg1.m_nodeA.next){
_arg1.m_nodeA.next.prev = _arg1.m_nodeA.prev;
};
if (_arg1.m_nodeA == _local4.m_contactList){
_local4.m_contactList = _arg1.m_nodeA.next;
};
if (_arg1.m_nodeB.prev){
_arg1.m_nodeB.prev.next = _arg1.m_nodeB.next;
};
if (_arg1.m_nodeB.next){
_arg1.m_nodeB.next.prev = _arg1.m_nodeB.prev;
};
if (_arg1.m_nodeB == _local5.m_contactList){
_local5.m_contactList = _arg1.m_nodeB.next;
};
m_contactFactory.Destroy(_arg1);
m_contactCount--;
}
public function AddPair(_arg1, _arg2):void{
var _local9:b2Fixture;
var _local10:b2Fixture;
var _local3:b2Fixture = (_arg1 as b2Fixture);
var _local4:b2Fixture = (_arg2 as b2Fixture);
var _local5:b2Body = _local3.GetBody();
var _local6:b2Body = _local4.GetBody();
if (_local5 == _local6){
return;
};
var _local7:b2ContactEdge = _local6.GetContactList();
while (_local7) {
if (_local7.other == _local5){
_local9 = _local7.contact.GetFixtureA();
_local10 = _local7.contact.GetFixtureB();
if ((((_local9 == _local3)) && ((_local10 == _local4)))){
return;
};
if ((((_local9 == _local4)) && ((_local10 == _local3)))){
return;
};
};
_local7 = _local7.next;
};
if (_local6.ShouldCollide(_local5) == false){
return;
};
if (m_contactFilter.ShouldCollide(_local3, _local4) == false){
return;
};
var _local8:b2Contact = m_contactFactory.Create(_local3, _local4);
_local3 = _local8.GetFixtureA();
_local4 = _local8.GetFixtureB();
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local8.m_prev = null;
_local8.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local8;
};
m_world.m_contactList = _local8;
_local8.m_nodeA.contact = _local8;
_local8.m_nodeA.other = _local6;
_local8.m_nodeA.prev = null;
_local8.m_nodeA.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local8.m_nodeA;
};
_local5.m_contactList = _local8.m_nodeA;
_local8.m_nodeB.contact = _local8;
_local8.m_nodeB.other = _local5;
_local8.m_nodeB.prev = null;
_local8.m_nodeB.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local8.m_nodeB;
};
_local6.m_contactList = _local8.m_nodeB;
m_world.m_contactCount++;
}
public function Collide():void{
var _local2:b2Fixture;
var _local3:b2Fixture;
var _local4:b2Body;
var _local5:b2Body;
var _local6:*;
var _local7:*;
var _local8:Boolean;
var _local9:b2Contact;
var _local1:b2Contact = m_world.m_contactList;
while (_local1) {
_local2 = _local1.GetFixtureA();
_local3 = _local1.GetFixtureB();
_local4 = _local2.GetBody();
_local5 = _local3.GetBody();
if ((((_local4.IsAwake() == false)) && ((_local5.IsAwake() == false)))){
_local1 = _local1.GetNext();
} else {
if ((_local1.m_flags & b2Contact.e_filterFlag)){
if (_local5.ShouldCollide(_local4) == false){
_local9 = _local1;
_local1 = _local9.GetNext();
Destroy(_local9);
continue;
};
if (m_contactFilter.ShouldCollide(_local2, _local3) == false){
_local9 = _local1;
_local1 = _local9.GetNext();
Destroy(_local9);
continue;
};
_local1.m_flags = (_local1.m_flags & ~(b2Contact.e_filterFlag));
};
_local6 = _local2.m_proxy;
_local7 = _local3.m_proxy;
_local8 = m_broadPhase.TestOverlap(_local6, _local7);
if (_local8 == false){
_local9 = _local1;
_local1 = _local9.GetNext();
Destroy(_local9);
} else {
_local1.Update(m_contactListener);
_local1 = _local1.GetNext();
};
};
};
}
}
}//package Box2D.Dynamics
Section 103
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Contacts.*;
import flash.display.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2DebugDraw {
private var m_xformScale:Number;// = 1
private var m_fillAlpha:Number;// = 1
private var m_alpha:Number;// = 1
private var m_lineThickness:Number;// = 1
private var m_drawFlags:uint;
b2internal var m_sprite:Sprite;
private var m_drawScale:Number;// = 1
public static var e_centerOfMassBit:uint = 16;
public static var e_shapeBit:uint = 1;
public static var e_aabbBit:uint = 4;
public static var e_controllerBit:uint = 32;
public static var e_pairBit:uint = 8;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawFlags = 0;
}
public function SetDrawScale(_arg1:Number):void{
m_drawScale = _arg1;
}
public function GetFillAlpha():Number{
return (m_fillAlpha);
}
public function GetAlpha():Number{
return (m_alpha);
}
public function GetLineThickness():Number{
return (m_lineThickness);
}
public function GetDrawScale():Number{
return (m_drawScale);
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function GetSprite():Sprite{
return (m_sprite);
}
public function GetXFormScale():Number{
return (m_xformScale);
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function SetSprite(_arg1:Sprite):void{
m_sprite = _arg1;
}
public function DrawTransform(_arg1:b2Transform):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function SetXFormScale(_arg1:Number):void{
m_xformScale = _arg1;
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
public function SetFillAlpha(_arg1:Number):void{
m_fillAlpha = _arg1;
}
public function SetAlpha(_arg1:Number):void{
m_alpha = _arg1;
}
public function SetLineThickness(_arg1:Number):void{
m_lineThickness = _arg1;
}
}
}//package Box2D.Dynamics
Section 104
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeFixture(_arg1:b2Fixture):void{
}
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 105
//b2FilterData (Box2D.Dynamics.b2FilterData)
package Box2D.Dynamics {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function Copy():b2FilterData{
var _local1:b2FilterData = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Dynamics
Section 106
//b2Fixture (Box2D.Dynamics.b2Fixture)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Fixture {
b2internal var m_next:b2Fixture;
b2internal var m_shape:b2Shape;
b2internal var m_restitution:Number;
b2internal var m_friction:Number;
b2internal var m_proxy;
b2internal var m_filter:b2FilterData;
b2internal var m_density:Number;
private var m_massData:b2MassData;
b2internal var m_isSensor:Boolean;
b2internal var m_userData;
b2internal var m_aabb:b2AABB;
b2internal var m_body:b2Body;
public function b2Fixture(){
m_filter = new b2FilterData();
super();
m_aabb = new b2AABB();
m_userData = null;
m_body = null;
m_next = null;
m_shape = null;
m_density = 0;
m_friction = 0;
m_restitution = 0;
}
public function TestPoint(_arg1:b2Vec2):Boolean{
return (m_shape.TestPoint(m_body.GetTransform(), _arg1));
}
public function SetDensity(_arg1:Number):void{
m_density = _arg1;
}
public function SetRestitution(_arg1:Number):void{
m_restitution = _arg1;
}
public function GetNext():b2Fixture{
return (m_next);
}
public function GetShape():b2Shape{
return (m_shape);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetDensity():Number{
return (m_density);
}
public function GetMassData(_arg1:b2MassData=null):b2MassData{
if (_arg1 == null){
_arg1 = new b2MassData();
};
m_shape.ComputeMass(_arg1, m_density);
return (_arg1);
}
public function GetAABB():b2AABB{
return (m_aabb);
}
public function GetType():int{
return (m_shape.GetType());
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
b2internal function Destroy():void{
m_shape = null;
}
public function GetRestitution():Number{
return (m_restitution);
}
public function SetFriction(_arg1:Number):void{
m_friction = _arg1;
}
b2internal function Create(_arg1:b2Body, _arg2:b2Transform, _arg3:b2FixtureDef):void{
m_userData = _arg3.userData;
m_friction = _arg3.friction;
m_restitution = _arg3.restitution;
m_body = _arg1;
m_next = null;
m_filter = _arg3.filter.Copy();
m_isSensor = _arg3.isSensor;
m_shape = _arg3.shape.Copy();
m_density = _arg3.density;
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function RayCast(_arg1:b2RayCastOutput, _arg2:b2RayCastInput):Boolean{
return (m_shape.RayCast(_arg1, _arg2, m_body.GetTransform()));
}
public function GetUserData(){
return (m_userData);
}
b2internal function Synchronize(_arg1:IBroadPhase, _arg2:b2Transform, _arg3:b2Transform):void{
if (!m_proxy){
return;
};
var _local4:b2AABB = new b2AABB();
var _local5:b2AABB = new b2AABB();
m_shape.ComputeAABB(_local4, _arg2);
m_shape.ComputeAABB(_local5, _arg3);
m_aabb.Combine(_local4, _local5);
var _local6:b2Vec2 = b2Math.SubtractVV(_arg3.position, _arg2.position);
_arg1.MoveProxy(m_proxy, m_aabb, _local6);
}
b2internal function CreateProxy(_arg1:IBroadPhase, _arg2:b2Transform):void{
m_shape.ComputeAABB(m_aabb, _arg2);
m_proxy = _arg1.CreateProxy(m_aabb, this);
}
public function SetFilterData(_arg1:b2FilterData):void{
var _local3:b2Contact;
var _local4:b2Fixture;
var _local5:b2Fixture;
m_filter = _arg1.Copy();
if (m_body){
return;
};
var _local2:b2ContactEdge = m_body.GetContactList();
while (_local2) {
_local3 = _local2.contact;
_local4 = _local3.GetFixtureA();
_local5 = _local3.GetFixtureB();
if ((((_local4 == this)) || ((_local5 == this)))){
_local3.FlagForFiltering();
};
_local2 = _local2.next;
};
}
b2internal function DestroyProxy(_arg1:IBroadPhase):void{
if (m_proxy == null){
return;
};
_arg1.DestroyProxy(m_proxy);
m_proxy = null;
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody():b2Body{
return (m_body);
}
public function SetSensor(_arg1:Boolean):void{
var _local3:b2Contact;
var _local4:b2Fixture;
var _local5:b2Fixture;
if (m_isSensor == _arg1){
return;
};
m_isSensor = _arg1;
if (m_body == null){
return;
};
var _local2:b2ContactEdge = m_body.GetContactList();
while (_local2) {
_local3 = _local2.contact;
_local4 = _local3.GetFixtureA();
_local5 = _local3.GetFixtureB();
if ((((_local4 == this)) || ((_local5 == this)))){
_local3.SetSensor(((_local4.IsSensor()) || (_local5.IsSensor())));
};
_local2 = _local2.next;
};
}
}
}//package Box2D.Dynamics
Section 107
//b2FixtureDef (Box2D.Dynamics.b2FixtureDef)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2FixtureDef {
public var shape:b2Shape;
public var isSensor:Boolean;
public var density:Number;
public var restitution:Number;
public var userData;
public var filter:b2FilterData;
public var friction:Number;
public function b2FixtureDef(){
filter = new b2FilterData();
super();
shape = null;
userData = null;
friction = 0.2;
restitution = 0;
density = 0;
filter.categoryBits = 1;
filter.maskBits = 0xFFFF;
filter.groupIndex = 0;
isSensor = false;
}
}
}//package Box2D.Dynamics
Section 108
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Island {
private var m_contactSolver:b2ContactSolver;
private var m_listener:b2ContactListener;
private var m_bodyCapacity:int;
b2internal var m_bodies:Array;
b2internal var m_bodyCount:int;
b2internal var m_jointCapacity:int;
b2internal var m_contactCount:int;
b2internal var m_contacts:Array;
b2internal var m_contactCapacity:int;
b2internal var m_jointCount:int;
private var m_allocator;
b2internal var m_joints:Array;
private static var s_impulse:b2ContactImpulse = new b2ContactImpulse();
public function b2Island(){
m_bodies = new Array();
m_contacts = new Array();
m_joints = new Array();
}
public function AddBody(_arg1:b2Body):void{
_arg1.m_islandIndex = m_bodyCount;
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local3:b2Contact;
var _local4:b2ContactConstraint;
var _local5:int;
if (m_listener == null){
return;
};
var _local2:int;
while (_local2 < m_contactCount) {
_local3 = m_contacts[_local2];
_local4 = _arg1[_local2];
_local5 = 0;
while (_local5 < _local4.pointCount) {
s_impulse.normalImpulses[_local5] = _local4.points[_local5].normalImpulse;
s_impulse.tangentImpulses[_local5] = _local4.points[_local5].tangentImpulse;
_local5++;
};
m_listener.PostSolve(_local3, s_impulse);
_local2++;
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean):void{
var _local4:int;
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local4 = 0;
while (_local4 < m_bodyCount) {
_local6 = m_bodies[_local4];
if (_local6.GetType() != b2Body.b2_dynamicBody){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_linearVelocity.Multiply(b2Math.Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
};
_local4++;
};
m_contactSolver.Initialize(_arg1, m_contacts, m_contactCount, m_allocator);
var _local8:b2ContactSolver = m_contactSolver;
_local8.InitVelocityConstraints(_arg1);
_local4 = 0;
while (_local4 < m_jointCount) {
_local7 = m_joints[_local4];
_local7.InitVelocityConstraints(_arg1);
_local4++;
};
_local4 = 0;
while (_local4 < _arg1.velocityIterations) {
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.SolveVelocityConstraints(_arg1);
_local5++;
};
_local8.SolveVelocityConstraints();
_local4++;
};
_local4 = 0;
while (_local4 < m_jointCount) {
_local7 = m_joints[_local4];
_local7.FinalizeVelocityConstraints();
_local4++;
};
_local8.FinalizeVelocityConstraints();
_local4 = 0;
while (_local4 < m_bodyCount) {
_local6 = m_bodies[_local4];
if (_local6.GetType() == b2Body.b2_staticBody){
} else {
_local9 = (_arg1.dt * _local6.m_linearVelocity.x);
_local10 = (_arg1.dt * _local6.m_linearVelocity.y);
if (((_local9 * _local9) + (_local10 * _local10)) > b2Settings.b2_maxTranslationSquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * (b2Settings.b2_maxTranslation * _arg1.inv_dt));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * (b2Settings.b2_maxTranslation * _arg1.inv_dt));
};
_local11 = (_arg1.dt * _local6.m_angularVelocity);
if (((_arg1.dt * _local6.m_angularVelocity) * _local11) > b2Settings.b2_maxRotationSquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = (-(b2Settings.b2_maxRotation) * _arg1.inv_dt);
} else {
_local6.m_angularVelocity = (b2Settings.b2_maxRotation * _arg1.inv_dt);
};
};
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local4++;
};
_local4 = 0;
while (_local4 < _arg1.positionIterations) {
_local12 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local13 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local14 = _local7.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local13 = ((_local13) && (_local14));
_local5++;
};
if (((_local12) && (_local13))){
break;
};
_local4++;
};
Report(_local8.m_constraints);
if (_arg3){
_local15 = Number.MAX_VALUE;
_local16 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local17 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local4 = 0;
while (_local4 < m_bodyCount) {
_local6 = m_bodies[_local4];
if (_local6.GetType() == b2Body.b2_staticBody){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local15 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local17)))) || ((b2Math.Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local16)))){
_local6.m_sleepTime = 0;
_local15 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local15 = b2Math.Min(_local15, _local6.m_sleepTime);
};
};
_local4++;
};
if (_local15 >= b2Settings.b2_timeToSleep){
_local4 = 0;
while (_local4 < m_bodyCount) {
_local6 = m_bodies[_local4];
_local6.SetAwake(false);
_local4++;
};
};
};
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:int;
var _local6:b2Body;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
m_contactSolver.Initialize(_arg1, m_contacts, m_contactCount, m_allocator);
var _local4:b2ContactSolver = m_contactSolver;
_local2 = 0;
while (_local2 < m_jointCount) {
m_joints[_local2].InitVelocityConstraints(_arg1);
_local2++;
};
_local2 = 0;
while (_local2 < _arg1.velocityIterations) {
_local4.SolveVelocityConstraints();
_local3 = 0;
while (_local3 < m_jointCount) {
m_joints[_local3].SolveVelocityConstraints(_arg1);
_local3++;
};
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local6 = m_bodies[_local2];
if (_local6.GetType() == b2Body.b2_staticBody){
} else {
_local7 = (_arg1.dt * _local6.m_linearVelocity.x);
_local8 = (_arg1.dt * _local6.m_linearVelocity.y);
if (((_local7 * _local7) + (_local8 * _local8)) > b2Settings.b2_maxTranslationSquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * (b2Settings.b2_maxTranslation * _arg1.inv_dt));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * (b2Settings.b2_maxTranslation * _arg1.inv_dt));
};
_local9 = (_arg1.dt * _local6.m_angularVelocity);
if (((_arg1.dt * _local6.m_angularVelocity) * _local9) > b2Settings.b2_maxRotationSquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = (-(b2Settings.b2_maxRotation) * _arg1.inv_dt);
} else {
_local6.m_angularVelocity = (b2Settings.b2_maxRotation * _arg1.inv_dt);
};
};
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local2++;
};
var _local5:Number = 0.75;
_local2 = 0;
while (_local2 < _arg1.positionIterations) {
_local10 = _local4.SolvePositionConstraints(_local5);
_local11 = true;
_local3 = 0;
while (_local3 < m_jointCount) {
_local12 = m_joints[_local3].SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = ((_local11) && (_local12));
_local3++;
};
if (((_local10) && (_local11))){
break;
};
_local2++;
};
Report(_local4.m_constraints);
}
public function Initialize(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener, _arg6:b2ContactSolver):void{
var _local7:int;
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_contactSolver = _arg6;
_local7 = m_bodies.length;
while (_local7 < _arg1) {
m_bodies[_local7] = null;
_local7++;
};
_local7 = m_contacts.length;
while (_local7 < _arg2) {
m_contacts[_local7] = null;
_local7++;
};
_local7 = m_joints.length;
while (_local7 < _arg3) {
m_joints[_local7] = null;
_local7++;
};
}
}
}//package Box2D.Dynamics
Section 109
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var inv_dt:Number;
public var dt:Number;
public var velocityIterations:int;
public var dtRatio:Number;
public var positionIterations:int;
public function Set(_arg1:b2TimeStep):void{
dt = _arg1.dt;
inv_dt = _arg1.inv_dt;
positionIterations = _arg1.positionIterations;
velocityIterations = _arg1.velocityIterations;
warmStarting = _arg1.warmStarting;
}
}
}//package Box2D.Dynamics
Section 110
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Controllers.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2World {
private var m_inv_dt0:Number;
private var m_contactSolver:b2ContactSolver;
private var m_controllerList:b2Controller;
b2internal var m_contactList:b2Contact;
private var m_controllerCount:int;
private var m_allowSleep:Boolean;
private var m_island:b2Island;
b2internal var m_flags:int;
private var m_jointCount:int;
private var m_bodyCount:int;
private var s_stack:Array;
private var m_destructionListener:b2DestructionListener;
b2internal var m_groundBody:b2Body;
b2internal var m_contactCount:int;
private var m_debugDraw:b2DebugDraw;
b2internal var m_bodyList:b2Body;
private var m_jointList:b2Joint;
private var m_gravity:b2Vec2;
b2internal var m_contactManager:b2ContactManager;
public static const e_newFixture:int = 1;
public static const e_locked:int = 2;
private static var s_timestep:b2TimeStep = new b2TimeStep();
private static var s_queue:Array = new Array();
private static var s_timestep2:b2TimeStep = new b2TimeStep();
private static var s_backupA:b2Sweep = new b2Sweep();
private static var m_continuousPhysics:Boolean;
private static var m_warmStarting:Boolean;
private static var s_xf:b2Transform = new b2Transform();
private static var s_backupB:b2Sweep = new b2Sweep();
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public function b2World(_arg1:b2Vec2, _arg2:Boolean){
s_stack = new Array();
m_contactManager = new b2ContactManager();
m_contactSolver = new b2ContactSolver();
m_island = new b2Island();
super();
m_destructionListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_controllerList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_controllerCount = 0;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg2;
m_gravity = _arg1;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
var _local3:b2BodyDef = new b2BodyDef();
m_groundBody = CreateBody(_local3);
}
b2internal function DrawJoint(_arg1:b2Joint):void{
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local2:b2Body = _arg1.GetBodyA();
var _local3:b2Body = _arg1.GetBodyB();
var _local4:b2Transform = _local2.m_xf;
var _local5:b2Transform = _local3.m_xf;
var _local6:b2Vec2 = _local4.position;
var _local7:b2Vec2 = _local5.position;
var _local8:b2Vec2 = _arg1.GetAnchorA();
var _local9:b2Vec2 = _arg1.GetAnchorB();
var _local10:b2Color = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchorA();
_local13 = _local11.GetGroundAnchorB();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function RayCastAll(_arg1:b2Vec2, _arg2:b2Vec2):Array{
var result:Array;
var RayCastAllWrapper:Function;
var point1 = _arg1;
var point2 = _arg2;
RayCastAllWrapper = function (_arg1:b2Fixture, _arg2:b2Vec2, _arg3:b2Vec2, _arg4:Number):Number{
result[result.length] = _arg1;
return (1);
};
result = new Array();
RayCast(RayCastAllWrapper, point1, point2);
return (result);
}
public function QueryAABB(_arg1:Function, _arg2:b2AABB):void{
var broadPhase:IBroadPhase;
var WorldQueryWrapper:Function;
var callback = _arg1;
var aabb = _arg2;
WorldQueryWrapper = function (_arg1):Boolean{
return (callback(broadPhase.GetUserData(_arg1)));
};
broadPhase = m_contactManager.m_broadPhase;
broadPhase.Query(WorldQueryWrapper, aabb);
}
public function GetJointCount():int{
return (m_jointCount);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_contactManager.m_broadPhase.GetProxyCount());
}
public function DrawDebugData():void{
var _local2:int;
var _local3:b2Body;
var _local4:b2Fixture;
var _local5:b2Shape;
var _local6:b2Joint;
var _local7:IBroadPhase;
var _local11:b2Transform;
var _local16:b2Controller;
var _local17:b2Contact;
var _local18:b2Fixture;
var _local19:b2Fixture;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2AABB;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
var _local1:uint = m_debugDraw.GetFlags();
var _local8:b2Vec2 = new b2Vec2();
var _local9:b2Vec2 = new b2Vec2();
var _local10:b2Vec2 = new b2Vec2();
var _local12:b2AABB = new b2AABB();
var _local13:b2AABB = new b2AABB();
var _local14:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
var _local15:b2Color = new b2Color(0, 0, 0);
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetFixtureList();
while (_local4) {
_local5 = _local4.GetShape();
if (_local3.IsActive() == false){
_local15.Set(0.5, 0.5, 0.3);
DrawShape(_local5, _local11, _local15);
} else {
if (_local3.GetType() == b2Body.b2_staticBody){
_local15.Set(0.5, 0.9, 0.5);
DrawShape(_local5, _local11, _local15);
} else {
if (_local3.GetType() == b2Body.b2_kinematicBody){
_local15.Set(0.5, 0.5, 0.9);
DrawShape(_local5, _local11, _local15);
} else {
if (_local3.IsAwake() == false){
_local15.Set(0.6, 0.6, 0.6);
DrawShape(_local5, _local11, _local15);
} else {
_local15.Set(0.9, 0.7, 0.7);
DrawShape(_local5, _local11, _local15);
};
};
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local6 = m_jointList;
while (_local6) {
DrawJoint(_local6);
_local6 = _local6.m_next;
};
};
if ((_local1 & b2DebugDraw.e_controllerBit)){
_local16 = m_controllerList;
while (_local16) {
_local16.Draw(m_debugDraw);
_local16 = _local16.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local15.Set(0.3, 0.9, 0.9);
_local17 = m_contactManager.m_contactList;
while (_local17) {
_local18 = _local17.GetFixtureA();
_local19 = _local17.GetFixtureB();
_local20 = _local18.GetAABB().GetCenter();
_local21 = _local19.GetAABB().GetCenter();
m_debugDraw.DrawSegment(_local20, _local21, _local15);
_local17 = _local17.GetNext();
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local7 = m_contactManager.m_broadPhase;
_local14 = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
_local3 = m_bodyList;
while (_local3) {
if (_local3.IsActive() == false){
} else {
_local4 = _local3.GetFixtureList();
while (_local4) {
_local22 = _local7.GetFatAABB(_local4.m_proxy);
_local14[0].Set(_local22.lowerBound.x, _local22.lowerBound.y);
_local14[1].Set(_local22.upperBound.x, _local22.lowerBound.y);
_local14[2].Set(_local22.upperBound.x, _local22.upperBound.y);
_local14[3].Set(_local22.lowerBound.x, _local22.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local15);
_local4 = _local4.GetNext();
};
};
_local3 = _local3.GetNext();
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawTransform(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local6:b2JointEdge;
var _local7:b2ControllerEdge;
var _local8:b2ContactEdge;
var _local9:b2Fixture;
if (IsLocked() == true){
return;
};
var _local2:b2JointEdge = _arg1.m_jointList;
while (_local2) {
_local6 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local6.joint);
};
DestroyJoint(_local6.joint);
};
var _local3:b2ControllerEdge = _arg1.m_controllerList;
while (_local3) {
_local7 = _local3;
_local3 = _local3.nextController;
_local7.controller.RemoveBody(_arg1);
};
var _local4:b2ContactEdge = _arg1.m_contactList;
while (_local4) {
_local8 = _local4;
_local4 = _local4.next;
m_contactManager.Destroy(_local8.contact);
};
_arg1.m_contactList = null;
var _local5:b2Fixture = _arg1.m_fixtureList;
while (_local5) {
_local9 = _local5;
_local5 = _local5.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeFixture(_local9);
};
_local9.DestroyProxy(m_contactManager.m_broadPhase);
_local9.Destroy();
};
_arg1.m_fixtureList = null;
_arg1.m_fixtureCount = 0;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
b2internal function DrawShape(_arg1:b2Shape, _arg2:b2Transform, _arg3:b2Color):void{
var _local4:b2CircleShape;
var _local5:b2Vec2;
var _local6:Number;
var _local7:b2Vec2;
var _local8:int;
var _local9:b2PolygonShape;
var _local10:int;
var _local11:Array;
var _local12:Array;
var _local13:b2EdgeShape;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local4 = (_arg1 as b2CircleShape);
_local5 = b2Math.MulX(_arg2, _local4.m_p);
_local6 = _local4.m_radius;
_local7 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local5, _local6, _local7, _arg3);
break;
case b2Shape.e_polygonShape:
_local9 = (_arg1 as b2PolygonShape);
_local10 = _local9.GetVertexCount();
_local11 = _local9.GetVertices();
_local12 = new Array(_local10);
_local8 = 0;
while (_local8 < _local10) {
_local12[_local8] = b2Math.MulX(_arg2, _local11[_local8]);
_local8++;
};
m_debugDraw.DrawSolidPolygon(_local12, _local10, _arg3);
break;
case b2Shape.e_edgeShape:
_local13 = (_arg1 as b2EdgeShape);
m_debugDraw.DrawSegment(b2Math.MulX(_arg2, _local13.GetVertex1()), b2Math.MulX(_arg2, _local13.GetVertex2()), _arg3);
break;
};
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DestroyController(_arg1:b2Controller):void{
_arg1.Clear();
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1 == m_controllerList){
m_controllerList = _arg1.m_next;
};
m_controllerCount--;
}
b2internal function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local10:int;
var _local11:int;
var _local12:b2Body;
var _local13:b2ContactEdge;
var _local14:b2JointEdge;
var _local3:b2Controller = m_controllerList;
while (_local3) {
_local3.Step(_arg1);
_local3 = _local3.m_next;
};
var _local4:b2Island = m_island;
_local4.Initialize(m_bodyCount, m_contactCount, m_jointCount, null, m_contactManager.m_contactListener, m_contactSolver);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
var _local5:b2Contact = m_contactList;
while (_local5) {
_local5.m_flags = (_local5.m_flags & ~(b2Contact.e_islandFlag));
_local5 = _local5.m_next;
};
var _local6:b2Joint = m_jointList;
while (_local6) {
_local6.m_islandFlag = false;
_local6 = _local6.m_next;
};
var _local7:int = m_bodyCount;
var _local8:Array = s_stack;
var _local9:b2Body = m_bodyList;
while (_local9) {
if ((_local9.m_flags & b2Body.e_islandFlag)){
} else {
if ((((_local9.IsAwake() == false)) || ((_local9.IsActive() == false)))){
} else {
if (_local9.GetType() == b2Body.b2_staticBody){
} else {
_local4.Clear();
_local10 = 0;
var _temp1 = _local10;
_local10 = (_local10 + 1);
var _local15 = _temp1;
_local8[_local15] = _local9;
_local9.m_flags = (_local9.m_flags | b2Body.e_islandFlag);
while (_local10 > 0) {
--_local10;
_local2 = _local8[_local10];
_local4.AddBody(_local2);
if (_local2.IsAwake() == false){
_local2.SetAwake(true);
};
if (_local2.GetType() == b2Body.b2_staticBody){
} else {
_local13 = _local2.m_contactList;
while (_local13) {
if ((_local13.contact.m_flags & b2Contact.e_islandFlag)){
} else {
if ((((((((_local13.contact.IsSensor() == true)) || ((_local13.contact.IsEnabled() == false)))) || ((_local13.contact.IsTouching() == false)))) || ((_local13.contact.IsKinematic() == true)))){
} else {
_local4.AddContact(_local13.contact);
_local13.contact.m_flags = (_local13.contact.m_flags | b2Contact.e_islandFlag);
_local12 = _local13.other;
if ((_local12.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local10;
_local10 = (_local10 + 1);
var _local16 = _temp2;
_local8[_local16] = _local12;
_local12.m_flags = (_local12.m_flags | b2Body.e_islandFlag);
};
};
};
_local13 = _local13.next;
};
_local14 = _local2.m_jointList;
while (_local14) {
if (_local14.joint.m_islandFlag == true){
} else {
_local12 = _local14.other;
if (_local12.IsActive() == false){
} else {
_local4.AddJoint(_local14.joint);
_local14.joint.m_islandFlag = true;
if ((_local12.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local10;
_local10 = (_local10 + 1);
_local16 = _temp3;
_local8[_local16] = _local12;
_local12.m_flags = (_local12.m_flags | b2Body.e_islandFlag);
};
};
};
_local14 = _local14.next;
};
};
};
_local4.Solve(_arg1, m_gravity, m_allowSleep);
_local11 = 0;
while (_local11 < _local4.m_bodyCount) {
_local2 = _local4.m_bodies[_local11];
if (_local2.GetType() == b2Body.b2_staticBody){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local11++;
};
};
};
};
_local9 = _local9.m_next;
};
_local11 = 0;
while (_local11 < _local8.length) {
if (!_local8[_local11]){
break;
};
_local8[_local11] = null;
_local11++;
};
_local2 = m_bodyList;
while (_local2) {
if ((((_local2.IsAwake() == false)) || ((_local2.IsActive() == false)))){
} else {
if (_local2.GetType() == b2Body.b2_staticBody){
} else {
_local2.SynchronizeFixtures();
};
};
_local2 = _local2.m_next;
};
m_contactManager.FindNewContacts();
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactManager.m_contactFilter = _arg1;
}
b2internal function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Fixture;
var _local4:b2Fixture;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local8:b2Joint;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:int;
var _local17:b2TimeStep;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:b2JointEdge;
var _local22:b2Body;
var _local9:b2Island = m_island;
_local9.Initialize(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, b2Settings.b2_maxTOIJointsPerIsland, null, m_contactManager.m_contactListener, m_contactSolver);
var _local10:Array = s_queue;
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
_local8 = m_jointList;
while (_local8) {
_local8.m_islandFlag = false;
_local8 = _local8.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((((((((_local11.IsSensor() == true)) || ((_local11.IsEnabled() == false)))) || ((_local11.IsContinuous() == false)))) || ((_local11.IsKinematic() == true)))){
} else {
_local19 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local19 = _local11.m_toi;
} else {
_local3 = _local11.m_fixtureA;
_local4 = _local11.m_fixtureB;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((!((_local5.GetType() == b2Body.b2_dynamicBody))) || ((_local5.IsAwake() == false)))) && (((!((_local6.GetType() == b2Body.b2_dynamicBody))) || ((_local6.IsAwake() == false)))))){
continue;
};
_local20 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local20 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local20);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local20 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local20);
};
};
_local19 = _local11.ComputeTOI(_local5.m_sweep, _local6.m_sweep);
b2Settings.b2Assert((((0 <= _local19)) && ((_local19 <= 1))));
if ((((_local19 > 0)) && ((_local19 < 1)))){
_local19 = (((1 - _local19) * _local20) + _local19);
if (_local19 > 1){
_local19 = 1;
};
};
_local11.m_toi = _local19;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local19)) && ((_local19 < _local13)))){
_local12 = _local11;
_local13 = _local19;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_fixtureA;
_local4 = _local12.m_fixtureB;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
s_backupA.Set(_local5.m_sweep);
s_backupB.Set(_local6.m_sweep);
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactManager.m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if ((((((_local12.IsSensor() == true)) || ((_local12.IsEnabled() == false)))) || ((_local12.IsKinematic() == true)))){
_local5.m_sweep.Set(s_backupA);
_local6.m_sweep.Set(s_backupB);
_local5.SynchronizeTransform();
_local6.SynchronizeTransform();
} else {
if (_local12.IsTouching() == false){
} else {
_local14 = _local5;
if (_local14.GetType() != b2Body.b2_dynamicBody){
_local14 = _local6;
};
_local9.Clear();
_local15 = 0;
_local16 = 0;
var _temp1 = _local16;
_local16 = (_local16 + 1);
_local10[(_local15 + _temp1)] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local16 > 0) {
var _temp2 = _local15;
_local15 = (_local15 + 1);
_local2 = _local10[_temp2];
_local16--;
_local9.AddBody(_local2);
if (_local2.IsAwake() == false){
_local2.SetAwake(true);
};
if (_local2.GetType() != b2Body.b2_dynamicBody){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local9.m_contactCount == _local9.m_contactCapacity){
break;
};
if ((_local7.contact.m_flags & b2Contact.e_islandFlag)){
} else {
if ((((((((_local7.contact.IsSensor() == true)) || ((_local7.contact.IsEnabled() == false)))) || ((_local7.contact.IsTouching() == false)))) || ((_local7.contact.IsKinematic() == true)))){
} else {
_local9.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local22 = _local7.other;
if ((_local22.m_flags & b2Body.e_islandFlag)){
} else {
if (_local22.GetType() != b2Body.b2_staticBody){
_local22.Advance(_local13);
_local22.SetAwake(true);
};
_local10[(_local15 + _local16)] = _local22;
_local16++;
_local22.m_flags = (_local22.m_flags | b2Body.e_islandFlag);
};
};
};
_local7 = _local7.next;
};
_local21 = _local2.m_jointList;
while (_local21) {
if (_local9.m_jointCount == _local9.m_jointCapacity){
} else {
if (_local21.joint.m_islandFlag == true){
} else {
_local22 = _local21.other;
if (_local22.IsActive() == false){
} else {
_local9.AddJoint(_local21.joint);
_local21.joint.m_islandFlag = true;
if ((_local22.m_flags & b2Body.e_islandFlag)){
} else {
if (_local22.GetType() != b2Body.b2_staticBody){
_local22.Advance(_local13);
_local22.SetAwake(true);
};
_local10[(_local15 + _local16)] = _local22;
_local16++;
_local22.m_flags = (_local22.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local21 = _local21.next;
};
};
};
_local17 = s_timestep;
_local17.warmStarting = false;
_local17.dt = ((1 - _local13) * _arg1.dt);
_local17.inv_dt = (1 / _local17.dt);
_local17.dtRatio = 0;
_local17.velocityIterations = _arg1.velocityIterations;
_local17.positionIterations = _arg1.positionIterations;
_local9.SolveTOI(_local17);
_local18 = 0;
while (_local18 < _local9.m_bodyCount) {
_local2 = _local9.m_bodies[_local18];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if (_local2.IsAwake() == false){
} else {
if (_local2.GetType() != b2Body.b2_dynamicBody){
} else {
_local2.SynchronizeFixtures();
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local18++;
};
_local18 = 0;
while (_local18 < _local9.m_contactCount) {
_local11 = _local9.m_contacts[_local18];
_local9.m_contacts[_local18].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local18++;
};
_local18 = 0;
while (_local18 < _local9.m_jointCount) {
_local8 = _local9.m_joints[_local18];
_local8.m_islandFlag = false;
_local18++;
};
m_contactManager.FindNewContacts();
};
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function GetContactCount():int{
return (m_contactCount);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function GetGravity():b2Vec2{
return (m_gravity);
}
public function RayCastOne(_arg1:b2Vec2, _arg2:b2Vec2):b2Fixture{
var result:b2Fixture;
var RayCastOneWrapper:Function;
var point1 = _arg1;
var point2 = _arg2;
RayCastOneWrapper = function (_arg1:b2Fixture, _arg2:b2Vec2, _arg3:b2Vec2, _arg4:Number):Number{
result = _arg1;
return (_arg4);
};
RayCast(RayCastOneWrapper, point1, point2);
return (result);
}
public function Validate():void{
m_contactManager.m_broadPhase.Validate();
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function QueryPoint(_arg1:Function, _arg2:b2Vec2):void{
var broadPhase:IBroadPhase;
var WorldQueryWrapper:Function;
var callback = _arg1;
var p = _arg2;
WorldQueryWrapper = function (_arg1):Boolean{
var _local2:b2Fixture = (broadPhase.GetUserData(_arg1) as b2Fixture);
if (_local2.TestPoint(p)){
return (callback(_local2));
};
return (true);
};
broadPhase = m_contactManager.m_broadPhase;
var aabb:b2AABB = new b2AABB();
aabb.lowerBound.Set((p.x - b2Settings.b2_linearSlop), (p.y - b2Settings.b2_linearSlop));
aabb.upperBound.Set((p.x + b2Settings.b2_linearSlop), (p.y + b2Settings.b2_linearSlop));
broadPhase.Query(WorldQueryWrapper, aabb);
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local5:b2ContactEdge;
var _local2:b2Joint = b2Joint.Create(_arg1, null);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_edgeA.joint = _local2;
_local2.m_edgeA.other = _local2.m_bodyB;
_local2.m_edgeA.prev = null;
_local2.m_edgeA.next = _local2.m_bodyA.m_jointList;
if (_local2.m_bodyA.m_jointList){
_local2.m_bodyA.m_jointList.prev = _local2.m_edgeA;
};
_local2.m_bodyA.m_jointList = _local2.m_edgeA;
_local2.m_edgeB.joint = _local2;
_local2.m_edgeB.other = _local2.m_bodyA;
_local2.m_edgeB.prev = null;
_local2.m_edgeB.next = _local2.m_bodyB.m_jointList;
if (_local2.m_bodyB.m_jointList){
_local2.m_bodyB.m_jointList.prev = _local2.m_edgeB;
};
_local2.m_bodyB.m_jointList = _local2.m_edgeB;
var _local3:b2Body = _arg1.bodyA;
var _local4:b2Body = _arg1.bodyB;
if (_arg1.collideConnected == false){
_local5 = _local4.GetContactList();
while (_local5) {
if (_local5.other == _local3){
_local5.contact.FlagForFiltering();
};
_local5 = _local5.next;
};
};
return (_local2);
}
public function GetContactList():b2Contact{
return (m_contactList);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local5:b2ContactEdge;
var _local2:Boolean = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
var _local3:b2Body = _arg1.m_bodyA;
var _local4:b2Body = _arg1.m_bodyB;
_local3.SetAwake(true);
_local4.SetAwake(true);
if (_arg1.m_edgeA.prev){
_arg1.m_edgeA.prev.next = _arg1.m_edgeA.next;
};
if (_arg1.m_edgeA.next){
_arg1.m_edgeA.next.prev = _arg1.m_edgeA.prev;
};
if (_arg1.m_edgeA == _local3.m_jointList){
_local3.m_jointList = _arg1.m_edgeA.next;
};
_arg1.m_edgeA.prev = null;
_arg1.m_edgeA.next = null;
if (_arg1.m_edgeB.prev){
_arg1.m_edgeB.prev.next = _arg1.m_edgeB.next;
};
if (_arg1.m_edgeB.next){
_arg1.m_edgeB.next.prev = _arg1.m_edgeB.prev;
};
if (_arg1.m_edgeB == _local4.m_jointList){
_local4.m_jointList = _arg1.m_edgeB.next;
};
_arg1.m_edgeB.prev = null;
_arg1.m_edgeB.next = null;
b2Joint.Destroy(_arg1, null);
m_jointCount--;
if (_local2 == false){
_local5 = _local4.GetContactList();
while (_local5) {
if (_local5.other == _local3){
_local5.contact.FlagForFiltering();
};
_local5 = _local5.next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactManager.m_contactListener = _arg1;
}
public function CreateController(_arg1:b2Controller):b2Controller{
if (_arg1.m_world != this){
throw (new Error("Controller can only be a member of one world"));
};
_arg1.m_next = m_controllerList;
_arg1.m_prev = null;
if (m_controllerList){
m_controllerList.m_prev = _arg1;
};
m_controllerList = _arg1;
m_controllerCount++;
_arg1.m_world = this;
return (_arg1);
}
public function QueryShape(_arg1:Function, _arg2:b2Shape, _arg3:b2Transform=null):void{
var broadPhase:IBroadPhase;
var WorldQueryWrapper:Function;
var callback = _arg1;
var shape = _arg2;
var transform = _arg3;
WorldQueryWrapper = function (_arg1):Boolean{
var _local2:b2Fixture = (broadPhase.GetUserData(_arg1) as b2Fixture);
if (b2Shape.TestOverlap(shape, transform, _local2.GetShape(), _local2.GetBody().GetTransform())){
return (callback(_local2));
};
return (true);
};
if (transform == null){
transform = new b2Transform();
transform.SetIdentity();
};
broadPhase = m_contactManager.m_broadPhase;
var aabb:b2AABB = new b2AABB();
shape.ComputeAABB(aabb, transform);
broadPhase.Query(WorldQueryWrapper, aabb);
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
if (IsLocked() == true){
return (null);
};
var _local2:b2Body = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function RemoveController(_arg1:b2Controller):void{
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (m_controllerList == _arg1){
m_controllerList = _arg1.m_next;
};
m_controllerCount--;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function RayCast(_arg1:Function, _arg2:b2Vec2, _arg3:b2Vec2):void{
var broadPhase:IBroadPhase;
var output:b2RayCastOutput;
var RayCastWrapper:Function;
var callback = _arg1;
var point1 = _arg2;
var point2 = _arg3;
RayCastWrapper = function (_arg1:b2RayCastInput, _arg2):Number{
var _local6:Number;
var _local7:b2Vec2;
var _local3:* = broadPhase.GetUserData(_arg2);
var _local4:b2Fixture = (_local3 as b2Fixture);
var _local5:Boolean = _local4.RayCast(output, _arg1);
if (_local5){
_local6 = output.fraction;
_local7 = new b2Vec2((((1 - _local6) * point1.x) + (_local6 * point2.x)), (((1 - _local6) * point1.y) + (_local6 * point2.y)));
return (callback(_local4, _local7, output.normal, _local6));
};
return (_arg1.maxFraction);
};
broadPhase = m_contactManager.m_broadPhase;
output = new b2RayCastOutput();
var input:b2RayCastInput = new b2RayCastInput(point1, point2);
broadPhase.RayCast(RayCastWrapper, input);
}
public function Step(_arg1:Number, _arg2:int, _arg3:int):void{
if ((m_flags & e_newFixture)){
m_contactManager.FindNewContacts();
m_flags = (m_flags & ~(e_newFixture));
};
m_flags = (m_flags | e_locked);
var _local4:b2TimeStep = s_timestep2;
_local4.dt = _arg1;
_local4.velocityIterations = _arg2;
_local4.positionIterations = _arg3;
if (_arg1 > 0){
_local4.inv_dt = (1 / _arg1);
} else {
_local4.inv_dt = 0;
};
_local4.dtRatio = (m_inv_dt0 * _arg1);
_local4.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local4.dt > 0){
Solve(_local4);
};
if (((m_continuousPhysics) && ((_local4.dt > 0)))){
SolveTOI(_local4);
};
if (_local4.dt > 0){
m_inv_dt0 = _local4.inv_dt;
};
m_flags = (m_flags & ~(e_locked));
}
public function IsLocked():Boolean{
return (((m_flags & e_locked) > 0));
}
public function ClearForces():void{
var _local1:b2Body = m_bodyList;
while (_local1) {
_local1.m_force.SetZero();
_local1.m_torque = 0;
_local1 = _local1.m_next;
};
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function SetBroadPhase(_arg1:IBroadPhase):void{
var _local4:b2Fixture;
var _local2:IBroadPhase = m_contactManager.m_broadPhase;
m_contactManager.m_broadPhase = _arg1;
var _local3:b2Body = m_bodyList;
while (_local3) {
_local4 = _local3.m_fixtureList;
while (_local4) {
_local4.m_proxy = _arg1.CreateProxy(_local2.GetFatAABB(_local4.m_proxy), _local4);
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
}
public function AddController(_arg1:b2Controller):b2Controller{
_arg1.m_next = m_controllerList;
_arg1.m_prev = null;
m_controllerList = _arg1;
_arg1.m_world = this;
m_controllerCount++;
return (_arg1);
}
}
}//package Box2D.Dynamics
Section 111
//b2eContactListener (Box2DExt.b2eContactListener)
package Box2DExt {
import Box2D.Dynamics.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
public class b2eContactListener extends b2ContactListener {
public var onBeginContact:Function;
public var onPreSolve:Function;
public var onEndContact:Function;
public var onPostSolve:Function;
override public function BeginContact(_arg1:b2Contact):void{
if (onBeginContact != null){
onBeginContact(_arg1);
};
}
override public function PreSolve(_arg1:b2Contact, _arg2:b2Manifold):void{
if (onPreSolve != null){
onPreSolve(_arg1, _arg2);
};
}
override public function EndContact(_arg1:b2Contact):void{
if (onEndContact != null){
onEndContact(_arg1);
};
}
override public function PostSolve(_arg1:b2Contact, _arg2:b2ContactImpulse):void{
if (onPostSolve != null){
onPostSolve(_arg1, _arg2);
};
}
}
}//package Box2DExt
Section 112
//b2eMaterial (Box2DExt.b2eMaterial)
package Box2DExt {
public class b2eMaterial {
public var restitution:Number;
public var friction:Number;
public var density:Number;
public function b2eMaterial(_arg1:Number=0, _arg2:Number=0.2, _arg3:Number=0){
this.restitution = _arg1;
this.friction = _arg2;
this.density = _arg3;
}
}
}//package Box2DExt
Section 113
//b2eProperties (Box2DExt.b2eProperties)
package Box2DExt {
public class b2eProperties {
public var linearDamping:Number;
public var angularDamping:Number;
public function b2eProperties(_arg1:Number=0, _arg2:Number=0){
this.linearDamping = _arg1;
this.angularDamping = _arg2;
}
}
}//package Box2DExt
Section 114
//Box2DAPI (Box2DExt.Box2DAPI)
package Box2DExt {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class Box2DAPI {
private static const CONF_OBJ:Object = new Object();
public static const DISTANCE_JOINT:String = "distanceJoint";
public static const FRICTION_JOINT:String = "frictionJoint";
public static const GEAR_JOINT:String = "gearJoint";
public static const LINE_JOINT:String = "lineJoint";
public static const MOUSE_JOINT:String = "mouseJoint";
public static const PRISMATIC_JOINT:String = "prismaticJoint";
public static const PULLEY_JOINT:String = "pulleyJoint";
public static const REVOLUTE_JOINT:String = "revoluteJoint";
public static const WELD_JOINT:String = "weldJoint";
public static function createWorld(_arg1, _arg2:Boolean=true):b2World{
var _local3:b2Vec2;
if (_arg1){
_local3 = ((_arg1 is b2Vec2)) ? _arg1 : new b2Vec2(Number(_arg1.x), Number(_arg1.y));
} else {
_local3 = new b2Vec2();
};
return (new b2World(_local3, _arg2));
}
public static function createBodyDef(_arg1:Object=null):b2BodyDef{
var _local2:b2BodyDef = new b2BodyDef();
if (_arg1){
if ((_arg1.active is Boolean)){
_local2.active = _arg1.active;
};
if ((_arg1.allowSleep is Boolean)){
_local2.allowSleep = _arg1.allowSleep;
};
if ((_arg1.angle is Number)){
_local2.angle = _arg1.angle;
};
if ((_arg1.angularDamping is Number)){
_local2.angularDamping = _arg1.angularDamping;
};
if ((_arg1.angularVelocity is Number)){
_local2.angularVelocity = _arg1.angularVelocity;
};
if ((_arg1.awake is Boolean)){
_local2.awake = _arg1.awake;
};
if ((_arg1.bullet is Boolean)){
_local2.bullet = _arg1.bullet;
};
if ((_arg1.fixedRotation is Boolean)){
_local2.fixedRotation = _arg1.fixedRotation;
};
if ((_arg1.inertiaScale is Number)){
_local2.inertiaScale = _arg1.inertiaScale;
};
if ((_arg1.linearDamping is Number)){
_local2.linearDamping = _arg1.linearDamping;
};
if ((_arg1.linearVelocity is b2Vec2)){
_local2.linearVelocity = _arg1.linearVelocity;
};
if ((_arg1.position is b2Vec2)){
_local2.position = _arg1.position;
};
if ((_arg1.type is uint)){
_local2.type = _arg1.type;
};
if ((_arg1.userData is Object)){
_local2.userData = _arg1.userData;
};
if ((_arg1.x is Number)){
_local2.position.x = _arg1.x;
};
if ((_arg1.y is Number)){
_local2.position.y = _arg1.y;
};
if ((_arg1.vx is Number)){
_local2.linearVelocity.x = _arg1.vx;
};
if ((_arg1.vy is Number)){
_local2.linearVelocity.y = _arg1.vy;
};
};
return (_local2);
}
public static function createBody(_arg1:b2World, _arg2, _arg3=null, ... _args):b2Body{
var _local7:uint;
var _local8:uint;
var _local5:b2BodyDef = ((_arg2 is b2BodyDef)) ? _arg2 : createBodyDef(_arg2);
var _local6:b2Body = _arg1.CreateBody(_local5);
if (_arg3){
createFixture(_local6, _arg3);
};
if (_args.length){
_local7 = _args.length;
_local8 = 0;
while (_local8 < _local7) {
createFixture(_local6, _args[_local8]);
_local8++;
};
};
return (_local6);
}
public static function createFixtureDef(_arg1:Object=null):b2FixtureDef{
var _local2:b2FixtureDef = new b2FixtureDef();
if (_arg1){
if ((_arg1.density is Number)){
_local2.density = _arg1.density;
};
if ((_arg1.filter is b2FilterData)){
_local2.filter = _arg1.filter;
};
if ((_arg1.friction is Number)){
_local2.friction = _arg1.friction;
};
if ((_arg1.isSensor is Boolean)){
_local2.isSensor = _arg1.isSensor;
};
if ((_arg1.restitution is Number)){
_local2.restitution = _arg1.restitution;
};
if ((_arg1.shape is b2Shape)){
_local2.shape = _arg1.shape;
};
if ((_arg1.userData is Object)){
_local2.userData = _arg1.userData;
};
};
return (_local2);
}
public static function createFixture(_arg1:b2Body, _arg2):b2Fixture{
var _local3:b2FixtureDef = ((_arg2 is b2FixtureDef)) ? _arg2 : createFixtureDef(_arg2);
return (_arg1.CreateFixture(_local3));
}
public static function createRectangularFixture(_arg1:b2Body, _arg2:Number, _arg3:Number, _arg4:Number=0, _arg5:Number=0, _arg6=null):b2Fixture{
var _local7:b2Fixture;
var _local8:b2PolygonShape = b2PolygonShape.AsOrientedBox((_arg2 / 2), (_arg3 / 2), new b2Vec2(_arg4, _arg5));
if (_arg6){
_arg6.shape = _local8;
_local7 = createFixture(_arg1, _arg6);
} else {
_local7 = createFixture(_arg1, {shape:_local8});
};
return (_local7);
}
public static function createCircularFixture(_arg1:b2Body, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5=null):b2Fixture{
var _local6:b2Fixture;
var _local7:b2CircleShape = new b2CircleShape((_arg2 / 2));
var _local8:b2Vec2 = _local7.GetLocalPosition();
_local8.x = _arg3;
_local8.y = _arg4;
if (_arg5){
_arg5.shape = _local7;
_local6 = createFixture(_arg1, _arg5);
} else {
_local6 = createFixture(_arg1, {shape:_local7});
};
return (_local6);
}
public static function createTriangularFixture(_arg1:b2Body, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number=0, _arg6:Number=0, _arg7=null):b2Fixture{
var _local8:b2Fixture;
var _local15:b2PolygonShape;
var _local9:Number = (_arg2 / 2);
var _local10:Number = (_arg3 / 2);
var _local11:b2Vec2 = ((_arg4)!="tl") ? new b2Vec2((_arg5 - _local9), (_arg6 - _local10)) : null;
var _local12:b2Vec2 = ((_arg4)!="tr") ? new b2Vec2((_arg5 + _local9), (_arg6 - _local10)) : null;
var _local13:b2Vec2 = ((_arg4)!="br") ? new b2Vec2((_arg5 + _local9), (_arg6 + _local10)) : null;
var _local14:b2Vec2 = ((_arg4)!="bl") ? new b2Vec2((_arg5 - _local9), (_arg6 + _local10)) : null;
switch (_arg4){
case "bl":
_local15 = b2PolygonShape.AsArray([_local11, _local13, _local12], 3);
break;
case "br":
_local15 = b2PolygonShape.AsArray([_local11, _local14, _local12], 3);
break;
case "tl":
_local15 = b2PolygonShape.AsArray([_local14, _local13, _local12], 3);
break;
case "tr":
_local15 = b2PolygonShape.AsArray([_local11, _local14, _local13], 3);
break;
default:
throw (new Error("[Box2DAPI] : <createTriangularFixture> : Wrong 'kind'."));
};
if (_arg7){
_arg7.shape = _local15;
_local8 = createFixture(_arg1, _arg7);
} else {
_local8 = createFixture(_arg1, {shape:_local15});
};
return (_local8);
}
public static function createPolygonalFixture(_arg1:b2Body, _arg2:Array, _arg3=null):b2Fixture{
var _local4:b2Fixture;
if (((!(_arg2)) || ((_arg2.length < 3)))){
throw (new Error("[Box2DAPI] : <createPolygonalFixture> : Wrong points."));
};
var _local5:b2PolygonShape = b2PolygonShape.AsArray(_arg2, _arg2.length);
if (_arg3){
_arg3.shape = _local5;
_local4 = createFixture(_arg1, _arg3);
} else {
_local4 = createFixture(_arg1, {shape:_local5});
};
return (_local4);
}
public static function createRectangularBody(_arg1:b2World, _arg2:Number, _arg3:Number, _arg4=null, _arg5=null):b2Body{
var _local6:b2BodyDef = ((_arg4 is b2BodyDef)) ? _arg4 : createBodyDef(_arg4);
var _local7:b2Body = _arg1.CreateBody(_local6);
var _local8:b2PolygonShape = b2PolygonShape.AsBox((_arg2 / 2), (_arg3 / 2));
if (_arg5){
_arg5.shape = _local8;
createFixture(_local7, _arg5);
} else {
createFixture(_local7, {shape:_local8});
};
return (_local7);
}
public static function createCircularBody(_arg1:b2World, _arg2:Number, _arg3=null, _arg4=null):b2Body{
var _local5:b2BodyDef = ((_arg3 is b2BodyDef)) ? _arg3 : createBodyDef(_arg3);
var _local6:b2Body = _arg1.CreateBody(_local5);
var _local7:b2CircleShape = new b2CircleShape((_arg2 / 2));
if (_arg4){
_arg4.shape = _local7;
createFixture(_local6, _arg4);
} else {
createFixture(_local6, {shape:_local7});
};
return (_local6);
}
public static function createTriangularBody(_arg1:b2World, _arg2:Number, _arg3:Number, _arg4:String, _arg5=null, _arg6=null):b2Body{
var _local15:b2PolygonShape;
var _local7:b2BodyDef = ((_arg5 is b2BodyDef)) ? _arg5 : createBodyDef(_arg5);
var _local8:b2Body = _arg1.CreateBody(_local7);
var _local9:Number = (_arg2 / 2);
var _local10:Number = (_arg3 / 2);
var _local11:b2Vec2 = ((_arg4)!="tl") ? new b2Vec2(-(_local9), -(_local10)) : null;
var _local12:b2Vec2 = ((_arg4)!="tr") ? new b2Vec2(_local9, -(_local10)) : null;
var _local13:b2Vec2 = ((_arg4)!="br") ? new b2Vec2(_local9, _local10) : null;
var _local14:b2Vec2 = ((_arg4)!="bl") ? new b2Vec2(-(_local9), _local10) : null;
switch (_arg4){
case "bl":
_local15 = b2PolygonShape.AsArray([_local11, _local13, _local12], 3);
break;
case "br":
_local15 = b2PolygonShape.AsArray([_local11, _local14, _local12], 3);
break;
case "tl":
_local15 = b2PolygonShape.AsArray([_local14, _local13, _local12], 3);
break;
case "tr":
_local15 = b2PolygonShape.AsArray([_local11, _local14, _local13], 3);
break;
default:
throw (new Error("[Box2DAPI] : <createTriangularBody> : Wrong 'kind'."));
};
if (_arg6){
_arg6.shape = _local15;
createFixture(_local8, _arg6);
} else {
createFixture(_local8, {shape:_local15});
};
return (_local8);
}
public static function createPolygonalBody(_arg1:b2World, _arg2:Array, _arg3=null, _arg4=null):b2Body{
var _local5:b2BodyDef = ((_arg3 is b2BodyDef)) ? _arg3 : createBodyDef(_arg3);
var _local6:b2Body = _arg1.CreateBody(_local5);
if (((!(_arg2)) || ((_arg2.length < 3)))){
throw (new Error("[Box2DAPI] : <createPolygonalBody> : Wrong points."));
};
var _local7:b2PolygonShape = b2PolygonShape.AsArray(_arg2, _arg2.length);
if (_arg4){
_arg4.shape = _local7;
createFixture(_local6, _arg4);
} else {
createFixture(_local6, {shape:_local7});
};
return (_local6);
}
public static function createCapsuleBody(_arg1:b2World, _arg2:Number, _arg3:Number=NaN, _arg4=null, _arg5=null):b2Body{
var _local12:b2PolygonShape;
var _local6:b2BodyDef = ((_arg4 is b2BodyDef)) ? _arg4 : createBodyDef(_arg4);
var _local7:b2Body = _arg1.CreateBody(_local6);
var _local8:b2CircleShape = new b2CircleShape(_arg2);
var _local9:b2CircleShape = new b2CircleShape(_arg2);
var _local10:b2Vec2 = _local8.GetLocalPosition();
var _local11:b2Vec2 = _local9.GetLocalPosition();
var _local13:Number = (_arg3 / 2);
if (_arg3 > 0){
_local10.y = -(_local13);
_local11.y = _local13;
_local12 = b2PolygonShape.AsBox(_arg2, _local13);
} else {
_local10.y = -(_arg2);
_local11.y = _arg2;
_local12 = b2PolygonShape.AsBox(_arg2, _arg2);
};
if (_arg5){
_arg5.shape = _local8;
createFixture(_local7, _arg5);
_arg5.shape = _local9;
createFixture(_local7, _arg5);
_arg5.shape = _local12;
createFixture(_local7, _arg5);
} else {
createFixture(_local7, {shape:_local8});
createFixture(_local7, {shape:_local9});
createFixture(_local7, {shape:_local12});
};
return (_local7);
}
public static function createGlobuleBody(_arg1:b2World, _arg2:Number, _arg3:Number=NaN, _arg4:Number=NaN, _arg5=null, _arg6=null):b2Body{
var _local7:b2BodyDef = ((_arg5 is b2BodyDef)) ? _arg5 : createBodyDef(_arg5);
var _local8:b2Body = _arg1.CreateBody(_local7);
var _local9:Number = (_arg3 / 2);
var _local10:Number = (_arg4 / 2);
var _local11:b2PolygonShape = b2PolygonShape.AsBox(((_arg3)>0) ? _local9 : _arg2, ((_arg4)>0) ? (_local10 + _arg2) : _arg2);
var _local12:b2PolygonShape = b2PolygonShape.AsBox(((_arg3)>0) ? (_local9 + _arg2) : _arg2, ((_arg4)>0) ? _local10 : _arg2);
var _local13:b2CircleShape = new b2CircleShape(_arg2);
var _local14:b2CircleShape = new b2CircleShape(_arg2);
var _local15:b2CircleShape = new b2CircleShape(_arg2);
var _local16:b2CircleShape = new b2CircleShape(_arg2);
var _local17:b2Vec2 = _local13.GetLocalPosition();
var _local18:b2Vec2 = _local14.GetLocalPosition();
var _local19:b2Vec2 = _local15.GetLocalPosition();
var _local20:b2Vec2 = _local16.GetLocalPosition();
if (_arg3 > 0){
_local17.x = -(_local9);
_local18.x = _local9;
_local19.x = -(_local9);
_local20.x = _local9;
} else {
_local17.x = -(_arg2);
_local18.x = _arg2;
_local19.x = -(_arg2);
_local20.x = _arg2;
};
if (_arg4 > 0){
_local17.y = -(_local10);
_local18.y = -(_local10);
_local19.y = _local10;
_local20.y = _local10;
} else {
_local17.y = -(_arg2);
_local18.y = -(_arg2);
_local19.y = _arg2;
_local20.y = _arg2;
};
if (_arg6){
_arg6.shape = _local13;
createFixture(_local8, _arg6);
_arg6.shape = _local14;
createFixture(_local8, _arg6);
_arg6.shape = _local15;
createFixture(_local8, _arg6);
_arg6.shape = _local16;
createFixture(_local8, _arg6);
_arg6.shape = _local11;
createFixture(_local8, _arg6);
_arg6.shape = _local12;
createFixture(_local8, _arg6);
} else {
createFixture(_local8, {shape:_local13});
createFixture(_local8, {shape:_local14});
createFixture(_local8, {shape:_local15});
createFixture(_local8, {shape:_local16});
createFixture(_local8, {shape:_local11});
createFixture(_local8, {shape:_local12});
};
return (_local8);
}
public static function createJointDef(_arg1:String, _arg2:Object=null):b2JointDef{
var _JointDef:b2JointDef;
var type = _arg1;
var config = _arg2;
switch (type){
case DISTANCE_JOINT:
_JointDef = new b2DistanceJointDef();
if (config){
var _local4 = (_JointDef as b2DistanceJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.dampingRatio is Number)){
dampingRatio = config.dampingRatio;
};
if ((config.frequencyHz is Number)){
frequencyHz = config.frequencyHz;
};
if ((config.length is Number)){
length = config.length;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
};
};
case FRICTION_JOINT:
_JointDef = new b2FrictionJointDef();
if (config){
_local4 = (_JointDef as b2FrictionJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
if ((config.maxForce is Number)){
maxForce = config.maxForce;
};
if ((config.maxTorque is Number)){
maxTorque = config.maxTorque;
};
};
};
case GEAR_JOINT:
_JointDef = new b2GearJointDef();
if (config){
_local4 = (_JointDef as b2GearJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((((config.joint1 is b2RevoluteJoint)) || ((config.joint1 is b2PrismaticJoint)))){
joint1 = config.joint1;
};
if ((((config.joint2 is b2RevoluteJoint)) || ((config.joint2 is b2PrismaticJoint)))){
joint2 = config.joint2;
};
if ((config.ratio is Number)){
ratio = config.ratio;
};
};
};
case LINE_JOINT:
_JointDef = new b2LineJointDef();
if (config){
_local4 = (_JointDef as b2LineJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.enableLimit is Boolean)){
enableLimit = config.enableLimit;
};
if ((config.enableMotor is Boolean)){
enableMotor = config.enableMotor;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
if ((config.localAxisA is b2Vec2)){
localAxisA = config.localAxisA;
};
if ((config.lowerTranslation is Number)){
lowerTranslation = config.lowerTranslation;
};
if ((config.maxMotorForce is Number)){
maxMotorForce = config.maxMotorForce;
};
if ((config.motorSpeed is Number)){
motorSpeed = config.motorSpeed;
};
if ((config.upperTranslation is Number)){
upperTranslation = config.upperTranslation;
};
};
};
case MOUSE_JOINT:
_JointDef = new b2MouseJointDef();
if (config){
_local4 = (_JointDef as b2MouseJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.dampingRatio is Number)){
dampingRatio = config.dampingRatio;
};
if ((config.frequencyHz is Number)){
frequencyHz = config.frequencyHz;
};
if ((config.maxForce is Number)){
maxForce = config.maxForce;
};
if ((config.target is b2Vec2)){
target = config.target;
};
};
};
case PRISMATIC_JOINT:
_JointDef = new b2PrismaticJointDef();
if (config){
_local4 = (_JointDef as b2PrismaticJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.enableLimit is Boolean)){
enableLimit = config.enableLimit;
};
if ((config.enableMotor is Boolean)){
enableMotor = config.enableMotor;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
if ((config.localAxisA is b2Vec2)){
localAxisA = config.localAxisA;
};
if ((config.lowerTranslation is Number)){
lowerTranslation = config.lowerTranslation;
};
if ((config.maxMotorForce is Number)){
maxMotorForce = config.maxMotorForce;
};
if ((config.motorSpeed is Number)){
motorSpeed = config.motorSpeed;
};
if ((config.referenceAngle is Number)){
referenceAngle = config.referenceAngle;
};
if ((config.upperTranslation is Number)){
upperTranslation = config.upperTranslation;
};
};
};
case PULLEY_JOINT:
_JointDef = new b2PulleyJointDef();
if (config){
_local4 = (_JointDef as b2PulleyJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.groundAnchorA is b2Vec2)){
groundAnchorA = config.groundAnchorA;
};
if ((config.groundAnchorB is b2Vec2)){
groundAnchorB = config.groundAnchorB;
};
if ((config.lengthA is Number)){
lengthA = config.lengthA;
};
if ((config.lengthB is Number)){
lengthB = config.lengthB;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
if ((config.maxLengthA is Number)){
maxLengthA = config.maxLengthA;
};
if ((config.maxLengthB is Number)){
maxLengthB = config.maxLengthB;
};
if ((config.ratio is Number)){
ratio = config.ratio;
};
};
};
case REVOLUTE_JOINT:
_JointDef = new b2RevoluteJointDef();
if (config){
_local4 = (_JointDef as b2RevoluteJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.enableLimit is Boolean)){
enableLimit = config.enableLimit;
};
if ((config.enableMotor is Boolean)){
enableMotor = config.enableMotor;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
if ((config.lowerAngle is Number)){
lowerAngle = config.lowerAngle;
};
if ((config.maxMotorForce is Number)){
maxMotorForce = config.maxMotorForce;
};
if ((config.motorSpeed is Number)){
motorSpeed = config.motorSpeed;
};
if ((config.referenceAngle is Number)){
referenceAngle = config.referenceAngle;
};
if ((config.upperAngle is Number)){
upperAngle = config.upperAngle;
};
};
};
case WELD_JOINT:
_JointDef = new b2WeldJointDef();
if (config){
_local4 = (_JointDef as b2WeldJointDef);
with (_local4) {
if ((config.bodyA is b2Body)){
bodyA = config.bodyA;
};
if ((config.bodyB is b2Body)){
bodyB = config.bodyB;
};
if ((config.collideConnected is Boolean)){
collideConnected = config.collideConnected;
};
if ((config.userData is Object)){
userData = config.userData;
};
if ((config.localAnchorA is b2Vec2)){
localAnchorA = config.localAnchorA;
};
if ((config.localAnchorB is b2Vec2)){
localAnchorB = config.localAnchorB;
};
if ((config.referenceAngle is Number)){
referenceAngle = config.referenceAngle;
};
};
};
default:
throw (new Error("[Box2DAPI] : <createJointDef> : Wrong joint 'type'."));
};
}
public static function createJoint(_arg1:b2World, _arg2, _arg3:String=null):b2Joint{
var _local4:b2JointDef = ((_arg2 is b2JointDef)) ? _arg2 : createJointDef(_arg3, _arg2);
return (_arg1.CreateJoint(_local4));
}
}
}//package Box2DExt
Section 115
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 116
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 117
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local4:CampaignTracker;
var _local8:CampaignTracker;
var _local9:int;
var _local3:CampaignInfo = new CampaignInfo();
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
var _local3:Variables = new Variables(_arg1);
var _local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker = getOrganicCampaign();
var _local3:CampaignTracker = new CampaignTracker();
var _local4:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
var _local5:Variables = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3:String = _local2.hostName;
var _local4:String = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 118
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 119
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 120
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _OBJ:Object;
private var _utma:UTMA;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:Boolean;
var _local6:String;
super();
_config = _arg1;
_debug = _arg2;
UTMB.defaultTimespan = _config.sessionTimeout;
UTMZ.defaultTimespan = _config.conversionTimeout;
if (!_arg3){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
_local5 = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
_local5 = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
_local5 = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
_local5 = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
_local5 = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
_local5 = true;
};
};
if (_local5){
save();
};
} else {
_OBJ = new Object();
if (_arg4){
for (_local6 in _arg4) {
_OBJ[_local6] = _arg4[_local6];
};
};
};
_volatile = _arg3;
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 121
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
import com.google.analytics.external.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String = _info.locationPath;
var _local3:String = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 122
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 123
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 124
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.utils.*;
import com.google.analytics.data.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 125
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 126
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 127
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 128
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.utils.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number = _arg1.idleLoop;
var _local6:Number = _arg1.idleTimeout;
var _local7:Number = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 129
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 130
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 131
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var _local1:Array = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 132
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 133
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
return (null);
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 134
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 135
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
var _local3:Array = [" ", "\n", "\r", "\t"];
var _local4:String = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local4:int;
var _local5:int;
var _local2 = 1;
var _local3:int;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 136
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 137
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 138
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 139
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 140
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
var _local3:int;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var _local1:String;
var _local2:int;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int = fields.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date = new Date();
var _local2:Number = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var _local2:String;
var _local3:*;
var _local1:Array = [];
var _local4:int;
while (_local4 < fields.length) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local4++;
};
return (("" + _local1.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var _local2:String;
var _local3:*;
var _local1:Object = {};
var _local4:int;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local3:String;
var _local4:*;
var _local2:Array = [];
var _local5:int = fields.length;
var _local6:int;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
var _local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 141
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 142
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
override public function toURLString():String{
return (((inURL + "=") + encodeURI(valueOf())));
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 143
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 144
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
private function _renderProject(_arg1:Object):String{
var _local4:int;
var _local5:Array;
var _local2 = "";
var _local3:Boolean;
var _local6:int = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local3:String;
var _local4:int;
var _local2:Array = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
var _local2:Array = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local2:String;
var _local1:Array = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:* = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local3:int;
var _local4:String;
var _local5:String;
var _local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 145
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.net.*;
import flash.text.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 146
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
var _local8:int;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
private function _defineActions():void{
var _local3:AlertAction;
var _local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
var _local2:Array = [];
var _local4:int;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
protected function spaces(_arg1:int):String{
var _local2 = "";
var _local3 = " ";
var _local4:int;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 147
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 148
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 149
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 150
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint = 0;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
//unresolved jump
};
return (super.forcedWidth);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 151
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
public class DebugConfiguration {
public var showHideKey:Number;
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
showHideKey = Keyboard.SPACE;
destroyKey = Keyboard.BACKSPACE;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 152
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 153
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 154
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
public interface ILayout {
function createAlert(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(_arg1:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 155
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 156
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 157
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 158
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 159
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 160
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 161
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 162
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(_arg1:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 163
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 164
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 165
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 166
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 167
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var _local1:Object = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 168
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 169
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
var _local2:String = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local4:String;
var _local5:String;
var _local1:Protocols = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _local2:String = _dom.protocol;
var _local3:String = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String = _dom.language;
var _local2:String = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 170
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 171
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 172
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 173
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var _local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProductToken():String{
var _local1:String = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 174
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 175
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var _local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local4:Array;
var _local3:Version = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 176
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
return (null);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 177
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 178
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function getServiceMode():ServerOperationMode;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function setAllowLinker(_arg1:Boolean):void;
function getClientInfo():Boolean;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function clearIgnoredRef():void;
function setDomainName(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function setLocalRemoteServerMode():void;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 179
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals){
var _local8:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
if (!Utils.validateAccount(_arg1)){
_local8 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local8);
throw (new Error(_local8));
};
_initData();
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
_debug.warning("trackTrans() not implemented");
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((("linkByPost( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
_initData();
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.warning((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " ) not implemented"));
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = _arg1;
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.warning((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " ) not implemented"));
return (null);
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.warning((("link( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 180
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(_arg1:String):void;
function get config():Configuration;
function get mode():String;
function set config(_arg1:Configuration):void;
function set mode(_arg1:String):void;
function set debug(_arg1:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(_arg1:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 181
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 182
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.external.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function isReady():Boolean{
return (_ready);
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var _local2:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense));
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 183
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public final class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 184
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
public function insert(_arg1:TweenCore, _arg2=0):TweenCore{
var _local3:SimpleTimeline = _arg1.timeline;
if (((!(_arg1.cachedOrphan)) && (_local3))){
_local3.remove(_arg1, true);
};
_arg1.timeline = this;
_arg1.cachedStartTime = (Number(_arg2) + _arg1.delay);
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (((_arg1.cachedPaused) && (!((_local3 == this))))){
_arg1.cachedPauseTime = (_arg1.cachedStartTime + ((this.rawTime - _arg1.cachedStartTime) / _arg1.cachedTimeScale));
};
if (_lastChild){
_lastChild.nextNode = _arg1;
} else {
_firstChild = _arg1;
};
_arg1.prevNode = _lastChild;
_lastChild = _arg1;
_arg1.nextNode = null;
_arg1.cachedOrphan = false;
return (_arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local5:Number;
var _local6:TweenCore;
var _local4:TweenCore = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
_arg1.cachedOrphan = true;
}
}
}//package com.greensock.core
Section 185
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
public var cachedTime:Number;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedOrphan:Boolean;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
public var cachedPauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.693;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2)!=null) ? _arg2 : {};
if (this.vars.isGSVars){
this.vars = this.vars.vars;
};
this.cachedDuration = (this.cachedTotalDuration = _arg1);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
_local3.insert(this, _local3.cachedTotalTime);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
if (((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc))))){
this.timeline.insert(this, (_arg1 - _delay));
} else {
this.cachedStartTime = _arg1;
};
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
var _local2:Number = (_arg1 / this.cachedDuration);
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(true);
if (((((this.active) && (!(this.cachedPaused)))) && (!((_arg1 == 0))))){
this.setTotalTime((this.cachedTotalTime * _local2), true);
};
}
public function invalidate():void{
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.totalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime >= this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
this.cachedPauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - this.cachedPauseTime));
this.cachedPauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (this.cachedPaused) ? this.cachedPauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
this.gc = !(_arg1);
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.cachedOrphan))){
this.timeline.insert(this, (this.cachedStartTime - _delay));
};
} else {
this.active = false;
if (((!(_arg2)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
}
}//package com.greensock.core
Section 186
//Linear (com.greensock.easing.Linear)
package com.greensock.easing {
public class Linear {
public static const power:uint = 0;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.greensock.easing
Section 187
//Quad (com.greensock.easing.Quad)
package com.greensock.easing {
public class Quad {
public static const power:uint = 1;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
return (((((_arg3 * 0.5) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) * 0.5) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package com.greensock.easing
Section 188
//ShakeEffect (com.greensock.plugins.ShakeEffect)
package com.greensock.plugins {
import com.greensock.*;
import flash.utils.*;
public class ShakeEffect extends TweenPlugin {
protected var _target:Object;
protected var numShakes:Number;// = 3
protected var _tween:TweenLite;
private var amplitude:Number;
private var decrease:Number;
private var lastValueAdditions:Dictionary;
private var currentValueAdditions:Dictionary;
private var props:Array;
private var strengths:Dictionary;
public static const API:Number = 1;
private static const PIm2:Number = 6.28318530717959;
public function ShakeEffect(){
lastValueAdditions = new Dictionary();
currentValueAdditions = new Dictionary();
props = new Array();
strengths = new Dictionary();
super();
this.propName = "shake";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:*;
if (!(_arg2 is Object)){
throw (new Error("[ShakeEffect] : <onInitTween> : Invalid arguments!"));
};
for (_local4 in _arg2) {
if (_local4 == "numShakes"){
if ((_arg2[_local4] is Number)){
numShakes = _arg2[_local4];
} else {
throw (new Error("[ShakeEffect] : <onInitTween> : Invalid arguments!"));
};
} else {
if (!_arg1.hasOwnProperty(_local4)){
throw (new Error("[ShakeEffect] : <onInitTween> : Invalid arguments!"));
};
props.push(_local4);
strengths[_local4] = _arg2[_local4];
lastValueAdditions[_local4] = 0;
currentValueAdditions[_local4] = 0;
};
};
_tween = _arg3;
_target = _arg1;
return (true);
}
override public function killProps(_arg1:Object):void{
var _local2:int = this.overwriteProps.length;
while (_local2--) {
if ((this.overwriteProps[_local2] in _arg1)){
_target[this.overwriteProps[_local2]] = (_target[this.overwriteProps[_local2]] - lastValueAdditions[this.overwriteProps[_local2]]);
this.overwriteProps.splice(_local2, 1);
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:String;
amplitude = Math.sin(((_arg1 * PIm2) * numShakes));
decrease = (1 - _arg1);
for each (_local2 in props) {
currentValueAdditions[_local2] = ((strengths[_local2] * amplitude) * decrease);
_target[_local2] = ((_target[_local2] - lastValueAdditions[_local2]) + currentValueAdditions[_local2]);
lastValueAdditions[_local2] = currentValueAdditions[_local2];
};
}
}
}//package com.greensock.plugins
Section 189
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class TweenPlugin {
public var activeDisable:Boolean;
public var onInitAllProps:Function;
protected var _tweens:Array;
public var onDisable:Function;
public var propName:String;
public var onEnable:Function;
public var round:Boolean;
public var priority:int;// = 0
public var overwriteProps:Array;
public var onComplete:Function;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.4;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function updateTweens(_arg1:Number):void{
var _local3:PropTween;
var _local4:Number;
var _local2:int = _tweens.length;
if (this.round){
while (--_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
if (_local4 > 0){
_local3.target[_local3.property] = ((_local4 + 0.5) >> 0);
} else {
_local3.target[_local3.property] = ((_local4 - 0.5) >> 0);
};
};
} else {
while (--_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
};
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (Number(_arg4) - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public function killProps(_arg1:Object):void{
var _local2:int = this.overwriteProps.length;
while (--_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
};
_local2 = _tweens.length;
while (--_local2 > -1) {
if ((PropTween(_tweens[_local2]).name in _arg1)){
_tweens.splice(_local2, 1);
};
};
}
public static function activate(_arg1:Array):Boolean{
var _local3:Object;
TweenLite.onPluginEvent = TweenPlugin.onTweenEvent;
var _local2:int = _arg1.length;
while (_local2--) {
if (_arg1[_local2].hasOwnProperty("API")){
_local3 = new ((_arg1[_local2] as Class));
TweenLite.plugins[_local3.propName] = _arg1[_local2];
};
};
return (true);
}
private static function onTweenEvent(_arg1:String, _arg2:TweenLite):Boolean{
var _local4:Boolean;
var _local5:Array;
var _local6:int;
var _local3:PropTween = _arg2.cachedPT1;
if (_arg1 == "onInitAllProps"){
_local5 = [];
_local6 = 0;
while (_local3) {
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local7 = _temp1;
_local5[_local7] = _local3;
_local3 = _local3.nextNode;
};
_local5.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
while (--_local6 > -1) {
PropTween(_local5[_local6]).nextNode = _local5[(_local6 + 1)];
PropTween(_local5[_local6]).prevNode = _local5[(_local6 - 1)];
};
_local3 = (_arg2.cachedPT1 = _local5[0]);
};
while (_local3) {
if (((_local3.isPlugin) && (_local3.target[_arg1]))){
if (_local3.target.activeDisable){
_local4 = true;
};
_local7 = _local3.target;
_local7[_arg1]();
};
_local3 = _local3.nextNode;
};
return (_local4);
}
}
}//package com.greensock.plugins
Section 190
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.events.*;
import flash.display.*;
import com.greensock.core.*;
import flash.utils.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:int;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.698;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1, reversed:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:TweenLite;
super(_arg2, _arg3);
if (_arg1 == null){
throw (new Error("Cannot tween a null object."));
};
this.target = _arg1;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
var _local4:Array = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = !(this.cachedReversed);
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime >= 0){
_arg3 = true;
_local4 = (_rawPrevTime > 0);
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (((!((this.cachedTime == 0))) || ((this.cachedDuration == 0)))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var _local6:PropTween = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((_local4) && (!(this.gc)))){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
if (_local3.indexOf(this) == -1){
_local3[_local3.length] = this;
};
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (--_local2 > -1) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInitAllProps", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
if (((!((_local3 == _local4.target.propName))) || ((_local4.name == "")))){
delete propTweenLookup[_local3];
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (((_arg2) && (!((_arg1 == _overwrittenProps))))){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
if ((_arg1 in masterList)){
_local4 = masterList[_arg1];
_local5 = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (!_local6.gc){
if (_arg2){
_local6.complete(false, false);
};
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
};
if (_arg3 == null){
delete masterList[_arg1];
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
if (_arg3.isGSVars){
_arg3 = _arg3.vars;
};
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame = (rootFrame + 1);
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (--_local5 > -1) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 191
//AchievementsButton (lp.pge.game.buttons.AchievementsButton)
package lp.pge.game.buttons {
import lp.pge.*;
import lp.pge.menu.*;
import lp.pge.gui.*;
public class AchievementsButton extends Button {
public function AchievementsButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
(parent.parent as Window).close();
GameApplication.instance.goToMenu();
Menu.instance.openAchievements();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 192
//BlockButton (lp.pge.game.buttons.BlockButton)
package lp.pge.game.buttons {
import com.greensock.*;
import flash.events.*;
import flash.display.*;
import lp.pge.game.gui.*;
public class BlockButton extends MovieClip {
public var icon:Sprite;
public var hit:Sprite;
private var _index:int;// = -1
private var _tween:TweenLite;
private var _dir:int;
public function BlockButton(){
addFrameScript(0, frame1);
hitArea = hit;
_index = int(name.split("blockButton")[1]);
enable();
refresh();
}
public function get index():int{
return (_index);
}
public function set index(_arg1:int):void{
if (_arg1 == _index){
return;
};
_index = _arg1;
}
public function refresh():void{
var _local2:Object;
var _local1:HiddenBlock = (parent.parent as HiddenBlock);
if (_local1){
_local2 = _local1[("blockData" + _index)];
gotoAndStop(_local2.id);
};
}
public function remove():void{
if (_tween){
_tween.kill();
};
_tween = undefined;
_dir = 0;
if (parent){
parent.removeChild(this);
};
}
public function enable():void{
addEventListener(MouseEvent.MOUSE_UP, onUp);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.MOUSE_OUT, onOut);
}
public function disable():void{
removeEventListener(MouseEvent.MOUSE_UP, onUp);
}
public function get isEnabled():Boolean{
return (hasEventListener(MouseEvent.MOUSE_UP));
}
public function get isDisabled():Boolean{
return (!(hasEventListener(MouseEvent.MOUSE_UP)));
}
public function get isBroken():Boolean{
return (!(((isEnabled) || (isDisabled))));
}
private function onUp(_arg1:MouseEvent):void{
var _local2:HiddenBlock = (parent.parent as HiddenBlock);
if (_local2){
disable();
_local2.selectBlock((_index - 1));
};
}
private function onOver(_arg1:MouseEvent):void{
var $event = _arg1;
if (_dir != 1){
if (_tween){
_tween.kill();
};
_dir = 1;
scaleX = (scaleY = 1);
if (parent){
parent.setChildIndex(this, (parent.numChildren - 1));
};
_tween = new TweenLite(this, 0.5, {scaleX:1.2, scaleY:1.2, onComplete:function ():void{
_dir = 0;
_tween = undefined;
}});
};
}
private function onOut(_arg1:MouseEvent):void{
var $event = _arg1;
if (_dir != -1){
if (_tween){
_tween.kill();
};
_dir = -1;
scaleX = (scaleY = 1.2);
_tween = new TweenLite(this, 0.5, {scaleX:1, scaleY:1, onComplete:function ():void{
_dir = 0;
_tween = undefined;
}});
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 193
//ContinueButton (lp.pge.game.buttons.ContinueButton)
package lp.pge.game.buttons {
import lp.pge.gui.*;
public class ContinueButton extends Button {
public function ContinueButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
var _local1:Function = (parent.parent["callback"] as Function);
(parent.parent as Window).close();
if (_local1 != null){
_local1();
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 194
//DoneButton (lp.pge.game.buttons.DoneButton)
package lp.pge.game.buttons {
import lp.pge.game.*;
import lp.pge.gui.*;
public class DoneButton extends Button {
public function DoneButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
(parent as Window).close();
trace("*** YOU WIN ***");
Game.instance.openFinal();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 195
//MenuButton (lp.pge.game.buttons.MenuButton)
package lp.pge.game.buttons {
import lp.pge.*;
import lp.pge.gui.*;
public class MenuButton extends Button {
public function MenuButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
if ((parent is Window)){
(parent as Window).close();
} else {
if ((parent.parent is Window)){
(parent.parent as Window).close();
};
};
GameApplication.instance.goToMenu();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 196
//MoreGamesButton (lp.pge.game.buttons.MoreGamesButton)
package lp.pge.game.buttons {
import lp.pge.*;
import lp.pge.gui.*;
import flash.net.*;
public class MoreGamesButton extends Button {
public function MoreGamesButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
GameApplication.instance.trackEvent("/more-games");
_soundPlayer.play(new ButtonClickSound());
if (GameApplication.linksOut){
if (((GameApplication.moreLink) && (GameApplication.moreLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.moreLink), "_blank");
} catch(error:Error) {
};
};
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 197
//NextButton (lp.pge.game.buttons.NextButton)
package lp.pge.game.buttons {
import lp.pge.game.*;
import lp.pge.gui.*;
public class NextButton extends Button {
public function NextButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
(parent as Window).close();
Game.instance.nextLevel();
Game.instance.startLevel();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 198
//ReplayButton (lp.pge.game.buttons.ReplayButton)
package lp.pge.game.buttons {
import lp.pge.game.*;
import lp.pge.gui.*;
public class ReplayButton extends Button {
public function ReplayButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
(parent as Window).close();
GameStatistics.submitReplay(Game.instance.getCurrentLevelIndex());
Game.instance.restartLevel();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 199
//RetryButton (lp.pge.game.buttons.RetryButton)
package lp.pge.game.buttons {
import lp.pge.game.*;
import lp.pge.gui.*;
public class RetryButton extends Button {
public function RetryButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
(parent as Window).close();
GameStatistics.submitRetry(Game.instance.getCurrentLevelIndex());
Game.instance.restartLevel();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 200
//SkipTutorialButton (lp.pge.game.buttons.SkipTutorialButton)
package lp.pge.game.buttons {
import lp.pge.gui.*;
public class SkipTutorialButton extends Button {
public function SkipTutorialButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
var _local1:Window = (parent as Window);
if (_local1){
_local1.close();
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 201
//WalkthroughButton (lp.pge.game.buttons.WalkthroughButton)
package lp.pge.game.buttons {
import lp.pge.*;
import lp.pge.gui.*;
import flash.net.*;
public class WalkthroughButton extends Button {
public function WalkthroughButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
GameApplication.instance.trackEvent("/walkthrough");
_soundPlayer.play(new ButtonClickSound());
if (GameApplication.linksOut){
if (((GameApplication.helpLink) && (GameApplication.helpLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.helpLink), "_blank");
} catch(error:Error) {
};
};
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.game.buttons
Section 202
//AcousticalAspect (lp.pge.game.core.aspects.AcousticalAspect)
package lp.pge.game.core.aspects {
import flash.media.*;
import flash.events.*;
import asp.aspects.*;
import asp.entities.*;
import lp.pge.game.*;
public class AcousticalAspect extends AAspect {
private var _sound:Sound;
private var _soundChannel:SoundChannel;
private var _volume:Number;
private var _pan:Number;
private var _loop:Boolean;
private var _mute:Boolean;
private var _position:Number;
public function AcousticalAspect(){
_volume = 1;
_pan = 0;
_loop = false;
_mute = false;
}
public function get volume():Number{
return (_volume);
}
public function set volume(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 == _volume){
return;
};
_volume = _arg1;
if (_soundChannel){
setSoundTransform();
};
}
public function get pan():Number{
return (_pan);
}
public function set pan(_arg1:Number):void{
if (_arg1 < -1){
_arg1 = -1;
};
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 == _pan){
return;
};
_pan = _arg1;
if (_soundChannel){
setSoundTransform();
};
}
public function get loop():Boolean{
return (_loop);
}
public function set loop(_arg1:Boolean):void{
_loop = _arg1;
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
if (_arg1 == _mute){
return;
};
_mute = _arg1;
if (_soundChannel){
setSoundTransform();
};
}
public function get isPlaying():Boolean{
return (Boolean(_soundChannel));
}
override public function destroy():void{
var _local1:IEntity;
if (!_exists){
throw (new Error("[AcousticalAspect] : <destroy> : Aspect not exists."));
};
if (!_entity){
_entity = undefined;
destroyThis();
_exists = undefined;
} else {
_local1 = _entity;
_entity = undefined;
_local1.removeAspect(this);
destroyThis();
_exists = undefined;
};
}
public function play(_arg1:Sound=null, _arg2:Number=0):void{
if (_arg1){
_sound = _arg1;
};
if (_soundChannel){
stopSound();
};
if (!_sound){
throw (new Error("[AcousticalAspect] : <play> : There is no sound to play."));
};
_position = _arg2;
playSound();
}
public function stop():void{
if (_soundChannel){
stopSound();
_position = 0;
};
}
public function pause():void{
if (_soundChannel){
_position = _soundChannel.position;
stopSound();
} else {
throw (new Error("[AcousticalAspect] : <pause> : Sound isn't playing."));
};
}
public function resume():void{
if (!_soundChannel){
if (_sound){
playSound();
} else {
throw (new Error("[AcousticalAspect] : <resume> : There is no sound to resume."));
};
} else {
throw (new Error("[AcousticalAspect] : <resume> : Sound not paused."));
};
}
private function playSound():void{
if (!_soundChannel){
if (_sound){
_soundChannel = _sound.play(_position);
setSoundTransform();
_soundChannel.addEventListener(Event.SOUND_COMPLETE, restart);
} else {
throw (new Error("[AcousticalAspect] : <playSound> : There is no sound to play."));
};
} else {
throw (new Error("[AcousticalAspect] : <playSound> : Sound is playing."));
};
}
private function stopSound():void{
if (_soundChannel){
_soundChannel.stop();
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restart);
_soundChannel = undefined;
} else {
throw (new Error("[AcousticalAspect] : <stopSound> : Sound not playing."));
};
}
private function restart(_arg1:Event):void{
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restart);
if (_loop){
_soundChannel = _sound.play();
setSoundTransform();
_soundChannel.addEventListener(Event.SOUND_COMPLETE, restart);
} else {
dispatchEvent(new GameEvent(GameEvent.SFX_COMPLETE));
};
}
private function setSoundTransform():void{
if (_soundChannel){
_soundChannel.soundTransform = new SoundTransform((int(!(_mute)) * _volume), _pan);
};
}
private function destroyThis():void{
_sound = undefined;
if (_soundChannel){
stopSound();
};
_soundChannel = undefined;
_volume = undefined;
_pan = undefined;
_loop = undefined;
_mute = undefined;
_position = undefined;
}
}
}//package lp.pge.game.core.aspects
Section 203
//GraphicalAspect (lp.pge.game.core.aspects.GraphicalAspect)
package lp.pge.game.core.aspects {
import flash.display.*;
import asp.aspects.*;
import asp.entities.*;
public class GraphicalAspect extends AAspect {
private var _image:Sprite;
public function GraphicalAspect(_arg1:Sprite){
if (!_arg1){
throw (new Error("[GraphicalAspect] : <GraphicalAspect> : Can't create graphical aspect with non-existing image."));
};
_image = _arg1;
}
public function get image():Sprite{
return (_image);
}
override public function destroy():void{
var _local1:IEntity;
if (!_exists){
throw (new Error("[GraphicalAspect] : <destroy> : Aspect not exists."));
};
if (!_entity){
_entity = undefined;
destroyThis();
_exists = undefined;
} else {
_local1 = _entity;
_entity = undefined;
_local1.removeAspect(this);
destroyThis();
_exists = undefined;
};
}
private function destroyThis():void{
if ((_image is MovieClip)){
(_image as MovieClip).stop();
};
if (((_image) && (_image.parent))){
_image.parent.removeChild(_image);
};
_image = undefined;
}
}
}//package lp.pge.game.core.aspects
Section 204
//InteractiveAspect (lp.pge.game.core.aspects.InteractiveAspect)
package lp.pge.game.core.aspects {
import flash.events.*;
import asp.aspects.*;
import asp.entities.*;
import flash.geom.*;
import lp.pge.game.*;
public class InteractiveAspect extends AAspect {
private var _area:Rectangle;
private var _axis:String;
private var _numSteps:uint;
private var _movSteps:Array;
public var drag:Boolean;
public function InteractiveAspect(_arg1:Rectangle=null, _arg2:String="all", _arg3:uint=0){
var _local4:Number;
var _local5:Number;
var _local6:uint;
var _local7:uint;
super();
_area = _arg1;
_axis = _arg2;
_numSteps = _arg3;
if (((((_arg1) && ((((_arg2 == "x")) || ((_arg2 == "y")))))) && ((_arg3 > 0)))){
_local4 = (((_arg2)=="x") ? _area.width : _area.height / (2 * _numSteps));
_local5 = ((_arg2)=="x") ? _area.left : _area.top;
_movSteps = new Array();
_local6 = ((2 * _numSteps) + 1);
_local7 = 0;
while (_local7 < _local6) {
_movSteps[_local7] = (_local5 + (_local7 * _local4));
_local7++;
};
};
}
public function get area():Rectangle{
return (_area);
}
public function get axis():String{
return (_axis);
}
public function get numSteps():uint{
return (_numSteps);
}
public function get moveSteps():Array{
return (_movSteps);
}
override public function destroy():void{
var _local1:IEntity;
if (!_exists){
throw (new Error("[InteractiveAspect] : <destroy> : Aspect not exists."));
};
if (!_entity){
_entity = undefined;
destroyThis();
_exists = undefined;
} else {
_local1 = _entity;
_entity = undefined;
_local1.removeAspect(this);
destroyThis();
_exists = undefined;
};
}
override public function add(_arg1:IEntity):void{
if (!_exists){
throw (new Error("[InteractiveAspect] : <add> : Aspect not exists."));
};
if (!_entity){
if (!_arg1.hasAspectOfType(GraphicalAspect)){
throw (new Error("[InteractiveAspect] : <add> : This aspect can be added only to entity that already has graphical aspect."));
};
_entity = _arg1;
if (!_entity.hasAspect(this)){
_entity.addAspect(this);
};
} else {
throw (new Error("[InteractiveAspect] : <add> : Aspect is already added to some entity."));
};
}
public function onClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.USER_MOUSE_CLICK, false, false, {iAsp:this, hit:_arg1.target.name}));
}
public function onDown(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.USER_MOUSE_DOWN, false, false, this));
}
public function onUp(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.USER_MOUSE_UP, false, false, this));
}
public function onOver(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.USER_MOUSE_OVER, false, false, this));
}
public function onOut(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.USER_MOUSE_OUT, false, false, this));
}
private function destroyThis():void{
_area = undefined;
_axis = undefined;
_numSteps = undefined;
_movSteps = undefined;
drag = undefined;
}
}
}//package lp.pge.game.core.aspects
Section 205
//MovementAspect (lp.pge.game.core.aspects.MovementAspect)
package lp.pge.game.core.aspects {
import Box2D.Common.Math.*;
import asp.aspects.*;
import asp.entities.*;
import lp.pge.game.*;
public class MovementAspect extends AAspect {
public const showTicks:uint = 24;
public const hideTicks:uint = 24;
private var _wp0:b2Vec2;
private var _wp1:b2Vec2;
private var _type:String;
private var _wpM:b2Vec2;
public var currTicks:uint;// = 0
public var pos:int;// = 0
public var dir:int;// = -1
public var currMode:uint;// = 0
private var _waypoint:b2Vec2;
private var _speed:Number;
private var _fixed:Boolean;
private var _moveOnce:Boolean;
private var _count:int;
public function MovementAspect(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:String="moving", _arg4:Number=2, _arg5:Boolean=false, _arg6:Boolean=false){
if (((!(_arg1)) && (!(_arg2)))){
throw (new Error("[MovementAspect] : <MovementAspect> : Can't create automatical aspect without waypoints."));
};
_wp0 = _arg1;
_wp1 = _arg2;
_type = _arg3;
if (_type == ThingTypes.JUMPING){
_wpM = new b2Vec2((_wp0.x + ((_wp1.x - _wp0.x) / 2)), (_wp0.y + ((_wp1.y - _wp0.y) / 2)));
};
_waypoint = _wp0;
_speed = _arg4;
_fixed = _arg5;
_moveOnce = _arg6;
_count = 0;
}
public function get wp0():b2Vec2{
return (_wp0.Copy());
}
public function get wp1():b2Vec2{
return (_wp1.Copy());
}
public function get type():String{
return (_type);
}
public function get wpM():b2Vec2{
return (_wpM.Copy());
}
public function get distance():Number{
var _local1:Number = (_wp1.x - _wp0.x);
var _local2:Number = (_wp1.y - _wp0.y);
return (Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
}
public function get xDistance():Number{
return ((_wp1.x - _wp0.x));
}
public function get yDistance():Number{
return ((_wp1.y - _wp0.y));
}
public function get waypoint():b2Vec2{
return ((_waypoint) ? _waypoint.Copy() : null);
}
public function set waypoint(_arg1:b2Vec2):void{
_waypoint = _arg1;
}
public function get speed():Number{
return (_speed);
}
public function set speed(_arg1:Number):void{
_speed = _arg1;
}
public function get fixed():Boolean{
return (_fixed);
}
public function set fixed(_arg1:Boolean):void{
_fixed = _arg1;
}
public function get moveOnce():Boolean{
return (_moveOnce);
}
public function set moveOnce(_arg1:Boolean):void{
_moveOnce = _arg1;
}
public function get count():int{
return (_count);
}
public function set count(_arg1:int):void{
_count = _arg1;
}
override public function destroy():void{
var _local1:IEntity;
if (!_exists){
throw (new Error("[MovementAspect] : <destroy> : Aspect not exists."));
};
if (!_entity){
_entity = undefined;
destroyThis();
_exists = undefined;
} else {
_local1 = _entity;
_entity = undefined;
_local1.removeAspect(this);
destroyThis();
_exists = undefined;
};
}
public function turnBack():void{
_waypoint = ((_waypoint)==_wp1) ? _wp0 : _wp1;
}
private function destroyThis():void{
_wp0 = undefined;
_wp1 = undefined;
_waypoint = undefined;
_wpM = undefined;
_fixed = undefined;
_moveOnce = undefined;
_speed = undefined;
_count = undefined;
}
}
}//package lp.pge.game.core.aspects
Section 206
//PhysicalAspect (lp.pge.game.core.aspects.PhysicalAspect)
package lp.pge.game.core.aspects {
import Box2D.Dynamics.*;
import asp.aspects.*;
import asp.entities.*;
public class PhysicalAspect extends AAspect {
private var _body:b2Body;
private var _type:String;
public static const DYNAMIC:String = "dynamic";
public static const KINEMATIC:String = "kinematic";
public static const STATIC:String = "static";
public static const MOVING:String = "moving";
public static const ROTATING:String = "rotating";
public function PhysicalAspect(_arg1:b2Body, _arg2:String="static"){
if (!_arg1){
throw (new Error("[PhysicalAspect] : <PhysicalAspect> : Can't create physical aspect with non-existing body."));
};
if ((((((((((_arg2 == "dynamic")) || ((_arg2 == "kinematic")))) || ((_arg2 == "static")))) || ((_arg2 == "moving")))) || ((_arg2 == "rotating")))){
_type = _arg2;
} else {
throw (new Error("[PhysicalAspect] : <PhysicalAspect> : Wrong type."));
};
_body = _arg1;
_body.SetUserData(this);
}
public function get body():b2Body{
return (_body);
}
public function get type():String{
return (_type);
}
override public function destroy():void{
var _local1:IEntity;
if (!_exists){
throw (new Error("[PhysicalAspect] : <destroy> : Aspect not exists."));
};
if (!_entity){
_entity = undefined;
destroyThis();
_exists = undefined;
} else {
_local1 = _entity;
_entity = undefined;
destroyThis();
_exists = undefined;
};
}
private function destroyThis():void{
if (body.GetWorld()){
body.GetWorld().DestroyBody(body);
};
_body.SetUserData(undefined);
_body = undefined;
_type = undefined;
}
}
}//package lp.pge.game.core.aspects
Section 207
//Animat (lp.pge.game.core.entities.Animat)
package lp.pge.game.core.entities {
import flash.display.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
public class Animat extends GameEntity {
private var _anim:MovieClip;
private var _ignoreAnim:Boolean;
public function Animat(_arg1:GraphicalAspect, _arg2:Boolean=false){
if (!_arg1){
throw (new Error("[Animat] : <Animat> : Can't initialize."));
};
if (((_arg1) && (_arg1.image))){
_anim = (_arg1.image.getChildByName("anim") as MovieClip);
if (_anim){
_anim.gotoAndStop(1);
_anim.addEventListener(GameEvent.ANIM_COMPLETE, onAnimComplete);
_anim.addEventListener(GameEvent.ANIM_DISPOSE, onAnimDispose);
};
};
addAspect(_arg1);
_ignoreAnim = _arg2;
}
override public function destroy():void{
if (_anim){
_anim.removeEventListener(GameEvent.ANIM_COMPLETE, onAnimComplete);
_anim.removeEventListener(GameEvent.ANIM_DISPOSE, onAnimDispose);
};
_anim = undefined;
_ignoreAnim = undefined;
super.destroy();
}
override public function dispose():void{
if (_anim){
_anim.removeEventListener(GameEvent.ANIM_COMPLETE, onAnimComplete);
_anim.removeEventListener(GameEvent.ANIM_DISPOSE, onAnimDispose);
};
_anim = undefined;
_ignoreAnim = undefined;
super.dispose();
}
public function get animated():Boolean{
return (Boolean(_anim));
}
public function get ignoreAnim():Boolean{
return (_ignoreAnim);
}
public function getAnim():MovieClip{
return (_anim);
}
public function gotoFrame(_arg1):void{
if (_anim){
_anim.gotoAndStop(_arg1);
} else {
throw (new Error("[Animat] : <gotoFrame> : Entity hasn't animation."));
};
}
public function playAnim(_arg1:String):void{
if (_anim){
_anim.gotoAndPlay(_arg1);
} else {
throw (new Error("[Animat] : <playAnim> : Entity hasn't animation."));
};
}
private function onAnimComplete(_arg1:GameEvent):void{
dispatchEvent(_arg1);
}
private function onAnimDispose(_arg1:GameEvent):void{
dispose();
}
}
}//package lp.pge.game.core.entities
Section 208
//Block (lp.pge.game.core.entities.Block)
package lp.pge.game.core.entities {
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.gui.*;
import com.greensock.easing.*;
public class Block extends Thing {
private var _hArrows:ArrowsIcon;
private var _vArrows:ArrowsIcon;
private var _hPosInd:MovieClip;
private var _vPosInd:MovieClip;
private var _fixed:Boolean;
private var _tween:TweenLite;
private var _baseX:Number;
private var _baseY:Number;
private var _convPt:Point;
private var _question:HiddenBlock;
private var _spr:Sprite;
public function Block(_arg1:PhysicalAspect, _arg2:GraphicalAspect, _arg3:Boolean=false){
super(_arg1, _arg2);
if (_anim){
_arg2.image.mouseChildren = true;
_arg2.image.mouseEnabled = false;
_baseX = _anim.x;
_baseY = _anim.y;
};
_hArrows = (_arg2.image.getChildByName("hArrows") as ArrowsIcon);
if (_hArrows){
_hArrows.visible = false;
_hArrows.align();
};
_vArrows = (_arg2.image.getChildByName("vArrows") as ArrowsIcon);
if (_vArrows){
_vArrows.visible = false;
_vArrows.align();
};
_hPosInd = (_arg2.image.getChildByName("hPosInd") as MovieClip);
if (_hPosInd){
_hPosInd.visible = false;
_hPosInd.align();
};
_vPosInd = (_arg2.image.getChildByName("vPosInd") as MovieClip);
if (_vPosInd){
_vPosInd.visible = false;
_vPosInd.align();
};
_fixed = _arg3;
_convPt = new Point();
if (_anim){
_spr = (_anim.getChildByName("sprite") as Sprite);
if (_spr){
_spr.getChildAt(0).visible = false;
};
};
}
override public function destroy():void{
_hArrows = undefined;
_vArrows = undefined;
_hPosInd = undefined;
_vPosInd = undefined;
_fixed = undefined;
if (_tween){
_tween.kill();
};
_tween = undefined;
_baseX = undefined;
_baseY = undefined;
_convPt = undefined;
_question = undefined;
super.destroy();
}
override public function dispose():void{
_hArrows = undefined;
_vArrows = undefined;
_hPosInd = undefined;
_vPosInd = undefined;
_fixed = undefined;
if (_tween){
_tween.kill();
};
_tween = undefined;
_baseX = undefined;
_baseY = undefined;
_convPt = undefined;
_question = undefined;
_spr = undefined;
super.dispose();
}
public function get question():HiddenBlock{
return (_question);
}
public function set question(_arg1:HiddenBlock):void{
_question = _arg1;
}
public function highlight():void{
if (_spr){
_spr.getChildAt(0).visible = true;
_spr.getChildAt(1).visible = false;
};
}
public function unhighlight():void{
if (_spr){
_spr.getChildAt(0).visible = false;
_spr.getChildAt(1).visible = true;
};
}
public function get fixed():Boolean{
return (_fixed);
}
public function shake(_arg1:Object):void{
var image:Sprite;
var rot:Number;
var cos:Number;
var sin:Number;
var shX:Number;
var shY:Number;
var v = _arg1;
if (_fixed){
return;
};
if (_tween){
return;
};
if (((((v) && ((v.x is Number)))) && ((v.y is Number)))){
if (_tween){
_tween.kill();
};
_anim.x = _baseX;
_anim.y = _baseY;
image = (getAspectByType(GraphicalAspect) as GraphicalAspect).image;
rot = ((Math.PI * image.rotation) / 180);
cos = Math.cos(rot);
sin = Math.sin(rot);
shX = ((v.x * cos) + (v.y * sin));
shY = ((v.y * cos) - (v.x * sin));
_tween = TweenLite.to(_anim, 0.5, {shake:{x:shX, y:shY, numShakes:3}, onComplete:function ():void{
_tween = undefined;
}});
};
}
public function stopShake():void{
if (_tween){
_tween.kill();
_tween = undefined;
_anim.x = _baseX;
_anim.y = _baseY;
};
}
public function get hasArrows():Boolean{
return (Boolean(((_hArrows) && (_vArrows))));
}
public function showArrows():void{
if (((_hArrows) && (_vArrows))){
_hArrows.visible = true;
_vArrows.visible = true;
} else {
throw (new Error("[Block] : <showArrows> : Entity hasn't 'hArrows' or/and 'vArrows' icon(s)."));
};
}
public function hideArrows():void{
if (((_hArrows) && (_vArrows))){
_hArrows.visible = false;
_vArrows.visible = false;
} else {
throw (new Error("[Block] : <showArrows> : Entity hasn't 'hArrows' or/and 'vArrows' icon(s)."));
};
}
public function alignArrows():void{
if (((_hArrows) && (_vArrows))){
_hArrows.align();
_vArrows.align();
} else {
throw (new Error("[Block] : <alignMove> : Entity hasn't 'hArrows' or/and 'vArrows' icon(s)."));
};
}
public function showHArrows():void{
if (_hArrows){
_hArrows.visible = true;
} else {
throw (new Error("[Block] : <showHArrows> : Entity hasn't 'hArrows' icon."));
};
}
public function hideHArrows():void{
if (_hArrows){
_hArrows.visible = false;
} else {
throw (new Error("[Block] : <hideHArrows> : Entity hasn't 'hArrows' icon."));
};
}
public function showVArrows():void{
if (_vArrows){
_vArrows.visible = true;
} else {
throw (new Error("[Block] : <showVArrows> : Entity hasn't 'vArrows' icon."));
};
}
public function hideVArrows():void{
if (_vArrows){
_vArrows.visible = false;
} else {
throw (new Error("[Block] : <hideVArrows> : Entity hasn't 'vArrows' icon."));
};
}
public function get hasPosInds():Boolean{
return (Boolean(((_hPosInd) && (_vPosInd))));
}
public function showPosInds():void{
if (((_hPosInd) && (_vPosInd))){
_hPosInd.visible = true;
_vPosInd.visible = true;
} else {
throw (new Error("[Block] : <showPosInds> : Entity hasn't 'hPosInd' or/and 'vPosInd' movieclip(s)."));
};
}
public function hidePosInds():void{
if (((_hPosInd) && (_vPosInd))){
_hPosInd.visible = false;
_vPosInd.visible = false;
} else {
throw (new Error("[Block] : <hidePosInds> : Entity hasn't 'hPosInd' or/and 'vPosInd' movieclip(s)."));
};
}
public function alignPosInds():void{
if (((_hPosInd) && (_vPosInd))){
_hPosInd.align();
_vPosInd.align();
} else {
throw (new Error("[Block] : <alignPosInds> : Entity hasn't 'hPosInd' or/and 'vPosInd' movieclip(s)."));
};
}
public function updatePosInds(_arg1:uint, _arg2:Number=0, _arg3:Number=0):void{
var _local4:Sprite;
if (((_hPosInd) && (_vPosInd))){
_hPosInd.gotoAndStop((1 + _arg1));
_vPosInd.gotoAndStop((1 + _arg1));
_local4 = (getAspectByType(GraphicalAspect) as GraphicalAspect).image;
_convPt.x = (_local4.x + _arg2);
_convPt.y = (_local4.y + _arg3);
_convPt = _local4.globalToLocal(_convPt);
_hPosInd.x = _convPt.x;
_hPosInd.y = _convPt.y;
_vPosInd.x = _convPt.x;
_vPosInd.y = _convPt.y;
} else {
throw (new Error("[Block] : <updatePosInds> : Entity hasn't 'hPosInd' or/and 'vPosInd' movieclip(s)."));
};
}
public function showHPosInd():void{
if (_hPosInd){
_hPosInd.visible = true;
} else {
throw (new Error("[Block] : <showHPosInd> : Entity hasn't 'hPosInd' movieclip."));
};
}
public function hideHPosInd():void{
if (_hPosInd){
_hPosInd.visible = false;
} else {
throw (new Error("[Block] : <hideHPosInd> : Entity hasn't 'hPosInd' movieclip."));
};
}
public function showVPosInd():void{
if (_vPosInd){
_vPosInd.visible = true;
} else {
throw (new Error("[Block] : <showVPosInd> : Entity hasn't 'vPosInd' movieclip."));
};
}
public function hideVPosInd():void{
if (_vPosInd){
_vPosInd.visible = false;
} else {
throw (new Error("[Block] : <hideVPosInd> : Entity hasn't 'vPosInd' movieclip."));
};
}
}
}//package lp.pge.game.core.entities
Section 209
//Bonus (lp.pge.game.core.entities.Bonus)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class Bonus extends Thing {
public function Bonus(_arg1:PhysicalAspect, _arg2:GraphicalAspect){
super(_arg1, _arg2);
}
}
}//package lp.pge.game.core.entities
Section 210
//BouncyBlock (lp.pge.game.core.entities.BouncyBlock)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class BouncyBlock extends Block {
public function BouncyBlock(_arg1:PhysicalAspect, _arg2:GraphicalAspect, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package lp.pge.game.core.entities
Section 211
//GameEntity (lp.pge.game.core.entities.GameEntity)
package lp.pge.game.core.entities {
import asp.entities.*;
public class GameEntity extends AEntity {
}
}//package lp.pge.game.core.entities
Section 212
//Geometry (lp.pge.game.core.entities.Geometry)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class Geometry extends GameEntity {
public function Geometry(_arg1:PhysicalAspect){
if (!_arg1){
throw (new Error("[Geometry] : <Geometry> : Can't initialize."));
};
addAspect(_arg1);
}
}
}//package lp.pge.game.core.entities
Section 213
//GFX (lp.pge.game.core.entities.GFX)
package lp.pge.game.core.entities {
import flash.display.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
public class GFX extends GameEntity {
private var _anim:MovieClip;
private var _loop:Boolean;
public function GFX(_arg1:GraphicalAspect, _arg2:Boolean=false){
if (!_arg1){
throw (new Error("[GFX] : <GFX> : Can't initialize."));
};
if (_arg1.image){
_anim = (_arg1.image.getChildByName("anim") as MovieClip);
if (_anim){
_anim.gotoAndStop(1);
_anim.addEventListener(GameEvent.GFX_COMPLETE, onGFXComplete);
};
};
addAspect(_arg1);
_loop = _arg2;
}
override public function destroy():void{
_anim = undefined;
_loop = undefined;
super.destroy();
}
override public function dispose():void{
_anim = undefined;
_loop = undefined;
super.dispose();
}
public function get animated():Boolean{
return (Boolean(_anim));
}
public function get loop():Boolean{
return (_loop);
}
public function getAnim():MovieClip{
return (_anim);
}
public function playAnim(_arg1:String):void{
if (_anim){
_anim.gotoAndPlay(_arg1);
} else {
throw (new Error("[GFX] : <playAnim> : Entity hasn't animation."));
};
}
public function stopAnim():void{
if (_anim){
_anim.gotoAndStop(1);
} else {
throw (new Error("[GFX] : <stopAnim> : Entity hasn't animation."));
};
}
public function pauseAnim():void{
if (_anim){
_anim.stop();
} else {
throw (new Error("[GFX] : <pauseAnim> : Entity hasn't animation."));
};
}
public function resumeAnim():void{
if (_anim){
_anim.play();
} else {
throw (new Error("[GFX] : <resumeAnim> : Entity hasn't animation."));
};
}
private function onGFXComplete(_arg1:GameEvent):void{
_anim.removeEventListener(GameEvent.GFX_COMPLETE, onGFXComplete);
if (_loop){
_anim.gotoAndPlay(1);
} else {
dispose();
};
}
}
}//package lp.pge.game.core.entities
Section 214
//NormalBlock (lp.pge.game.core.entities.NormalBlock)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class NormalBlock extends Block {
public function NormalBlock(_arg1:PhysicalAspect, _arg2:GraphicalAspect, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package lp.pge.game.core.entities
Section 215
//Packet (lp.pge.game.core.entities.Packet)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class Packet extends Thing {
private var _hitPoints:int;
private var _initHitPoints:int;
public function Packet(_arg1:PhysicalAspect, _arg2:GraphicalAspect, _arg3:int=0){
super(_arg1, _arg2);
_hitPoints = _arg3;
_initHitPoints = _hitPoints;
}
override public function destroy():void{
_hitPoints = undefined;
_initHitPoints = undefined;
super.destroy();
}
override public function dispose():void{
_hitPoints = undefined;
_initHitPoints = undefined;
super.dispose();
}
public function get hitPoints():int{
return (_hitPoints);
}
public function set hitPoints(_arg1:int):void{
_hitPoints = _arg1;
}
public function get initHitPoints():int{
return (_initHitPoints);
}
public function getHitProgress():Number{
if (!isFinite(_hitPoints)){
return (0);
};
return ((1 - (_hitPoints / _initHitPoints)));
}
public function updateSkin(_arg1:Number):void{
if (_anim){
_anim.updateSkin(_arg1);
} else {
throw (new Error("[Packet] : <updateSkin> : Entity hasn't animation."));
};
}
}
}//package lp.pge.game.core.entities
Section 216
//SFX (lp.pge.game.core.entities.SFX)
package lp.pge.game.core.entities {
import flash.media.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
public class SFX extends GameEntity {
private var _speaker:AcousticalAspect;
private var _loop:Boolean;
public function SFX(_arg1:AcousticalAspect, _arg2:Boolean=false){
if (!_arg1){
throw (new Error("[SFX] : <SFX> : Can't initialize."));
};
_speaker = _arg1;
_speaker.addEventListener(GameEvent.SFX_COMPLETE, onSFXComplete);
addAspect(_arg1);
_loop = _arg2;
}
override public function destroy():void{
_speaker = undefined;
_loop = undefined;
super.destroy();
}
override public function dispose():void{
_speaker = undefined;
_loop = undefined;
super.dispose();
}
public function get loop():Boolean{
return (_loop);
}
public function get mute():Boolean{
return (_speaker.mute);
}
public function get isPlaying():Boolean{
return (_speaker.isPlaying);
}
public function playSound(_arg1:Sound=null, _arg2:Number=0):void{
_speaker.play(_arg1, _arg2);
}
public function stopSound():void{
_speaker.stop();
}
public function pauseSound():void{
_speaker.pause();
}
public function resumeSound():void{
_speaker.resume();
}
private function onSFXComplete(_arg1:GameEvent):void{
(getAspectByType(AcousticalAspect) as AcousticalAspect).removeEventListener(GameEvent.SFX_COMPLETE, onSFXComplete);
if (_loop){
_speaker.play();
} else {
dispose();
};
}
}
}//package lp.pge.game.core.entities
Section 217
//Spikes (lp.pge.game.core.entities.Spikes)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class Spikes extends Thing {
public function Spikes(_arg1:PhysicalAspect, _arg2:GraphicalAspect){
super(_arg1, _arg2);
}
}
}//package lp.pge.game.core.entities
Section 218
//StickyBlock (lp.pge.game.core.entities.StickyBlock)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class StickyBlock extends Block {
public function StickyBlock(_arg1:PhysicalAspect, _arg2:GraphicalAspect, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package lp.pge.game.core.entities
Section 219
//Target (lp.pge.game.core.entities.Target)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class Target extends Thing {
private var _event:String;
private var _hitDistance:Number;
private var _packetAction:String;
public function Target(_arg1:PhysicalAspect, _arg2:GraphicalAspect, _arg3:Number, _arg4:String=null){
super(_arg1, _arg2);
_hitDistance = _arg3;
_event = _arg4;
}
override public function destroy():void{
_event = undefined;
_hitDistance = undefined;
_packetAction = undefined;
super.destroy();
}
override public function dispose():void{
_event = undefined;
_hitDistance = undefined;
_packetAction = undefined;
super.dispose();
}
public function get event():String{
return (_event);
}
public function get hitDistance():Number{
return (_hitDistance);
}
public function get packetAction():String{
return (_packetAction);
}
public function set packetAction(_arg1:String):void{
_packetAction = _arg1;
}
}
}//package lp.pge.game.core.entities
Section 220
//Thing (lp.pge.game.core.entities.Thing)
package lp.pge.game.core.entities {
import flash.display.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
public class Thing extends GameEntity {
protected var _anim:MovieClip;
public function Thing(_arg1:PhysicalAspect, _arg2:GraphicalAspect){
if (((!(_arg1)) || (!(_arg2)))){
throw (new Error("[Thing] : <Thing> : Can't initialize."));
};
if (((_arg2) && (_arg2.image))){
_anim = (_arg2.image.getChildByName("anim") as MovieClip);
if (_anim){
_anim.gotoAndStop(1);
_anim.addEventListener(GameEvent.ANIM_COMPLETE, onAnimComplete);
};
};
addAspects([_arg1, _arg2]);
}
override public function destroy():void{
_anim = undefined;
super.destroy();
}
override public function dispose():void{
_anim = undefined;
super.dispose();
}
public function get animated():Boolean{
return (Boolean(_anim));
}
public function getAnim():MovieClip{
return (_anim);
}
public function gotoFrame(_arg1):void{
if (_anim){
_anim.gotoAndStop(_arg1);
} else {
throw (new Error("[Thing] : <gotoFrame> : Entity hasn't animation."));
};
}
public function playFrame(_arg1):void{
if (_anim){
_anim.gotoAndPlay(_arg1);
} else {
throw (new Error("[Thing] : <playFrame> : Entity hasn't animation."));
};
}
public function playAnim(_arg1:String):void{
if (_anim){
_anim.gotoAndPlay(_arg1);
} else {
throw (new Error("[Thing] : <playAnim> : Entity hasn't animation."));
};
}
protected function onAnimComplete(_arg1:GameEvent):void{
dispatchEvent(_arg1);
}
}
}//package lp.pge.game.core.entities
Section 221
//Trigger (lp.pge.game.core.entities.Trigger)
package lp.pge.game.core.entities {
import lp.pge.game.core.aspects.*;
public class Trigger extends GameEntity {
private var _event:String;
public function Trigger(_arg1:PhysicalAspect, _arg2:String=null){
if (!_arg1){
throw (new Error("[Trigger] : <Trigger> : Can't initialize."));
};
addAspect(_arg1);
_event = _arg2;
}
override public function destroy():void{
_event = undefined;
super.destroy();
}
override public function dispose():void{
_event = undefined;
super.dispose();
}
public function get event():String{
return (_event);
}
}
}//package lp.pge.game.core.entities
Section 222
//GameManager (lp.pge.game.core.managers.GameManager)
package lp.pge.game.core.managers {
import asp.managers.*;
import lp.pge.game.core.*;
import asp.events.*;
public class GameManager extends SmartManager {
private static var _instance:GameManager;
public function GameManager(){
_instance = this;
GameEngine.instance.addEventListener(EngineEvent.FINISH_UPDATE, onFinishUpdate);
}
override public function destroy():void{
if (GameEngine.instance.hasEventListener(EngineEvent.FINISH_UPDATE)){
GameEngine.instance.removeEventListener(EngineEvent.FINISH_UPDATE, onFinishUpdate);
};
super.destroy();
}
override public function dispose():void{
if (GameEngine.instance.hasEventListener(EngineEvent.FINISH_UPDATE)){
GameEngine.instance.removeEventListener(EngineEvent.FINISH_UPDATE, onFinishUpdate);
};
super.dispose();
}
override protected function condition():Boolean{
return (GameEngine.instance.updating());
}
private function onFinishUpdate(_arg1:EngineEvent):void{
executeOperations();
}
public static function get instance():GameManager{
return (_instance);
}
}
}//package lp.pge.game.core.managers
Section 223
//AcousticalAdapter (lp.pge.game.core.systems.AcousticalAdapter)
package lp.pge.game.core.systems {
import asp.systems.*;
import asp.entities.*;
import lp.pge.game.core.aspects.*;
public class AcousticalAdapter extends AAdapter {
private var _mute:Boolean;
private var _playing:Boolean;
public function AcousticalAdapter(){
_types = [AcousticalAspect];
_mute = false;
_playing = true;
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
var _local2:IEntity;
var _local3:AcousticalAspect;
_mute = _arg1;
for each (_local2 in _entities) {
_local3 = (_local2.getAspectByType(AcousticalAspect) as AcousticalAspect);
_local3.mute = _mute;
};
}
public function get isPlaying():Boolean{
return (_playing);
}
override public function update():void{
}
public function play():void{
var _local1:IEntity;
var _local2:AcousticalAspect;
_playing = true;
for each (_local1 in _entities) {
_local2 = (_local1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (!_local2.isPlaying){
_local2.play();
};
};
}
public function pause():void{
var _local1:IEntity;
var _local2:AcousticalAspect;
_playing = false;
for each (_local1 in _entities) {
_local2 = (_local1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (_local2.isPlaying){
_local2.pause();
};
};
}
public function resume():void{
var _local1:IEntity;
var _local2:AcousticalAspect;
_playing = true;
for each (_local1 in _entities) {
_local2 = (_local1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (!_local2.isPlaying){
_local2.resume();
};
};
}
public function stop():void{
var _local1:IEntity;
var _local2:AcousticalAspect;
_playing = false;
for each (_local1 in _entities) {
_local2 = (_local1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (_local2.isPlaying){
_local2.stop();
};
};
}
override protected function onEntityAdd(_arg1:IEntity):void{
var _local2:AcousticalAspect = (_arg1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (_local2.mute != _mute){
_local2.mute = _mute;
};
}
override protected function onEntityRemove(_arg1:IEntity):void{
var _local2:AcousticalAspect = (_arg1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (_local2.isPlaying){
_local2.stop();
};
}
override protected function onEntityDestroy(_arg1:IEntity):void{
var _local2:AcousticalAspect = (_arg1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (_local2.isPlaying){
_local2.stop();
};
}
override protected function onEntityDispose(_arg1:IEntity):void{
var _local2:AcousticalAspect = (_arg1.getAspectByType(AcousticalAspect) as AcousticalAspect);
if (_local2.isPlaying){
_local2.stop();
};
}
}
}//package lp.pge.game.core.systems
Section 224
//CollisionProcess (lp.pge.game.core.systems.CollisionProcess)
package lp.pge.game.core.systems {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Contacts.*;
import lp.pge.game.core.entities.*;
import flash.display.*;
import Box2D.Collision.*;
import asp.systems.*;
import asp.aspects.*;
import Box2DExt.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
import lp.pge.game.core.managers.*;
import flash.utils.*;
public class CollisionProcess extends AProcess {
private const DPR:Number = 57.2957795130823;
private const PS:Number = 30;
private var _world:b2World;
private var _events:Array;
private var _listener:b2eContactListener;
private var _trash:Dictionary;
private var _stack:Dictionary;
public function CollisionProcess(_arg1:b2World, _arg2:Array){
if (((!(_arg1)) || (!(_arg2)))){
throw (new Error("[CollisionProcess] : <CollisionProcess> : Can't initialize."));
};
_world = _arg1;
_events = _arg2;
_trash = new Dictionary();
_stack = new Dictionary();
_listener = new b2eContactListener();
_listener.onBeginContact = processContactBegin;
_listener.onPostSolve = processContact;
_world.SetContactListener(_listener);
}
override public function update():void{
var _local2:b2ContactEdge;
var _local3:*;
var _local4:Target;
var _local1:Packet = (GameManager.instance.getEntityByType(Packet) as Packet);
if (_local1){
if (!_stack[_local1]){
_stack[_local1] = {block:new Dictionary(), target:new Dictionary(), bonus:new Dictionary(), spikes:new Dictionary(), geometry:new Dictionary(), trigger:new Dictionary()};
};
_local2 = (_local1.getAspectByType(PhysicalAspect) as PhysicalAspect).body.GetContactList();
while (((_local2) && (_local2.other))) {
_local3 = _local2.other.GetUserData();
if ((((_local3 is PhysicalAspect)) && (_local3.entity))){
_local4 = (_local3.entity as Target);
if (_local4){
_stack[_local1].target[_local4] = {type:"target"};
};
};
_local2 = _local2.next;
};
};
processStack();
_trash = new Dictionary();
}
override public function destroy():void{
super.destroy();
destroyThis();
}
override public function dispose():void{
super.dispose();
destroyThis();
}
override public function disposeAll():void{
super.disposeAll();
destroyThis();
}
private function processContact(_arg1:b2Contact, _arg2:b2ContactImpulse):void{
var _local11:Boolean;
var _local12:Packet;
var _local13:GameEntity;
var _local3:b2Fixture = _arg1.GetFixtureA();
var _local4:b2Fixture = _arg1.GetFixtureB();
var _local5:b2Body = _local3.GetBody();
var _local6:b2Body = _local4.GetBody();
var _local7:* = _local5.GetUserData();
var _local8:* = _local6.GetUserData();
var _local9:GameEntity = (_local7.entity as GameEntity);
var _local10:GameEntity = (_local8.entity as GameEntity);
if (((_trash[_local9]) || (_trash[_local10]))){
return;
};
if ((((_local9 is Packet)) || ((_local10 is Packet)))){
_local11 = (_local9 is Packet);
_local12 = (_local11) ? (_local9 as Packet) : (_local10 as Packet);
_local13 = (_local11) ? _local10 : _local9;
if (!_stack[_local12]){
_stack[_local12] = {block:new Dictionary(), target:new Dictionary(), bonus:new Dictionary(), spikes:new Dictionary(), geometry:new Dictionary(), trigger:new Dictionary()};
};
if ((_local13 is Block)){
_stack[_local12].block[_local13] = {type:"block", contact:_arg1, impulse:_arg2, hazard:(((_local3.GetUserData() == "hazard")) || ((_local4.GetUserData() == "hazard"))), inverse:!(_local11)};
};
} else {
if (((!(_local3.IsSensor())) && (!(_local4.IsSensor())))){
if (((_local9.hasAspectOfType(MovementAspect)) || (_local10.hasAspectOfType(MovementAspect)))){
if (_local9.hasAspectOfType(MovementAspect)){
processMovingBlockCollision(_local9, _local10);
} else {
processMovingBlockCollision(_local10, _local9);
};
};
};
};
}
private function processContactBegin(_arg1:b2Contact):void{
var _local8:GameEntity;
var _local9:GameEntity;
var _local10:Boolean;
var _local11:Packet;
var _local12:GameEntity;
var _local13:String;
var _local2:b2Fixture = _arg1.GetFixtureA();
var _local3:b2Fixture = _arg1.GetFixtureB();
var _local4:b2Body = _local2.GetBody();
var _local5:b2Body = _local3.GetBody();
var _local6:* = _local4.GetUserData();
var _local7:* = _local5.GetUserData();
if (((!(_local6)) || (!(_local7)))){
if (((_local6) && (!(_local2.IsSensor())))){
_local8 = (_local6.entity as GameEntity);
if (_local8.hasAspectOfType(MovementAspect)){
(_local8.getAspectByType(MovementAspect) as MovementAspect).turnBack();
};
} else {
if (((_local7) && (!(_local3.IsSensor())))){
_local9 = (_local7.entity as GameEntity);
if (_local9.hasAspectOfType(MovementAspect)){
(_local9.getAspectByType(MovementAspect) as MovementAspect).turnBack();
};
};
};
return;
};
if (((!((_local6 is IAspect))) || (!((_local7 is IAspect))))){
if ((_local6 is IAspect)){
_local8 = (_local6.entity as GameEntity);
if (!_local8.exists()){
return;
};
if (_trash[_local8]){
return;
};
if (_local7 == "bBound"){
GameManager.instance.disposeEntity(_local8);
_trash[_local8] = _local8;
if ((_local8 is Packet)){
trace("[CollisionProcess] > Packet lost (floor).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
} else {
if (_local7 == "tBound"){
GameManager.instance.disposeEntity(_local8);
_trash[_local8] = _local8;
if ((_local8 is Packet)){
trace("[CollisionProcess] > Packet lost (roof).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
} else {
if (_local7 == "lBound"){
GameManager.instance.disposeEntity(_local8);
_trash[_local8] = _local8;
if ((_local8 is Packet)){
trace("[CollisionProcess] > Packet lost (left wall).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
} else {
if (_local7 == "rBound"){
GameManager.instance.disposeEntity(_local8);
_trash[_local8] = _local8;
if ((_local8 is Packet)){
trace("[CollisionProcess] > Packet lost (right wall).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
};
};
};
};
} else {
if ((_local7 is IAspect)){
_local9 = (_local7.entity as GameEntity);
if (!_local9.exists()){
return;
};
if (_trash[_local9]){
return;
};
if (_local6 == "bBound"){
GameManager.instance.disposeEntity(_local9);
_trash[_local9] = _local9;
if ((_local9 is Packet)){
trace("[CollisionProcess] > Packet lost (floor).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
} else {
if (_local6 == "tBound"){
GameManager.instance.disposeEntity(_local9);
_trash[_local9] = _local9;
if ((_local9 is Packet)){
trace("[CollisionProcess] > Packet lost (roof).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
} else {
if (_local6 == "lBound"){
GameManager.instance.disposeEntity(_local9);
_trash[_local9] = _local9;
if ((_local9 is Packet)){
trace("[CollisionProcess] > Packet lost (left wall).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
} else {
if (_local6 == "rBound"){
GameManager.instance.disposeEntity(_local9);
_trash[_local9] = _local9;
if ((_local9 is Packet)){
trace("[CollisionProcess] > Packet lost (right wall).");
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
};
};
};
};
};
};
return;
};
_local8 = (_local6.entity as GameEntity);
_local9 = (_local7.entity as GameEntity);
if (((_trash[_local8]) || (_trash[_local9]))){
return;
};
if ((((_local8 is Packet)) || ((_local9 is Packet)))){
_local10 = (_local8 is Packet);
_local11 = (_local10) ? (_local8 as Packet) : (_local9 as Packet);
_local12 = (_local10) ? _local9 : _local8;
if (!_stack[_local11]){
_stack[_local11] = {block:new Dictionary(), target:new Dictionary(), bonus:new Dictionary(), spikes:new Dictionary(), geometry:new Dictionary(), trigger:new Dictionary()};
};
if ((_local12 is Target)){
_stack[_local11].target[_local12] = {type:"target"};
} else {
if ((_local12 is Bonus)){
_stack[_local11].bonus[_local12] = {type:"bonus"};
} else {
if ((_local12 is Spikes)){
_stack[_local11].spikes[_local12] = {type:"spikes"};
} else {
if ((_local12 is Geometry)){
_local13 = ((((_local2.GetUserData() == "water")) || ((_local3.GetUserData() == "water")))) ? "water" : "default";
_stack[_local11].geometry[_local12] = {type:"geometry", kind:_local13, contact:_arg1};
} else {
if ((_local12 is Trigger)){
_stack[_local11].trigger[_local12] = {type:"trigger"};
};
};
};
};
};
} else {
if (((!(_local2.IsSensor())) && (!(_local3.IsSensor())))){
if (((_local8.hasAspectOfType(MovementAspect)) || (_local9.hasAspectOfType(MovementAspect)))){
if (_local8.hasAspectOfType(MovementAspect)){
processMovingBlockCollision(_local8, _local9);
} else {
processMovingBlockCollision(_local9, _local8);
};
};
};
};
}
private function processContactEnd(_arg1:b2Contact):void{
var _local2:b2Fixture = _arg1.GetFixtureA();
var _local3:b2Fixture = _arg1.GetFixtureB();
var _local4:b2Body = _local2.GetBody();
var _local5:b2Body = _local3.GetBody();
var _local6:* = _local4.GetUserData();
var _local7:* = _local5.GetUserData();
if (((!(_local6)) || (!(_local7)))){
return;
};
if (((!((_local6 is IAspect))) || (!((_local7 is IAspect))))){
return;
};
var _local8:GameEntity = (_local6.entity as GameEntity);
var _local9:GameEntity = (_local7.entity as GameEntity);
if (((_trash[_local8]) || (_trash[_local9]))){
return;
};
}
private function processPacketBlockCollision(_arg1:Packet, _arg2:Block, _arg3:b2Contact, _arg4:b2ContactImpulse, _arg5:Boolean=false, _arg6:Boolean=false):void{
var _local8:Number;
var _local9:SFX;
var _local10:b2WorldManifold;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Sprite;
var _local15:GFX;
var _local16:b2WorldManifold;
var _local17:b2Vec2;
var _local18:b2Body;
var _local19:b2Vec2;
var _local20:Number;
var _local21:Number;
var _local22:b2Vec2;
var _local23:b2Vec2;
var _local24:Number;
var _local25:Number;
var _local7:Number = 0;
for each (_local8 in _arg4.normalImpulses) {
_local7 = (_local7 + _local8);
};
if ((((_local7 >= 15)) && ((((_arg2 is BouncyBlock)) || ((_arg2 is NormalBlock)))))){
_local9 = new SFX(new AcousticalAspect());
GameManager.instance.addEntity(_local9);
if ((_arg2 is BouncyBlock)){
_local9.playSound(new WoodHit());
} else {
if ((_arg2 is NormalBlock)){
_local9.playSound(new IronHit());
};
};
_local10 = new b2WorldManifold();
_arg3.GetWorldManifold(_local10);
_local11 = _local10.m_points[0];
_local12 = _local10.m_normal;
if (!_arg6){
_local12.x = (_local12.x * -1);
_local12.y = (_local12.y * -1);
};
_local13 = (_local7 / 20);
_local12.x = (_local12.x * -(_local13));
_local12.y = (_local12.y * -(_local13));
_arg2.shake(_local12);
_local14 = new SparksAnim();
_local14.x = (_local11.x * PS);
_local14.y = (_local11.y * PS);
_local14.rotation = ((DPR * Math.atan2(_local12.y, _local12.x)) + 90);
_local15 = new GFX(new GraphicalAspect(_local14));
GameManager.instance.addEntity(_local15);
};
if ((_arg2 is StickyBlock)){
_local16 = new b2WorldManifold();
_arg3.GetWorldManifold(_local16);
_local17 = _local16.m_normal;
if (!_arg6){
_local17.x = (_local17.x * -1);
_local17.y = (_local17.y * -1);
};
_local18 = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
_local19 = _local18.GetLinearVelocity();
_local20 = Math.sqrt(((_local19.x * _local19.x) + (_local19.y * _local19.y)));
_local21 = ((_local19.x * _local17.x) + (_local19.y * _local17.y));
_local22 = new b2Vec2((_local21 * _local17.x), (_local21 * _local17.y));
_local19.Subtract(_local22);
_local18.SetLinearVelocity(_local19);
_local23 = new b2Vec2(-(_local17.y), _local17.x);
_local24 = _local18.GetAngularVelocity();
_local25 = (_local20 / (40 / PS));
if (((((_local23.x * _local19.x) > 0)) && (((_local24 * _local25) < 0)))){
_local18.SetAngularVelocity(_local25);
} else {
if (((((_local23.x * _local19.x) < 0)) && (((-(_local24) * _local25) < 0)))){
_local18.SetAngularVelocity(-(_local25));
};
};
};
if (_arg5){
trace("[CollisionProcess] > Packet lost (hazard).");
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_arg1);
packetCrash(_arg1);
GameManager.instance.disposeEntity(_arg1);
_trash[_arg1] = _arg1;
_events.push(new GameEvent(GameEvent.PACKET_LOST));
} else {
if (isFinite(_arg1.hitPoints)){
if (_local7 < 25){
return;
};
_arg1.hitPoints--;
_arg1.updateSkin(_arg1.getHitProgress());
if (!_arg1.hitPoints){
trace("[CollisionProcess] > Packet lost (crashed).");
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_arg1);
packetCrash(_arg1);
GameManager.instance.disposeEntity(_arg1);
_trash[_arg1] = _arg1;
_events.push(new GameEvent(GameEvent.PACKET_LOST));
};
};
};
}
private function processPacketTargetCollision(_arg1:Packet, _arg2:Target):void{
var _local10:GraphicalAspect;
var _local11:Animat;
var _local3:b2Body = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
var _local4:b2Body = (_arg2.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
var _local5:b2Vec2 = _local3.GetPosition();
var _local6:b2Vec2 = _local4.GetPosition();
var _local7:Number = (_local5.x - _local6.x);
var _local8:Number = (_local5.y - _local6.y);
var _local9:Number = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
if (_local9 <= _arg2.hitDistance){
trace("[CollisionProcess] > Packet delivered.");
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_arg1);
if (_arg2.packetAction == "break"){
packetCrash(_arg1);
};
GameManager.instance.disposeEntity(_arg1);
_trash[_arg1] = _arg1;
_local10 = (_arg2.getAspectByType(GraphicalAspect) as GraphicalAspect);
_arg2.removeAspect(_local10);
_local11 = new Animat(_local10);
GameManager.instance.addEntity(_local11);
_local11.playAnim("disappear");
GameManager.instance.disposeEntity(_arg2);
_trash[_arg2] = _arg2;
_events.push(new GameEvent(GameEvent.PACKET_DELIVERED, false, false, _arg2.event));
};
}
private function processPacketBonusCollision(_arg1:Packet, _arg2:Bonus):void{
trace("[CollisionProcess] > Bonus collected.");
var _local3:GraphicalAspect = (_arg2.getAspectByType(GraphicalAspect) as GraphicalAspect);
_arg2.removeAspect(_local3);
var _local4:Animat = new Animat(_local3);
GameManager.instance.addEntity(_local4);
_local4.playAnim("away");
var _local5:SFX = new SFX(new AcousticalAspect());
GameManager.instance.addEntity(_local5);
_local5.playSound(new BonusSound());
GameManager.instance.disposeEntity(_arg2);
_trash[_arg2] = _arg2;
_events.push(new GameEvent(GameEvent.BONUS_COLLECTED));
}
private function processPacketSpikesCollision(_arg1:Packet, _arg2:Spikes):void{
trace("[CollisionProcess] > Packet lost (spikes).");
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_arg1);
packetCrash(_arg1);
GameManager.instance.disposeEntity(_arg1);
_trash[_arg1] = _arg1;
_events.push(new GameEvent(GameEvent.PACKET_LOST));
}
private function processPacketGeometryCollision(_arg1:Packet, _arg2:Geometry, _arg3:String="default", _arg4:b2Contact=null):void{
var _local5:Sprite;
var _local6:WaterSplashAnim;
trace("[CollisionProcess] > Packet lost (geometry).");
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_arg1);
if (_arg3 == "water"){
_local5 = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect).image;
_local6 = new WaterSplashAnim();
new WaterSplashAnim().scaleX = (_local6.scaleY = 0.5);
_local6.x = _local5.x;
_local6.y = _local5.y;
_local5.parent.addChild(_local6);
} else {
packetCrash(_arg1);
};
GameManager.instance.disposeEntity(_arg1);
_trash[_arg1] = _arg1;
_events.push(new GameEvent(GameEvent.PACKET_LOST));
}
private function processPacketTriggerCollision(_arg1:Packet, _arg2:Trigger):void{
trace("[CollisionProcess] > Packet lost (trigger).");
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_arg1);
packetCrash(_arg1);
GameManager.instance.disposeEntity(_arg1);
_trash[_arg1] = _arg1;
_events.push(new GameEvent(GameEvent.TRIGGER_ACTIVATED, false, false, _arg2.event));
_events.push(new GameEvent(GameEvent.PACKET_LOST));
}
private function processMovingBlockCollision(_arg1:GameEntity, _arg2:GameEntity):void{
}
private function packetCrash(_arg1:Packet):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
_arg1.removeAspect(_local2);
var _local3:Animat = new Animat(_local2);
GameManager.instance.addEntity(_local3);
_local3.playAnim("crash");
var _local4:SFX = new SFX(new AcousticalAspect());
GameManager.instance.addEntity(_local4);
_local4.playSound(new CrashSound());
}
private function destroyThis():void{
_listener = undefined;
_world = undefined;
_trash = undefined;
}
private function processStack():void{
var _local1:*;
var _local2:Packet;
var _local3:Object;
var _local4:Dictionary;
var _local5:Dictionary;
var _local6:Dictionary;
var _local7:Dictionary;
var _local8:Dictionary;
var _local9:Dictionary;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:Target;
var _local17:Bonus;
var _local18:Trigger;
var _local19:Spikes;
var _local20:Geometry;
var _local21:Object;
var _local22:Block;
var _local23:Object;
for (_local1 in _stack) {
_local2 = _local1;
if (_trash[_local2]){
} else {
_local3 = _stack[_local2];
_local4 = _local3.target;
_local5 = _local3.bonus;
_local6 = _local3.trigger;
_local7 = _local3.spikes;
_local8 = _local3.geometry;
_local9 = _local3.block;
for (_local10 in _local4) {
_local16 = _local10;
if (_trash[_local2]){
break;
};
if (_trash[_local16]){
} else {
processPacketTargetCollision(_local2, _local16);
};
};
for (_local11 in _local5) {
_local17 = _local11;
if (_trash[_local2]){
break;
};
if (_trash[_local17]){
} else {
processPacketBonusCollision(_local2, _local17);
};
};
for (_local12 in _local6) {
_local18 = _local12;
if (_trash[_local2]){
break;
};
processPacketTriggerCollision(_local2, _local18);
};
for (_local13 in _local7) {
_local19 = _local13;
if (_trash[_local2]){
break;
};
processPacketSpikesCollision(_local2, _local19);
};
for (_local14 in _local8) {
_local20 = _local14;
if (_trash[_local2]){
break;
};
_local21 = _local8[_local20];
processPacketGeometryCollision(_local2, _local20, _local21.kind, _local21.contact);
};
for (_local15 in _local9) {
_local22 = _local15;
if (_trash[_local2]){
break;
};
_local23 = _local9[_local22];
processPacketBlockCollision(_local2, _local22, _local23.contact, _local23.impulse, _local23.hazard, _local23.inverse);
};
};
};
_stack = new Dictionary();
}
}
}//package lp.pge.game.core.systems
Section 225
//GraphicalAdapter (lp.pge.game.core.systems.GraphicalAdapter)
package lp.pge.game.core.systems {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import lp.pge.game.core.entities.*;
import flash.display.*;
import asp.systems.*;
import asp.entities.*;
import lp.pge.game.core.aspects.*;
public class GraphicalAdapter extends AAdapter {
private const DPR:Number = 57.2957795130823;
private const RPD:Number = 0.0174532925199433;
private const PS:Number = 30;
private var cachedAngle:Number;
private var cachedCos:Number;
private var cachedSin:Number;
private var _screen:Sprite;
private var _canvas:Sprite;
public function GraphicalAdapter(_arg1:Sprite, _arg2:Sprite=null){
if (_arg1){
_screen = _arg1;
} else {
throw (new Error("[GraphicalAdapter] : <GraphicalAdapter> : Can't initialize."));
};
_canvas = _arg2;
_types = [GraphicalAspect];
}
public function updateBodyImage(_arg1:b2Body, _arg2:Sprite):void{
var _local3:b2Vec2 = _arg1.GetPosition();
var _local4:Number = _arg1.GetAngle();
_arg2.x = (_local3.x * PS);
_arg2.y = (_local3.y * PS);
_arg2.rotation = (_local4 * DPR);
}
public function updateEntity(_arg1:IEntity):void{
var _local2:b2Body;
var _local3:Sprite;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Block;
if (((_arg1.hasAspectOfType(PhysicalAspect)) && (_arg1.hasAspectOfType(GraphicalAspect)))){
_local2 = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
_local3 = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect).image;
_local4 = _local2.GetPosition();
_local5 = _local2.GetAngle();
_local3.x = (_local4.x * PS);
_local3.y = (_local4.y * PS);
_local3.rotation = (_local5 * DPR);
_local6 = (_arg1 as Block);
if (((_local6) && (_local6.hasArrows))){
_local6.alignArrows();
};
if (((_local6) && (_local6.hasPosInds))){
_local6.alignPosInds();
};
};
}
override public function update():void{
var _local1:IEntity;
var _local2:b2Body;
var _local3:Sprite;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Block;
for each (_local1 in _entities) {
if (((_local1.hasAspectOfType(PhysicalAspect)) && (_local1.hasAspectOfType(GraphicalAspect)))){
_local2 = (_local1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
_local3 = (_local1.getAspectByType(GraphicalAspect) as GraphicalAspect).image;
_local4 = _local2.GetPosition();
_local5 = _local2.GetAngle();
_local3.x = (_local4.x * PS);
_local3.y = (_local4.y * PS);
_local3.rotation = (_local5 * DPR);
_local6 = (_local1 as Block);
if (((_local6) && (_local6.hasArrows))){
_local6.alignArrows();
};
if (((_local6) && (_local6.hasPosInds))){
_local6.alignPosInds();
};
};
};
}
override public function destroy():void{
super.destroy();
destroyThis();
}
override public function dispose():void{
super.dispose();
destroyThis();
}
override public function disposeAll():void{
super.disposeAll();
destroyThis();
}
override protected function onEntityAdd(_arg1:IEntity):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (((_local2) && (_local2.image))){
_screen.addChild(_local2.image);
};
}
override protected function onEntityRemove(_arg1:IEntity):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (((_local2) && (_local2.image))){
_screen.removeChild(_local2.image);
};
}
override protected function onEntityDestroy(_arg1:IEntity):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (((_local2) && (_local2.image))){
_screen.removeChild(_local2.image);
};
}
override protected function onEntityDispose(_arg1:IEntity):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (((_local2) && (_local2.image))){
_screen.removeChild(_local2.image);
};
}
private function destroyThis():void{
cachedAngle = undefined;
cachedCos = undefined;
cachedSin = undefined;
_screen = undefined;
_canvas = undefined;
}
}
}//package lp.pge.game.core.systems
Section 226
//InteractiveControl (lp.pge.game.core.systems.InteractiveControl)
package lp.pge.game.core.systems {
import flash.events.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import lp.pge.game.core.entities.*;
import flash.display.*;
import asp.systems.*;
import asp.entities.*;
import com.greensock.*;
import flash.geom.*;
import lp.pge.game.core.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
import lp.pge.game.core.managers.*;
public class InteractiveControl extends AControl {
private const PS:Number = 30;
private var _events:Array;
private var _screen:Sprite;
private var _target:IEntity;
private var _handle:Point;
private var _tween:TweenLite;
public function InteractiveControl(_arg1:Array){
_types = [InteractiveAspect];
_events = _arg1;
_screen = GameEngine.instance.getScreen();
}
override protected function onEntityAdd(_arg1:IEntity):void{
var _local4:Sprite;
var _local2:InteractiveAspect = (_arg1.getAspectByType(InteractiveAspect) as InteractiveAspect);
var _local3:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (_local3){
_local4 = _local3.image;
if ((_arg1 is Block)){
_local4.addEventListener(MouseEvent.CLICK, _local2.onClick);
_local4.addEventListener(MouseEvent.MOUSE_DOWN, _local2.onDown);
_local4.addEventListener(MouseEvent.MOUSE_UP, _local2.onUp);
};
};
if ((_arg1 is Block)){
_local2.addEventListener(GameEvent.USER_MOUSE_CLICK, onClick);
_local2.addEventListener(GameEvent.USER_MOUSE_DOWN, onDown);
_local2.addEventListener(GameEvent.USER_MOUSE_UP, onUp);
};
}
override protected function onEntityRemove(_arg1:IEntity):void{
var _local4:Sprite;
if (_target == _arg1){
drop();
};
var _local2:InteractiveAspect = (_arg1.getAspectByType(InteractiveAspect) as InteractiveAspect);
var _local3:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (_local3){
_local4 = _local3.image;
if ((_arg1 is Block)){
if (_local4.hasEventListener(MouseEvent.CLICK)){
_local4.removeEventListener(MouseEvent.CLICK, _local2.onClick);
};
if (_local4.hasEventListener(MouseEvent.MOUSE_DOWN)){
_local4.removeEventListener(MouseEvent.MOUSE_DOWN, _local2.onDown);
};
if (_local4.hasEventListener(MouseEvent.MOUSE_UP)){
_local4.removeEventListener(MouseEvent.MOUSE_UP, _local2.onUp);
};
};
};
if ((_arg1 is Block)){
if (_local2.hasEventListener(GameEvent.USER_MOUSE_CLICK)){
_local2.removeEventListener(GameEvent.USER_MOUSE_CLICK, onClick);
};
if (_local2.hasEventListener(GameEvent.USER_MOUSE_DOWN)){
_local2.removeEventListener(GameEvent.USER_MOUSE_DOWN, onDown);
};
if (_local2.hasEventListener(GameEvent.USER_MOUSE_UP)){
_local2.removeEventListener(GameEvent.USER_MOUSE_UP, onUp);
};
};
}
override protected function onEntityDestroy(_arg1:IEntity):void{
var _local4:Sprite;
if (_target == _arg1){
drop();
};
var _local2:InteractiveAspect = (_arg1.getAspectByType(InteractiveAspect) as InteractiveAspect);
var _local3:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (_local3){
_local4 = _local3.image;
if ((_arg1 is Block)){
if (_local4.hasEventListener(MouseEvent.CLICK)){
_local4.removeEventListener(MouseEvent.CLICK, _local2.onClick);
};
if (_local4.hasEventListener(MouseEvent.MOUSE_DOWN)){
_local4.removeEventListener(MouseEvent.MOUSE_DOWN, _local2.onDown);
};
if (_local4.hasEventListener(MouseEvent.MOUSE_UP)){
_local4.removeEventListener(MouseEvent.MOUSE_UP, _local2.onUp);
};
};
};
if ((_arg1 is Block)){
if (_local2.hasEventListener(GameEvent.USER_MOUSE_CLICK)){
_local2.removeEventListener(GameEvent.USER_MOUSE_CLICK, onClick);
};
if (_local2.hasEventListener(GameEvent.USER_MOUSE_DOWN)){
_local2.removeEventListener(GameEvent.USER_MOUSE_DOWN, onDown);
};
if (_local2.hasEventListener(GameEvent.USER_MOUSE_UP)){
_local2.removeEventListener(GameEvent.USER_MOUSE_UP, onUp);
};
};
}
override protected function onEntityDispose(_arg1:IEntity):void{
var _local4:Sprite;
if (_target == _arg1){
drop();
};
var _local2:InteractiveAspect = (_arg1.getAspectByType(InteractiveAspect) as InteractiveAspect);
var _local3:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
if (_local3){
_local4 = _local3.image;
if ((_arg1 is Block)){
if (_local4.hasEventListener(MouseEvent.CLICK)){
_local4.removeEventListener(MouseEvent.CLICK, _local2.onClick);
};
if (_local4.hasEventListener(MouseEvent.MOUSE_DOWN)){
_local4.removeEventListener(MouseEvent.MOUSE_DOWN, _local2.onDown);
};
if (_local4.hasEventListener(MouseEvent.MOUSE_UP)){
_local4.removeEventListener(MouseEvent.MOUSE_UP, _local2.onUp);
};
};
};
if ((_arg1 is Block)){
if (_local2.hasEventListener(GameEvent.USER_MOUSE_CLICK)){
_local2.removeEventListener(GameEvent.USER_MOUSE_CLICK, onClick);
};
if (_local2.hasEventListener(GameEvent.USER_MOUSE_DOWN)){
_local2.removeEventListener(GameEvent.USER_MOUSE_DOWN, onDown);
};
if (_local2.hasEventListener(GameEvent.USER_MOUSE_UP)){
_local2.removeEventListener(GameEvent.USER_MOUSE_UP, onUp);
};
};
}
private function onClick(_arg1:GameEvent):void{
var iAsp:InteractiveAspect;
var block:Block;
var numSteps:uint;
var pAsp:PhysicalAspect;
var body:b2Body;
var pos:b2Vec2;
var posNum:uint;
var xPos:Number;
var yPos:Number;
var xBase:Number;
var yBase:Number;
var area:Rectangle;
var dx:Number;
var dy:Number;
var sx:Number;
var sy:Number;
var time:Number;
var event = _arg1;
if (_active){
iAsp = (event.data.iAsp as InteractiveAspect);
block = (iAsp.entity as Block);
if (block){
if (iAsp.drag){
iAsp.drag = false;
return;
};
numSteps = iAsp.numSteps;
pAsp = (block.getAspectByType(PhysicalAspect) as PhysicalAspect);
body = pAsp.body;
pos = body.GetPosition();
xPos = pos.x;
yPos = pos.y;
xBase = pos.x;
yBase = pos.y;
area = iAsp.area;
if ((((event.data.hit == "leftArrow")) || ((event.data.hit == "rightArrow")))){
sx = ((pos.x - area.left) / area.width);
if (sx < 0){
sx = 0;
} else {
if (sx > 1){
sx = 1;
};
};
posNum = Math.round(((iAsp.moveSteps.length - 1) * sx));
if (numSteps > 0){
xBase = iAsp.moveSteps[Math.floor((iAsp.moveSteps.length / 2))];
};
yPos = pos.y;
if (event.data.hit == "leftArrow"){
if (posNum > 0){
xPos = iAsp.moveSteps[(posNum - 1)];
};
} else {
if (event.data.hit == "rightArrow"){
if (posNum < (iAsp.moveSteps.length - 1)){
xPos = iAsp.moveSteps[(posNum + 1)];
};
};
};
} else {
if ((((event.data.hit == "upArrow")) || ((event.data.hit == "downArrow")))){
sy = ((pos.y - area.top) / area.height);
if (sy < 0){
sy = 0;
} else {
if (sy > 1){
sy = 1;
};
};
posNum = Math.round(((iAsp.moveSteps.length - 1) * sy));
if (numSteps > 0){
yBase = iAsp.moveSteps[Math.floor((iAsp.moveSteps.length / 2))];
};
xPos = pos.x;
if (event.data.hit == "upArrow"){
if (posNum > 0){
yPos = iAsp.moveSteps[(posNum - 1)];
};
} else {
if (event.data.hit == "downArrow"){
if (posNum < (iAsp.moveSteps.length - 1)){
yPos = iAsp.moveSteps[(posNum + 1)];
};
};
};
} else {
return;
};
};
dx = (xPos - pos.x);
dy = (yPos - pos.y);
if (((!((dx == 0))) || (!((dy == 0))))){
if (_tween){
_tween.kill();
};
body.SetPosition(pos);
time = Math.max((Math.abs(dx) / 7), (Math.abs(dy) / 7));
_tween = new TweenLite(pos, time, {x:xPos, y:yPos, onUpdate:function ():void{
body.SetPosition(pos);
if (numSteps > 0){
block.updatePosInds(posNum, (-((pos.x - xBase)) * PS), (-((pos.y - yBase)) * PS));
};
}, onComplete:function ():void{
_tween = undefined;
if (iAsp.axis == "x"){
(iAsp.entity as Block).shake({x:3, y:0});
} else {
if (iAsp.axis == "y"){
(iAsp.entity as Block).shake({x:0, y:3});
};
};
}});
};
};
};
}
private function onDown(_arg1:GameEvent):void{
var _local2:InteractiveAspect;
if (_active){
_local2 = (_arg1.data as InteractiveAspect);
drag(_local2.entity);
};
}
private function onUp(_arg1:GameEvent):void{
var _local2:InteractiveAspect;
if (_active){
_local2 = (_arg1.data as InteractiveAspect);
if (_target == _local2.entity){
drop();
};
};
}
private function onOver(_arg1:GameEvent):void{
}
private function onOut(_arg1:GameEvent):void{
}
private function drag(_arg1:IEntity):void{
var _local2:GraphicalAspect;
var _local3:Sprite;
var _local4:InteractiveAspect;
var _local5:uint;
var _local6:Block;
var _local7:Rectangle;
var _local8:String;
var _local9:PhysicalAspect;
var _local10:b2Body;
var _local11:b2Vec2;
var _local12:uint;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
if (!_target){
_target = _arg1;
_local2 = (_target.getAspectByType(GraphicalAspect) as GraphicalAspect);
_local3 = _local2.image;
_handle = new Point(_local3.mouseX, _local3.mouseY);
_handle = _local3.localToGlobal(_handle);
_handle.x = (_handle.x - _local3.x);
_handle.y = (_handle.y - _local3.y);
_screen.stage.addEventListener(MouseEvent.MOUSE_MOVE, move);
_screen.stage.addEventListener(MouseEvent.MOUSE_UP, drop);
_local4 = (_target.getAspectByType(InteractiveAspect) as InteractiveAspect);
_local5 = _local4.numSteps;
if (_local5){
_local6 = (_arg1 as Block);
if (_local6){
_local7 = _local4.area;
_local8 = _local4.axis;
if (_local7){
_local9 = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect);
_local10 = _local9.body;
_local11 = _local10.GetPosition();
_local13 = 0;
_local14 = 0;
if (_local8 == "x"){
_local15 = ((_local11.x - _local7.left) / _local7.width);
if (_local15 < 0){
_local15 = 0;
} else {
if (_local15 > 1){
_local15 = 1;
};
};
_local12 = Math.round(((_local4.moveSteps.length - 1) * _local15));
_local16 = _local4.moveSteps[Math.floor((_local4.moveSteps.length / 2))];
_local13 = (_local11.x - _local16);
} else {
if (_local8 == "y"){
_local17 = ((_local11.y - _local7.top) / _local7.height);
if (_local17 < 0){
_local17 = 0;
} else {
if (_local17 > 1){
_local17 = 1;
};
};
_local12 = Math.round(((_local4.moveSteps.length - 1) * _local17));
_local18 = _local4.moveSteps[Math.floor((_local4.moveSteps.length / 2))];
_local14 = (_local11.y - _local18);
};
};
_local6.updatePosInds(_local12, (-(_local13) * PS), (-(_local14) * PS));
switch (_local8){
case "all":
_local6.showPosInds();
break;
case "x":
_local6.showHPosInd();
break;
case "y":
_local6.showVPosInd();
break;
default:
throw (new Error("[InteractiveControl] : <drag> : Unknown block axis."));
};
};
};
};
} else {
throw (new Error("[InteractiveControl] : <drag> : Drop last target first."));
};
}
private function drop(_arg1:MouseEvent=null):void{
var _local2:Block;
if (_target){
_screen.stage.removeEventListener(MouseEvent.MOUSE_MOVE, move);
_screen.stage.removeEventListener(MouseEvent.MOUSE_UP, drop);
_handle = undefined;
_local2 = (_target as Block);
if (_local2){
_local2.hidePosInds();
};
_target = undefined;
} else {
throw (new Error((("[InteractiveControl] : <drop> : Nothing to drop. (" + _arg1) + ")")));
};
}
private function move(_arg1:MouseEvent):void{
var iAsp:InteractiveAspect;
var xPos:Number;
var yPos:Number;
var pAsp:PhysicalAspect;
var body:b2Body;
var pos:b2Vec2;
var block:Block;
var posNum:uint;
var xShift:Number;
var yShift:Number;
var numSteps:uint;
var xBase:Number;
var yBase:Number;
var dx:Number;
var dy:Number;
var sx:Number;
var sy:Number;
var time:Number;
var event = _arg1;
iAsp = (_target.getAspectByType(InteractiveAspect) as InteractiveAspect);
iAsp.drag = true;
var area:Rectangle = iAsp.area;
var axis:String = iAsp.axis;
block = (_target as Block);
if (iAsp.numSteps > 0){
xPos = ((_screen.stage.mouseX - _handle.x) / PS);
yPos = ((_screen.stage.mouseY - _handle.y) / PS);
if (area){
xShift = 0;
yShift = 0;
numSteps = iAsp.numSteps;
pAsp = (_target.getAspectByType(PhysicalAspect) as PhysicalAspect);
body = pAsp.body;
pos = body.GetPosition();
xBase = pos.x;
yBase = pos.y;
if (axis == "x"){
sx = ((xPos - area.left) / area.width);
if (sx < 0){
sx = 0;
} else {
if (sx > 1){
sx = 1;
};
};
posNum = Math.round(((iAsp.moveSteps.length - 1) * sx));
xPos = iAsp.moveSteps[posNum];
if (numSteps > 0){
xBase = iAsp.moveSteps[Math.floor((iAsp.moveSteps.length / 2))];
};
} else {
if (axis == "y"){
sy = ((yPos - area.top) / area.height);
if (sy < 0){
sy = 0;
} else {
if (sy > 1){
sy = 1;
};
};
posNum = Math.round(((iAsp.moveSteps.length - 1) * sy));
yPos = iAsp.moveSteps[posNum];
if (numSteps > 0){
yBase = iAsp.moveSteps[Math.floor((iAsp.moveSteps.length / 2))];
};
};
};
if (axis == "x"){
yPos = pos.y;
};
if (axis == "y"){
xPos = pos.x;
};
dx = (xPos - pos.x);
dy = (yPos - pos.y);
if (((!((dx == 0))) || (!((dy == 0))))){
if (_tween){
_tween.kill();
};
body.SetPosition(pos);
time = Math.max((Math.abs(dx) / 7), (Math.abs(dy) / 7));
_tween = new TweenLite(pos, time, {x:xPos, y:yPos, onUpdate:function ():void{
body.SetPosition(pos);
if (numSteps > 0){
block.updatePosInds(posNum, (-((pos.x - xBase)) * PS), (-((pos.y - yBase)) * PS));
};
}, onComplete:function ():void{
_tween = undefined;
if (iAsp.axis == "x"){
(iAsp.entity as Block).shake({x:3, y:0});
} else {
if (iAsp.axis == "y"){
(iAsp.entity as Block).shake({x:0, y:3});
};
};
}});
};
};
} else {
xPos = ((_screen.stage.mouseX - _handle.x) / PS);
yPos = ((_screen.stage.mouseY - _handle.y) / PS);
if (((!(area)) || ((((((axis == "y")) || ((((xPos >= area.left)) && ((xPos <= area.right)))))) && ((((axis == "x")) || ((((yPos >= area.top)) && ((yPos <= area.bottom)))))))))){
pAsp = (_target.getAspectByType(PhysicalAspect) as PhysicalAspect);
body = pAsp.body;
pos = body.GetPosition();
if (axis == "x"){
pos.x = xPos;
} else {
if (axis == "y"){
pos.y = yPos;
};
};
body.SetPosition(pos);
};
};
}
private function packetCrash(_arg1:Packet):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
_arg1.removeAspect(_local2);
var _local3:Animat = new Animat(_local2);
GameManager.instance.addEntity(_local3);
_local3.playAnim("crash");
var _local4:SFX = new SFX(new AcousticalAspect());
GameManager.instance.addEntity(_local4);
_local4.playSound(new CrashSound());
}
}
}//package lp.pge.game.core.systems
Section 227
//MovementSystem (lp.pge.game.core.systems.MovementSystem)
package lp.pge.game.core.systems {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import flash.display.*;
import asp.systems.*;
import asp.entities.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
public class MovementSystem extends ASystem {
private const PS:Number = 30;
private static const EPSILON:Number = 0.0001;
public function MovementSystem(){
_types = [MovementAspect];
}
override public function update():void{
var _local1:IEntity;
var _local2:MovementAspect;
var _local3:b2Body;
var _local4:b2Vec2;
var _local5:Sprite;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
for each (_local1 in _entities) {
if (_local1.hasAspectOfType(PhysicalAspect)){
_local2 = (_local1.getAspectByType(MovementAspect) as MovementAspect);
if (((!(_local2.fixed)) && (_local2.waypoint))){
if (_local2.type == ThingTypes.MOVING){
_local3 = (_local1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
_local6 = _local3.GetPosition();
_local4 = _local2.waypoint;
_local7 = (_local4.x - _local6.x);
_local8 = (_local4.y - _local6.y);
if (Math.abs(_local7) < EPSILON){
_local7 = 0;
};
if (Math.abs(_local8) < EPSILON){
_local8 = 0;
};
if ((((_local7 == 0)) && ((_local8 == 0)))){
_local3.SetPosition(_local4);
_local3.SetLinearVelocity(new b2Vec2(0, 0));
_local2.turnBack();
_local2.count++;
if (((_local2.moveOnce) && ((_local2.count == 1)))){
_local2.waypoint = null;
};
continue;
};
_local9 = Math.atan2(_local8, _local7);
_local10 = _local2.speed;
_local11 = (_local10 * Math.cos(_local9));
_local12 = (_local10 * Math.sin(_local9));
_local13 = ((Math.abs(_local11) / PS) - Math.abs(_local7));
if (_local13 >= 0){
_local11 = (_local7 * PS);
};
_local14 = ((Math.abs(_local12) / PS) - Math.abs(_local8));
if (_local14 >= 0){
_local12 = (_local8 * PS);
};
if (Math.abs(_local11) < EPSILON){
_local11 = 0;
};
if (Math.abs(_local12) < EPSILON){
_local12 = 0;
};
_local3.SetLinearVelocity(new b2Vec2(_local11, _local12));
} else {
if (_local2.type == ThingTypes.JUMPING){
_local5 = (_local1.getAspectByType(GraphicalAspect) as GraphicalAspect).image;
_local3 = (_local1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
if (_local2.currTicks > 0){
_local2.currTicks--;
if (_local2.currMode == 1){
_local5.alpha = (_local2.currTicks / _local2.showTicks);
if ((((_local5.alpha < 0.5)) && (_local3.IsActive()))){
_local3.SetActive(false);
};
} else {
_local5.alpha = (1 - (_local2.currTicks / _local2.hideTicks));
if ((((_local5.alpha >= 0.5)) && (!(_local3.IsActive())))){
_local3.SetActive(true);
};
};
} else {
if (_local2.currMode == 1){
_local2.currMode = 0;
_local2.currTicks = _local2.hideTicks;
if (_local2.dir == -1){
if (_local2.pos > -1){
_local2.pos--;
} else {
_local2.dir = 1;
_local2.pos++;
};
} else {
if (_local2.dir == 1){
if (_local2.pos < 1){
_local2.pos++;
} else {
_local2.dir = -1;
_local2.pos--;
};
};
};
if (_local2.pos == -1){
_local4 = _local2.wp0;
} else {
if (_local2.pos == 0){
_local4 = _local2.wpM;
} else {
if (_local2.pos == 1){
_local4 = _local2.wp1;
};
};
};
_local3.SetPosition(_local4.Copy());
_local5.alpha = 0;
} else {
_local2.currMode = 1;
_local2.currTicks = _local2.showTicks;
_local5.alpha = 1;
};
};
};
};
};
} else {
throw (new Error("[MovementSystem] : <update> : PhysicalAspect not found."));
};
};
}
}
}//package lp.pge.game.core.systems
Section 228
//PhysicalAdapter (lp.pge.game.core.systems.PhysicalAdapter)
package lp.pge.game.core.systems {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import asp.systems.*;
import asp.entities.*;
import Box2DExt.*;
import lp.pge.game.core.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.*;
public class PhysicalAdapter extends AAdapter {
private const PS:Number = 30;
private const _gravity:b2Vec2;
private const _doSleep:Boolean = false;
private const _timeStep:Number = 0.0333333333333333;
private const _velIt:int = 10;
private const _posIt:int = 10;
private const BUFFER_ZONE:Number = 240;
private const SENSOR_SIZE:Number = 10;
private var _world:b2World;
private var _debugDraw:b2DebugDraw;
private var _events:Array;
private var _bBound:b2Body;
private var _lBound:b2Body;
private var _rBound:b2Body;
private var _tBound:b2Body;
private var _width:Number;
private var _height:Number;
public static const PACKET_MATERIAL:b2eMaterial = new b2eMaterial(0.5, 0.2, 1);
public static const SPIKES_MATERIAL:b2eMaterial = new b2eMaterial(0, 0.2, 1);
public static const TARGET_MATERIAL:b2eMaterial = new b2eMaterial(0, 0, 1);
public static const BONUS_MATERIAL:b2eMaterial = new b2eMaterial(0, 0, 1);
public static const BOUNCY_MATERIAL:b2eMaterial = new b2eMaterial(1.1, 0, 1);
public static const NORMAL_MATERIAL:b2eMaterial = new b2eMaterial(0.5, 0.2, 1);
public static const STICKY_MATERIAL:b2eMaterial = new b2eMaterial(0, 0.8, 1);
public static const GEOMETRY_MATERIAL:b2eMaterial = new b2eMaterial(0, 0, 1);
public static const DEFAULT_MATERIAL:b2eMaterial = new b2eMaterial(0, 0, 1);
public static const PACKET_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const SPIKES_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const TARGET_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const BONUS_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const BOUNCY_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const NORMAL_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const STICKY_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const GEOMETRY_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
public static const DEFAULT_PROPERTIES:b2eProperties = new b2eProperties(0, 0);
private static var _sharedWorld:b2World;
public function PhysicalAdapter(_arg1:Number=640, _arg2:Number=480){
_gravity = new b2Vec2(0, 15);
super();
_types = [PhysicalAspect];
_width = _arg1;
_height = _arg2;
_world = new b2World(_gravity, _doSleep);
_world.SetContinuousPhysics(true);
_world.GetGroundBody().SetUserData("space");
if (GameConfig.DRAW_DEBUG){
_debugDraw = new b2DebugDraw();
_debugDraw.SetSprite(GameEngine.instance.getCanvas());
_debugDraw.SetDrawScale(PS);
_debugDraw.SetFillAlpha(0.25);
_debugDraw.SetLineThickness(1);
_debugDraw.SetFlags(((b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit) | b2DebugDraw.e_centerOfMassBit));
_world.SetDebugDraw(_debugDraw);
};
_sharedWorld = _world;
_events = new Array();
var _local3:Number = (((_width / 2) + BUFFER_ZONE) / PS);
var _local4:Number = (SENSOR_SIZE / PS);
_tBound = Box2DAPI.createBody(_world, {type:b2Body.b2_staticBody}, {shape:b2PolygonShape.AsOrientedBox(_local3, _local4, new b2Vec2((_local3 - (BUFFER_ZONE / PS)), (((0 - 40) / PS) - _local4))), isSensor:true});
_tBound.SetUserData("tBound");
var _local5:Number = (((_width / 2) + BUFFER_ZONE) / PS);
var _local6:Number = (SENSOR_SIZE / PS);
_bBound = Box2DAPI.createBody(_world, {type:b2Body.b2_staticBody}, {shape:b2PolygonShape.AsOrientedBox(_local5, _local6, new b2Vec2((_local5 - (BUFFER_ZONE / PS)), (((_height + BUFFER_ZONE) / PS) + _local6))), isSensor:true});
_bBound.SetUserData("bBound");
var _local7:Number = (SENSOR_SIZE / PS);
var _local8:Number = (((_height / 2) + BUFFER_ZONE) / PS);
_lBound = Box2DAPI.createBody(_world, {type:b2Body.b2_staticBody}, {shape:b2PolygonShape.AsOrientedBox(_local7, _local8, new b2Vec2((((0 - BUFFER_ZONE) / PS) - _local7), (_local8 - (BUFFER_ZONE / PS)))), isSensor:true});
_lBound.SetUserData("lBound");
var _local9:Number = (SENSOR_SIZE / PS);
var _local10:Number = (((_height / 2) + BUFFER_ZONE) / PS);
_rBound = Box2DAPI.createBody(_world, {type:b2Body.b2_staticBody}, {shape:b2PolygonShape.AsOrientedBox(_local9, _local10, new b2Vec2((((_width + BUFFER_ZONE) / PS) + _local9), (_local10 - (BUFFER_ZONE / PS)))), isSensor:true});
_rBound.SetUserData("rBound");
}
override public function update():void{
_world.Step(_timeStep, _velIt, _posIt);
_world.ClearForces();
if (_debugDraw){
_world.DrawDebugData();
};
while (_events.length) {
GameEngine.instance.dispatchEvent(_events.shift());
};
}
override public function destroy():void{
super.destroy();
destroyThis();
}
override public function dispose():void{
super.dispose();
destroyThis();
}
override public function disposeAll():void{
super.disposeAll();
destroyThis();
}
public function getWorld():b2World{
return (_world);
}
public function getEvents():Array{
return (_events);
}
override protected function onEntityAdd(_arg1:IEntity):void{
var _local2:PhysicalAspect = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect);
switch (_local2.type){
case PhysicalAspect.STATIC:
_local2.body.SetType(b2Body.b2_staticBody);
break;
case PhysicalAspect.KINEMATIC:
_local2.body.SetType(b2Body.b2_kinematicBody);
break;
case PhysicalAspect.MOVING:
_local2.body.SetType(b2Body.b2_kinematicBody);
break;
case PhysicalAspect.ROTATING:
_local2.body.SetType(b2Body.b2_kinematicBody);
break;
case PhysicalAspect.DYNAMIC:
_local2.body.SetType(b2Body.b2_dynamicBody);
break;
default:
throw (new Error("[PhysicalAdapter] : <onEntityAdd> : Wrong physical aspect type."));
};
}
override protected function onEntityRemove(_arg1:IEntity):void{
var _local2:PhysicalAspect = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect);
_world.DestroyBody(_local2.body);
}
override protected function onEntityDestroy(_arg1:IEntity):void{
var _local2:PhysicalAspect = (_arg1.getAspectByType(PhysicalAspect) as PhysicalAspect);
_world.DestroyBody(_local2.body);
}
private function destroyThis():void{
var _local1:b2Joint;
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Body;
_world.DestroyBody(_tBound);
_tBound = undefined;
_world.DestroyBody(_bBound);
_bBound = undefined;
_world.DestroyBody(_lBound);
_lBound = undefined;
_world.DestroyBody(_rBound);
_rBound = undefined;
_debugDraw = undefined;
if (_world.GetJointCount() > 0){
_local1 = _world.GetJointList();
while (_local1) {
_local2 = _local1;
_local1 = _local1.GetNext();
_world.DestroyJoint(_local2);
};
};
if (_world.GetBodyCount() > 0){
_local3 = _world.GetBodyList();
while (_local3) {
_local4 = _local3;
_local3 = _local3.GetNext();
_world.DestroyBody(_local4);
};
};
_world = undefined;
_width = undefined;
_height = undefined;
_sharedWorld = undefined;
}
public static function getSharedWorld():b2World{
return (_sharedWorld);
}
}
}//package lp.pge.game.core.systems
Section 229
//GameEngine (lp.pge.game.core.GameEngine)
package lp.pge.game.core {
import flash.display.*;
import asp.*;
import asp.events.*;
import lp.pge.game.core.systems.*;
public class GameEngine extends AEngine {
private var _aAdap:AcousticalAdapter;
private var _cProc:CollisionProcess;
private var _gAdap:GraphicalAdapter;
private var _iCont:InteractiveControl;
private var _mSyst:MovementSystem;
private var _pAdap:PhysicalAdapter;
private var _screen:Sprite;
private var _canvas:Sprite;
private static var _instance:GameEngine;
public function GameEngine(_arg1:Sprite, _arg2:Sprite=null, _arg3:Number=720, _arg4:Number=480){
_instance = this;
if (!_arg1){
throw (new Error("[GameEngine] : <GameEngine> : Can't initialize."));
};
_screen = _arg1;
_canvas = _arg2;
_mSyst = new MovementSystem();
_pAdap = new PhysicalAdapter(_arg3, _arg4);
_cProc = new CollisionProcess(_pAdap.getWorld(), _pAdap.getEvents());
_gAdap = new GraphicalAdapter(_screen, _canvas);
_aAdap = new AcousticalAdapter();
_iCont = new InteractiveControl(_pAdap.getEvents());
addSystem(_mSyst);
addSystem(_pAdap);
addSystem(_cProc);
addSystem(_gAdap);
addSystem(_aAdap);
addSystem(_iCont);
}
override public function update():void{
if (!_exists){
throw (new Error("[GameEngine] : <update> : Engine not exists."));
};
_updating = true;
dispatchEvent(new EngineEvent(EngineEvent.START_UPDATE));
_mSyst.update();
_pAdap.update();
_cProc.update();
_gAdap.update();
_aAdap.update();
_updating = false;
dispatchEvent(new EngineEvent(EngineEvent.FINISH_UPDATE));
}
override public function reset():void{
_mSyst.reset();
_pAdap.reset();
_cProc.reset();
_gAdap.reset();
_aAdap.reset();
_iCont.reset();
}
public function getCanvas():Sprite{
return (_canvas);
}
public function getScreen():Sprite{
return (_screen);
}
public function get mute():Boolean{
return ((_aAdap) ? _aAdap.mute : true);
}
public function set mute(_arg1:Boolean):void{
if (_aAdap){
_aAdap.mute = _arg1;
};
}
public static function get instance():GameEngine{
return (_instance);
}
}
}//package lp.pge.game.core
Section 230
//ADummy (lp.pge.game.dummies.ADummy)
package lp.pge.game.dummies {
import flash.display.*;
public class ADummy extends Sprite {
public function ADummy(){
if ((this as Object).constructor === ADummy){
throw (new Error("[ADummy] : <ADummy> : Abstract class can't be instantiated."));
};
}
}
}//package lp.pge.game.dummies
Section 231
//BlockDummy (lp.pge.game.dummies.BlockDummy)
package lp.pge.game.dummies {
public class BlockDummy extends ThingDummy {
public var fixed:Boolean;
public function BlockDummy(){
if ((this as Object).constructor === BlockDummy){
throw (new Error("[BlockDummy] : <BlockDummy> : Abstract class can't be instantiated."));
};
}
}
}//package lp.pge.game.dummies
Section 232
//BonusDummy (lp.pge.game.dummies.BonusDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class BonusDummy extends ThingDummy {
public function BonusDummy(){
material = PhysicalAdapter.BONUS_MATERIAL;
properties = PhysicalAdapter.BONUS_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 233
//BouncyBlockDummy (lp.pge.game.dummies.BouncyBlockDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class BouncyBlockDummy extends BlockDummy {
public function BouncyBlockDummy(){
material = PhysicalAdapter.BOUNCY_MATERIAL;
properties = PhysicalAdapter.BOUNCY_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 234
//GameDummy (lp.pge.game.dummies.GameDummy)
package lp.pge.game.dummies {
import flash.display.*;
import Box2DExt.*;
public class GameDummy extends ADummy {
public var image:Sprite;
public var shape:Sprite;
public var material:b2eMaterial;
public var properties:b2eProperties;
public function GameDummy(){
if ((this as Object).constructor === GameDummy){
throw (new Error("[GameDummy] : <GameDummy> : Abstract class can't be instantiated."));
};
}
}
}//package lp.pge.game.dummies
Section 235
//GeometryDummy (lp.pge.game.dummies.GeometryDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class GeometryDummy extends GameDummy {
public function GeometryDummy(){
material = PhysicalAdapter.GEOMETRY_MATERIAL;
properties = PhysicalAdapter.GEOMETRY_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 236
//JumpingSpikesDummy (lp.pge.game.dummies.JumpingSpikesDummy)
package lp.pge.game.dummies {
import lp.pge.game.*;
public class JumpingSpikesDummy extends SpikesDummy {
public function JumpingSpikesDummy(){
type = ThingTypes.JUMPING;
}
}
}//package lp.pge.game.dummies
Section 237
//MovingSpikesDummy (lp.pge.game.dummies.MovingSpikesDummy)
package lp.pge.game.dummies {
import lp.pge.game.*;
public class MovingSpikesDummy extends SpikesDummy {
public function MovingSpikesDummy(){
type = ThingTypes.MOVING;
}
}
}//package lp.pge.game.dummies
Section 238
//NormalBlockDummy (lp.pge.game.dummies.NormalBlockDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class NormalBlockDummy extends BlockDummy {
public function NormalBlockDummy(){
material = PhysicalAdapter.NORMAL_MATERIAL;
properties = PhysicalAdapter.NORMAL_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 239
//PacketDummy (lp.pge.game.dummies.PacketDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class PacketDummy extends ThingDummy {
public function PacketDummy(){
material = PhysicalAdapter.PACKET_MATERIAL;
properties = PhysicalAdapter.PACKET_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 240
//SpikesDummy (lp.pge.game.dummies.SpikesDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class SpikesDummy extends ThingDummy {
public function SpikesDummy(){
material = PhysicalAdapter.SPIKES_MATERIAL;
properties = PhysicalAdapter.SPIKES_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 241
//StaticSpikesDummy (lp.pge.game.dummies.StaticSpikesDummy)
package lp.pge.game.dummies {
public class StaticSpikesDummy extends SpikesDummy {
}
}//package lp.pge.game.dummies
Section 242
//StickyBlockDummy (lp.pge.game.dummies.StickyBlockDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class StickyBlockDummy extends BlockDummy {
public function StickyBlockDummy(){
material = PhysicalAdapter.STICKY_MATERIAL;
properties = PhysicalAdapter.STICKY_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 243
//TargetDummy (lp.pge.game.dummies.TargetDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class TargetDummy extends ThingDummy {
public var hitDistance:Number;// = 30
public var event:String;
public var packetAction:String;// = "break"
public function TargetDummy(){
material = PhysicalAdapter.TARGET_MATERIAL;
properties = PhysicalAdapter.TARGET_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 244
//ThingDummy (lp.pge.game.dummies.ThingDummy)
package lp.pge.game.dummies {
import flash.geom.*;
public class ThingDummy extends GameDummy {
public var massScale:Number;// = 1
public var wp0:Point;
public var wp1:Point;
public var speed:Number;// = 50
public var area:Rectangle;
public var axis:String;// = "all"
public var numSteps:uint;// = 0
public var type:String;// = "immovable"
public function ThingDummy(){
if ((this as Object).constructor === ThingDummy){
throw (new Error("[ThingDummy] : <ThingDummy> : Abstract class can't be instantiated."));
};
}
}
}//package lp.pge.game.dummies
Section 245
//TriggerDummy (lp.pge.game.dummies.TriggerDummy)
package lp.pge.game.dummies {
import lp.pge.game.core.systems.*;
public class TriggerDummy extends ThingDummy {
public var event:String;
public function TriggerDummy(){
material = PhysicalAdapter.DEFAULT_MATERIAL;
properties = PhysicalAdapter.DEFAULT_PROPERTIES;
}
}
}//package lp.pge.game.dummies
Section 246
//ArrowsIcon (lp.pge.game.gui.ArrowsIcon)
package lp.pge.game.gui {
import flash.display.*;
public class ArrowsIcon extends MovieClip {
public function align():void{
rotation = (parent) ? -(parent.rotation) : 0;
}
public function get animated():Boolean{
return ((totalFrames > 1));
}
}
}//package lp.pge.game.gui
Section 247
//HiddenBlock (lp.pge.game.gui.HiddenBlock)
package lp.pge.game.gui {
import flash.events.*;
import lp.pge.game.core.entities.*;
import lp.pge.game.models.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.*;
import lp.pge.game.core.managers.*;
import lp.pge.*;
public class HiddenBlock extends MovieClip {
private var _dir:int;// = 0
public var blockData1:Object;
public var blockData2:Object;
public var blockData3:Object;
private var _selectedBlock:Block;
private static const SPACE:Number = 190;
public static const BOUNCY_GIRDER_B:uint = 1;
public static const BOUNCY_GIRDER_L:uint = 2;
public static const BOUNCY_GIRDER_R:uint = 3;
public static const BOUNCY_GIRDER_T:uint = 4;
public static const BOUNCY_GIRDER_BL:uint = 5;
public static const BOUNCY_GIRDER_BR:uint = 6;
public static const BOUNCY_GIRDER_TL:uint = 7;
public static const BOUNCY_GIRDER_TR:uint = 8;
public static const BOUNCY_CIRCLE:uint = 9;
public static const BOUNCY_ARC:uint = 10;
public static const BOUNCY_CUP:uint = 11;
public static const NORMAL_GIRDER_B:uint = 12;
public static const NORMAL_GIRDER_L:uint = 13;
public static const NORMAL_GIRDER_R:uint = 14;
public static const NORMAL_GIRDER_T:uint = 15;
public static const NORMAL_GIRDER_BL:uint = 16;
public static const NORMAL_GIRDER_BR:uint = 17;
public static const NORMAL_GIRDER_TL:uint = 18;
public static const NORMAL_GIRDER_TR:uint = 19;
public static const NORMAL_CIRCLE:uint = 20;
public static const NORMAL_SLOPE_TL:uint = 21;
public static const NORMAL_SLOPE_TR:uint = 22;
public static const STICKY_GIRDER_T:uint = 23;
public static const STICKY_GIRDER_TL:uint = 24;
public static const STICKY_GIRDER_TR:uint = 25;
public function HiddenBlock(){
addFrameScript(0, frame1);
if (x < SPACE){
_dir = 1;
} else {
if ((GameApplication.APPL_WIDTH - x) < SPACE){
_dir = -1;
};
};
gotoAndStop((2 + _dir));
addEventListener(MouseEvent.MOUSE_DOWN, onDown);
}
public function get dir():int{
return (_dir);
}
public function set dir(_arg1:int):void{
if (_arg1 == _dir){
return;
};
_dir = _arg1;
gotoAndStop((2 + _dir));
}
public function selectBlock(_arg1:uint):void{
var _local2:Object;
var _local4:BlockModel;
if (_arg1 > 2){
throw (new Error((("[HiddenBlock] : <selectBlock> : Wrong block index (" + _arg1) + ").")));
};
if (_arg1 == 0){
_local2 = blockData1;
} else {
if (_arg1 == 1){
_local2 = blockData2;
} else {
if (_arg1 == 2){
_local2 = blockData3;
};
};
};
if (_local2.id == BOUNCY_CUP){
_local2.dummyClass = BouncyBlockArcTopDummy;
_local2.rotation = 0;
} else {
if (_local2.id == BOUNCY_ARC){
_local2.dummyClass = BouncyBlockArcBottomDummy;
_local2.rotation = 0;
} else {
if (_local2.id == BOUNCY_GIRDER_B){
_local2.dummyClass = BouncyBlockBottomDummy;
_local2.rotation = 0;
} else {
if (_local2.id == BOUNCY_GIRDER_R){
_local2.dummyClass = BouncyBlockBottomDummy;
_local2.rotation = -90;
} else {
if (_local2.id == BOUNCY_GIRDER_L){
_local2.dummyClass = BouncyBlockTopDummy;
_local2.rotation = -90;
} else {
if (_local2.id == BOUNCY_GIRDER_T){
_local2.dummyClass = BouncyBlockTopDummy;
_local2.rotation = 0;
} else {
if (_local2.id == BOUNCY_GIRDER_TL){
_local2.dummyClass = BouncyBlockTopDummy;
_local2.rotation = -45;
} else {
if (_local2.id == BOUNCY_GIRDER_TR){
_local2.dummyClass = BouncyBlockTopDummy;
_local2.rotation = 45;
} else {
if (_local2.id == BOUNCY_GIRDER_BL){
_local2.dummyClass = BouncyBlockBottomDummy;
_local2.rotation = 45;
} else {
if (_local2.id == BOUNCY_GIRDER_BR){
_local2.dummyClass = BouncyBlockBottomDummy;
_local2.rotation = -45;
} else {
if (_local2.id == BOUNCY_CIRCLE){
_local2.dummyClass = BouncyBlockCircleDummy;
_local2.rotation = 0;
} else {
if (_local2.id == NORMAL_SLOPE_TR){
_local2.dummyClass = NormalBlockSlopeTRDummy;
_local2.rotation = 0;
} else {
if (_local2.id == NORMAL_SLOPE_TL){
_local2.dummyClass = NormalBlockSlopeTLDummy;
_local2.rotation = 0;
} else {
if (_local2.id == NORMAL_GIRDER_B){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = 0;
} else {
if (_local2.id == NORMAL_GIRDER_R){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = -90;
} else {
if (_local2.id == NORMAL_GIRDER_L){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = 90;
} else {
if (_local2.id == NORMAL_GIRDER_TL){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = 135;
} else {
if (_local2.id == NORMAL_GIRDER_TR){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = -135;
} else {
if (_local2.id == NORMAL_GIRDER_BL){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = 45;
} else {
if (_local2.id == NORMAL_GIRDER_BR){
_local2.dummyClass = NormalBlockBottomDummy;
_local2.rotation = -45;
} else {
if (_local2.id == NORMAL_CIRCLE){
_local2.dummyClass = NormalBlockCircleDummy;
_local2.rotation = 0;
} else {
if (_local2.id == STICKY_GIRDER_T){
_local2.dummyClass = StickyBlockTopDummy;
_local2.rotation = 0;
} else {
if (_local2.id == STICKY_GIRDER_TR){
_local2.dummyClass = StickyBlockTopDummy;
_local2.rotation = 45;
} else {
if (_local2.id == STICKY_GIRDER_TL){
_local2.dummyClass = StickyBlockTopDummy;
_local2.rotation = -45;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
var _local3:BlockDummy = new _local2.dummyClass();
_local3.x = x;
_local3.y = y;
_local3.rotation = (isNaN(_local2.rotation)) ? 0 : Number(_local2.rotation);
if ((_local3 is BouncyBlockDummy)){
_local4 = new BouncyBlockModel();
} else {
if ((_local3 is NormalBlockDummy)){
_local4 = new NormalBlockModel();
} else {
if ((_local3 is StickyBlockDummy)){
_local4 = new StickyBlockModel();
};
};
};
_local4.load(_local3);
var _local5:Block = (EntitiesFactory.createEntity(_local4) as Block);
_local5.question = this;
_local5.highlight();
GameManager.instance.addEntity(_local5);
_selectedBlock = _local5;
alpha = 0;
if (parent){
parent.setChildIndex(this, (parent.numChildren - 1));
};
var _local6:MovieClip = (getChildAt(0) as MovieClip);
if (_local6){
_local6.gotoAndStop(1);
};
}
public function reset():void{
if (x < SPACE){
_dir = 1;
} else {
if ((GameApplication.APPL_WIDTH - x) < SPACE){
_dir = -1;
};
};
gotoAndStop((2 + _dir));
var _local1:MovieClip = (getChildAt(0) as MovieClip);
if (_local1){
_local1.reset();
};
if (_selectedBlock){
_selectedBlock.question = undefined;
};
_selectedBlock = undefined;
if (!hasEventListener(MouseEvent.MOUSE_DOWN)){
addEventListener(MouseEvent.MOUSE_DOWN, onDown);
};
GameApplication.instance.stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
alpha = 1;
}
public function destroy():void{
stop();
removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
GameApplication.instance.stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
_dir = undefined;
blockData1 = undefined;
blockData2 = undefined;
blockData3 = undefined;
if (parent){
parent.removeChild(this);
};
if (_selectedBlock){
_selectedBlock.question = undefined;
};
_selectedBlock = undefined;
}
private function onDown(_arg1:MouseEvent):void{
var anim:MovieClip;
var sign:MovieClip;
var $event = _arg1;
if (_selectedBlock){
GameManager.instance.disposeEntity(_selectedBlock);
_selectedBlock.question = undefined;
_selectedBlock = undefined;
};
anim = (getChildAt(0) as MovieClip);
if (anim){
sign = (anim.getChildByName("sign") as MovieClip);
if (sign){
alpha = 1;
sign.callback = function ():void{
anim.gotoAndPlay(2);
};
sign.gotoAndPlay(2);
} else {
anim.gotoAndPlay(2);
};
};
GameApplication.instance.stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
}
private function onUp(_arg1:MouseEvent):void{
var _local2:MovieClip = (getChildAt(0) as MovieClip);
if (_local2){
_local2.reset();
};
GameApplication.instance.stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
}
function frame1(){
stop();
}
}
}//package lp.pge.game.gui
Section 248
//AModel (lp.pge.game.models.AModel)
package lp.pge.game.models {
public class AModel {
public function AModel(){
if ((this as Object).constructor === AModel){
throw (new Error("[AModel] : <AModel> : Abstract class can't be instantiated."));
};
}
}
}//package lp.pge.game.models
Section 249
//BlockModel (lp.pge.game.models.BlockModel)
package lp.pge.game.models {
import lp.pge.game.dummies.*;
public class BlockModel extends ThingModel {
protected var _fixed:Boolean;
public function BlockModel(){
if ((this as Object).constructor === BlockModel){
throw (new Error("[BlockModel] : <BlockModel> : Abstract class can't be instantiated."));
};
}
public function get fixed():Boolean{
return (_fixed);
}
public function set fixed(_arg1:Boolean):void{
_fixed = _arg1;
}
override public function load(_arg1:GameDummy):void{
if (((!(_arg1)) || (((!(_arg1.shape)) || (!(_arg1.image)))))){
throw (new Error("[BlockModel] : <load> : Wrong dummy."));
};
super.load(_arg1);
_fixed = (_arg1 as BlockDummy).fixed;
}
}
}//package lp.pge.game.models
Section 250
//BonusModel (lp.pge.game.models.BonusModel)
package lp.pge.game.models {
import Box2D.Dynamics.*;
public class BonusModel extends ThingModel {
override public function createBody():b2Body{
var _local1:b2Body = constructBody();
var _local2:b2Fixture = _local1.GetFixtureList();
while (_local2) {
_local2.SetSensor(true);
_local2 = _local2.GetNext();
};
return (_local1);
}
}
}//package lp.pge.game.models
Section 251
//BouncyBlockModel (lp.pge.game.models.BouncyBlockModel)
package lp.pge.game.models {
public class BouncyBlockModel extends BlockModel {
}
}//package lp.pge.game.models
Section 252
//GameModel (lp.pge.game.models.GameModel)
package lp.pge.game.models {
import lp.pge.game.dummies.*;
import flash.geom.*;
public class GameModel extends AModel {
protected const DPR:Number = 57.2957795130823;
protected const PS:Number = 30;
protected var _id:String;
protected var _loaded:Boolean;
protected var _x:Number;
protected var _y:Number;
protected var _angle:Number;
protected var _scaleX:Number;
protected var _scaleY:Number;
protected var _transform:Transform;
protected var _data;
public function GameModel(){
if ((this as Object).constructor === GameModel){
throw (new Error("[GameModel] : <GameModel> : Abstract class can't be instantiated."));
};
}
public function get id():String{
return (_id);
}
public function load(_arg1:GameDummy):void{
if (!_arg1){
throw (new Error("[GameModel] : <load> : Wrong dummy."));
};
_id = _arg1.name;
_transform = _arg1.transform;
_x = _arg1.x;
_y = _arg1.y;
_angle = (_arg1.rotation / DPR);
_arg1.rotation = 0;
_scaleX = _arg1.scaleX;
_scaleY = _arg1.scaleY;
_loaded = true;
}
public function unload():void{
_x = undefined;
_y = undefined;
_angle = undefined;
_scaleX = undefined;
_scaleY = undefined;
_transform = undefined;
_data = undefined;
_loaded = false;
}
public function get isLoaded():Boolean{
return (_loaded);
}
public function get x():Number{
return (_x);
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function get y():Number{
return (_y);
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public function get angle():Number{
return (_angle);
}
public function set angle(_arg1:Number):void{
_angle = _arg1;
}
public function get scaleX():Number{
return (_scaleX);
}
public function set scaleX(_arg1:Number):void{
_scaleX = _arg1;
}
public function get scaleY():Number{
return (_scaleY);
}
public function set scaleY(_arg1:Number):void{
_scaleY = _arg1;
}
public function get data(){
return (_data);
}
public function set data(_arg1):void{
_data = _arg1;
}
}
}//package lp.pge.game.models
Section 253
//GeometryModel (lp.pge.game.models.GeometryModel)
package lp.pge.game.models {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import lp.pge.game.shapes.*;
import lp.pge.game.dummies.*;
import Box2DExt.*;
import lp.pge.game.samplers.*;
import lp.pge.game.core.systems.*;
import lp.pge.game.patterns.*;
public class GeometryModel extends GameModel {
protected var _shapes:Array;
protected var _material:b2eMaterial;
protected var _properties:b2eProperties;
protected var _filterData:b2FilterData;
public function GeometryModel(){
_filterData = new b2FilterData();
super();
}
override public function load(_arg1:GameDummy):void{
var _local3:uint;
var _local4:AbstractShapeSampler;
var _local5:uint;
if (((!(_arg1)) || (!(_arg1.shape)))){
throw (new Error("[GeometryModel] : <load> : Wrong dummy."));
};
_id = _arg1.name;
_transform = _arg1.transform;
_x = _arg1.x;
_y = _arg1.y;
_angle = (_arg1.rotation / DPR);
_arg1.rotation = 0;
_scaleX = _arg1.scaleX;
_scaleY = _arg1.scaleY;
_shapes = new Array();
var _local2:AbstractShapePattern = (_arg1.shape as AbstractShapePattern);
if ((_local2["init"] is Function)){
var _local6 = _local2;
_local6["init"]();
};
if (_local2){
_local3 = _local2.numChildren;
_local5 = 0;
while (_local5 < _local3) {
_local4 = (_local2.getChildAt(_local5) as AbstractShapeSampler);
if (_local4){
_local4.x = (_local4.x * _scaleX);
_local4.y = (_local4.y * _scaleY);
_shapes.push(getGeomShape(_local4));
} else {
throw (new Error("[GeometryModel] : <load> : Wrong shape pattern."));
};
_local5++;
};
} else {
throw (new Error("[GeometryModel] : <load> : Wrong shape data."));
};
_material = _arg1.material;
_properties = _arg1.properties;
_loaded = true;
}
override public function unload():void{
_x = undefined;
_y = undefined;
_angle = undefined;
_scaleX = undefined;
_scaleY = undefined;
_transform = undefined;
while (_shapes.length) {
_shapes.pop().dispose();
};
_shapes = undefined;
_material = undefined;
_properties = undefined;
_data = undefined;
_loaded = false;
}
public function createBody():b2Body{
return (constructBody());
}
public function get material():b2eMaterial{
return (_material);
}
public function set material(_arg1:b2eMaterial):void{
_material = _arg1;
}
public function get properties():b2eProperties{
return (_properties);
}
public function set properties(_arg1:b2eProperties):void{
_properties = _arg1;
}
protected function getGeomShape(_arg1:AbstractShapeSampler):AbstractShape{
var _local2:AbstractShape;
var _local6:Array;
var _local7:PointSampler;
var _local8:String;
var _local9:int;
var _local10:uint;
var _local11:uint;
var _local3:Number = _arg1.rotation;
_arg1.rotation = 0;
var _local4:Number = (_arg1.width * _scaleX);
var _local5:Number = (_arg1.height * _scaleY);
if ((_arg1 is CircleShapeSampler)){
_local2 = new CircleShape(((_local4 + _local5) / 4), _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is RectangleShapeSampler)){
_local2 = new RectangleShape((_local4 / 2), (_local5 / 2), _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is TriangleShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tc", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is BLSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "bl", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is BRSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "br", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is TLSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tl", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is TRSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tr", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is PolygonShapeSampler)){
_local6 = new Array();
_local10 = _arg1.numChildren;
_local11 = 0;
while (_local11 < _local10) {
_local7 = (_arg1.getChildAt(_local11) as PointSampler);
if (_local7){
_local8 = _local7.name.split("p_")[1];
_local9 = (((_local8) && (_local8.length))) ? int(_local8) : -1;
if (_local9 >= 0){
if (!_local6[_local9]){
_local6[_local9] = new b2Vec2((_local7.x * _scaleX), (_local7.y * _scaleY));
} else {
throw (new Error("[GeometryModel] : <getGeomShape> : Wrong index found."));
};
} else {
throw (new Error("[GeometryModel] : <getGeomShape> : Unnamed point found."));
};
};
_local11++;
};
_local2 = new PolygonShape(_local6, _arg1.x, _arg1.y, _local3);
} else {
throw (new Error("[GeometryModel] : <getGeomShape> : Unknown sampler."));
};
};
};
};
};
};
};
};
_local2.userData = _arg1.userData;
return (_local2);
}
protected function constructBody():b2Body{
var _local4:AbstractShape;
var _local7:Array;
var _local8:b2Vec2;
if (!_loaded){
throw (new Error("[GeometryModel] : <constructBody> : Model isn't loaded."));
};
var _local1:b2Body = Box2DAPI.createBody(PhysicalAdapter.getSharedWorld(), {position:new b2Vec2((_x / PS), (_y / PS)), type:b2Body.b2_staticBody});
var _local2:b2FixtureDef = Box2DAPI.createFixtureDef({restitution:_material.restitution, friction:_material.friction, density:_material.density, filter:_filterData});
var _local3:uint = _shapes.length;
var _local5:uint;
while (_local5 < _local3) {
_local4 = _shapes[_local5];
_local2.userData = _local4.userData;
if ((_local4 is CircleShape)){
Box2DAPI.createCircularFixture(_local1, ((2 * (_local4 as CircleShape).radius) / PS), (_local4.x / PS), (_local4.y / PS), _local2);
} else {
if ((_local4 is RectangleShape)){
_local7 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
for each (_local8 in _local7) {
_local8.x = (_local8.x / PS);
_local8.y = (_local8.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local7, _local2);
} else {
if ((_local4 is TriangleShape)){
switch ((_local4 as TriangleShape).kind){
case "tc":
_local7 = [_local4.getGlobalBottomLeft(), _local4.getGlobalTopCenter(), _local4.getGlobalBottomRight()];
break;
case "bl":
_local7 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomRight()];
break;
case "br":
_local7 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomLeft()];
break;
case "tl":
_local7 = [_local4.getGlobalTopRight(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
break;
case "tr":
_local7 = [_local4.getGlobalTopLeft(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
break;
default:
throw (new Error("[GeometryModel] : <createBody> : Unknown triangle kind."));
};
for each (_local8 in _local7) {
_local8.x = (_local8.x / PS);
_local8.y = (_local8.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local7, _local2);
} else {
if ((_local4 is PolygonShape)){
_local7 = (_local4 as PolygonShape).getGlobalPoints();
for each (_local8 in _local7) {
_local8.x = (_local8.x / PS);
_local8.y = (_local8.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local7, _local2);
} else {
throw (new Error("[GeometryModel] : <createBody> : Unknown shape."));
};
};
};
};
_local5++;
};
_local1.SetAngle(_angle);
var _local6:b2Vec2 = new b2Vec2((_x / PS), (_y / PS));
_local1.SetPosition(_local6);
if (_properties){
_local1.SetLinearDamping(_properties.linearDamping);
_local1.SetAngularDamping(_properties.angularDamping);
};
return (_local1);
}
}
}//package lp.pge.game.models
Section 254
//NormalBlockModel (lp.pge.game.models.NormalBlockModel)
package lp.pge.game.models {
public class NormalBlockModel extends BlockModel {
}
}//package lp.pge.game.models
Section 255
//PacketModel (lp.pge.game.models.PacketModel)
package lp.pge.game.models {
import Box2D.Dynamics.*;
public class PacketModel extends ThingModel {
override public function createBody():b2Body{
var _local1:b2Body = constructBody();
_local1.SetBullet(true);
return (_local1);
}
}
}//package lp.pge.game.models
Section 256
//SpikesModel (lp.pge.game.models.SpikesModel)
package lp.pge.game.models {
public class SpikesModel extends ThingModel {
}
}//package lp.pge.game.models
Section 257
//StickyBlockModel (lp.pge.game.models.StickyBlockModel)
package lp.pge.game.models {
public class StickyBlockModel extends BlockModel {
}
}//package lp.pge.game.models
Section 258
//TargetModel (lp.pge.game.models.TargetModel)
package lp.pge.game.models {
import Box2D.Dynamics.*;
import lp.pge.game.shapes.*;
import lp.pge.game.dummies.*;
import lp.pge.game.*;
public class TargetModel extends ThingModel {
private var _hitDistance:Number;
private var _event:String;
private var _packetAction:String;
override public function load(_arg1:GameDummy):void{
var _local5:CircleShape;
super.load(_arg1);
var _local2:TargetDummy = (_arg1 as TargetDummy);
_hitDistance = (_local2.hitDistance / GameConfig.PHYS_SCALE);
_event = _local2.event;
_packetAction = _local2.packetAction;
var _local3:uint = _shapes.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = (_shapes[_local4] as CircleShape);
if (_local5){
_local5.radius = _local2.hitDistance;
};
_local4++;
};
}
override public function createBody():b2Body{
var _local1:b2Body = constructBody();
var _local2:b2Fixture = _local1.GetFixtureList();
while (_local2) {
_local2.SetSensor(true);
_local2 = _local2.GetNext();
};
return (_local1);
}
public function getEvent():String{
return (_event);
}
public function getHitDistance():Number{
return (_hitDistance);
}
public function getPacketAction():String{
return (_packetAction);
}
}
}//package lp.pge.game.models
Section 259
//ThingModel (lp.pge.game.models.ThingModel)
package lp.pge.game.models {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import flash.display.*;
import lp.pge.game.shapes.*;
import lp.pge.game.dummies.*;
import Box2DExt.*;
import lp.pge.game.samplers.*;
import flash.geom.*;
import flash.utils.*;
import lp.pge.game.core.systems.*;
import lp.pge.game.patterns.*;
public class ThingModel extends GameModel {
protected var _shapes:Array;
protected var _imageClass:Class;
protected var _shiftX:Number;
protected var _shiftY:Number;
protected var _material:b2eMaterial;
protected var _properties:b2eProperties;
protected var _filterData:b2FilterData;
protected var _massScale:Number;
protected var _wp0:b2Vec2;
protected var _wp1:b2Vec2;
protected var _speed:Number;
protected var _axis:String;
protected var _area:Rectangle;
protected var _numSteps:uint;
protected var _type:String;
public function ThingModel(){
_filterData = new b2FilterData();
super();
if ((this as Object).constructor === ThingModel){
throw (new Error("[ThingModel] : <ThingModel> : Abstract class can't be instantiated."));
};
}
public function getShapes():Array{
var _local6:AbstractShape;
var _local1:Number = (_shiftX / _scaleX);
var _local2:Number = (_shiftY / _scaleY);
var _local3:Array = new Array();
var _local4:uint = _shapes.length;
var _local5:uint;
while (_local5 < _local4) {
_local6 = _shapes[_local5].clone();
_shapes[_local5].clone().x = (_local6.x - _local1);
_local6.y = (_local6.y - _local2);
_local3.push(_local6);
_local5++;
};
return (_local3);
}
override public function load(_arg1:GameDummy):void{
var _local8:uint;
var _local9:AbstractShapeSampler;
var _local10:uint;
if (((!(_arg1)) || (((!(_arg1.shape)) || (!(_arg1.image)))))){
throw (new Error("[ThingModel] : <load> : Wrong dummy."));
};
_id = _arg1.name;
_transform = _arg1.transform;
_x = _arg1.x;
_y = _arg1.y;
_angle = (_arg1.rotation / DPR);
_arg1.rotation = 0;
_scaleX = _arg1.scaleX;
_scaleY = _arg1.scaleY;
_shapes = new Array();
var _local2:AbstractShapePattern = (_arg1.shape as AbstractShapePattern);
if ((_local2["init"] is Function)){
var _local11 = _local2;
_local11["init"]();
};
if (_local2){
_local8 = _local2.numChildren;
_local10 = 0;
while (_local10 < _local8) {
_local9 = (_local2.getChildAt(_local10) as AbstractShapeSampler);
if (_local9){
_local9.x = (_local9.x * _scaleX);
_local9.y = (_local9.y * _scaleY);
_shapes.push(getGeomShape(_local9));
} else {
throw (new Error("[ThingModel] : <load> : Wrong shape pattern."));
};
_local10++;
};
} else {
throw (new Error("[ThingModel] : <load> : Wrong shape data."));
};
_imageClass = (getDefinitionByName(getQualifiedClassName(_arg1.image)) as Class);
_material = _arg1.material;
_properties = _arg1.properties;
_massScale = (_arg1 as ThingDummy).massScale;
var _local3:ThingDummy = (_arg1 as ThingDummy);
var _local4:Point = _local3.wp0;
var _local5:Point = _local3.wp1;
_wp0 = (_local4) ? new b2Vec2((_local4.x / PS), (_local4.y / PS)) : new b2Vec2((_x / PS), (_y / PS));
_wp1 = (_local5) ? new b2Vec2((_local5.x / PS), (_local5.y / PS)) : new b2Vec2((_x / PS), (_y / PS));
var _local6:Number = _local3.speed;
_speed = (isNaN(_local6)) ? 0 : (_local6 / PS);
var _local7:Rectangle = _local3.area;
_area = (_local7) ? new Rectangle((_local7.x / PS), (_local7.y / PS), (_local7.width / PS), (_local7.height / PS)) : null;
switch (_local3.axis){
case "x":
_axis = _local3.axis;
break;
case "y":
_axis = _local3.axis;
break;
default:
_axis = "all";
};
_numSteps = _local3.numSteps;
_type = _local3.type;
_loaded = true;
}
override public function unload():void{
_x = undefined;
_y = undefined;
_angle = undefined;
_scaleX = undefined;
_scaleY = undefined;
_transform = undefined;
while (_shapes.length) {
_shapes.pop().dispose();
};
_shapes = undefined;
_imageClass = undefined;
_shiftX = undefined;
_shiftY = undefined;
_material = undefined;
_properties = undefined;
_data = undefined;
_wp0 = undefined;
_wp1 = undefined;
_speed = undefined;
_loaded = false;
}
public function createBody():b2Body{
return (constructBody());
}
public function createSkin():Sprite{
return (constructSkin());
}
public function get shiftX():Number{
return (_shiftX);
}
public function set shiftX(_arg1:Number):void{
_shiftX = _arg1;
}
public function get shiftY():Number{
return (_shiftY);
}
public function set shiftY(_arg1:Number):void{
_shiftY = _arg1;
}
public function get material():b2eMaterial{
return (_material);
}
public function set material(_arg1:b2eMaterial):void{
_material = _arg1;
}
public function get properties():b2eProperties{
return (_properties);
}
public function set properties(_arg1:b2eProperties):void{
_properties = _arg1;
}
public function get massScale():Number{
return (_massScale);
}
public function set massScale(_arg1:Number):void{
_massScale = _arg1;
}
public function getPoint0():b2Vec2{
return (_wp0);
}
public function getPoint1():b2Vec2{
return (_wp1);
}
public function getSpeed():Number{
return (_speed);
}
public function getArea():Rectangle{
return (_area);
}
public function getAxis():String{
return (_axis);
}
public function getNumSteps():uint{
return (_numSteps);
}
public function getType():String{
return (_type);
}
protected function getGeomShape(_arg1:AbstractShapeSampler):AbstractShape{
var _local2:AbstractShape;
var _local6:Array;
var _local7:PointSampler;
var _local8:String;
var _local9:int;
var _local10:uint;
var _local11:uint;
var _local3:Number = _arg1.rotation;
_arg1.rotation = 0;
var _local4:Number = (_arg1.width * _scaleX);
var _local5:Number = (_arg1.height * _scaleY);
if ((_arg1 is CircleShapeSampler)){
_local2 = new CircleShape(((_local4 + _local5) / 4), _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is RectangleShapeSampler)){
_local2 = new RectangleShape((_local4 / 2), (_local5 / 2), _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is TriangleShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tc", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is BLSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "bl", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is BRSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "br", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is TLSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tl", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is TRSlopeShapeSampler)){
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tr", _arg1.x, _arg1.y, _local3);
} else {
if ((_arg1 is PolygonShapeSampler)){
_local6 = new Array();
_local10 = _arg1.numChildren;
_local11 = 0;
while (_local11 < _local10) {
_local7 = (_arg1.getChildAt(_local11) as PointSampler);
if (_local7){
_local8 = _local7.name.split("p_")[1];
_local9 = (((_local8) && (_local8.length))) ? int(_local8) : -1;
if (_local9 >= 0){
if (!_local6[_local9]){
_local6[_local9] = new b2Vec2((_local7.x * _scaleX), (_local7.y * _scaleY));
} else {
throw (new Error("[ThingModel] : <getGeomShape> : Wrong index found."));
};
} else {
throw (new Error("[ThingModel] : <getGeomShape> : Unnamed point found."));
};
};
_local11++;
};
_local2 = new PolygonShape(_local6, _arg1.x, _arg1.y, _local3);
} else {
throw (new Error("[ThingModel] : <getGeomShape> : Unknown sampler."));
};
};
};
};
};
};
};
};
_local2.userData = _arg1.userData;
return (_local2);
}
protected function constructBody():b2Body{
var _local4:AbstractShape;
var _local8:Array;
var _local9:b2Vec2;
if (!_loaded){
throw (new Error("[ThingModel] : <constructBody> : Model isn't loaded."));
};
var _local1:b2Body = Box2DAPI.createBody(PhysicalAdapter.getSharedWorld(), {position:new b2Vec2((_x / PS), (_y / PS)), type:b2Body.b2_staticBody});
var _local2:b2FixtureDef = Box2DAPI.createFixtureDef({restitution:_material.restitution, friction:_material.friction, density:(_material.density * _massScale), filter:_filterData});
var _local3:uint = _shapes.length;
var _local5:uint;
while (_local5 < _local3) {
_local4 = _shapes[_local5];
_local2.userData = _local4.userData;
if ((_local4 is CircleShape)){
Box2DAPI.createCircularFixture(_local1, ((2 * (_local4 as CircleShape).radius) / PS), (_local4.x / PS), (_local4.y / PS), _local2);
} else {
if ((_local4 is RectangleShape)){
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
} else {
if ((_local4 is TriangleShape)){
switch ((_local4 as TriangleShape).kind){
case "tc":
_local8 = [_local4.getGlobalBottomLeft(), _local4.getGlobalTopCenter(), _local4.getGlobalBottomRight()];
break;
case "bl":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomRight()];
break;
case "br":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomLeft()];
break;
case "tl":
_local8 = [_local4.getGlobalTopRight(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
break;
case "tr":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
break;
default:
throw (new Error("[ThingModel] : <createBody> : Unknown triangle kind."));
};
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
} else {
if ((_local4 is PolygonShape)){
_local8 = (_local4 as PolygonShape).getGlobalPoints();
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
} else {
throw (new Error("[ThingModel] : <createBody> : Unknown shape."));
};
};
};
};
_local5++;
};
var _local6:b2Vec2 = _local1.GetLocalCenter();
_shiftX = _local6.x;
_shiftY = _local6.y;
_local1.SetAngle(_angle);
var _local7:b2Vec2 = new b2Vec2((_x / PS), (_y / PS));
new b2Vec2((_x / PS), (_y / PS)).x = (_local7.x + _shiftX);
_local7.y = (_local7.y + _shiftY);
_local1.SetPosition(_local7);
if (_properties){
_local1.SetLinearDamping(_properties.linearDamping);
_local1.SetAngularDamping(_properties.angularDamping);
};
return (_local1);
}
protected function constructSkin():Sprite{
if (!_loaded){
throw (new Error("[ThingModel] : <constructSkin> : Model isn't loaded."));
};
var _local1:Sprite = new _imageClass();
_local1.transform = _transform;
return (_local1);
}
}
}//package lp.pge.game.models
Section 260
//TriggerModel (lp.pge.game.models.TriggerModel)
package lp.pge.game.models {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import lp.pge.game.shapes.*;
import lp.pge.game.dummies.*;
import Box2DExt.*;
import lp.pge.game.samplers.*;
import flash.utils.*;
import lp.pge.game.core.systems.*;
import lp.pge.game.patterns.*;
public class TriggerModel extends GameModel {
protected var _shapes:Array;
protected var _material:b2eMaterial;
protected var _properties:b2eProperties;
protected var _filterData:b2FilterData;
private var _event:String;
public function TriggerModel(){
_filterData = new b2FilterData();
super();
}
override public function load(_arg1:GameDummy):void{
var _local4:uint;
var _local5:AbstractShapeSampler;
var _local6:uint;
if (((!(_arg1)) || (!(_arg1.shape)))){
throw (new Error("[GeometryModel] : <load> : Wrong dummy."));
};
_id = _arg1.name;
_transform = _arg1.transform;
_x = _arg1.x;
_y = _arg1.y;
_angle = (_arg1.rotation / DPR);
_arg1.rotation = 0;
_scaleX = _arg1.scaleX;
_scaleY = _arg1.scaleY;
_shapes = new Array();
var _local2:AbstractShapePattern = (_arg1.shape as AbstractShapePattern);
if (_local2){
_local4 = _local2.numChildren;
_local6 = 0;
while (_local6 < _local4) {
_local5 = (_local2.getChildAt(_local6) as AbstractShapeSampler);
if (_local5){
_local5.x = (_local5.x * _scaleX);
_local5.y = (_local5.y * _scaleY);
_shapes.push(getGeomShape(_local5));
} else {
throw (new Error("[GeometryModel] : <load> : Wrong shape pattern."));
};
_local6++;
};
} else {
throw (new Error("[GeometryModel] : <load> : Wrong shape data."));
};
_material = _arg1.material;
_properties = _arg1.properties;
_loaded = true;
var _local3:TriggerDummy = (_arg1 as TriggerDummy);
_event = _local3.event;
}
override public function unload():void{
_x = undefined;
_y = undefined;
_angle = undefined;
_scaleX = undefined;
_scaleY = undefined;
_transform = undefined;
while (_shapes.length) {
_shapes.pop().dispose();
};
_shapes = undefined;
_material = undefined;
_properties = undefined;
_data = undefined;
_loaded = false;
}
public function createBody():b2Body{
return (constructBody());
}
public function get material():b2eMaterial{
return (_material);
}
public function set material(_arg1:b2eMaterial):void{
_material = _arg1;
}
public function get properties():b2eProperties{
return (_properties);
}
public function set properties(_arg1:b2eProperties):void{
_properties = _arg1;
}
public function getEvent():String{
return (_event);
}
protected function getGeomShape(_arg1:AbstractShapeSampler):AbstractShape{
var _local2:AbstractShape;
var _local6:Array;
var _local7:PointSampler;
var _local8:String;
var _local9:int;
var _local10:uint;
var _local11:uint;
var _local3:Number = _arg1.rotation;
_arg1.rotation = 0;
var _local4:Number = (_arg1.width * _scaleX);
var _local5:Number = (_arg1.height * _scaleY);
switch (getQualifiedClassName(_arg1)){
case "lp.pge.game.samplers::CircleShapeSampler":
_local2 = new CircleShape(((_local4 + _local5) / 4), _arg1.x, _arg1.y, _local3);
break;
case "lp.pge.game.samplers::RectangleShapeSampler":
_local2 = new RectangleShape((_local4 / 2), (_local5 / 2), _arg1.x, _arg1.y, _local3);
break;
case "lp.pge.game.samplers::TriangleShapeSampler":
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tc", _arg1.x, _arg1.y, _local3);
break;
case "lp.pge.game.samplers::BLSlopeShapeSampler":
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "bl", _arg1.x, _arg1.y, _local3);
break;
case "lp.pge.game.samplers::BRSlopeShapeSampler":
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "br", _arg1.x, _arg1.y, _local3);
break;
case "lp.pge.game.samplers::TLSlopeShapeSampler":
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tl", _arg1.x, _arg1.y, _local3);
break;
case "lp.pge.game.samplers::TRSlopeShapeSampler":
_local2 = new TriangleShape((_local4 / 2), (_local5 / 2), "tr", _arg1.x, _arg1.y, _local3);
break;
default:
if ((_arg1 is PolygonShapeSampler)){
_local6 = new Array();
_local10 = _arg1.numChildren;
_local11 = 0;
while (_local11 < _local10) {
_local7 = (_arg1.getChildAt(_local11) as PointSampler);
if (_local7){
_local8 = _local7.name.split("p_")[1];
_local9 = (((_local8) && (_local8.length))) ? int(_local8) : -1;
if (_local9 >= 0){
if (!_local6[_local9]){
_local6[_local9] = new b2Vec2((_local7.x * _scaleX), (_local7.y * _scaleY));
} else {
throw (new Error("[GeometryModel] : <getGeomShape> : Wrong index found."));
};
} else {
throw (new Error("[GeometryModel] : <getGeomShape> : Unnamed point found."));
};
};
_local11++;
};
_local2 = new PolygonShape(_local6, _arg1.x, _arg1.y, _local3);
} else {
throw (new Error("[GeometryModel] : <getGeomShape> : Unknown sampler."));
};
};
return (_local2);
}
protected function constructBody():b2Body{
var _local4:AbstractShape;
var _local8:Array;
var _local9:b2Vec2;
if (!_loaded){
throw (new Error("[GeometryModel] : <constructBody> : Model isn't loaded."));
};
var _local1:b2Body = Box2DAPI.createBody(PhysicalAdapter.getSharedWorld(), {position:new b2Vec2((_x / PS), (_y / PS)), type:b2Body.b2_staticBody});
var _local2:b2FixtureDef = Box2DAPI.createFixtureDef({restitution:_material.restitution, friction:_material.friction, density:_material.density, filter:_filterData});
var _local3:uint = _shapes.length;
var _local5:uint;
while (_local5 < _local3) {
_local4 = _shapes[_local5];
switch (getQualifiedClassName(_local4)){
case "lp.pge.game.shapes::CircleShape":
Box2DAPI.createCircularFixture(_local1, ((2 * (_local4 as CircleShape).radius) / PS), (_local4.x / PS), (_local4.y / PS), _local2);
break;
case "lp.pge.game.shapes::RectangleShape":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
case "lp.pge.game.shapes::TriangleShape":
switch ((_local4 as TriangleShape).kind){
case "tc":
_local8 = [_local4.getGlobalBottomLeft(), _local4.getGlobalTopCenter(), _local4.getGlobalBottomRight()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
case "bl":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomRight()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
case "br":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalTopRight(), _local4.getGlobalBottomLeft()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
case "tl":
_local8 = [_local4.getGlobalTopRight(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
case "tr":
_local8 = [_local4.getGlobalTopLeft(), _local4.getGlobalBottomRight(), _local4.getGlobalBottomLeft()];
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
default:
throw (new Error("[GeometryModel] : <createBody> : Unknown triangle kind."));
};
break;
case "lp.pge.game.shapes::PolygonShape":
_local8 = (_local4 as PolygonShape).getGlobalPoints();
for each (_local9 in _local8) {
_local9.x = (_local9.x / PS);
_local9.y = (_local9.y / PS);
};
Box2DAPI.createPolygonalFixture(_local1, _local8, _local2);
break;
default:
throw (new Error("[GeometryModel] : <createBody> : Unknown shape."));
};
_local5++;
};
var _local6:b2Vec2 = _local1.GetLocalCenter();
_local1.SetAngle(_angle);
var _local7:b2Vec2 = new b2Vec2((_x / PS), (_y / PS));
_local1.SetPosition(_local7);
if (_properties){
_local1.SetLinearDamping(_properties.linearDamping);
_local1.SetAngularDamping(_properties.angularDamping);
};
return (_local1);
}
}
}//package lp.pge.game.models
Section 261
//AbstractShapePattern (lp.pge.game.patterns.AbstractShapePattern)
package lp.pge.game.patterns {
import flash.display.*;
public class AbstractShapePattern extends MovieClip {
}
}//package lp.pge.game.patterns
Section 262
//AbstractShapeSampler (lp.pge.game.samplers.AbstractShapeSampler)
package lp.pge.game.samplers {
import flash.display.*;
public class AbstractShapeSampler extends Sprite {
public var userData;
}
}//package lp.pge.game.samplers
Section 263
//BLSlopeShapeSampler (lp.pge.game.samplers.BLSlopeShapeSampler)
package lp.pge.game.samplers {
public class BLSlopeShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 264
//BRSlopeShapeSampler (lp.pge.game.samplers.BRSlopeShapeSampler)
package lp.pge.game.samplers {
public class BRSlopeShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 265
//CircleShapeSampler (lp.pge.game.samplers.CircleShapeSampler)
package lp.pge.game.samplers {
public class CircleShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 266
//PointSampler (lp.pge.game.samplers.PointSampler)
package lp.pge.game.samplers {
import flash.display.*;
public class PointSampler extends Sprite {
}
}//package lp.pge.game.samplers
Section 267
//PolygonShapeSampler (lp.pge.game.samplers.PolygonShapeSampler)
package lp.pge.game.samplers {
public class PolygonShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 268
//RectangleShapeSampler (lp.pge.game.samplers.RectangleShapeSampler)
package lp.pge.game.samplers {
public class RectangleShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 269
//TLSlopeShapeSampler (lp.pge.game.samplers.TLSlopeShapeSampler)
package lp.pge.game.samplers {
public class TLSlopeShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 270
//TriangleShapeSampler (lp.pge.game.samplers.TriangleShapeSampler)
package lp.pge.game.samplers {
public class TriangleShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 271
//TRSlopeShapeSampler (lp.pge.game.samplers.TRSlopeShapeSampler)
package lp.pge.game.samplers {
public class TRSlopeShapeSampler extends AbstractShapeSampler {
}
}//package lp.pge.game.samplers
Section 272
//AbstractShape (lp.pge.game.shapes.AbstractShape)
package lp.pge.game.shapes {
import Box2D.Common.Math.*;
public class AbstractShape {
protected const RPD:Number = 0.0174532925199433;
protected var cachedAngle:Number;
protected var cachedCos:Number;
protected var cachedSin:Number;
protected var _x:Number;
protected var _y:Number;
protected var _halfWidth:Number;
protected var _halfHeight:Number;
protected var _rotation:Number;
public var userData;
public function AbstractShape(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6=null){
_x = _arg3;
_y = _arg4;
_halfWidth = _arg1;
_halfHeight = _arg2;
_rotation = _arg5;
userData = _arg6;
}
public function get x():Number{
return (_x);
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function get y():Number{
return (_y);
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public function get halfWidth():Number{
return (_halfWidth);
}
public function set halfWidth(_arg1:Number):void{
_halfWidth = _arg1;
}
public function get halfHeight():Number{
return (_halfHeight);
}
public function set halfHeight(_arg1:Number):void{
_halfHeight = _arg1;
}
public function get width():Number{
return ((2 * _halfWidth));
}
public function set width(_arg1:Number):void{
_halfWidth = (_arg1 / 2);
}
public function get height():Number{
return ((2 * _halfHeight));
}
public function set height(_arg1:Number):void{
_halfHeight = (_arg1 / 2);
}
public function get rotation():Number{
return (_rotation);
}
public function set rotation(_arg1:Number):void{
_rotation = _arg1;
}
public function getLocalCenter():b2Vec2{
return (new b2Vec2(0, 0));
}
public function getLocalBottomLeft():b2Vec2{
return (new b2Vec2(-(_halfWidth), _halfHeight));
}
public function getLocalBottomRight():b2Vec2{
return (new b2Vec2(_halfWidth, _halfHeight));
}
public function getLocalTopLeft():b2Vec2{
return (new b2Vec2(-(_halfWidth), -(_halfHeight)));
}
public function getLocalTopRight():b2Vec2{
return (new b2Vec2(_halfWidth, -(_halfHeight)));
}
public function getLocalBottomCenter():b2Vec2{
return (new b2Vec2(0, _halfHeight));
}
public function getLocalLeftCenter():b2Vec2{
return (new b2Vec2(-(_halfWidth), 0));
}
public function getLocalRightCenter():b2Vec2{
return (new b2Vec2(_halfWidth, 0));
}
public function getLocalTopCenter():b2Vec2{
return (new b2Vec2(0, -(_halfHeight)));
}
public function getGlobalCenter():b2Vec2{
return (new b2Vec2(_x, _y));
}
public function getGlobalBottomLeft():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(-(_halfWidth), _halfHeight), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalBottomRight():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(_halfWidth, _halfHeight), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalTopLeft():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(-(_halfWidth), -(_halfHeight)), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalTopRight():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(_halfWidth, -(_halfHeight)), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalBottomCenter():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(0, _halfHeight), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalLeftCenter():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(-(_halfWidth), 0), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalRightCenter():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(_halfWidth, 0), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function getGlobalTopCenter():b2Vec2{
var _local1:b2Vec2 = rotatePoint(new b2Vec2(0, -(_halfHeight)), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
}
public function clone():AbstractShape{
return (new AbstractShape(_halfWidth, _halfHeight, _x, _y, _rotation, userData));
}
public function dispose():void{
_x = undefined;
_y = undefined;
_halfWidth = undefined;
_halfHeight = undefined;
_rotation = undefined;
}
public function toString():String{
return ((((((((((("[AbstractShape (halfWidth:" + _halfWidth) + ", halfHeight:") + _halfHeight) + ", x:") + _x) + ", y:") + _y) + ", rotation:") + _rotation) + ")]"));
}
protected function rotatePoint(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local3:Number = (_arg2 * RPD);
if (_local3 != cachedAngle){
_local4 = Math.cos(_local3);
_local5 = Math.sin(_local3);
cachedAngle = _local3;
cachedCos = _local4;
cachedSin = _local5;
} else {
_local4 = cachedCos;
_local5 = cachedSin;
};
var _local6:Number = ((_arg1.x * _local4) - (_arg1.y * _local5));
var _local7:Number = ((_arg1.x * _local5) + (_arg1.y * _local4));
return (new b2Vec2(_local6, _local7));
}
}
}//package lp.pge.game.shapes
Section 273
//CircleShape (lp.pge.game.shapes.CircleShape)
package lp.pge.game.shapes {
import Box2D.Common.Math.*;
public class CircleShape extends AbstractShape {
private var _radius:Number;
public function CircleShape(_arg1:Number, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5=null){
super(_arg1, _arg1, _arg2, _arg3, _arg4, _arg5);
_radius = _arg1;
}
public function get radius():Number{
return (_radius);
}
public function set radius(_arg1:Number):void{
_radius = _arg1;
_halfWidth = _radius;
_halfHeight = _radius;
}
public function get diameter():Number{
return ((2 * _radius));
}
public function set diameter(_arg1:Number):void{
_radius = (_arg1 / 2);
_halfWidth = _radius;
_halfHeight = _radius;
}
override public function set halfWidth(_arg1:Number):void{
_radius = _arg1;
_halfWidth = _radius;
_halfHeight = _radius;
}
override public function set halfHeight(_arg1:Number):void{
_radius = _arg1;
_halfWidth = _radius;
_halfHeight = _radius;
}
override public function set width(_arg1:Number):void{
_radius = (_arg1 / 2);
_halfWidth = _radius;
_halfHeight = _radius;
}
override public function set height(_arg1:Number):void{
_radius = (_arg1 / 2);
_halfWidth = _radius;
_halfHeight = _radius;
}
override public function getLocalBottomLeft():b2Vec2{
return (null);
}
override public function getLocalBottomRight():b2Vec2{
return (null);
}
override public function getLocalTopLeft():b2Vec2{
return (null);
}
override public function getLocalTopRight():b2Vec2{
return (null);
}
override public function getLocalBottomCenter():b2Vec2{
return (null);
}
override public function getLocalLeftCenter():b2Vec2{
return (null);
}
override public function getLocalRightCenter():b2Vec2{
return (null);
}
override public function getLocalTopCenter():b2Vec2{
return (null);
}
override public function getGlobalBottomLeft():b2Vec2{
return (null);
}
override public function getGlobalBottomRight():b2Vec2{
return (null);
}
override public function getGlobalTopLeft():b2Vec2{
return (null);
}
override public function getGlobalTopRight():b2Vec2{
return (null);
}
override public function getGlobalBottomCenter():b2Vec2{
return (null);
}
override public function getGlobalLeftCenter():b2Vec2{
return (null);
}
override public function getGlobalRightCenter():b2Vec2{
return (null);
}
override public function getGlobalTopCenter():b2Vec2{
return (null);
}
override public function clone():AbstractShape{
return (new CircleShape(_radius, _x, _y, _rotation, userData));
}
override public function dispose():void{
super.dispose();
_radius = undefined;
}
override public function toString():String{
return ((((((((("[CircleShape (radius:" + _radius) + ", x:") + _x) + ", y:") + _y) + ", rotation:") + _rotation) + ")]"));
}
}
}//package lp.pge.game.shapes
Section 274
//PolygonShape (lp.pge.game.shapes.PolygonShape)
package lp.pge.game.shapes {
import Box2D.Common.Math.*;
public class PolygonShape extends AbstractShape {
protected var _points:Array;
public function PolygonShape(_arg1:Array=null, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5=null){
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:b2Vec2;
var _local12:uint;
super(0, 0, _arg2, _arg3, _arg4, _arg5);
_points = new Array();
if (_arg1){
_local6 = Number.POSITIVE_INFINITY;
_local7 = Number.NEGATIVE_INFINITY;
_local8 = Number.POSITIVE_INFINITY;
_local9 = Number.NEGATIVE_INFINITY;
_local10 = _arg1.length;
_local12 = 0;
while (_local12 < _local10) {
_local11 = _arg1[_local12];
if ((_local11 is b2Vec2)){
_points.push(_local11.Copy());
if (_local11.x < _local6){
_local6 = _local11.x;
};
if (_local11.x > _local7){
_local7 = _local11.x;
};
if (_local11.y < _local8){
_local8 = _local11.y;
};
if (_local11.y > _local9){
_local9 = _local11.y;
};
};
_local12++;
};
_halfWidth = ((_local7 - _local6) / 2);
_halfHeight = ((_local9 - _local8) / 2);
};
}
override public function set halfWidth(_arg1:Number):void{
}
override public function set halfHeight(_arg1:Number):void{
}
override public function set width(_arg1:Number):void{
}
override public function set height(_arg1:Number):void{
}
public function getLocalPoints():Array{
var _local1:Array = new Array();
var _local2:uint = _points.length;
var _local3:uint;
while (_local3 < _local2) {
_local1.push(_points[_local3].clone());
_local3++;
};
return (_local1);
}
override public function getLocalBottomLeft():b2Vec2{
return (null);
}
override public function getLocalBottomRight():b2Vec2{
return (null);
}
override public function getLocalTopLeft():b2Vec2{
return (null);
}
override public function getLocalTopRight():b2Vec2{
return (null);
}
override public function getLocalBottomCenter():b2Vec2{
return (null);
}
override public function getLocalLeftCenter():b2Vec2{
return (null);
}
override public function getLocalRightCenter():b2Vec2{
return (null);
}
override public function getLocalTopCenter():b2Vec2{
return (null);
}
public function getGlobalPoints():Array{
var _local2:b2Vec2;
var _local1:Array = new Array();
var _local3:uint = _points.length;
var _local4:uint;
while (_local4 < _local3) {
_local2 = rotatePoint(_points[_local4], _rotation);
_local1.push(new b2Vec2((_x + _local2.x), (_y + _local2.y)));
_local4++;
};
return (_local1);
}
override public function getGlobalBottomLeft():b2Vec2{
return (null);
}
override public function getGlobalBottomRight():b2Vec2{
return (null);
}
override public function getGlobalTopLeft():b2Vec2{
return (null);
}
override public function getGlobalTopRight():b2Vec2{
return (null);
}
override public function getGlobalBottomCenter():b2Vec2{
return (null);
}
override public function getGlobalLeftCenter():b2Vec2{
return (null);
}
override public function getGlobalRightCenter():b2Vec2{
return (null);
}
override public function getGlobalTopCenter():b2Vec2{
return (null);
}
override public function clone():AbstractShape{
return (new PolygonShape(_points, _x, _y, _rotation, userData));
}
override public function dispose():void{
super.dispose();
_points = undefined;
}
override public function toString():String{
return ((((((((((("[PolygonShape (halfWidth:" + _halfWidth) + ", halfHeight:") + _halfHeight) + ", x:") + _x) + ", y:") + _y) + ", rotation:") + _rotation) + ")]"));
}
}
}//package lp.pge.game.shapes
Section 275
//RectangleShape (lp.pge.game.shapes.RectangleShape)
package lp.pge.game.shapes {
public class RectangleShape extends AbstractShape {
public function RectangleShape(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
override public function clone():AbstractShape{
return (new RectangleShape(_halfWidth, _halfHeight, _x, _y, _rotation, userData));
}
override public function toString():String{
return ((((((((((("[RectangleShape (halfWidth:" + _halfWidth) + ", halfHeight:") + _halfHeight) + ", x:") + _x) + ", y:") + _y) + ", rotation:") + _rotation) + ")]"));
}
}
}//package lp.pge.game.shapes
Section 276
//TriangleShape (lp.pge.game.shapes.TriangleShape)
package lp.pge.game.shapes {
import Box2D.Common.Math.*;
public class TriangleShape extends AbstractShape {
private var _kind:String;
public function TriangleShape(_arg1:Number, _arg2:Number, _arg3:String="tc", _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7=null){
super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7);
kind = _arg3;
}
public function get kind():String{
return (_kind);
}
public function set kind(_arg1:String):void{
switch (_arg1){
case "tc":
_kind = _arg1;
break;
case "tl":
_kind = _arg1;
break;
case "tr":
_kind = _arg1;
break;
case "br":
_kind = _arg1;
break;
case "bl":
_kind = _arg1;
break;
default:
throw (new Error("[TriangleShape] : <(set) kind> : Wrong triangle kind."));
};
}
override public function getLocalBottomLeft():b2Vec2{
return (((_kind)!="bl") ? new b2Vec2(-(_halfWidth), _halfHeight) : null);
}
override public function getLocalBottomRight():b2Vec2{
return (((_kind)!="br") ? new b2Vec2(_halfWidth, _halfHeight) : null);
}
override public function getLocalTopLeft():b2Vec2{
return ((((!((_kind == "tl"))) && (!((_kind == "tc"))))) ? new b2Vec2(-(_halfWidth), -(_halfHeight)) : null);
}
override public function getLocalTopRight():b2Vec2{
return ((((!((_kind == "tr"))) && (!((_kind == "tc"))))) ? new b2Vec2(_halfWidth, -(_halfHeight)) : null);
}
override public function getLocalBottomCenter():b2Vec2{
return ((((!((_kind == "bl"))) && (!((_kind == "br"))))) ? new b2Vec2(0, _halfHeight) : null);
}
override public function getLocalLeftCenter():b2Vec2{
return ((((!((_kind == "bl"))) && (!((_kind == "tl"))))) ? new b2Vec2(-(_halfWidth), 0) : null);
}
override public function getLocalRightCenter():b2Vec2{
return ((((!((_kind == "br"))) && (!((_kind == "tr"))))) ? new b2Vec2(_halfWidth, 0) : null);
}
override public function getLocalTopCenter():b2Vec2{
return ((((!((_kind == "tl"))) && (!((_kind == "tr"))))) ? new b2Vec2(0, -(_halfHeight)) : null);
}
override public function getGlobalBottomLeft():b2Vec2{
var _local1:b2Vec2;
if (_kind != "bl"){
_local1 = rotatePoint(new b2Vec2(-(_halfWidth), _halfHeight), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalBottomRight():b2Vec2{
var _local1:b2Vec2;
if (_kind != "br"){
_local1 = rotatePoint(new b2Vec2(_halfWidth, _halfHeight), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalTopLeft():b2Vec2{
var _local1:b2Vec2;
if (((!((_kind == "tl"))) && (!((_kind == "tc"))))){
_local1 = rotatePoint(new b2Vec2(-(_halfWidth), -(_halfHeight)), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalTopRight():b2Vec2{
var _local1:b2Vec2;
if (((!((_kind == "tr"))) && (!((_kind == "tc"))))){
_local1 = rotatePoint(new b2Vec2(_halfWidth, -(_halfHeight)), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalBottomCenter():b2Vec2{
var _local1:b2Vec2;
if (((!((_kind == "bl"))) && (!((_kind == "br"))))){
_local1 = rotatePoint(new b2Vec2(0, _halfHeight), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalLeftCenter():b2Vec2{
var _local1:b2Vec2;
if (((!((_kind == "bl"))) && (!((_kind == "tl"))))){
_local1 = rotatePoint(new b2Vec2(-(_halfWidth), 0), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalRightCenter():b2Vec2{
var _local1:b2Vec2;
if (((!((_kind == "br"))) && (!((_kind == "tr"))))){
_local1 = rotatePoint(new b2Vec2(_halfWidth, 0), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function getGlobalTopCenter():b2Vec2{
var _local1:b2Vec2;
if (((!((_kind == "tl"))) && (!((_kind == "tr"))))){
_local1 = rotatePoint(new b2Vec2(0, -(_halfHeight)), _rotation);
return (new b2Vec2((_x + _local1.x), (_y + _local1.y)));
};
return (null);
}
override public function clone():AbstractShape{
return (new TriangleShape(_halfWidth, _halfHeight, _kind, _x, _y, _rotation, userData));
}
override public function dispose():void{
super.dispose();
_kind = undefined;
}
override public function toString():String{
return ((((((((((((("[TriangleShape (halfWidth:" + _halfWidth) + ", halfHeight:") + _halfHeight) + ", kind:") + _kind) + ", x:") + _x) + ", y:") + _y) + ", rotation:") + _rotation) + ")]"));
}
}
}//package lp.pge.game.shapes
Section 277
//AchievementWindow (lp.pge.game.windows.AchievementWindow)
package lp.pge.game.windows {
import flash.display.*;
import lp.pge.gui.*;
public class AchievementWindow extends Window {
public var callback:Function;
public var cards:MovieClip;
public function AchievementWindow(_arg1:String, _arg2:Function=null){
addFrameScript(11, frame12);
callback = _arg2;
if (cards.currentLabel == _arg1){
cards.refreshCard();
} else {
cards.gotoAndStop(_arg1);
cards.refreshCard();
};
}
function frame12(){
stop();
}
}
}//package lp.pge.game.windows
Section 278
//FinalWindow (lp.pge.game.windows.FinalWindow)
package lp.pge.game.windows {
import lp.pge.gui.*;
public class FinalWindow extends Window {
public function FinalWindow(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package lp.pge.game.windows
Section 279
//GameCompletedWindow (lp.pge.game.windows.GameCompletedWindow)
package lp.pge.game.windows {
import lp.pge.gui.*;
public class GameCompletedWindow extends Window {
private var _numStars:uint;// = 0
public function GameCompletedWindow(_arg1:uint=0){
addFrameScript(24, frame25, 34, frame35, 44, frame45, 54, frame55);
update(_arg1);
}
public function get numStars():uint{
return (_numStars);
}
public function update(_arg1:uint):void{
_numStars = _arg1;
}
function frame25(){
if (numStars < 1){
stop();
};
}
function frame35(){
if (numStars < 2){
stop();
};
}
function frame45(){
if (numStars < 3){
stop();
};
}
function frame55(){
stop();
}
}
}//package lp.pge.game.windows
Section 280
//LevelCompletedWindow (lp.pge.game.windows.LevelCompletedWindow)
package lp.pge.game.windows {
import lp.pge.gui.*;
public class LevelCompletedWindow extends Window {
private var _numStars:uint;// = 0
public function LevelCompletedWindow(_arg1:uint=0){
addFrameScript(24, frame25, 34, frame35, 44, frame45, 54, frame55);
update(_arg1);
}
public function get numStars():uint{
return (_numStars);
}
public function update(_arg1:uint):void{
_numStars = _arg1;
}
function frame25(){
if (numStars < 1){
stop();
};
}
function frame35(){
if (numStars < 2){
stop();
};
}
function frame45(){
if (numStars < 3){
stop();
};
}
function frame55(){
stop();
}
}
}//package lp.pge.game.windows
Section 281
//LevelFailedWindow (lp.pge.game.windows.LevelFailedWindow)
package lp.pge.game.windows {
import lp.pge.gui.*;
public class LevelFailedWindow extends Window {
public function LevelFailedWindow(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package lp.pge.game.windows
Section 282
//ThrowsWindow (lp.pge.game.windows.ThrowsWindow)
package lp.pge.game.windows {
import flash.events.*;
import flash.display.*;
import lp.pge.gui.*;
public class ThrowsWindow extends Window {
public var numThrowsMC:MovieClip;
private var _numThrows:uint;// = 0
private var _callback:Function;
private var _waitForUpdate:Boolean;
public function ThrowsWindow(_arg1:uint=0, _arg2:Function=null){
addFrameScript(11, frame12, 68, frame69);
update(_arg1);
_callback = _arg2;
addEventListener(MouseEvent.CLICK, onClick);
}
public function get numThrows():uint{
return (_numThrows);
}
public function update(_arg1:uint):void{
_numThrows = _arg1;
if (numThrowsMC){
numThrowsMC.gotoAndStop((1 + _arg1));
} else {
_waitForUpdate = true;
};
}
public function checkUpdate():void{
if (((_waitForUpdate) && (numThrowsMC))){
numThrowsMC.gotoAndStop((1 + _numThrows));
_waitForUpdate = false;
};
}
override public function destroy():void{
var _local1:Function;
if (_exists){
stop();
removeEventListener(MouseEvent.CLICK, onClick);
_exists = false;
if (_callback != null){
_local1 = _callback;
_callback = undefined;
_local1();
};
};
}
private function onClick(_arg1:MouseEvent):void{
stop();
removeEventListener(MouseEvent.CLICK, onClick);
close();
}
function frame12(){
checkUpdate();
}
function frame69(){
stop();
close();
}
}
}//package lp.pge.game.windows
Section 283
//TutorialL13Window (lp.pge.game.windows.TutorialL13Window)
package lp.pge.game.windows {
public class TutorialL13Window extends TutorialWindow {
public function TutorialL13Window(_arg1:Function=null){
addFrameScript(429, frame430);
super(_arg1);
}
function frame430(){
stop();
close();
}
}
}//package lp.pge.game.windows
Section 284
//TutorialL1Window (lp.pge.game.windows.TutorialL1Window)
package lp.pge.game.windows {
public class TutorialL1Window extends TutorialWindow {
public function TutorialL1Window(_arg1:Function=null){
addFrameScript(283, frame284);
super(_arg1);
}
function frame284(){
stop();
close();
}
}
}//package lp.pge.game.windows
Section 285
//TutorialL2Window (lp.pge.game.windows.TutorialL2Window)
package lp.pge.game.windows {
public class TutorialL2Window extends TutorialWindow {
public function TutorialL2Window(_arg1:Function=null){
addFrameScript(329, frame330);
super(_arg1);
}
function frame330(){
stop();
close();
}
}
}//package lp.pge.game.windows
Section 286
//TutorialL3Window (lp.pge.game.windows.TutorialL3Window)
package lp.pge.game.windows {
public class TutorialL3Window extends TutorialWindow {
public function TutorialL3Window(_arg1:Function=null){
addFrameScript(429, frame430);
super(_arg1);
}
function frame430(){
stop();
close();
}
}
}//package lp.pge.game.windows
Section 287
//TutorialWindow (lp.pge.game.windows.TutorialWindow)
package lp.pge.game.windows {
import flash.events.*;
import lp.pge.gui.*;
public class TutorialWindow extends Window {
protected var _callback:Function;
public function TutorialWindow(_arg1:Function=null){
_callback = _arg1;
}
override public function destroy():void{
var _local1:Function;
if (_exists){
stop();
removeEventListener(MouseEvent.CLICK, onClick);
_exists = false;
if (_callback != null){
_local1 = _callback;
_callback = undefined;
_local1();
};
};
}
protected function onClick(_arg1:MouseEvent):void{
stop();
removeEventListener(MouseEvent.CLICK, onClick);
close();
}
}
}//package lp.pge.game.windows
Section 288
//EntitiesFactory (lp.pge.game.EntitiesFactory)
package lp.pge.game {
import lp.pge.game.core.entities.*;
import lp.pge.game.models.*;
import lp.pge.game.core.aspects.*;
public class EntitiesFactory {
public static function createEntity(_arg1:GameModel):GameEntity{
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createEntity> : Can't create entity from non-existing model."));
};
if ((_arg1 is PacketModel)){
return (createPacket((_arg1 as PacketModel)));
};
if ((_arg1 is TargetModel)){
return (createTarget((_arg1 as TargetModel)));
};
if ((_arg1 is SpikesModel)){
return (createSpikes((_arg1 as SpikesModel)));
};
if ((_arg1 is BonusModel)){
return (createBonus((_arg1 as BonusModel)));
};
if ((_arg1 is BouncyBlockModel)){
return (createBouncyBlock((_arg1 as BouncyBlockModel)));
};
if ((_arg1 is NormalBlockModel)){
return (createNormalBlock((_arg1 as NormalBlockModel)));
};
if ((_arg1 is StickyBlockModel)){
return (createStickyBlock((_arg1 as StickyBlockModel)));
};
if ((_arg1 is TriggerModel)){
return (createTrigger((_arg1 as TriggerModel)));
};
if ((_arg1 is GeometryModel)){
return (createGeometry((_arg1 as GeometryModel)));
};
throw (new Error("[EntitiesFactory] : <createEntity> : Unknown entity model."));
}
public static function createPacket(_arg1:PacketModel):Packet{
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createPacket> : Can't create entity from non-existing model."));
};
var _local2:PhysicalAspect = new PhysicalAspect(_arg1.createBody(), PhysicalAspect.DYNAMIC);
var _local3:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local4:Packet = new Packet(_local2, _local3, 10);
_local4.id = _arg1.id;
return (_local4);
}
public static function createTarget(_arg1:TargetModel):Target{
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createTarget> : Can't create entity from non-existing model."));
};
var _local2:PhysicalAspect = new PhysicalAspect(_arg1.createBody());
var _local3:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local4:Target = new Target(_local2, _local3, _arg1.getHitDistance(), _arg1.getEvent());
_local4.packetAction = _arg1.getPacketAction();
var _local5:InteractiveAspect = new InteractiveAspect();
_local4.addAspect(_local5);
_local4.id = _arg1.id;
return (_local4);
}
public static function createSpikes(_arg1:SpikesModel):Spikes{
var _local5:MovementAspect;
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createSpikes> : Can't create entity from non-existing model."));
};
var _local2:PhysicalAspect = new PhysicalAspect(_arg1.createBody(), PhysicalAspect.MOVING);
var _local3:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local4:Spikes = new Spikes(_local2, _local3);
switch (_arg1.getType()){
case ThingTypes.MOVING:
_local5 = new MovementAspect(_arg1.getPoint0(), _arg1.getPoint1(), _arg1.getType(), _arg1.getSpeed());
_local4.addAspect(_local5);
break;
case ThingTypes.JUMPING:
_local5 = new MovementAspect(_arg1.getPoint0(), _arg1.getPoint1(), _arg1.getType());
_local4.addAspect(_local5);
break;
};
_local4.id = _arg1.id;
return (_local4);
}
public static function createBonus(_arg1:BonusModel):Bonus{
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createBonus> : Can't create entity from non-existing model."));
};
var _local2:PhysicalAspect = new PhysicalAspect(_arg1.createBody());
var _local3:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local4:Bonus = new Bonus(_local2, _local3);
_local4.id = _arg1.id;
return (_local4);
}
public static function createBouncyBlock(_arg1:BouncyBlockModel):BouncyBlock{
var _local6:InteractiveAspect;
var _local7:MovementAspect;
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createBouncyBlock> : Can't create entity from non-existing model."));
};
var _local2:String = ((_arg1.getType())==ThingTypes.IMMOVABLE) ? PhysicalAspect.STATIC : PhysicalAspect.KINEMATIC;
var _local3:PhysicalAspect = new PhysicalAspect(_arg1.createBody(), _local2);
var _local4:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local5:BouncyBlock = new BouncyBlock(_local3, _local4, _arg1.fixed);
switch (_arg1.getType()){
case ThingTypes.MOVABLE:
_local6 = new InteractiveAspect(_arg1.getArea(), _arg1.getAxis(), _arg1.getNumSteps());
_local5.addAspect(_local6);
break;
case ThingTypes.MOVING:
_local7 = new MovementAspect(_arg1.getPoint0(), _arg1.getPoint1(), _arg1.getType(), _arg1.getSpeed());
_local5.addAspect(_local7);
break;
};
_local5.id = _arg1.id;
return (_local5);
}
public static function createNormalBlock(_arg1:NormalBlockModel):NormalBlock{
var _local6:InteractiveAspect;
var _local7:MovementAspect;
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createNormalBlock> : Can't create entity from non-existing model."));
};
var _local2:String = ((_arg1.getType())==ThingTypes.IMMOVABLE) ? PhysicalAspect.STATIC : PhysicalAspect.KINEMATIC;
var _local3:PhysicalAspect = new PhysicalAspect(_arg1.createBody(), _local2);
var _local4:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local5:NormalBlock = new NormalBlock(_local3, _local4, _arg1.fixed);
switch (_arg1.getType()){
case ThingTypes.MOVABLE:
_local6 = new InteractiveAspect(_arg1.getArea(), _arg1.getAxis(), _arg1.getNumSteps());
_local5.addAspect(_local6);
break;
case ThingTypes.MOVING:
_local7 = new MovementAspect(_arg1.getPoint0(), _arg1.getPoint1(), _arg1.getType(), _arg1.getSpeed());
_local5.addAspect(_local7);
break;
};
_local5.id = _arg1.id;
return (_local5);
}
public static function createStickyBlock(_arg1:StickyBlockModel):StickyBlock{
var _local6:InteractiveAspect;
var _local7:MovementAspect;
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createStickyBlock> : Can't create entity from non-existing model."));
};
var _local2:String = ((_arg1.getType())==ThingTypes.IMMOVABLE) ? PhysicalAspect.STATIC : PhysicalAspect.KINEMATIC;
var _local3:PhysicalAspect = new PhysicalAspect(_arg1.createBody(), _local2);
var _local4:GraphicalAspect = new GraphicalAspect(_arg1.createSkin());
var _local5:StickyBlock = new StickyBlock(_local3, _local4, _arg1.fixed);
switch (_arg1.getType()){
case ThingTypes.MOVABLE:
_local6 = new InteractiveAspect(_arg1.getArea(), _arg1.getAxis(), _arg1.getNumSteps());
_local5.addAspect(_local6);
break;
case ThingTypes.MOVING:
_local7 = new MovementAspect(_arg1.getPoint0(), _arg1.getPoint1(), _arg1.getType(), _arg1.getSpeed());
_local5.addAspect(_local7);
break;
};
_local5.id = _arg1.id;
return (_local5);
}
public static function createTrigger(_arg1:TriggerModel):Trigger{
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createTrigger> : Can't create entity from non-existing model."));
};
var _local2:PhysicalAspect = new PhysicalAspect(_arg1.createBody());
var _local3:Trigger = new Trigger(_local2, _arg1.getEvent());
_local3.id = _arg1.id;
return (_local3);
}
public static function createGeometry(_arg1:GeometryModel):Geometry{
if (!_arg1){
throw (new Error("[EntitiesFactory] : <createGeometry> : Can't create entity from non-existing model."));
};
var _local2:PhysicalAspect = new PhysicalAspect(_arg1.createBody());
var _local3:Geometry = new Geometry(_local2);
_local3.id = _arg1.id;
return (_local3);
}
}
}//package lp.pge.game
Section 289
//Game (lp.pge.game.Game)
package lp.pge.game {
import flash.events.*;
import flash.display.*;
import lp.pge.system.*;
import lp.pge.gui.*;
import lp.pge.*;
import lp.pge.ui.keyboard.*;
public class Game extends InteractiveScreen {
public var blackScreen:MovieClip;
public var gameBar:GameBar;
public var windowManager:GameWindowManager;
public var levelManager:LevelManager;
public var logo:Sprite;
public var gameMenu:GameMenu;
private var _soundMode:uint;
public static const NONE_SOUND_MODE:uint = 0;
public static const MENU_SOUND_MODE:uint = 1;
public static const INFO_SOUND_MODE:uint = 2;
public static const PLAY_SOUND_MODE:uint = 3;
public static const DONE_SOUND_MODE:uint = 4;
private static var _instance:Game;
public function Game(){
if (_instance){
throw (new Error("[Game] : <Game> : Only one instance of this class is allowed."));
};
_instance = this;
KeyboardController.bindKeyUp(Key.SPACE, spaceKeyAction);
}
override public function hide(_arg1:Event=null):void{
returnToGame();
if (levelManager.getCurrentLevel()){
unloadLevel();
};
super.hide();
}
public function pause(_arg1:Function=null):void{
pauseLevel();
gameMenu.show(_arg1);
}
public function resume(_arg1:Function=null):void{
resumeLevel();
gameMenu.hide(_arg1);
}
override public function set mute(_arg1:Boolean):void{
if (_arg1 == _mute){
return;
};
_mute = _arg1;
switchSoundMode();
}
public function get soundMode():uint{
return (_soundMode);
}
public function set soundMode(_arg1:uint):void{
if (_arg1 == _soundMode){
return;
};
_soundMode = _arg1;
switchSoundMode();
}
public function load():void{
levelManager.load();
}
public function save():void{
levelManager.save();
}
public function submitTime(_arg1:uint, _arg2:uint):void{
levelManager.submitTime(_arg1, _arg2);
}
public function getTotalTime():uint{
return (levelManager.getTotalTime());
}
public function submitScore(_arg1:uint, _arg2:uint):void{
levelManager.submitScore(_arg1, _arg2);
}
public function getTotalScore():uint{
return (levelManager.getTotalScore());
}
public function openGameCompleted(_arg1:uint=0):void{
windowManager.openGameCompletedWindow(_arg1);
}
public function openLevelCompleted(_arg1:uint=0):void{
windowManager.openLevelCompletedWindow(_arg1);
}
public function openLevelFailed():void{
windowManager.openLevelFailedWindow();
}
public function openAchievement(_arg1:String, _arg2:Function=null):void{
GameApplication.instance.trackEvent(((("/achiev#" + _arg1) + "#") + GameAchievements.getAchievementBySID(_arg1)));
windowManager.openAchievementWindow(_arg1, _arg2);
}
public function openTutorialL1(_arg1:Function=null):void{
windowManager.openTutorialL1Window(_arg1);
}
public function openTutorialL2(_arg1:Function=null):void{
windowManager.openTutorialL2Window(_arg1);
}
public function openTutorialL3(_arg1:Function=null):void{
windowManager.openTutorialL3Window(_arg1);
}
public function openTutorialL13(_arg1:Function=null):void{
windowManager.openTutorialL13Window(_arg1);
}
public function openThrows(_arg1:uint=0, _arg2:Function=null):void{
windowManager.openThrowsWindow(_arg1, _arg2);
}
public function openFinal():void{
GameApplication.instance.trackEvent("/final");
windowManager.openFinalWindow();
}
public function returnToGame():void{
if (windowManager.activeWindow){
windowManager.closeActiveWindow();
};
}
public function showBlackScreen(_arg1:Function=null):void{
if (!blackScreen.isShown()){
blackScreen.show(_arg1);
} else {
if (blackScreen.currentFrame != blackScreen.totalFrames){
blackScreen.callback = _arg1;
};
};
}
public function hideBlackScreen():void{
blackScreen.callback = null;
if (!blackScreen.isHidden()){
blackScreen.hide();
};
}
public function getCurrentLevel():Level{
return (levelManager.getCurrentLevel());
}
public function getCurrentLevelIndex():uint{
return (levelManager.getCurrentLevelIndex());
}
public function getNumLevels():uint{
return (levelManager.getNumLevels());
}
public function isNextLevel():Boolean{
return (levelManager.isNextLevel());
}
public function isPrevLevel():Boolean{
return (levelManager.isPrevLevel());
}
public function isLevelCompleted(_arg1:uint):Boolean{
return (levelManager.isLevelCompleted(_arg1));
}
public function isLevelLocked(_arg1:uint):Boolean{
return (levelManager.isLevelLocked(_arg1));
}
public function registerLevel(_arg1:Class, _arg2:uint):void{
levelManager.registerLevel(_arg1, _arg2);
}
public function unregisterLevel(_arg1:uint):void{
levelManager.unregisterLevel(_arg1);
}
public function hasLevelAt(_arg1:uint):Boolean{
return (levelManager.hasLevelAt(_arg1));
}
public function lockLevel(_arg1:uint):void{
levelManager.lockLevel(_arg1);
}
public function unlockLevel(_arg1:uint):void{
levelManager.unlockLevel(_arg1);
}
public function completeLevel(_arg1:uint):void{
levelManager.completeLevel(_arg1);
}
public function resetLevel(_arg1:uint):void{
levelManager.resetLevel(_arg1);
}
public function loadLevel(_arg1:uint):void{
levelManager.loadLevel(_arg1);
}
public function unloadLevel():void{
levelManager.unloadLevel();
}
public function startLevel():void{
levelManager.startLevel();
}
public function finishLevel():void{
levelManager.finishLevel();
}
public function restartLevel():void{
levelManager.restartLevel();
}
public function pauseLevel():void{
if (levelManager.getCurrentLevel().state == LevelState.PLAYING){
levelManager.pauseLevel();
};
}
public function resumeLevel():void{
if (levelManager.getCurrentLevel().state == LevelState.PAUSED){
levelManager.resumeLevel();
};
}
public function prevLevel():void{
levelManager.prevLevel();
}
public function nextLevel():void{
levelManager.nextLevel();
}
public function launchLevel():void{
levelManager.launchLevel();
}
public function isLevelMute():Boolean{
return (levelManager.isLevelMute());
}
public function muteLevel():void{
if (levelManager.getCurrentLevel()){
levelManager.muteLevel();
};
}
public function unmuteLevel():void{
if (levelManager.getCurrentLevel()){
levelManager.unmuteLevel();
};
}
private function switchSoundMode():void{
var _local1:Boolean = GameApplication.instance.mute;
if (((!(_mute)) && (!(_local1)))){
if (_soundMode == INFO_SOUND_MODE){
blackScreen.mute = false;
windowManager.mute = false;
muteLevel();
} else {
if (_soundMode == PLAY_SOUND_MODE){
blackScreen.mute = false;
windowManager.mute = true;
unmuteLevel();
} else {
if (_soundMode == DONE_SOUND_MODE){
blackScreen.mute = false;
windowManager.mute = false;
unmuteLevel();
};
};
};
} else {
blackScreen.mute = true;
windowManager.mute = true;
muteLevel();
};
}
private function spaceKeyAction(_arg1:int=-1):void{
trace(">>> SPACE PRESSED");
if (((levelManager.getCurrentLevel()) && (!(Console.instance.active)))){
launchLevel();
};
}
private function onLoadError(_arg1:GameEvent):void{
}
private function onLoadComplete(_arg1:GameEvent):void{
}
private function onSaveError(_arg1:GameEvent):void{
}
private function onSaveComplete(_arg1:GameEvent):void{
}
public static function get instance():Game{
return (_instance);
}
}
}//package lp.pge.game
Section 290
//GameAchievements (lp.pge.game.GameAchievements)
package lp.pge.game {
public class GameAchievements {
public static const AXE_SID:String = "axe";
public static const BOOTS_SID:String = "boots";
public static const HELMET_SID:String = "helmet";
public static const JERKIN_SID:String = "jerkin";
public static const PANTS_SID:String = "pants";
public static const SHIELD_SID:String = "shield";
public static const SHIRT_SID:String = "shirt";
public static const VEST_SID:String = "vest";
public static const AXE_NID:uint = 1;
public static const BOOTS_NID:uint = 2;
public static const HELMET_NID:uint = 3;
public static const JERKIN_NID:uint = 4;
public static const PANTS_NID:uint = 5;
public static const SHIELD_NID:uint = 6;
public static const SHIRT_NID:uint = 7;
public static const VEST_NID:uint = 8;
public static const ORDER:Array = [PANTS_NID, SHIRT_NID, JERKIN_NID, VEST_NID, HELMET_NID, SHIELD_NID, AXE_NID, BOOTS_NID];
private static var _achievements:Array = [0, 0, 0, 0, 0, 0, 0, 0];
public static function getAchievementNID(_arg1:String):uint{
if (_arg1 == AXE_SID){
return (AXE_NID);
};
if (_arg1 == BOOTS_SID){
return (BOOTS_NID);
};
if (_arg1 == HELMET_SID){
return (HELMET_NID);
};
if (_arg1 == JERKIN_SID){
return (JERKIN_NID);
};
if (_arg1 == PANTS_SID){
return (PANTS_NID);
};
if (_arg1 == SHIELD_SID){
return (SHIELD_NID);
};
if (_arg1 == SHIRT_SID){
return (SHIRT_NID);
};
if (_arg1 == VEST_SID){
return (VEST_NID);
};
return (0);
}
public static function getAchievementSID(_arg1:uint):String{
if (_arg1 == AXE_NID){
return (AXE_SID);
};
if (_arg1 == BOOTS_NID){
return (BOOTS_SID);
};
if (_arg1 == HELMET_NID){
return (HELMET_SID);
};
if (_arg1 == JERKIN_NID){
return (JERKIN_SID);
};
if (_arg1 == PANTS_NID){
return (PANTS_SID);
};
if (_arg1 == SHIELD_NID){
return (SHIELD_SID);
};
if (_arg1 == SHIRT_NID){
return (SHIRT_SID);
};
if (_arg1 == VEST_NID){
return (VEST_SID);
};
return (null);
}
public static function getAchievementNIDForLevel(_arg1:uint):uint{
var _local2:int = Math.floor(((_arg1 - 3) / 3));
if ((((_local2 < 0)) || ((_local2 > 7)))){
return (0);
};
return (ORDER[_local2]);
}
public static function getAchievementSIDForLevel(_arg1:uint):String{
var _local3:uint;
var _local2:int = Math.floor(((_arg1 - 3) / 3));
if ((((_local2 >= 0)) && ((_local2 <= 7)))){
_local3 = ORDER[_local2];
if (_local3 == AXE_NID){
return (AXE_SID);
};
if (_local3 == BOOTS_NID){
return (BOOTS_SID);
};
if (_local3 == HELMET_NID){
return (HELMET_SID);
};
if (_local3 == JERKIN_NID){
return (JERKIN_SID);
};
if (_local3 == PANTS_NID){
return (PANTS_SID);
};
if (_local3 == SHIELD_NID){
return (SHIELD_SID);
};
if (_local3 == SHIRT_NID){
return (SHIRT_SID);
};
if (_local3 == VEST_NID){
return (VEST_SID);
};
};
return (null);
}
public static function getAchievementByNID(_arg1:uint):uint{
if ((((_arg1 < 1)) || ((_arg1 > 8)))){
throw (new Error((("[GameAchievements] : <getAchievementByNID> : Achievement not found (NID:" + _arg1) + ").")));
};
return (_achievements[(_arg1 - 1)]);
}
public static function getAchievementBySID(_arg1:String):uint{
var _local2:uint = getAchievementNID(_arg1);
if ((((_local2 < 1)) || ((_local2 > 8)))){
throw (new Error((("[GameAchievements] : <getAchievementBySID> : Achievement not found (SID:" + _arg1) + ").")));
};
return (_achievements[(_local2 - 1)]);
}
public static function hasAchievementByNID(_arg1:uint):Boolean{
if ((((_arg1 < 1)) || ((_arg1 > 8)))){
throw (new Error((("[GameAchievements] : <hasAchievementByNID> : Achievement not found (NID:" + _arg1) + ").")));
};
var _local2:int = ORDER.indexOf(_arg1);
return ((((_achievements[(_arg1 - 1)] > 0)) && (LevelManager.instance.isLevelCompleted(((Math.floor((_local2 + 1)) * 3) + 2)))));
}
public static function hasAchievementBySID(_arg1:String):Boolean{
var _local2:uint = getAchievementNID(_arg1);
if ((((_local2 < 1)) || ((_local2 > 8)))){
throw (new Error((("[GameAchievements] : <hasAchievementBySID> : Achievement not found (SID:" + _arg1) + ").")));
};
var _local3:int = ORDER.indexOf(_local2);
return ((((_achievements[(_local2 - 1)] > 0)) && (LevelManager.instance.isLevelCompleted(((Math.floor((_local3 + 1)) * 3) + 2)))));
}
public static function setAchievementByNID(_arg1:uint, _arg2:uint):void{
if (_arg2 > 3){
throw (new Error("[GameAchievements] : <setAchievementByNID> : Unknown item quality."));
};
if ((((_arg1 < 1)) || ((_arg1 > 8)))){
throw (new Error((("[GameAchievements] : <setAchievementByNID> : Achievement not found (NID:" + _arg1) + ").")));
};
_achievements[(_arg1 - 1)] = _arg2;
}
public static function setAchievementBySID(_arg1:String, _arg2:uint):void{
if (_arg2 > 3){
throw (new Error("[GameAchievements] : <setAchievementBySID> : Unknown item quality."));
};
var _local3:uint = getAchievementNID(_arg1);
if ((((_local3 < 1)) || ((_local3 > 8)))){
throw (new Error((("[GameAchievements] : <setAchievementBySID> : Achievement not found (SID:" + _arg1) + ").")));
};
_achievements[(_local3 - 1)] = _arg2;
}
public static function hasAchievementOnLevel(_arg1:uint):Boolean{
var _local2:uint = getAchievementNIDForLevel(_arg1);
if ((((_local2 > 0)) && ((_achievements[(_local2 - 1)] > 0)))){
return (LevelManager.instance.isLevelCompleted(((Math.floor((_arg1 / 3)) * 3) + 2)));
};
return (false);
}
public static function getAchievementOnLevel(_arg1:uint):uint{
var _local2:uint = getAchievementNIDForLevel(_arg1);
if ((((_local2 > 0)) && (LevelManager.instance.isLevelCompleted(((Math.floor((_arg1 / 3)) * 3) + 2))))){
return (_achievements[(_local2 - 1)]);
};
return (0);
}
public static function getAchievementOrderByNID(_arg1:uint):int{
return (ORDER.indexOf(_arg1));
}
public static function getAchievementOrderBySID(_arg1):uint{
return (ORDER.indexOf(getAchievementNID(_arg1)));
}
}
}//package lp.pge.game
Section 291
//GameBar (lp.pge.game.GameBar)
package lp.pge.game {
import flash.display.*;
public class GameBar extends Sprite {
public var progressDisplay:ProgressDisplay;
public var throwsDisplay:ThrowsDisplay;
public var pauseButton:MovieClip;
public var resetButton:MovieClip;
private static var _instance:GameBar;
public function GameBar(){
if (_instance){
throw (new Error("ERROR : [GameBar] : <GameBar> : Only one instance of this class is allowed."));
};
_instance = this;
}
public function updateProgress(_arg1:uint):void{
progressDisplay.update(_arg1);
}
public function updateTimer(_arg1:uint):void{
}
public function updateScore(_arg1:uint):void{
}
public function updateThrows(_arg1:int, _arg2:int):void{
throwsDisplay.update(_arg1, _arg2);
}
public function showLaunch():void{
}
public function hideLaunch():void{
}
public function showPause():void{
pauseButton.visible = true;
resetButton.visible = true;
}
public function hidePause():void{
pauseButton.visible = false;
resetButton.visible = false;
}
public static function get instance():GameBar{
return (_instance);
}
}
}//package lp.pge.game
Section 292
//GameConfig (lp.pge.game.GameConfig)
package lp.pge.game {
public class GameConfig {
public static const PHYS_SCALE:Number = 30;
public static const DRAW_DEBUG:Boolean = false;
public static const SAVE_LOAD:Boolean = true;
public static const STAR_BONUS:uint = 50;
}
}//package lp.pge.game
Section 293
//GameEvent (lp.pge.game.GameEvent)
package lp.pge.game {
import flash.events.*;
import lp.pge.*;
public class GameEvent extends GameApplicationEvent {
public static const PACKET_LOST:String = "packetLost";
public static const PACKET_DELIVERED:String = "packetDelivered";
public static const PACKET_LAUNCH:String = "packetLaunch";
public static const TRIGGER_ACTIVATED:String = "triggerActivated";
public static const BONUS_COLLECTED:String = "bonusCollected";
public static const LEVEL_LOAD:String = "levelLoad";
public static const LEVEL_START:String = "levelStart";
public static const LEVEL_RESTART:String = "levelRestart";
public static const LEVEL_FINISH:String = "levelFinish";
public static const LEVEL_COMPLETE:String = "levelComplete";
public static const LEVEL_FAIL:String = "levelFail";
public static const LEVEL_UNLOAD:String = "levelUnload";
public static const LOAD_COMPLETE:String = "loadComplete";
public static const LOAD_ERROR:String = "loadError";
public static const SAVE_COMPLETE:String = "saveComplete";
public static const SAVE_ERROR:String = "saveError";
public static const USER_MOUSE_CLICK:String = "userMouseClick";
public static const USER_MOUSE_DOWN:String = "userMouseDown";
public static const USER_MOUSE_UP:String = "userMouseUp";
public static const USER_MOUSE_OVER:String = "userMouseOver";
public static const USER_MOUSE_OUT:String = "userMouseOut";
public static const ANIM_DISPOSE:String = "animDispose";
public static const ANIM_COMPLETE:String = "animComplete";
public static const GFX_COMPLETE:String = "gfxComplete";
public static const SFX_COMPLETE:String = "sfxComplete";
public static const INTRO_COMPLETE:String = "introComplete";
public static const OUTRO_COMPLETE:String = "outroComplete";
public static const MOVIE_COMPLETE:String = "movieComplete";
public static const GO_BLACK:String = "goBlack";
public function GameEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4=null){
super(_arg1, _arg2, _arg3, _arg4);
}
override public function clone():Event{
return (new GameEvent(type, bubbles, cancelable, _data));
}
}
}//package lp.pge.game
Section 294
//GameMenu (lp.pge.game.GameMenu)
package lp.pge.game {
import flash.events.*;
import flash.display.*;
public class GameMenu extends MovieClip {
public var panel:MovieClip;
public var background:Sprite;
private var _callback:Function;
private static var _instance:GameMenu;
public function GameMenu(){
addFrameScript(0, frame1, 1, frame2, 10, frame11, 11, frame12);
if (_instance){
throw (new Error("[GameMenu] : <GameMenu> : Only one instance of this class is allowed."));
};
_instance = this;
background.addEventListener(MouseEvent.CLICK, onBGClick);
}
public function show(_arg1:Function=null):void{
if (currentLabel != "in"){
_callback = _arg1;
if (currentLabel != "go_in"){
gotoAndPlay("go_in");
};
} else {
_callback = undefined;
if (_arg1 != null){
_arg1();
};
};
}
public function hide(_arg1:Function=null):void{
if (currentLabel != "out"){
_callback = _arg1;
if (currentLabel != "go_out"){
gotoAndPlay("go_out");
};
} else {
_callback = undefined;
if (_arg1 != null){
_arg1();
};
};
}
public function showNow():void{
if (currentLabel != "in"){
gotoAndStop("in");
};
}
public function hideNow():void{
if (currentLabel != "out"){
gotoAndStop("out");
};
}
public function execCallback():void{
var _local1:Function;
if (_callback != null){
_local1 = _callback;
_callback = undefined;
_local1();
};
}
private function onBGClick(_arg1:MouseEvent):void{
Game.instance.resumeLevel();
hide();
}
function frame1(){
stop();
panel.disable();
background.visible = false;
background.mouseEnabled = false;
execCallback();
}
function frame2(){
panel.disable();
background.visible = true;
background.mouseEnabled = false;
}
function frame11(){
stop();
panel.enable();
background.visible = true;
background.mouseEnabled = true;
execCallback();
}
function frame12(){
panel.disable();
background.visible = true;
background.mouseEnabled = false;
}
public static function get instance():GameMenu{
return (_instance);
}
}
}//package lp.pge.game
Section 295
//GameStatistics (lp.pge.game.GameStatistics)
package lp.pge.game {
import lp.pge.*;
public class GameStatistics {
private static var _numWins:uint = 0;
private static var _numLosses:uint = 0;
private static var _numPlays:uint = 0;
private static var _numRestarts:uint = 0;
private static var _numReplays:uint = 0;
private static var _numRetries:uint = 0;
private static var _levels:Array = new Array();
public static function get numWins():uint{
return (_numWins);
}
public static function get numLosses():uint{
return (_numLosses);
}
public static function get numPlays():uint{
return (_numPlays);
}
public static function get numRestarts():uint{
return (_numRestarts);
}
public static function get numReplays():uint{
return (_numReplays);
}
public static function get numRetries():uint{
return (_numRetries);
}
public static function submitWin(_arg1:uint):void{
var _local2:Object = getLevelRecord(_arg1);
_local2.wins++;
_numWins++;
trace(((((("LEVEL #" + (_arg1 + 1)) + " WINS: ") + _local2.wins) + "/") + _numWins));
GameApplication.instance.trackEvent(("/win#" + _arg1));
}
public static function submitLose(_arg1:uint):void{
var _local2:Object = getLevelRecord(_arg1);
_local2.losses++;
_numLosses++;
trace(((((("LEVEL #" + (_arg1 + 1)) + " LOSSES: ") + _local2.losses) + "/") + _numLosses));
GameApplication.instance.trackEvent(("/lose#" + _arg1));
}
public static function submitPlay(_arg1:uint):void{
var _local2:Object = getLevelRecord(_arg1);
_local2.plays++;
_numPlays++;
trace(((((("LEVEL #" + (_arg1 + 1)) + " PLAYS: ") + _local2.plays) + "/") + _numPlays));
GameApplication.instance.trackEvent(("/play#" + _arg1));
}
public static function submitRestart(_arg1:uint):void{
var _local2:Object = getLevelRecord(_arg1);
_local2.restarts++;
_numRestarts++;
trace(((((("LEVEL #" + (_arg1 + 1)) + " RESTARTS: ") + _local2.restarts) + "/") + _numRestarts));
GameApplication.instance.trackEvent(("/restart#" + _arg1));
}
public static function submitReplay(_arg1:uint):void{
var _local2:Object = getLevelRecord(_arg1);
_local2.replays++;
_numReplays++;
trace(((((("LEVEL #" + (_arg1 + 1)) + " REPLAYS: ") + _local2.replays) + "/") + _numReplays));
GameApplication.instance.trackEvent(("/replay#" + _arg1));
}
public static function submitRetry(_arg1:uint):void{
var _local2:Object = getLevelRecord(_arg1);
_local2.retries++;
_numRetries++;
trace(((((("LEVEL #" + (_arg1 + 1)) + " RETRIES: ") + _local2.retries) + "/") + _numRetries));
GameApplication.instance.trackEvent(("/retry#" + _arg1));
}
public static function getNumWins(_arg1:uint):uint{
var _local2:Object = getLevelRecord(_arg1);
return (_local2.wins);
}
public static function getNumLosses(_arg1:uint):uint{
var _local2:Object = getLevelRecord(_arg1);
return (_local2.losses);
}
public static function getNumPlays(_arg1:uint):uint{
var _local2:Object = getLevelRecord(_arg1);
return (_local2.plays);
}
public static function getNumRestarts(_arg1:uint):uint{
var _local2:Object = getLevelRecord(_arg1);
return (_local2.restarts);
}
public static function getNumReplays(_arg1:uint):uint{
var _local2:Object = getLevelRecord(_arg1);
return (_local2.replays);
}
public static function getNumRetries(_arg1:uint):uint{
var _local2:Object = getLevelRecord(_arg1);
return (_local2.retries);
}
private static function getLevelRecord(_arg1:uint):Object{
var _local2:Object = _levels[_arg1];
if ((_local2 is Object)){
return (_local2);
};
_local2 = {wins:0, losses:0, plays:0, restarts:0, replays:0, retries:0};
_levels[_arg1] = _local2;
return (_local2);
}
}
}//package lp.pge.game
Section 296
//GameWindowManager (lp.pge.game.GameWindowManager)
package lp.pge.game {
import lp.pge.gui.*;
import lp.pge.game.windows.*;
public class GameWindowManager extends WindowManager {
private static var _instance:GameWindowManager;
public function GameWindowManager(){
if (_instance){
throw (new Error("[GameWindowManager] : <GameWindowManager> : Only one instance of this class is allowed."));
};
_instance = this;
}
public function openGameCompletedWindow(_arg1:uint=0):void{
openActiveWindow(new GameCompletedWindow(_arg1));
}
public function openLevelCompletedWindow(_arg1:uint=0):void{
openActiveWindow(new LevelCompletedWindow(_arg1));
}
public function openLevelFailedWindow():void{
openActiveWindow(new LevelFailedWindow());
}
public function openAchievementWindow(_arg1:String, _arg2:Function=null):void{
openActiveWindow(new AchievementWindow(_arg1, _arg2));
}
public function openTutorialL1Window(_arg1:Function=null):void{
openActiveWindow(new TutorialL1Window(_arg1));
}
public function openTutorialL2Window(_arg1:Function=null):void{
openActiveWindow(new TutorialL2Window(_arg1));
}
public function openTutorialL3Window(_arg1:Function=null):void{
openActiveWindow(new TutorialL3Window(_arg1));
}
public function openTutorialL13Window(_arg1:Function=null):void{
openActiveWindow(new TutorialL13Window(_arg1));
}
public function openThrowsWindow(_arg1:uint=0, _arg2:Function=null):void{
openActiveWindow(new ThrowsWindow(_arg1, _arg2));
}
public function openFinalWindow():void{
openActiveWindow(new FinalWindow());
}
public static function get instance():GameWindowManager{
return (_instance);
}
}
}//package lp.pge.game
Section 297
//Level (lp.pge.game.Level)
package lp.pge.game {
import lp.pge.media.*;
import flash.events.*;
import lp.pge.game.core.entities.*;
import lp.pge.game.models.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.geom.*;
import lp.pge.game.core.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.gui.*;
import asp.events.*;
import lp.pge.game.core.managers.*;
import lp.pge.*;
import flash.utils.*;
import lp.pge.game.core.systems.*;
public class Level extends Sprite {
private const LOAD_EVENT:GameEvent;
private const UNLOAD_EVENT:GameEvent;
private const START_EVENT:GameEvent;
private const RESTART_EVENT:GameEvent;
private const FINISH_EVENT:GameEvent;
private const COMPLETE_EVENT:GameEvent;
private const FAIL_EVENT:GameEvent;
private var _index:int;// = 0
private var _state:String;
private var _mode:String;
private var _mute:Boolean;
private var _canvas:Sprite;
private var _screen:Sprite;
private var _overlay:Sprite;
private var _sensor:Sprite;
private var _scale:Number;// = 1
private var _timer:Timer;
private var _time:int;
private var _ms:int;
private var _models:Array;
private var _hiddenBlocks:Array;
private var _engine:GameEngine;
private var _manager:GameManager;
private var _numPackets:uint;
private var _totPackets:uint;
private var _numTargets:int;
private var _totTargets:uint;
private var _numBonuses:uint;
private var _totBonuses:uint;
private var _packetGenerator:PacketGenerator;
private var _heavenLight:MovieClip;
private var _levelAnim:LevelAnimation;
private var _toDisappear:int;
private var _score:uint;
private var _phases:Array;
private var _levelPhases:Array;
private var _packet:Packet;
private var _gotAchievement:Boolean;
private var _ambienceSound:SoundPlayer;
private var _backgroundMusic:SoundPlayer;
private var _ambSoundClass:Class;
private var _bgMusicClass:Class;
private var _applauseSound:SoundPlayer;
private var _applauseTimer:Timer;
public static const DEFAULT_WIDTH:Number = 720;
public static const DEFAULT_HEIGHT:Number = 480;
private static const HINT_TIME:Number = 20;
private static const WAIT_APPLAUSE:uint = 1000;
public function Level(){
LOAD_EVENT = new GameEvent(GameEvent.LEVEL_LOAD);
UNLOAD_EVENT = new GameEvent(GameEvent.LEVEL_UNLOAD);
START_EVENT = new GameEvent(GameEvent.LEVEL_START);
RESTART_EVENT = new GameEvent(GameEvent.LEVEL_RESTART);
FINISH_EVENT = new GameEvent(GameEvent.LEVEL_FINISH);
COMPLETE_EVENT = new GameEvent(GameEvent.LEVEL_COMPLETE);
FAIL_EVENT = new GameEvent(GameEvent.LEVEL_FAIL);
super();
visible = false;
_state = LevelState.CREATED;
}
public function get index():int{
return (_index);
}
public function set index(_arg1:int):void{
_index = _arg1;
}
public function get state():String{
return (_state);
}
public function get mode():String{
return (_mode);
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
_mute = _arg1;
if (_engine){
_engine.mute = _mute;
};
if (_levelAnim){
_levelAnim.mute = _mute;
};
if (_ambienceSound){
_ambienceSound.mute = _mute;
};
if (_backgroundMusic){
_backgroundMusic.mute = _mute;
};
if (_heavenLight){
_heavenLight.mute = _mute;
};
if (_applauseSound){
_applauseSound.mute = _mute;
};
}
public function get screen():Sprite{
return (_screen);
}
public function get canvas():Sprite{
return (_canvas);
}
public function get overlay():Sprite{
return (_overlay);
}
public function get levelAnimation():LevelAnimation{
return (_levelAnim);
}
public function load():void{
var iLim:uint;
var i:uint;
trace((("[$] : Level #" + _index) + " loading..."));
loadLevelData();
var boundsData:Sprite = (getChildByName("levelBounds") as Sprite);
if (boundsData){
removeChild(boundsData);
};
_screen = new Sprite();
_screen.scaleX = (_screen.scaleY = (1 / _scale));
addChild(_screen);
_screen.addChild(_heavenLight);
_screen.addChild(_packetGenerator);
_overlay = new Sprite();
_overlay.mouseChildren = false;
_overlay.mouseEnabled = false;
_overlay.scaleX = (_overlay.scaleY = (1 / _scale));
addChild(_overlay);
_canvas = new Sprite();
_canvas.mouseChildren = false;
_canvas.mouseEnabled = false;
_canvas.scaleX = (_canvas.scaleY = (1 / _scale));
addChild(_canvas);
_sensor = new Sprite();
var _local2 = _sensor.graphics;
with (_local2) {
lineStyle(0, 0, 0);
beginFill(0xFF0000, 1);
drawRect(0, 0, 720, 424);
endFill();
};
_sensor.alpha = 0;
addChild(_sensor);
_sensor.addEventListener(MouseEvent.CLICK, onSensorClick);
_levelAnim = (getChildByName("levelAnim") as LevelAnimation);
if ((_levelAnim["init"] is Function)){
_local2 = _levelAnim;
_local2["init"]();
};
_levelAnim.dispatchEvent(LOAD_EVENT);
_levelAnim.addEventListener(GameEvent.INTRO_COMPLETE, onIntroComplete);
_levelAnim.addEventListener(GameEvent.OUTRO_COMPLETE, onOutroComplete);
_levelAnim.addEventListener(GameEvent.MOVIE_COMPLETE, onMovieComplete);
_levelAnim.addEventListener(GameEvent.GO_BLACK, onGoBlack);
if (_levelAnim.overlayObjects){
iLim = _levelAnim.overlayObjects.length;
i = 0;
while (i < iLim) {
_overlay.addChild(_levelAnim.overlayObjects[i]);
i = (i + 1);
};
};
_engine = new GameEngine(_screen, _canvas, (DEFAULT_WIDTH * _scale), (DEFAULT_HEIGHT * _scale));
_engine.addEventListener(GameEvent.PACKET_DELIVERED, onPacketDelivered);
_engine.addEventListener(GameEvent.PACKET_LOST, onPacketLost);
_engine.addEventListener(GameEvent.BONUS_COLLECTED, onBonusCollected);
_engine.addEventListener(GameEvent.TRIGGER_ACTIVATED, onTrigger);
_manager = (_engine.getManagerOfType(GameManager) as GameManager);
mute = Game.instance.mute;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, onTimer);
_applauseTimer = new Timer(WAIT_APPLAUSE, 1);
_applauseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onApplauseTimerComplete);
_score = 0;
_numBonuses = 0;
GameBar.instance.hidePause();
var gb:GameBar = GameBar.instance;
gb.updateProgress((_index + 1));
gb.updateTimer(_timer.currentCount);
gb.updateScore(_score);
gb.updateThrows(_totPackets, _totPackets);
_state = LevelState.LOADED;
trace((("[$] : Level #" + _index) + " loaded."));
}
public function unload():void{
trace((("[$] : Level #" + _index) + " unloading..."));
if (_state == LevelState.PLAYING){
finish();
};
visible = false;
_levelAnim.removeEventListener(GameEvent.INTRO_COMPLETE, onIntroComplete);
_levelAnim.removeEventListener(GameEvent.OUTRO_COMPLETE, onOutroComplete);
_levelAnim.removeEventListener(GameEvent.MOVIE_COMPLETE, onMovieComplete);
_levelAnim.removeEventListener(GameEvent.GO_BLACK, onGoBlack);
_levelAnim.dispatchEvent(UNLOAD_EVENT);
removeChild(_levelAnim);
_levelAnim.destroy();
_levelAnim = undefined;
if (_timer.running){
_timer.stop();
};
_timer.removeEventListener(TimerEvent.TIMER, onTimer);
_timer = undefined;
_time = undefined;
_ms = undefined;
if (_applauseTimer.running){
_applauseTimer.stop();
};
_applauseTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onApplauseTimerComplete);
_applauseTimer = undefined;
_score = undefined;
_numBonuses = undefined;
_totBonuses = undefined;
_manager.dispose();
_manager = undefined;
_engine.removeEventListener(GameEvent.PACKET_DELIVERED, onPacketDelivered);
_engine.removeEventListener(GameEvent.PACKET_LOST, onPacketLost);
_engine.removeEventListener(GameEvent.BONUS_COLLECTED, onBonusCollected);
_engine.removeEventListener(GameEvent.TRIGGER_ACTIVATED, onTrigger);
_engine.disposeAll();
_engine = undefined;
_heavenLight.gotoAndStop(1);
_screen.removeChild(_heavenLight);
_heavenLight = undefined;
_screen.removeChild(_packetGenerator);
removeChild(_screen);
_screen = undefined;
while (_overlay.numChildren) {
_overlay.removeChildAt(0);
};
removeChild(_overlay);
_overlay = undefined;
removeChild(_canvas);
_canvas = undefined;
_sensor.removeEventListener(MouseEvent.CLICK, onSensorClick);
removeChild(_sensor);
_sensor = undefined;
unloadLevelData();
_numPackets = undefined;
_numTargets = undefined;
_totTargets = undefined;
_phases = undefined;
_levelPhases = undefined;
_gotAchievement = undefined;
_mode = undefined;
_index = undefined;
_state = LevelState.UNLOADED;
trace((("[$] : Level #" + _index) + " unloaded."));
}
public function start():void{
trace((("[$] : Level #" + _index) + " starting..."));
GameStatistics.submitPlay(_index);
if (_state == LevelState.LOADED){
GameApplication.instance.soundMode = GameApplication.PLAY_SOUND_MODE;
if (_ambSoundClass){
_ambienceSound = new SoundPlayer();
_ambienceSound.mute = _mute;
_ambienceSound.loop = true;
_ambienceSound.play(new _ambSoundClass());
};
if (_bgMusicClass){
_backgroundMusic = new SoundPlayer();
_backgroundMusic.mute = _mute;
_backgroundMusic.loop = true;
_backgroundMusic.play(new _bgMusicClass());
};
_applauseSound = new SoundPlayer();
_heavenLight.animate();
_state = LevelState.STARTED;
trace((("[$] : Level #" + _index) + " started."));
_levelAnim.dispatchEvent(START_EVENT);
if (_levelAnim.hasIntro){
_levelAnim.playIntro();
} else {
startShow();
};
visible = true;
Game.instance.hideBlackScreen();
run();
} else {
throw (new Error("[Level] : <start> : Can't start, level must be initialized first."));
};
}
public function finish(_arg1:EngineEvent=null):void{
trace((("[$] : Level #" + _index) + " finishing..."));
if ((((((((_state == LevelState.LOADED)) || ((_state == LevelState.STARTED)))) || ((_state == LevelState.PLAYING)))) || ((_state == LevelState.PAUSED)))){
GameBar.instance.hidePause();
halt();
if (!_engine.updating()){
if (_engine.hasEventListener(EngineEvent.FINISH_UPDATE)){
_engine.removeEventListener(EngineEvent.FINISH_UPDATE, finish);
};
if (_ambienceSound){
_ambienceSound.stop();
_ambienceSound.dispose();
_ambienceSound = undefined;
};
if (_backgroundMusic){
_backgroundMusic.stop();
_backgroundMusic.dispose();
_backgroundMusic = undefined;
};
_levelAnim.dispatchEvent(FINISH_EVENT);
destroyEntities();
_state = LevelState.FINISHED;
trace((("[$] : Level #" + _index) + " finished."));
} else {
_engine.addEventListener(EngineEvent.FINISH_UPDATE, finish);
};
} else {
throw (new Error("[Level] : <finish> : Can't finish (finished yet or is in unallowable state)."));
};
}
public function restart(_arg1:EngineEvent=null):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:DisplayObject;
var _local6:WaterSplashAnim;
trace((("[$] : Level #" + _index) + " restarting..."));
if ((((((((((((_state == LevelState.STARTED)) || ((_state == LevelState.PLAYING)))) || ((_state == LevelState.PAUSED)))) || ((_state == LevelState.FINISHED)))) || ((_state == LevelState.WON)))) || ((_state == LevelState.LOST)))){
GameBar.instance.hidePause();
halt();
if (!_engine.updating()){
GameApplication.instance.soundMode = GameApplication.PLAY_SOUND_MODE;
GameBar.instance.showPause();
if (_engine.hasEventListener(EngineEvent.FINISH_UPDATE)){
_engine.removeEventListener(EngineEvent.FINISH_UPDATE, restart);
};
destroyEntities();
_local2 = new Array();
_local3 = _screen.numChildren;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _screen.getChildAt(_local4);
_local6 = (_local5 as WaterSplashAnim);
if (_local6){
_local2.push(_local6);
};
_local4++;
};
while (_local2.length) {
_local2.pop().destroy();
};
_engine.reset();
createEntities();
if (_levelPhases){
_phases = _levelPhases.slice();
};
_timer.reset();
_time = 0;
_ms = 0;
_score = 0;
_numBonuses = 0;
_gotAchievement = undefined;
GameBar.instance.updateTimer(_timer.currentCount);
GameBar.instance.updateScore(_score);
GameBar.instance.updateThrows(_totPackets, _totPackets);
_levelAnim.dispatchEvent(RESTART_EVENT);
_heavenLight.gotoAndStop("anim");
Game.instance.hideBlackScreen();
if (_ambSoundClass){
if (!_ambienceSound){
_ambienceSound = new SoundPlayer();
_ambienceSound.mute = _mute;
_ambienceSound.loop = true;
_ambienceSound.play(new _ambSoundClass());
} else {
_ambienceSound.play();
};
};
if (_bgMusicClass){
if (!_backgroundMusic){
_backgroundMusic = new SoundPlayer();
_backgroundMusic.mute = _mute;
_backgroundMusic.loop = true;
_backgroundMusic.play(new _bgMusicClass());
} else {
_backgroundMusic.play();
};
};
run();
_state = LevelState.PLAYING;
trace((("[$] : Level #" + _index) + " restarted."));
plan();
} else {
_engine.addEventListener(EngineEvent.FINISH_UPDATE, restart);
};
} else {
throw (new Error("[Level] : <restart> : Can't restart (is in unallowable state)."));
};
}
public function pause():void{
trace((("[$] : Level #" + _index) + " pausing..."));
if (_state == LevelState.PLAYING){
halt();
_engine.getSystemByType(InteractiveControl).deactivate();
_sensor.visible = false;
_state = LevelState.PAUSED;
trace((("[$] : Level #" + _index) + " paused."));
} else {
throw (new Error("[Level] : <pause> : Can't pause, level isn't playing."));
};
}
public function resume():void{
trace((("[$] : Level #" + _index) + " resuming..."));
if (_state == LevelState.PAUSED){
run();
if (_mode == LevelMode.PLAN){
_engine.getSystemByType(InteractiveControl).activate();
_sensor.visible = false;
} else {
if (_mode == LevelMode.PLAY){
_engine.getSystemByType(InteractiveControl).deactivate();
_sensor.visible = true;
};
};
_state = LevelState.PLAYING;
trace((("[$] : Level #" + _index) + " resumed."));
} else {
throw (new Error("[Level] : <resume> : Can't resume, level isn't paused."));
};
}
public function lose():void{
trace((("[$] : Level #" + _index) + " losing..."));
GameStatistics.submitLose(_index);
if (_state == LevelState.PLAYING){
finish();
};
_state = LevelState.LOST;
initLoseGUI();
trace((("[$] : Level #" + _index) + " lost."));
}
public function skip(_arg1:uint=0):void{
trace((("[$] : Level #" + _index) + " skipping..."));
_timer.stop();
_numBonuses = _arg1;
if (_engine.updating()){
_engine.addEventListener(EngineEvent.FINISH_UPDATE, onSkipLevel);
} else {
onSkipLevel();
};
}
public function win():void{
trace((("[$] : Level #" + _index) + " winning..."));
GameStatistics.submitWin(_index);
if (_state == LevelState.PLAYING){
finish();
};
_state = LevelState.WON;
var _local1:uint = GameAchievements.getAchievementOnLevel(_index);
LevelManager.instance.submitTime(_index, _timer.currentCount);
LevelManager.instance.submitScore(_index, _score);
LevelManager.instance.submitStars(_index, _numBonuses);
LevelManager.instance.completeLevel(_index);
if (LevelManager.instance.isNextLevel()){
LevelManager.instance.unlockLevel((_index + 1));
};
var _local2:uint = GameAchievements.getAchievementOnLevel(_index);
_gotAchievement = !((_local2 == _local1));
if (GameConfig.SAVE_LOAD){
LevelManager.instance.addEventListener(GameEvent.SAVE_COMPLETE, onSaveResult);
LevelManager.instance.addEventListener(GameEvent.SAVE_ERROR, onSaveResult);
LevelManager.instance.save();
} else {
initWinGUI();
};
trace((("[$] : Level #" + _index) + " won."));
}
public function launch():void{
play();
}
public function showHint():void{
_levelAnim.showHint();
}
public function hideHint():void{
_levelAnim.hideHint();
}
public function play(_arg1:Boolean=true):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:Block;
trace((("[$] : Level #" + _index) + " play..."));
if (_mode != LevelMode.PLAY){
_local2 = GameManager.instance.getAllEntities();
_local3 = _local2.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = (_local2[_local4] as Block);
if (_local5){
if (((_local5.hasAspectOfType(InteractiveAspect)) && (_local5.hasArrows))){
_local5.hideArrows();
};
};
_local4++;
};
createPacket();
if (_arg1){
_engine.getSystemByType(InteractiveControl).deactivate();
_sensor.visible = true;
};
_mode = LevelMode.PLAY;
};
GameBar.instance.hideLaunch();
trace((("[$] : Level #" + _index) + " playing."));
}
public function plan(_arg1:Boolean=true):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:Block;
var _local6:String;
trace((("[$] : Level #" + _index) + " plan..."));
if (_mode != LevelMode.PLAN){
_local2 = GameManager.instance.getAllEntities();
_local3 = _local2.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = (_local2[_local4] as Block);
if (_local5){
if (((_local5.hasAspectOfType(InteractiveAspect)) && (_local5.hasArrows))){
_local6 = (_local5.getAspectByType(InteractiveAspect) as InteractiveAspect).axis;
switch (_local6){
case "all":
_local5.showArrows();
break;
case "x":
_local5.showHArrows();
break;
case "y":
_local5.showVArrows();
break;
default:
throw (new Error("[Level] : <plan> : Unknown block axis."));
};
};
};
_local4++;
};
_packetGenerator.animatePacket();
if (_arg1){
_engine.getSystemByType(InteractiveControl).activate();
_sensor.visible = false;
};
_mode = LevelMode.PLAN;
};
GameBar.instance.showLaunch();
trace((("[$] : Level #" + _index) + " planning."));
}
public function wait():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:Block;
trace((("[$] : Level #" + _index) + " wait..."));
if (_mode != LevelMode.WAIT){
_local1 = GameManager.instance.getAllEntities();
_local2 = _local1.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = (_local1[_local3] as Block);
if (_local4){
if (((_local4.hasAspectOfType(InteractiveAspect)) && (_local4.hasArrows))){
_local4.hideArrows();
};
};
_local3++;
};
_engine.getSystemByType(InteractiveControl).deactivate();
_sensor.visible = false;
_mode = LevelMode.WAIT;
};
GameBar.instance.hideLaunch();
trace((("[$] : Level #" + _index) + " waiting."));
}
private function run():void{
trace((("[$] : Level #" + _index) + " run..."));
if (!hasEventListener(Event.ENTER_FRAME)){
addEventListener(Event.ENTER_FRAME, loop);
};
if (_ms < 1000){
_timer.delay = (1000 - _ms);
_ms = -1;
};
_time = getTimer();
_timer.start();
trace((("[$] : Level #" + _index) + " running."));
}
private function halt():void{
trace((("[$] : Level #" + _index) + " halting..."));
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, loop);
};
_timer.stop();
_ms = (getTimer() - _time);
trace((("[$] : Level #" + _index) + " halt."));
}
private function loop(_arg1:Event=null):void{
_engine.update();
}
private function loadLevelData():void{
var _local2:DisplayObject;
var _local3:GameModel;
var _local1:Sprite = (getChildByName("levelData") as Sprite);
if (_local1){
removeChild(_local1);
if (_local1["init"] != null){
var _local4 = _local1;
_local4["init"]();
};
_ambSoundClass = (_local1["ambienceSound"] as Class);
_bgMusicClass = (_local1["backgroundMusic"] as Class);
_levelPhases = _local1["phases"];
_totPackets = uint(_local1["numPackets"]);
trace(((("[$] : Level #" + _index) + " num packets: ") + _totPackets));
applyWaymarks(_local1);
_models = new Array();
_hiddenBlocks = new Array();
while (_local1.numChildren) {
_local2 = _local1.getChildAt(0);
if ((_local2 is GameDummy)){
_local3 = undefined;
if ((_local2 is ThingDummy)){
if ((_local2 is BlockDummy)){
if ((_local2 is BouncyBlockDummy)){
if ((_local2 is BouncyBlockArcTopDummy)){
(_local2 as BouncyBlockDummy).fixed = true;
};
_local3 = new BouncyBlockModel();
_local3.load((_local2 as BouncyBlockDummy));
} else {
if ((_local2 is NormalBlockDummy)){
_local3 = new NormalBlockModel();
_local3.load((_local2 as NormalBlockDummy));
} else {
if ((_local2 is StickyBlockDummy)){
_local3 = new StickyBlockModel();
_local3.load((_local2 as StickyBlockDummy));
} else {
throw (new Error((("[Level] : <loadLevelData> : Unknown block dummy (" + _local2) + ") was found while processing 'data'.")));
};
};
};
} else {
if ((_local2 is PacketDummy)){
if (!_packetGenerator){
_packetGenerator = new PacketGenerator();
_packetGenerator.addEventListener(GameEvent.PACKET_LAUNCH, onPacketLaunch);
_packetGenerator.init((_local2 as PacketDummy));
_heavenLight = new HeavenLightAnim();
_heavenLight.x = _local2.x;
} else {
throw (new Error("[Level] : <loadLevelData> : Only one 'packet' can be placed, to define packet generator."));
};
} else {
if ((_local2 is TargetDummy)){
_local3 = new TargetModel();
_local3.load((_local2 as TargetDummy));
} else {
if ((_local2 is BonusDummy)){
_local3 = new BonusModel();
_local3.load((_local2 as BonusDummy));
} else {
if ((_local2 is SpikesDummy)){
_local3 = new SpikesModel();
_local3.load((_local2 as SpikesDummy));
} else {
if ((_local2 is TriggerDummy)){
_local3 = new TriggerModel();
_local3.load((_local2 as TriggerDummy));
} else {
throw (new Error((("[Level] : <loadLevelData> : Unknown thing dummy (" + _local2) + ") was found while processing 'data'.")));
};
};
};
};
};
};
} else {
if ((_local2 is GeometryDummy)){
if ((_local2 as DisplayObjectContainer).numChildren){
_local3 = new GeometryModel();
_local3.load((_local2 as GeometryDummy));
};
} else {
throw (new Error((("[Level] : <loadLevelData> : Unknown game dummy (" + _local2) + ") was found while processing 'data'.")));
};
};
if (_local3){
_models.push(_local3);
};
} else {
if ((_local2 is HiddenBlock)){
_hiddenBlocks.push(_local2);
} else {
throw (new Error((("[Level] : <loadLevelData> : Unknown object (" + _local2) + ") was found while processing 'data'.")));
};
};
_local1.removeChild(_local2);
};
if (!_packetGenerator){
throw (new Error("[Level] : <loadLevelData> : Can't find 'packet' dummy in 'data'."));
};
} else {
throw (new Error("[Level] : <loadLevelData> : Can't find 'data'."));
};
}
private function unloadLevelData():void{
while (_models.length) {
_models.pop().unload();
};
_models = undefined;
_packetGenerator.halt();
_packetGenerator.removeEventListener(GameEvent.PACKET_LAUNCH, onPacketLaunch);
_packetGenerator = undefined;
while (_hiddenBlocks.length) {
_hiddenBlocks.pop().destroy();
};
_hiddenBlocks = undefined;
}
private function applyWaymarks(_arg1:Sprite):void{
var _local4:Waymark;
var _local5:String;
var _local6:ThingDummy;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:String;
var _local13:Boolean;
var _local2:uint = _arg1.numChildren;
var _local3:int = (_local2 - 1);
while (_local3 >= 0) {
_local4 = (_arg1.getChildAt(_local3) as Waymark);
if (_local4){
_arg1.removeChild(_local4);
_local5 = _local4.name.split("$mvr")[0];
if (_local5.length){
_local6 = (_arg1.getChildByName(_local5) as ThingDummy);
if (_local6){
if ((_local6 is BlockDummy)){
_local6.type = ThingTypes.MOVABLE;
if ((((((_local4.rotation == 0)) || ((_local4.rotation == 180)))) || ((_local4.rotation == -180)))){
_local6.axis = "x";
} else {
if ((((((((_local4.rotation == 90)) || ((_local4.rotation == -90)))) || ((_local4.rotation == 270)))) || ((_local4.rotation == -270)))){
_local6.axis = "y";
};
};
_local4.rotation = 0;
_local7 = (_local4.width / 2);
if (_local6.axis == "x"){
_local8 = (_local4.x - _local7);
_local9 = (_local4.x + _local7);
if (_local6.x < _local8){
_local6.x = _local8;
} else {
if (_local6.x > _local9){
_local6.x = _local9;
};
};
if (_local6.y != _local4.y){
_local6.y = _local4.y;
};
_local6.area = new Rectangle(_local8, _local4.y, (2 * _local7), 0);
} else {
if (_local6.axis == "y"){
_local10 = (_local4.y - _local7);
_local11 = (_local4.y + _local7);
if (_local6.x != _local4.x){
_local6.x = _local4.x;
};
if (_local6.y < _local10){
_local6.y = _local10;
} else {
if (_local6.y > _local11){
_local6.y = _local11;
};
};
_local6.area = new Rectangle(_local4.x, _local10, 0, (2 * _local7));
} else {
throw (new Error((("[Level] : <applyWaymarks> : Wrong waymark '" + _local5) + "' found.")));
};
};
} else {
if ((_local6 is SpikesDummy)){
if ((_local6 is JumpingSpikesDummy)){
_local6.type = ThingTypes.JUMPING;
} else {
_local6.type = ThingTypes.MOVING;
};
_local13 = false;
if (_local4.rotation == 0){
_local12 = "x";
} else {
if ((((_local4.rotation == 180)) || ((_local4.rotation == -180)))){
_local12 = "x";
_local13 = true;
} else {
if ((((_local4.rotation == 90)) || ((_local4.rotation == -270)))){
_local12 = "y";
} else {
if ((((_local4.rotation == -90)) || ((_local4.rotation == 270)))){
_local12 = "y";
_local13 = true;
};
};
};
};
_local4.rotation = 0;
_local7 = (_local4.width / 2);
if (_local12 == "x"){
_local8 = (_local4.x - _local7);
_local9 = (_local4.x + _local7);
if (_local6.x < _local8){
_local6.x = _local8;
} else {
if (_local6.x > _local9){
_local6.x = _local9;
};
};
if (_local6.y != _local4.y){
_local6.y = _local4.y;
};
if (!_local13){
_local6.wp0 = new Point(_local8, _local4.y);
_local6.wp1 = new Point(_local9, _local4.y);
} else {
_local6.wp0 = new Point(_local9, _local4.y);
_local6.wp1 = new Point(_local8, _local4.y);
};
} else {
if (_local12 == "y"){
_local10 = (_local4.y - _local7);
_local11 = (_local4.y + _local7);
if (_local6.x != _local4.x){
_local6.x = _local4.x;
};
if (_local6.y < _local10){
_local6.y = _local10;
} else {
if (_local6.y > _local11){
_local6.y = _local11;
};
};
if (!_local13){
_local6.wp0 = new Point(_local4.x, _local10);
_local6.wp1 = new Point(_local4.x, _local11);
} else {
_local6.wp0 = new Point(_local4.x, _local11);
_local6.wp1 = new Point(_local4.x, _local10);
};
} else {
throw (new Error((("[Level] : <applyWaymarks> : Wrong waymark '" + _local5) + "' found.")));
};
};
};
};
} else {
throw (new Error((("[Level] : <applyWaymarks> : Waymark '" + _local5) + "' has't target.")));
};
} else {
throw (new Error((("[Level] : <applyWaymarks> : Wrong waymark '" + _local5) + "' found.")));
};
};
_local3--;
};
}
private function createEntities():void{
var _local5:GameModel;
var _local6:GameEntity;
var _local7:Block;
var _local8:String;
var _local9:Bonus;
var _local10:Target;
var _local11:HiddenBlock;
_numPackets = 0;
_numTargets = 0;
_totTargets = 0;
_numBonuses = 0;
_totBonuses = 0;
var _local1:uint = _models.length;
var _local2:uint;
while (_local2 < _local1) {
_local5 = _models[_local2];
if ((_local5 is TargetModel)){
_numTargets++;
};
_local6 = EntitiesFactory.createEntity(_local5);
_manager.addEntity(_local6);
if ((_local6 is Block)){
_local7 = (_local6 as Block);
if (_local7.hasAspectOfType(InteractiveAspect)){
if (_local7.hasArrows){
_local8 = (_local7.getAspectByType(InteractiveAspect) as InteractiveAspect).axis;
switch (_local8){
case "all":
_local7.showArrows();
break;
case "x":
_local7.showHArrows();
break;
case "y":
_local7.showVArrows();
break;
default:
throw (new Error("[Level] : <createEntities> : Unknown block axis."));
};
};
if (_local7.hasPosInds){
_local7.hidePosInds();
};
};
} else {
if ((_local6 is Bonus)){
_local9 = (_local6 as Bonus);
if (_local9.animated){
_local9.playFrame((2 + (_totBonuses * 7)));
};
_totBonuses++;
} else {
if ((_local6 is Target)){
_local10 = (_local6 as Target);
if (_local10.animated){
_local10.gotoFrame("basic");
};
};
};
};
_local2++;
};
_totTargets = _numTargets;
if (_totBonuses != 3){
throw (new Error((("[Level] : <createEntities> : " + _totBonuses) + " of 3 bonuses found.")));
};
var _local3:uint = _hiddenBlocks.length;
var _local4:uint;
while (_local4 < _local3) {
_local11 = _hiddenBlocks[_local4];
if (_local11.parent != _screen){
_screen.addChild(_local11);
};
_local11.reset();
_local4++;
};
}
private function destroyEntities():void{
var _local3:DisplayObject;
_manager.disposeAllEntities();
var _local1:uint = _hiddenBlocks.length;
var _local2:uint;
while (_local2 < _local1) {
_local3 = _hiddenBlocks[_local2];
if (_local3.parent == _screen){
_screen.removeChild(_local3);
};
_local2++;
};
}
private function createPacket():void{
_packet = _packetGenerator.createPacket();
_manager.addEntity(_packet);
}
private function initWinGUI():void{
if (Game.instance.isNextLevel()){
if (_gotAchievement){
_gotAchievement = false;
Game.instance.openAchievement(GameAchievements.getAchievementSIDForLevel(_index), function ():void{
GameApplication.instance.trackEvent(((("/stars#" + _index) + "=") + _numBonuses));
Game.instance.openLevelCompleted(_numBonuses);
});
} else {
GameApplication.instance.trackEvent(((("/stars#" + _index) + "=") + _numBonuses));
Game.instance.openLevelCompleted(_numBonuses);
};
} else {
GameApplication.instance.trackEvent(((("/stars#" + _index) + "=") + _numBonuses));
Game.instance.openGameCompleted(_numBonuses);
};
}
private function initLoseGUI():void{
Game.instance.openLevelFailed();
}
private function onPacketDelivered(_arg1:GameEvent):void{
var _local2:Function;
_numPackets++;
_numTargets--;
GameBar.instance.updateThrows(((_totPackets)>0) ? (_totPackets - _numPackets) : 0, _totPackets);
_packet = undefined;
if ((((_arg1.data is String)) && (String(_arg1.data).length))){
_levelAnim.dispatchEvent(new ScriptEvent(String(_arg1.data)));
};
runApplauseTimer();
if (!_numTargets){
if (((_phases) && (_phases.length))){
_local2 = _phases.shift();
_local2.apply(this);
} else {
_timer.stop();
GameBar.instance.hidePause();
if (_engine.updating()){
_engine.addEventListener(EngineEvent.FINISH_UPDATE, onLevelComplete);
} else {
onLevelComplete();
};
};
} else {
if ((((_totPackets > 0)) && ((_numPackets >= _totPackets)))){
_timer.stop();
GameBar.instance.hidePause();
if (_engine.updating()){
_engine.addEventListener(EngineEvent.FINISH_UPDATE, onLevelFail);
} else {
onLevelFail();
};
} else {
plan();
};
};
}
private function onPacketLost(_arg1:GameEvent):void{
_numPackets++;
GameBar.instance.updateThrows(((_totPackets)>0) ? (_totPackets - _numPackets) : 0, _totPackets);
_packet = undefined;
if ((((_totPackets > 0)) && ((_numPackets >= _totPackets)))){
_timer.stop();
GameBar.instance.hidePause();
if (_engine.updating()){
_engine.addEventListener(EngineEvent.FINISH_UPDATE, onLevelFail);
} else {
onLevelFail();
};
} else {
plan();
};
}
private function onBonusCollected(_arg1:GameEvent):void{
_score = (_score + GameConfig.STAR_BONUS);
GameBar.instance.updateScore(_score);
_numBonuses++;
}
private function onTrigger(_arg1:GameEvent):void{
var _local2:String = String(_arg1.data);
if (((_local2) && (_local2.length))){
_levelAnim.dispatchEvent(new ScriptEvent(_local2));
};
}
private function onTimer(_arg1:TimerEvent):void{
if (_timer.delay != 1000){
_timer.delay = 1000;
};
GameBar.instance.updateTimer(_timer.currentCount);
}
private function onSaveResult(_arg1:GameEvent):void{
LevelManager.instance.removeEventListener(GameEvent.SAVE_COMPLETE, onSaveResult);
LevelManager.instance.removeEventListener(GameEvent.SAVE_ERROR, onSaveResult);
initWinGUI();
}
private function onLevelFail(_arg1:EngineEvent=null):void{
var _local5:GameEntity;
var _local6:Animat;
_engine.removeEventListener(EngineEvent.FINISH_UPDATE, onLevelFail);
_toDisappear = 1;
_heavenLight.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearFail);
_heavenLight.disappear();
var _local2:Array = GameManager.instance.getAllEntities();
var _local3:uint = _local2.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = _local2[_local4];
if (_local5.exists()){
if ((_local5 is Animat)){
_local6 = (_local5 as Animat);
if (!_local6.ignoreAnim){
_toDisappear++;
_local6.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearFail);
};
};
};
_local4++;
};
if (!_toDisappear){
if (_state == LevelState.PLAYING){
finish();
};
failLevel();
};
}
private function onDisappearFail(_arg1:GameEvent):void{
(_arg1.target as EventDispatcher).removeEventListener(GameEvent.ANIM_COMPLETE, onDisappearFail);
_toDisappear--;
if (!_toDisappear){
GameApplication.instance.soundMode = GameApplication.DONE_SOUND_MODE;
if (_state == LevelState.PLAYING){
finish();
};
failLevel();
};
}
private function failLevel():void{
GameApplication.instance.soundMode = GameApplication.DONE_SOUND_MODE;
if (_state == LevelState.PLAYING){
finish();
};
trace("Level statistics: (FAIL)");
trace((" - packets lost: " + (_numPackets - _totTargets)));
trace((" - packets delivered: " + _totTargets));
trace((" - accuracy: " + (_totTargets / (_numPackets - _totTargets))));
trace((" - bonus score: " + _score));
trace(((" - stars collected: " + _numBonuses) + " of 3"));
lose();
}
private function onLevelComplete(_arg1:EngineEvent=null):void{
var _local5:GameEntity;
var _local6:Block;
var _local7:Spikes;
var _local8:Bonus;
var _local9:Animat;
GameBar.instance.hidePause();
_engine.removeEventListener(EngineEvent.FINISH_UPDATE, onLevelComplete);
_toDisappear = 1;
_heavenLight.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_heavenLight.disappear();
var _local2:Array = GameManager.instance.getAllEntities();
var _local3:uint = _local2.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = _local2[_local4];
if (_local5.exists()){
if ((_local5 is Block)){
_local6 = (_local5 as Block);
if (_local6.animated){
_toDisappear++;
_local6.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_local6.playAnim("disappear");
};
} else {
if ((_local5 is Spikes)){
_local7 = (_local5 as Spikes);
if (_local7.animated){
_toDisappear++;
_local7.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_local7.playAnim("disappear");
};
} else {
if ((_local5 is Bonus)){
_local8 = (_local5 as Bonus);
if (_local8.animated){
_toDisappear++;
_local8.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_local8.playAnim("disappear");
};
} else {
if ((_local5 is Animat)){
_local9 = (_local5 as Animat);
if (!_local9.ignoreAnim){
_toDisappear++;
_local9.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
};
};
};
};
};
};
_local4++;
};
if (!_toDisappear){
if (_state == LevelState.PLAYING){
finish();
};
_levelAnim.dispatchEvent(COMPLETE_EVENT);
if (_levelAnim.hasOutro){
} else {
Game.instance.showBlackScreen(completeLevel);
};
};
}
private function onDisappearComplete(_arg1:GameEvent):void{
(_arg1.target as EventDispatcher).removeEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_toDisappear--;
if (!_toDisappear){
GameApplication.instance.soundMode = GameApplication.DONE_SOUND_MODE;
if (_state == LevelState.PLAYING){
finish();
};
_levelAnim.dispatchEvent(COMPLETE_EVENT);
if (_levelAnim.hasOutro){
} else {
Game.instance.showBlackScreen(completeLevel);
};
};
}
private function completeLevel():void{
GameApplication.instance.soundMode = GameApplication.DONE_SOUND_MODE;
if (_state == LevelState.PLAYING){
finish();
};
trace("Level statistics: (DONE)");
trace((" - packets lost: " + (_numPackets - _totTargets)));
trace((" - packets delivered: " + _totTargets));
trace((" - accuracy: " + (_totTargets / (_numPackets - _totTargets))));
trace((" - bonus score: " + _score));
trace(((" - stars collected: " + _numBonuses) + " of 3"));
win();
}
private function onIntroComplete(_arg1:GameEvent):void{
startShow();
}
private function onOutroComplete(_arg1:GameEvent):void{
}
private function onMovieComplete(_arg1:GameEvent):void{
var _local3:Array;
var _local4:Array;
var _local5:uint;
var _local6:uint;
var _local7:TargetDummy;
var _local8:TargetModel;
var _local9:Target;
var _local10:uint;
var _local11:uint;
var _local12:SpikesDummy;
var _local13:SpikesModel;
var _local14:Spikes;
var _local2:Object = _arg1.data;
if (_local2){
_local3 = _local2.addTargets;
if (((_local3) && (_local3.length))){
_local5 = _local3.length;
_local6 = 0;
while (_local6 < _local5) {
_local7 = _local3[_local6];
if (_local7){
_local8 = new TargetModel();
_local8.load(_local7);
_local9 = EntitiesFactory.createTarget(_local8);
GameManager.instance.addEntity(_local9);
_local9.gotoFrame("basic");
_numTargets++;
};
_local6++;
};
};
_local4 = _local2.addSpikes;
if (((_local4) && (_local4.length))){
_local10 = _local4.length;
_local11 = 0;
while (_local11 < _local10) {
_local12 = _local4[_local11];
if (_local12){
_local13 = new SpikesModel();
_local13.load(_local12);
_local14 = EntitiesFactory.createSpikes(_local13);
GameManager.instance.addEntity(_local14);
};
_local11++;
};
};
};
plan();
}
private function onGoBlack(_arg1:GameEvent):void{
Game.instance.showBlackScreen(completeLevel);
}
private function startShow():void{
_levelAnim.goToGame();
createEntities();
if (_levelPhases){
_phases = _levelPhases.slice();
};
plan(false);
_levelAnim.showHint(function ():void{
if (_index == 0){
Game.instance.openTutorialL1(startPlay);
} else {
if (_index == 1){
Game.instance.openTutorialL2(startPlay);
} else {
if (_index == 2){
Game.instance.openTutorialL3(startPlay);
} else {
if (_index == 12){
Game.instance.openTutorialL13(startPlay);
} else {
startPlay();
};
};
};
};
});
}
private function startPlay():void{
Game.instance.openThrows(_totPackets, function ():void{
GameApplication.instance.soundMode = GameApplication.PLAY_SOUND_MODE;
GameBar.instance.showPause();
_engine.getSystemByType(InteractiveControl).activate();
_sensor.visible = false;
_state = LevelState.PLAYING;
trace((("[$] : Level #" + _index) + " playing"));
});
}
private function onApplauseTimerComplete(_arg1:TimerEvent):void{
_applauseSound.play(new ApplauseSound());
}
private function runApplauseTimer():void{
_applauseTimer.reset();
_applauseTimer.start();
}
private function haltApplauseTimer():void{
_applauseTimer.stop();
}
private function onSkipLevel(_arg1:EngineEvent=null):void{
var _local3:GameEntity;
var _local4:Target;
var _local5:String;
var _local6:Function;
play();
if (_packet){
if (_packet.exists()){
packetCrash(_packet);
GameManager.instance.disposeEntity(_packet);
};
_packet = undefined;
};
var _local2:Array = GameManager.instance.getAllEntities();
for each (_local3 in _local2) {
_local4 = (_local3 as Target);
if (_local4){
_local5 = _local4.event;
if (((_local5) && (_local5.length))){
_levelAnim.dispatchEvent(new ScriptEvent(_local5));
};
};
};
trace((("[$] : Level #" + _index) + " skipped."));
if (((_phases) && (_phases.length))){
_local6 = _phases.shift();
_local6.apply(this);
} else {
onLevelComplete();
};
}
private function packetCrash(_arg1:Packet):void{
var _local2:GraphicalAspect = (_arg1.getAspectByType(GraphicalAspect) as GraphicalAspect);
_arg1.removeAspect(_local2);
var _local3:Animat = new Animat(_local2);
GameManager.instance.addEntity(_local3);
_local3.playAnim("crash");
var _local4:SFX = new SFX(new AcousticalAspect());
GameManager.instance.addEntity(_local4);
_local4.playSound(new CrashSound());
}
private function onPacketLaunch(_arg1:GameEvent):void{
launch();
}
private function onSensorClick(_arg1:MouseEvent):void{
if (_state == LevelState.PLAYING){
if (_mode == LevelMode.PLAY){
if (_engine.updating()){
_engine.addEventListener(EngineEvent.FINISH_UPDATE, onSkipPacket);
} else {
onSkipPacket();
};
};
} else {
if (_state == LevelState.FINISHED){
Game.instance.showBlackScreen(completeLevel);
} else {
if (_state == LevelState.STARTED){
if (_levelAnim.isHintPlaying){
_levelAnim.skipHint();
};
};
};
};
}
private function onSkipPacket(_arg1:EngineEvent=null):void{
if (_packet){
if (_packet.exists()){
packetCrash(_packet);
GameManager.instance.disposeEntity(_packet);
};
_packet = undefined;
_numPackets++;
GameBar.instance.updateThrows(((_totPackets)>0) ? (_totPackets - _numPackets) : 0, _totPackets);
if ((((_totPackets > 0)) && ((_numPackets >= _totPackets)))){
_timer.stop();
GameBar.instance.hidePause();
if (_engine.updating()){
_engine.addEventListener(EngineEvent.FINISH_UPDATE, onLevelFail);
} else {
onLevelFail();
};
} else {
plan();
};
};
}
}
}//package lp.pge.game
Section 298
//LevelAnimation (lp.pge.game.LevelAnimation)
package lp.pge.game {
import flash.media.*;
import flash.display.*;
public class LevelAnimation extends MovieClip {
private var _states:Array;
private var _hasIntro:Boolean;
private var _hasOutro:Boolean;
private var _hintCallback:Function;
private var _mute:Boolean;
public var hintAnim:MovieClip;
public var charAnim:VikingAnimation;
public var charXPos:Number;
public var charYPos:Number;
public var charRot:Number;
public var overlayObjects:Array;
public var onLevelLoad:Function;
public var onLevelStart:Function;
public var onLevelRestart:Function;
public var onLevelFinish:Function;
public var onLevelComplete:Function;
public var onLevelFail:Function;
public var onLevelUnload:Function;
public static const SUFF_POS_LEFT:Number = -60;
public static const SUFF_POS_RIGHT:Number = 790;
public static const SUFF_POS_BLACK:Number = 620;
public static const STD_OFFSET_LEFT:Number = 288;
public static const STD_OFFSET_RIGHT:Number = 732;
public static const STD_OFFSET_BLACK:Number = 632;
public static const SHIFT_PER_STEP:Number = 96;
public static const DIST_PER_STEP:Number = 128;
public static const STEPS_1:Number = 96;
public static const STEPS_2:Number = 240;
public function LevelAnimation(){
gotoAndStop(1);
_states = new Array();
var _local1:uint = currentLabels.length;
var _local2:uint;
while (_local2 < _local1) {
_states[_local2] = currentLabels[_local2].name;
_local2++;
};
if (_states.indexOf("game") == -1){
throw (new Error("[LevelAnimation] : <LevelAnimation> : Wrong level animation."));
};
_hasIntro = !((_states.indexOf("intro") == -1));
_hasOutro = !((_states.indexOf("outro") == -1));
addEventListener(GameEvent.LEVEL_LOAD, levelLoadHandler);
addEventListener(GameEvent.LEVEL_START, levelStartHandler);
addEventListener(GameEvent.LEVEL_RESTART, levelRestartHandler);
addEventListener(GameEvent.LEVEL_FINISH, levelFinishHandler);
addEventListener(GameEvent.LEVEL_COMPLETE, levelCompleteHandler);
addEventListener(GameEvent.LEVEL_FAIL, levelFailHandler);
addEventListener(GameEvent.LEVEL_UNLOAD, levelUnloadHandler);
}
public function stdEnter():void{
var startPos:Number = (Math.ceil(((charXPos - SUFF_POS_LEFT) / SHIFT_PER_STEP)) * SHIFT_PER_STEP);
charAnim.walk([{x:(charXPos - startPos)}, {x:charXPos}], function ():void{
charAnim.halt(charAnim.randomIdle);
introEnd();
});
}
public function stdLeave():void{
var _local1:Number = (Math.ceil(((((SUFF_POS_RIGHT - charXPos) - STEPS_1) - STEPS_2) / DIST_PER_STEP)) * DIST_PER_STEP);
charAnim.walk([null, {x:(charXPos + STEPS_1)}, {x:((charXPos + STEPS_1) + STEPS_2), an:"walk2"}, {x:620, an:"walk3", cb:goBlack}, {x:(((charXPos + STEPS_1) + STEPS_2) + _local1), an:"walk3"}], charAnim.halt);
}
public function get hasIntro():Boolean{
return (_hasIntro);
}
public function get hasOutro():Boolean{
return (_hasOutro);
}
public function playIntro():void{
if (!_hasIntro){
throw (new Error("[LevelAnimation] : <playIntro> : No such animation."));
};
if (currentLabel != "intro"){
gotoAndPlay("intro");
};
}
public function playOutro():void{
if (!_hasOutro){
throw (new Error("[LevelAnimation] : <playOutro> : No such animation."));
};
if (currentLabel != "outro"){
gotoAndPlay("outro");
};
}
public function goToGame():void{
if (currentLabel != "game"){
gotoAndStop("game");
};
}
public function introEnd():void{
dispatchEvent(new GameEvent(GameEvent.INTRO_COMPLETE));
}
public function outroEnd():void{
dispatchEvent(new GameEvent(GameEvent.OUTRO_COMPLETE));
}
public function goBlack():void{
dispatchEvent(new GameEvent(GameEvent.GO_BLACK));
}
public function destroy():void{
var _local1:DisplayObject;
stop();
removeEventListener(GameEvent.LEVEL_LOAD, levelLoadHandler);
removeEventListener(GameEvent.LEVEL_START, levelStartHandler);
removeEventListener(GameEvent.LEVEL_RESTART, levelRestartHandler);
removeEventListener(GameEvent.LEVEL_FINISH, levelFinishHandler);
removeEventListener(GameEvent.LEVEL_COMPLETE, levelCompleteHandler);
removeEventListener(GameEvent.LEVEL_FAIL, levelFailHandler);
removeEventListener(GameEvent.LEVEL_UNLOAD, levelUnloadHandler);
_states = undefined;
_hasIntro = undefined;
_hasOutro = undefined;
_hintCallback = undefined;
_mute = undefined;
onLevelLoad = undefined;
onLevelStart = undefined;
onLevelRestart = undefined;
onLevelFinish = undefined;
onLevelComplete = undefined;
onLevelFail = undefined;
onLevelUnload = undefined;
if (hintAnim){
hintAnim.stop();
};
hintAnim = undefined;
if (charAnim){
charAnim.destroy();
};
charAnim = undefined;
charXPos = undefined;
charYPos = undefined;
charRot = undefined;
for each (_local1 in overlayObjects) {
if (((_local1) && (_local1.parent))){
_local1.parent.removeChild(_local1);
};
};
overlayObjects = undefined;
}
public function resetCharAnim():void{
if (charAnim){
charAnim.reset();
charAnim.x = charXPos;
charAnim.y = charYPos;
charAnim.rotation = charRot;
};
}
public function showHint(_arg1:Function=null):void{
_hintCallback = _arg1;
if (hintAnim){
hintAnim.gotoAndPlay(2);
} else {
execHintCB();
};
}
public function hideHint(_arg1:Boolean=true):void{
if (_arg1){
_hintCallback = undefined;
};
if (hintAnim){
hintAnim.gotoAndStop(1);
};
execHintCB();
}
public function execHintCB():void{
var _local1:Function;
if (_hintCallback != null){
if (hintAnim){
hintAnim.gotoAndStop(1);
};
_local1 = _hintCallback;
_hintCallback = undefined;
_local1();
};
}
public function skipHint():void{
if (hintAnim){
hintAnim.gotoAndStop(1);
};
execHintCB();
}
public function get isHintPlaying():Boolean{
return (((hintAnim) && ((hintAnim.currentFrame > 1))));
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
if (_arg1 == _mute){
return;
};
_mute = _arg1;
soundTransform = new SoundTransform(int(!(_mute)));
}
private function levelLoadHandler(_arg1:GameEvent):void{
if (onLevelLoad != null){
onLevelLoad();
};
}
private function levelStartHandler(_arg1:GameEvent):void{
if (currentLabel != "intro"){
gotoAndPlay("intro");
};
if (onLevelStart != null){
onLevelStart();
};
}
private function levelRestartHandler(_arg1:GameEvent):void{
if (currentLabel != "game"){
gotoAndStop("game");
};
if (onLevelRestart != null){
onLevelRestart();
};
}
private function levelFinishHandler(_arg1:GameEvent):void{
if (onLevelFinish != null){
onLevelFinish();
};
}
private function levelCompleteHandler(_arg1:GameEvent):void{
if (currentLabel != "outro"){
gotoAndPlay("outro");
};
if (onLevelComplete != null){
onLevelComplete();
};
}
private function levelFailHandler(_arg1:GameEvent):void{
if (onLevelFail != null){
onLevelFail();
};
}
private function levelUnloadHandler(_arg1:GameEvent):void{
if (onLevelUnload != null){
onLevelUnload();
};
stop();
destroy();
}
}
}//package lp.pge.game
Section 299
//LevelManager (lp.pge.game.LevelManager)
package lp.pge.game {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import lp.pge.*;
public class LevelManager extends Sprite {
private var _levels:Array;
private var _index:uint;
private var _level:Level;
private var _so:SharedObject;
private static const MIN_DISK_SPACE:int = 10000;
private static var _instance:LevelManager;
public function LevelManager(){
if (_instance){
throw (new Error("[LevelManager] : <LevelManager> : Only one instance of this class is allowed."));
};
_instance = this;
_levels = new Array();
_so = SharedObject.getLocal(GameApplication.gameName);
}
public function load():void{
var _local2:Boolean;
var _local3:uint;
var _local4:uint;
var _local5:int;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:Array;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Object;
var _local14:Object;
var _local15:uint;
var _local1:Array = _so.data.gamesave;
if (_local1){
_local2 = false;
_local3 = _levels.length;
_local4 = 0;
while (_local4 < _local3) {
_local13 = _levels[_local4];
_local14 = _local1[_local4];
if ((_local14 is Object)){
_local13.locked = _local14.locked;
_local13.completed = _local14.completed;
_local13.bestTime = _local14.bestTime;
_local13.bestScore = _local14.bestScore;
_local13.bestStars = _local14.bestStars;
} else {
trace("[LevelManager] > Gamesave corrupted. All next levels including this will be reset.");
_local2 = true;
break;
};
_local4++;
};
if (_local2){
while (_local4 < _local3) {
_local13 = _levels[_local4];
_local13.locked = ((_local4)>0) ? !(GameApplication.LEVELS_DEBUGGING) : false;
_local13.completed = false;
_local13.bestTime = Infinity;
_local13.bestScore = 0;
_local13.bestStars = 0;
_local4++;
};
};
_local5 = -1;
_local6 = _levels.length;
_local7 = 0;
while (_local7 < _local6) {
if (!_levels[_local7].completed){
_local5 = _local7;
break;
};
_local7++;
};
if (_local5 < 0){
_index = (_levels.length - 1);
} else {
_index = _local5;
};
_local8 = _levels.length;
_local9 = new Array();
_local10 = 0;
while (_local10 < (_local8 - 1)) {
_local15 = Math.floor((_local10 / 3));
if (isNaN(_local9[_local15])){
_local9[_local15] = 0;
};
_local9[_local15] = (_local9[_local15] + _levels[_local10].bestStars);
_local10++;
};
_local11 = _local9.length;
_local12 = 1;
while (_local12 < _local11) {
GameAchievements.setAchievementByNID(GameAchievements.getAchievementNIDForLevel((_local12 * 3)), Math.floor((_local9[_local12] / 3)));
_local12++;
};
dispatchEvent(new GameEvent(GameEvent.LOAD_COMPLETE));
} else {
_index = 0;
dispatchEvent(new GameEvent(GameEvent.LOAD_ERROR));
};
}
public function save():void{
var _local4:Object;
var _local1:Array = new Array();
var _local2:uint = _levels.length;
var _local3:uint;
while (_local3 < _local2) {
_local4 = _levels[_local3];
_local1[_local3] = {locked:_local4.locked, completed:_local4.completed, bestTime:_local4.bestTime, bestScore:_local4.bestScore, bestStars:_local4.bestStars};
_local3++;
};
_so.data.gamesave = _local1;
flushSharedObject();
}
public function wipe():void{
var _local3:Object;
var _local1:uint = _levels.length;
var _local2:uint;
while (_local2 < _local1) {
_local3 = _levels[_local2];
if (_local3){
_local3.locked = ((_local2)>3) ? !(GameApplication.LEVELS_DEBUGGING) : false;
_local3.completed = false;
_local3.bestTime = Number.POSITIVE_INFINITY;
_local3.bestScore = 0;
_local3.bestStars = 0;
};
_local2++;
};
_so.data.gamesave = undefined;
flushSharedObject();
}
public function submitTime(_arg1:uint, _arg2:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <submitTime> : Level with such index isn't registered."));
};
if (_levels[_arg1].bestTime > _arg2){
_levels[_arg1].bestTime = _arg2;
};
}
public function getLevelTime(_arg1:uint):uint{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <getLevelTime> : Level with such index isn't registered."));
};
return (_levels[_arg1].bestTime);
}
public function getTotalTime():uint{
var _local1:uint;
var _local2:uint = _levels.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (_local1 + _levels[_local3].bestTime);
_local3++;
};
return (_local1);
}
public function submitScore(_arg1:uint, _arg2:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <submitScore> : Level with such index isn't registered."));
};
if (_levels[_arg1].bestScore < _arg2){
_levels[_arg1].bestScore = _arg2;
};
}
public function getLevelScore(_arg1:uint):uint{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <getLevelScore> : Level with such index isn't registered."));
};
return (_levels[_arg1].bestScore);
}
public function getTotalScore():uint{
var _local1:uint;
var _local2:uint = _levels.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (_local1 + _levels[_local3].bestScore);
_local3++;
};
return (_local1);
}
public function submitStars(_arg1:uint, _arg2:uint):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <submitStars> : Level with such index isn't registered."));
};
if (_levels[_arg1].bestStars < _arg2){
_levels[_arg1].bestStars = _arg2;
_local3 = Math.floor((_arg1 / 3));
if ((((0 < _local3)) && ((_local3 < 9)))){
_local4 = (_local3 * 3);
_local5 = (_local4 + 1);
_local6 = (_local4 + 2);
GameAchievements.setAchievementByNID(GameAchievements.getAchievementNIDForLevel(_arg1), Math.floor((((_levels[_local4].bestStars + _levels[_local5].bestStars) + _levels[_local6].bestStars) / 3)));
};
};
}
public function getLevelNumStars(_arg1:uint):uint{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <getLevelNumStars> : Level with such index isn't registered."));
};
return (_levels[_arg1].bestStars);
}
public function getTotalNumStars():uint{
var _local1:uint;
var _local2:uint = _levels.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (_local1 + _levels[_local3].bestStars);
_local3++;
};
return (_local1);
}
public function registerLevel(_arg1:Class, _arg2:uint):void{
if (_levels[_arg2]){
throw (new Error("[LevelManager] : <registerLevel> : Level with same index already registered."));
};
_levels[_arg2] = {level:_arg1, locked:true, completed:false, bestTime:Infinity, bestScore:0, bestStars:0};
}
public function unregisterLevel(_arg1:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <unregisterLevel> : Level with such index isn't registered."));
};
var _local2:Object = _levels[_arg1];
_local2.level = undefined;
_local2.locked = undefined;
_local2.completed = undefined;
_local2.bestTime = undefined;
_local2.bestScore = undefined;
_levels[_arg1] = undefined;
}
public function hasLevelAt(_arg1:uint):Boolean{
if (_arg1 < _levels.length){
return (Boolean(_levels[_arg1]));
};
return (false);
}
public function lockLevel(_arg1:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <lockLevel> : Level with such index isn't registered."));
};
_levels[_arg1].locked = true;
}
public function unlockLevel(_arg1:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <unlockLevel> : Level with such index isn't registered."));
};
_levels[_arg1].locked = false;
}
public function completeLevel(_arg1:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <completeLevel> : Level with such index isn't registered."));
};
_levels[_arg1].completed = true;
}
public function resetLevel(_arg1:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <resetLevel> : Level with such index isn't registered."));
};
_levels[_arg1].completed = false;
}
public function loadLevel(_arg1:uint):void{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <loadLevel> : Level with such index isn't registered."));
};
if (_level){
unloadLevel();
};
_index = _arg1;
_level = new _levels[_index].level();
_level.index = _index;
_level.load();
addChild((_level as Sprite));
}
public function unloadLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <unloadLevel> : There is no level to unload."));
};
_level.unload();
removeChild((_level as Sprite));
_level = undefined;
}
public function startLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <startLevel> : There is no level to start."));
};
_level.start();
}
public function finishLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <finishLevel> : There is no level to finish."));
};
_level.finish();
}
public function restartLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <restartRestart> : There is no level to restart."));
};
_level.restart();
}
public function pauseLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <pauseLevel> : There is no level to pause."));
};
_level.pause();
}
public function resumeLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <resumeLevel> : There is no level to resume."));
};
_level.resume();
}
public function prevLevel():void{
if (_index > 0){
_index--;
loadLevel(_index);
} else {
throw (new Error("[LevelManager] : <prevLevel> : There isn't prev level."));
};
}
public function nextLevel():void{
if (_index < (_levels.length - 1)){
_index++;
loadLevel(_index);
} else {
throw (new Error("[LevelManager] : <nextLevel> : There isn't next level."));
};
}
public function launchLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <launchLevel> : There is no level to launch."));
};
_level.launch();
}
public function isLevelMute():Boolean{
if (!_level){
throw (new Error("[LevelManager] : <isLevelMute> : There is no current level."));
};
return (_level.mute);
}
public function muteLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <muteLevel> : There is no level to mute."));
};
_level.mute = true;
}
public function unmuteLevel():void{
if (!_level){
throw (new Error("[LevelManager] : <unmuteLevel> : There is no level to unmute."));
};
_level.mute = false;
}
public function getCurrentLevel():Level{
return (_level);
}
public function getCurrentLevelIndex():uint{
return (_index);
}
public function getNumLevels():uint{
return (_levels.length);
}
public function isPrevLevel():Boolean{
return ((_index > 0));
}
public function isNextLevel():Boolean{
return ((_index < (_levels.length - 1)));
}
public function isLevelCompleted(_arg1:uint):Boolean{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <isLevelCompleted> : Level with such index isn't registered."));
};
return (_levels[_arg1].completed);
}
public function isLevelLocked(_arg1:uint):Boolean{
if (!_levels[_arg1]){
throw (new Error("[LevelManager] : <isLevelLocked> : Level with such index isn't registered."));
};
return (_levels[_arg1].locked);
}
private function flushSharedObject():void{
var flushStatus:String;
try {
flushStatus = _so.flush(MIN_DISK_SPACE);
} catch(error:Error) {
dispatchEvent(new GameEvent(GameEvent.SAVE_ERROR));
};
if (flushStatus != null){
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_so.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
dispatchEvent(new GameEvent(GameEvent.SAVE_COMPLETE));
break;
};
};
}
private function onFlushStatus(_arg1:NetStatusEvent):void{
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
dispatchEvent(new GameEvent(GameEvent.SAVE_COMPLETE));
break;
case "SharedObject.Flush.Failed":
dispatchEvent(new GameEvent(GameEvent.SAVE_ERROR));
break;
};
_so.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
}
public static function get instance():LevelManager{
return (_instance);
}
}
}//package lp.pge.game
Section 300
//LevelMode (lp.pge.game.LevelMode)
package lp.pge.game {
public class LevelMode {
public static const PLAN:String = "plan";
public static const PLAY:String = "play";
public static const WAIT:String = "wait";
}
}//package lp.pge.game
Section 301
//LevelState (lp.pge.game.LevelState)
package lp.pge.game {
public class LevelState {
public static const CREATED:String = "created";
public static const LOADED:String = "loaded";
public static const INTRO:String = "outro";
public static const STARTED:String = "started";
public static const PLAYING:String = "playing";
public static const PAUSED:String = "paused";
public static const MOVIE:String = "movie";
public static const OUTRO:String = "outro";
public static const FINISHED:String = "finished";
public static const UNLOADED:String = "unloaded";
public static const WON:String = "won";
public static const LOST:String = "lost";
}
}//package lp.pge.game
Section 302
//MediaAnimation (lp.pge.game.MediaAnimation)
package lp.pge.game {
import lp.pge.media.*;
import flash.media.*;
import flash.display.*;
public class MediaAnimation extends MovieClip {
protected var _soundPlayer:SoundPlayer;
public function MediaAnimation(){
_soundPlayer = SoundManager.instance.createPlayer();
}
public function get mute():Boolean{
return ((_soundPlayer) ? _soundPlayer.mute : false);
}
public function set mute(_arg1:Boolean):void{
if (!_soundPlayer){
return;
};
_soundPlayer.mute = ((_arg1) || (SoundManager.instance.mute));
}
public function playSound(_arg1:Sound=null, _arg2:Number=0):void{
if (!_soundPlayer){
return;
};
_soundPlayer.play(_arg1, _arg2);
}
public function stopSound():void{
if (!_soundPlayer){
return;
};
_soundPlayer.stop();
}
public function pauseSound():void{
if (!_soundPlayer){
return;
};
_soundPlayer.pause();
}
public function resumeSound():void{
if (!_soundPlayer){
return;
};
_soundPlayer.resume();
}
public function isSoundPlaying():Boolean{
if (!_soundPlayer){
return (false);
};
return (_soundPlayer.isPlaying);
}
public function destroy():void{
var _local1:Function;
stop();
if (_soundPlayer){
_soundPlayer.stop();
_soundPlayer = undefined;
};
if (this.hasOwnProperty("destroyThis")){
_local1 = (this["destroyThis"] as Function);
if ((_local1 is Function)){
_local1();
};
};
}
}
}//package lp.pge.game
Section 303
//PacketGenerator (lp.pge.game.PacketGenerator)
package lp.pge.game {
import flash.events.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import lp.pge.game.core.entities.*;
import lp.pge.game.models.*;
import flash.display.*;
import com.greensock.*;
import lp.pge.game.dummies.*;
import lp.pge.game.core.aspects.*;
import lp.pge.game.core.managers.*;
import com.greensock.easing.*;
import lp.pge.game.core.systems.*;
public class PacketGenerator extends Sprite {
private const PS:Number = 30;
private const HOR_OFFSET:Number = 30;
private var _model:PacketModel;
private var _image:Sprite;
private var _tween:TweenLite;
public var sensor:Sprite;
public var holder:Sprite;
public function init(_arg1:PacketDummy):void{
if (_model){
_model.unload();
};
x = _arg1.x;
y = 0;
sensor.y = HOR_OFFSET;
_model = new PacketModel();
_model.load(_arg1);
_image = _model.createSkin();
_image.visible = false;
(_image.getChildByName("anim") as MovieClip).gotoAndStop(1);
holder.addChild(_image);
if (!sensor.hasEventListener(MouseEvent.CLICK)){
sensor.addEventListener(MouseEvent.CLICK, onClick);
};
}
public function halt():void{
if (_model){
_model.unload();
};
_model = undefined;
if (sensor.hasEventListener(MouseEvent.CLICK)){
sensor.removeEventListener(MouseEvent.CLICK, onClick);
};
}
public function createPacket():Packet{
if (!_model){
throw (new Error("[PacketGenerator] : <createPacket> : Must be initialized first."));
};
if (_tween){
_tween.kill();
};
_image.visible = false;
sensor.visible = false;
var _local1:Packet = EntitiesFactory.createPacket(_model);
var _local2:b2Body = (_local1.getAspectByType(PhysicalAspect) as PhysicalAspect).body;
_local2.SetType(b2Body.b2_dynamicBody);
_local2.SetBullet(true);
var _local3:b2Vec2 = _local2.GetPosition();
_local3.y = (30 / PS);
_local2.SetPosition(_local3);
var _local4:b2Vec2 = _local2.GetLinearVelocity();
_local4.x = 0;
_local4.y = 20;
_local2.SetLinearVelocity(_local4);
(GameManager.instance.getSystemByType(GraphicalAdapter) as GraphicalAdapter).updateEntity(_local1);
return (_local1);
}
public function animatePacket():void{
var sfx:SFX = new SFX(new AcousticalAspect());
GameManager.instance.addEntity(sfx);
sfx.playSound(new HolyBallSound());
if (_tween){
_tween.kill();
};
_image.x = 0;
_image.y = _model.y;
_image.visible = true;
sensor.visible = true;
_tween = new TweenLite(_image, 0.5, {ease:Quad.easeOut, y:HOR_OFFSET, onComplete:function ():void{
_tween = undefined;
(_image.getChildByName("anim") as MovieClip).gotoAndPlay("hover");
}});
}
private function onClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.PACKET_LAUNCH));
}
}
}//package lp.pge.game
Section 304
//ScriptEvent (lp.pge.game.ScriptEvent)
package lp.pge.game {
import flash.events.*;
public class ScriptEvent extends GameEvent {
public static const L01_THORN_BROKEN:String = "l01ThornBroken";
public static const L02_THORN_1_BROKEN:String = "l02Thorn1Broken";
public static const L02_THORN_2_BROKEN:String = "l02Thorn2Broken";
public static const L03_THORN_BROKEN:String = "l03ThornBroken";
public static const L04_TREE_HIT:String = "l04TreeHit";
public static const L05_VOLCANO_BLOCKED:String = "l05VolcanoBlocked";
public static const L06_VOLCANO_1_BLOCKED:String = "l06Volcano1Blocked";
public static const L06_VOLCANO_2_BLOCKED:String = "l06Volcano2Blocked";
public static const L07_BIG_STONE_HIT:String = "l07BigStoneHit";
public static const L07_BIG_STONE_PUSH:String = "l07BigStonePush";
public static const L08_VOLCANO_1_BLOCKED:String = "l08Volcano1Blocked";
public static const L08_VOLCANO_2_BLOCKED:String = "l08Volcano2Blocked";
public static const L09_VOLCANO_BLOCKED:String = "l09VolcanoBlocked";
public static const L10_ICICLE_1_BROKEN:String = "l10Icicle1Broken";
public static const L10_ICICLE_2_BROKEN:String = "l10Icicle2Broken";
public static const L11_ICICLE_1_BROKEN:String = "l11Icicle1Broken";
public static const L11_ICICLE_2_BROKEN:String = "l11Icicle2Broken";
public static const L11_ICICLE_3_BROKEN:String = "l11Icicle3Broken";
public static const L12_WATERFALL_BLOCKED:String = "l12WaterfallBlocked";
public static const L13_ROCK_HIT:String = "l13RockHit";
public static const L14_BRANCH_HIT:String = "l14BranchHit";
public static const L15_CROCODILE_HIT:String = "l15CrocodileHit";
public static const L16_DEBRIS_HIT:String = "l16DebrisHit";
public static const L17_WATERFALL_BLOCKED:String = "l17WaterfallBlocked";
public static const L18_DRAGON_HIT:String = "l18DragonHit";
public static const L19_DRAGON_1_HIT:String = "l19Dragon1Hit";
public static const L19_DRAGON_2_HIT:String = "l19Dragon2Hit";
public static const L19_DRAGON_3_HIT:String = "l19Dragon3Hit";
public static const L20_GEYSER_BLOCKED:String = "l20GeyserBlocked";
public static const L21_GEYSER_1_BLOCKED:String = "l21Geyser1Blocked";
public static const L21_GEYSER_2_BLOCKED:String = "l21Geyser2Blocked";
public static const L21_GEYSER_3_BLOCKED:String = "l21Geyser3Blocked";
public static const L22_ICE_CRACK_BROKEN:String = "l22IceCrackBroken";
public static const L23_ICICLE_1_BROKEN:String = "l23Icicle1Broken";
public static const L23_ICICLE_2_BROKEN:String = "l23Icicle2Broken";
public static const L23_ICICLE_3_BROKEN:String = "l23Icicle3Broken";
public static const L24_ICICLE_BROKEN:String = "l24IcicleBroken";
public static const L25_ICICLE_BROKEN:String = "l25IcicleBroken";
public static const L25_ICE_ROCK_HIT:String = "l25IceRockHit";
public static const L26_ICICLE_1_BROKEN:String = "l26Icicle1Broken";
public static const L26_ICICLE_2_BROKEN:String = "l26Icicle2Broken";
public static const L26_ICICLE_3_BROKEN:String = "l26Icicle3Broken";
public static const L27_BEAR_HIT:String = "l27BearHit";
public static const L28_ICE_ROOF_BROKEN:String = "l28IceRoofBroken";
public static const L28_WIND_HIT:String = "l28WindHit";
public function ScriptEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4=null){
super(_arg1, _arg2, _arg3, _arg4);
}
override public function clone():Event{
return (new ScriptEvent(type, bubbles, cancelable, _data));
}
}
}//package lp.pge.game
Section 305
//ThingTypes (lp.pge.game.ThingTypes)
package lp.pge.game {
public class ThingTypes {
public static const IMMOVABLE:String = "immovable";
public static const MOVABLE:String = "movable";
public static const MOVING:String = "moving";
public static const JUMPING:String = "jumping";
}
}//package lp.pge.game
Section 306
//VikingAnimation (lp.pge.game.VikingAnimation)
package lp.pge.game {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import com.greensock.easing.*;
public class VikingAnimation extends MediaAnimation {
private var _init:Boolean;
private var _haltCB:Function;
private var _toggle:String;// = "none"
private var _walkCB:Function;
private var _lastIdle:uint;// = 0
private var _helmetVisible:Boolean;
private var _jerkinVisible:Boolean;
private var _vestVisible:Boolean;
private var _pantsVisible:Boolean;
private var _shirtVisible:Boolean;
private var _axeVisible:Boolean;
private var _shieldVisible:Boolean;
private var _bootsVisible:Boolean;
private var _wps:Array;
private var _tween:TweenLite;
private var _stepCB:Function;
private var _moveCB:Function;
public var helmet:Sprite;
public var jerkin:Sprite;
public var vest:Sprite;
public var pantsLL:Sprite;
public var pantsLR:Sprite;
public var shirtB:Sprite;
public var shirtAL1:Sprite;
public var shirtAL2:Sprite;
public var shirtAR1:Sprite;
public var shirtAR2:Sprite;
public var axe:Sprite;
public var shield:Sprite;
public var bootL1:Sprite;
public var bootL2:Sprite;
public var bootR1:Sprite;
public var bootR2:Sprite;
private static const MOVE_SPEED_1:Number = 4;
private static const MOVE_SPEED_2:Number = 6;
private static const MOVE_SPEED_3:Number = 8;
public function VikingAnimation(){
addFrameScript(0, frame1, 1, frame2, 37, frame38, 38, frame39, 126, frame127, 127, frame128, 169, frame170, 170, frame171, 173, frame174, 197, frame198, 202, frame203, 222, frame223, 238, frame239);
init();
}
public function init():void{
if (!_init){
_init = true;
_helmetVisible = true;
_jerkinVisible = true;
_vestVisible = true;
_pantsVisible = true;
_shirtVisible = true;
_axeVisible = true;
_shieldVisible = true;
_bootsVisible = true;
setHelmetVisibility(GameAchievements.hasAchievementBySID(GameAchievements.HELMET_SID));
setJerkinVisibility(GameAchievements.hasAchievementBySID(GameAchievements.JERKIN_SID));
setVestVisibility(GameAchievements.hasAchievementBySID(GameAchievements.VEST_SID));
setPantsVisibility(GameAchievements.hasAchievementBySID(GameAchievements.PANTS_SID));
setShirtVisibility(GameAchievements.hasAchievementBySID(GameAchievements.SHIRT_SID));
setAxeVisibility(GameAchievements.hasAchievementBySID(GameAchievements.AXE_SID));
setShieldVisibility(GameAchievements.hasAchievementBySID(GameAchievements.SHIELD_SID));
setBootsVisibility(GameAchievements.hasAchievementBySID(GameAchievements.BOOTS_SID));
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
};
}
public function reset():void{
stopMove();
_toggle = "none";
_haltCB = undefined;
_walkCB = undefined;
randomIdle();
}
override public function destroy():void{
removeEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
stop();
_toggle = "none";
_haltCB = undefined;
_walkCB = undefined;
stopMove();
_init = false;
_lastIdle = undefined;
_helmetVisible = undefined;
_jerkinVisible = undefined;
_vestVisible = undefined;
_pantsVisible = undefined;
_shirtVisible = undefined;
_axeVisible = undefined;
_shieldVisible = undefined;
_bootsVisible = undefined;
if (parent){
parent.removeChild(this);
};
super.destroy();
}
public function randomIdle():void{
var _local1:uint = 1;
do {
_local1 = (1 + Math.round((2 * Math.random())));
} while (_local1 == _lastIdle);
_lastIdle = _local1;
gotoAndPlay(("idle" + _local1));
}
public function walk(_arg1:Array=null, _arg2:Function=null):void{
var pos0:*;
var $wps = _arg1;
var $callback = _arg2;
gotoAndStop(1);
_toggle = "none";
gotoAndPlay("walk");
if ($wps){
pos0 = $wps[0];
if ((pos0 is Object)){
if (!isNaN(pos0.x)){
x = pos0.x;
};
if (!isNaN(pos0.y)){
y = pos0.y;
};
if (!isNaN(pos0.r)){
rotation = pos0.r;
};
if (!isNaN(pos0.rotation)){
rotation = pos0.rotation;
};
};
_walkCB = function ():void{
move($wps, $callback);
};
};
}
public function switchWalk():void{
if (_toggle == "halt"){
_toggle = "none";
gotoAndPlay("halt");
stopMove();
} else {
if (_toggle == "walk2"){
gotoAndPlay("walk_cycle_2");
} else {
if (_toggle == "walk3"){
gotoAndPlay("walk_cycle_3");
} else {
gotoAndPlay("walk_cycle");
};
};
};
}
public function halt(_arg1:Function=null):void{
if ((((((((currentLabel == "walk")) || ((currentLabel == "walk_cycle")))) || ((currentLabel == "walk_cycle_2")))) || ((currentLabel == "walk_cycle_3")))){
_haltCB = _arg1;
_toggle = "halt";
};
}
public function whenHalted():void{
var _local1:Function;
if (_haltCB != null){
_local1 = _haltCB;
_haltCB = undefined;
_local1();
};
}
public function whenWalking():void{
var _local1:Function;
if (_walkCB != null){
_local1 = _walkCB;
_walkCB = undefined;
_local1();
};
}
public function setHelmetVisibility(_arg1:Boolean):void{
if (_arg1 != _helmetVisible){
_helmetVisible = _arg1;
getChildByName("helmet").visible = _helmetVisible;
};
}
public function setJerkinVisibility(_arg1:Boolean):void{
if (_arg1 != _jerkinVisible){
_jerkinVisible = _arg1;
getChildByName("jerkin").visible = _jerkinVisible;
};
}
public function setVestVisibility(_arg1:Boolean):void{
if (_arg1 != _vestVisible){
_vestVisible = _arg1;
getChildByName("vest").visible = _vestVisible;
};
}
public function setPantsVisibility(_arg1:Boolean):void{
if (_arg1 != _pantsVisible){
_pantsVisible = _arg1;
getChildByName("pantsLL").visible = _pantsVisible;
getChildByName("pantsLR").visible = _pantsVisible;
};
}
public function setShirtVisibility(_arg1:Boolean):void{
if (_arg1 != _shirtVisible){
_shirtVisible = _arg1;
getChildByName("shirtB").visible = _shirtVisible;
getChildByName("shirtAL1").visible = _shirtVisible;
getChildByName("shirtAL2").visible = _shirtVisible;
getChildByName("shirtAR1").visible = _shirtVisible;
getChildByName("shirtAR2").visible = _shirtVisible;
};
}
public function setAxeVisibility(_arg1:Boolean):void{
if (_arg1 != _axeVisible){
_axeVisible = _arg1;
getChildByName("axe").visible = _axeVisible;
};
}
public function setShieldVisibility(_arg1:Boolean):void{
if (_arg1 != _shieldVisible){
_shieldVisible = _arg1;
getChildByName("shield").visible = _shieldVisible;
};
}
public function setBootsVisibility(_arg1:Boolean):void{
if (_arg1 != _bootsVisible){
_bootsVisible = _arg1;
getChildByName("bootL1").visible = _bootsVisible;
getChildByName("bootL2").visible = _bootsVisible;
getChildByName("bootR1").visible = _bootsVisible;
getChildByName("bootR2").visible = _bootsVisible;
};
}
private function onRemoved(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
stop();
_toggle = "none";
stopMove();
_init = false;
}
private function move(_arg1:Array, _arg2:Function=null):void{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:String;
if (_tween){
_tween.kill();
};
_wps = _arg1;
_moveCB = _arg2;
var _local3:* = _wps.shift();
if ((_local3 is Object)){
if (!isNaN(_local3.x)){
x = _local3.x;
};
if (!isNaN(_local3.y)){
y = _local3.y;
};
if (!isNaN(_local3.r)){
rotation = _local3.r;
};
if (!isNaN(_local3.rotation)){
rotation = _local3.rotation;
};
};
var _local4:* = _wps.shift();
if ((_local4 is Object)){
_local9 = (isNaN(_local4.x)) ? x : _local4.x;
_local10 = (isNaN(_local4.y)) ? y : _local4.y;
_local11 = (isNaN(_local4.r)) ? rotation : _local4.r;
if (!isNaN(_local4.rotation)){
_local11 = _local4.rotation;
};
_local12 = _local4.an;
if (_local12 == "walk1"){
_toggle = _local12;
} else {
if (_local12 == "walk2"){
_toggle = _local12;
} else {
if (_local12 == "walk3"){
_toggle = _local12;
};
};
};
_stepCB = (_local4.cb as Function);
_toggle = "walk1";
} else {
throw (new Error("[VikingAnimation] : <move> : Wrong waypoint."));
};
var _local5:Number = (_local9 - x);
var _local6:Number = (_local10 - y);
var _local7:Number = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
var _local8:uint = Math.round((_local7 / MOVE_SPEED_1));
_tween = new TweenLite(this, _local8, {x:_local9, y:_local10, rotation:_local11, ease:Linear.easeNone, useFrames:true, onComplete:nextMove});
}
private function nextMove():void{
var _local1:Function;
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:String;
var _local12:Function;
if (_stepCB != null){
_local1 = _stepCB;
_stepCB = undefined;
_local1();
};
if (_wps.length){
_local2 = _wps.shift();
if ((_local2 is Object)){
_local8 = (isNaN(_local2.x)) ? x : _local2.x;
_local9 = (isNaN(_local2.y)) ? y : _local2.y;
_local10 = (isNaN(_local2.r)) ? rotation : _local2.r;
if (!isNaN(_local2.rotation)){
_local10 = _local2.rotation;
};
_local11 = _local2.an;
if (_local11 == "walk1"){
_toggle = _local11;
} else {
if (_local11 == "walk2"){
_toggle = _local11;
} else {
if (_local11 == "walk3"){
_toggle = _local11;
};
};
};
_stepCB = (_local2.cb as Function);
} else {
throw (new Error("[VikingAnimation] : <nextMove> : Wrong waypoint."));
};
_local3 = (_local8 - x);
_local4 = (_local9 - y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local6 = MOVE_SPEED_1;
if (_toggle == "walk2"){
_local6 = MOVE_SPEED_2;
};
if (_toggle == "walk3"){
_local6 = MOVE_SPEED_3;
};
_local7 = Math.round((_local5 / _local6));
_tween = new TweenLite(this, _local7, {x:_local8, y:_local9, rotation:_local10, ease:Linear.easeNone, useFrames:true, onComplete:nextMove});
} else {
_tween = undefined;
_wps = undefined;
if (_moveCB != null){
_local12 = _moveCB;
_moveCB = undefined;
_local12();
};
};
}
private function stopMove():void{
if (_tween){
_tween.kill();
};
_tween = undefined;
_wps = undefined;
_stepCB = undefined;
_moveCB = undefined;
}
function frame1(){
stop();
}
function frame2(){
playSound(new VikingSound(), 0);
}
function frame38(){
randomIdle();
}
function frame39(){
playSound(new VikingSound(), 1600);
}
function frame127(){
randomIdle();
}
function frame128(){
playSound(new VikingSound(), 5300);
}
function frame170(){
randomIdle();
}
function frame171(){
stopSound();
}
function frame174(){
whenWalking();
}
function frame198(){
switchWalk();
}
function frame203(){
stop();
whenHalted();
}
function frame223(){
switchWalk();
}
function frame239(){
switchWalk();
}
}
}//package lp.pge.game
Section 307
//Button (lp.pge.gui.Button)
package lp.pge.gui {
import flash.events.*;
import lp.pge.*;
import flash.utils.*;
import flash.display.*;
import lp.pge.media.*;
public class Button extends MovieClip {
protected const BLINK_TIME:uint = 1000;
protected const IS_MOBILE:Boolean;
public var clickAction:Function;
protected var _enabled:Boolean;
protected var _soundPlayer:SoundPlayer;
protected var _blinkTimer:Timer;
protected var _exists:Boolean;
public function Button(){
IS_MOBILE = GameApplication.isMobile;
super();
mouseChildren = false;
gotoAndStop(1);
if (IS_MOBILE){
_blinkTimer = new Timer(1000, 1);
};
enable();
_soundPlayer = new SoundPlayer();
SoundManager.instance.addPlayer(_soundPlayer);
_exists = true;
}
public function get exists():Boolean{
return (_exists);
}
public function destroy():void{
if (_exists){
buttonMode = false;
useHandCursor = false;
removeEventListener(MouseEvent.CLICK, onClick);
if (IS_MOBILE){
_blinkTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onBlink);
removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
_blinkTimer = undefined;
} else {
removeEventListener(MouseEvent.MOUSE_OUT, onOut);
removeEventListener(MouseEvent.MOUSE_OVER, onOver);
};
clickAction = undefined;
_enabled = undefined;
if (_soundPlayer){
if (_soundPlayer.isPlaying){
_soundPlayer.stop();
};
SoundManager.instance.disposePlayer(_soundPlayer);
_soundPlayer = undefined;
};
_exists = false;
};
}
public function enable():void{
if (!_enabled){
buttonMode = true;
useHandCursor = true;
addEventListener(MouseEvent.CLICK, onClick);
if (IS_MOBILE){
_blinkTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onBlink);
addEventListener(MouseEvent.MOUSE_DOWN, onDown);
} else {
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
};
_enabled = true;
};
}
public function disable():void{
if (_enabled){
buttonMode = false;
useHandCursor = false;
removeEventListener(MouseEvent.CLICK, onClick);
if (IS_MOBILE){
_blinkTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onBlink);
removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
} else {
removeEventListener(MouseEvent.MOUSE_OUT, onOut);
removeEventListener(MouseEvent.MOUSE_OVER, onOver);
};
_enabled = false;
};
}
public function get isEnabled():Boolean{
return (_enabled);
}
public function get isDisabled():Boolean{
return (!(_enabled));
}
protected function onOut(_arg1:MouseEvent):void{
gotoAndStop("out");
}
protected function onOver(_arg1:MouseEvent):void{
gotoAndStop("over");
}
protected function onClick(_arg1:MouseEvent):void{
if (clickAction != null){
clickAction();
};
}
protected function onDown(_arg1:MouseEvent):void{
if (IS_MOBILE){
gotoAndStop("over");
_blinkTimer.reset();
_blinkTimer.start();
};
}
protected function onBlink(_arg1:TimerEvent):void{
gotoAndStop("out");
}
}
}//package lp.pge.gui
Section 308
//Cursor (lp.pge.gui.Cursor)
package lp.pge.gui {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class Cursor extends MovieClip {
private var _state:Boolean;
private static var _instance:Cursor;
public function Cursor(){
addFrameScript(0, frame1, 1, frame2);
if (_instance){
throw (new Error("[Cursor] : <Cursor> : Only one instance of this class is allowed."));
};
_instance = this;
mouseChildren = false;
mouseEnabled = false;
}
public function launch():void{
init();
}
public function show():void{
work();
Mouse.hide();
visible = true;
}
public function hide():void{
halt();
visible = false;
Mouse.show();
}
public function up():void{
gotoAndStop("up");
}
public function down():void{
gotoAndStop("down");
}
private function update(_arg1:Event=null):void{
x = root.mouseX;
y = root.mouseY;
}
private function work():void{
if (!_state){
stage.addEventListener(MouseEvent.MOUSE_DOWN, goDown);
stage.addEventListener(MouseEvent.MOUSE_UP, goUp);
stage.addEventListener(Event.MOUSE_LEAVE, onLeave);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onEnter);
addEventListener(Event.ENTER_FRAME, update);
_state = true;
};
}
private function halt():void{
if (_state){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, goDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, goUp);
stage.removeEventListener(Event.MOUSE_LEAVE, onLeave);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onEnter);
removeEventListener(Event.ENTER_FRAME, update);
_state = false;
};
}
private function goDown(_arg1:MouseEvent):void{
down();
}
private function goUp(_arg1:MouseEvent):void{
up();
}
private function onLeave(_arg1:Event):void{
visible = false;
}
private function onEnter(_arg1:MouseEvent):void{
visible = true;
}
private function init(_arg1:Event=null):void{
if (_arg1){
removeEventListener(Event.ADDED_TO_STAGE, init);
};
show();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public static function get instance():Cursor{
return (_instance);
}
}
}//package lp.pge.gui
Section 309
//HScrollBar (lp.pge.gui.HScrollBar)
package lp.pge.gui {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class HScrollBar extends Sprite {
private const SPEED:Number = 8;
public var track:Sprite;
public var thumb:Sprite;
public var leftButton:Sprite;
public var rightButton:Sprite;
private var _cont:Sprite;
private var _mask:Sprite;
private var _moveDir:int;// = 0
public function attach(_arg1:Sprite, _arg2:Sprite):void{
if (((!(_arg1)) || (!(_arg2)))){
throw (new Error("[HScrollBar] : <attach> : Wrong target (container or mask)."));
};
_cont = _arg1;
_mask = _arg2;
_cont.mask = _mask;
resizeThumb();
thumb.addEventListener(MouseEvent.MOUSE_DOWN, dragThumb);
thumb.addEventListener(MouseEvent.MOUSE_UP, dropThumb);
thumb.addEventListener(Event.ENTER_FRAME, moveCont);
stage.addEventListener(MouseEvent.MOUSE_UP, dropThumb);
track.addEventListener(MouseEvent.CLICK, placeThumb);
track.addEventListener(Event.ENTER_FRAME, shiftThumb);
if (leftButton){
leftButton.addEventListener(MouseEvent.MOUSE_DOWN, startMoveLeft);
leftButton.addEventListener(MouseEvent.MOUSE_UP, stopMove);
leftButton.addEventListener(MouseEvent.CLICK, stepLeft);
};
if (rightButton){
rightButton.addEventListener(MouseEvent.MOUSE_DOWN, startMoveRight);
rightButton.addEventListener(MouseEvent.MOUSE_UP, stopMove);
rightButton.addEventListener(MouseEvent.CLICK, stepRight);
};
track.parent.addEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
_mask.parent.addEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
}
public function detach():void{
thumb.removeEventListener(MouseEvent.MOUSE_DOWN, dragThumb);
thumb.removeEventListener(MouseEvent.MOUSE_UP, dropThumb);
thumb.removeEventListener(Event.ENTER_FRAME, moveCont);
stage.removeEventListener(MouseEvent.MOUSE_UP, dropThumb);
track.removeEventListener(MouseEvent.CLICK, placeThumb);
track.removeEventListener(Event.ENTER_FRAME, shiftThumb);
if (leftButton){
leftButton.removeEventListener(MouseEvent.MOUSE_DOWN, startMoveLeft);
leftButton.removeEventListener(MouseEvent.MOUSE_UP, stopMove);
leftButton.removeEventListener(MouseEvent.CLICK, stepLeft);
};
if (rightButton){
rightButton.removeEventListener(MouseEvent.MOUSE_DOWN, startMoveRight);
rightButton.removeEventListener(MouseEvent.MOUSE_UP, stopMove);
rightButton.removeEventListener(MouseEvent.CLICK, stepRight);
};
track.parent.removeEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
_mask.parent.removeEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
_cont = undefined;
_mask = undefined;
}
public function get isAttached():Boolean{
return (((_cont) && (_mask)));
}
private function resizeThumb():void{
var _local1:Number;
if (_cont.width > 0){
_local1 = (_cont.width / _mask.width);
thumb.width = ((_local1)>=1) ? (track.width / _local1) : track.width;
} else {
thumb.width = track.width;
};
}
private function moveThumb(_arg1:int, _arg2:Number):void{
if (_arg1 == -1){
if ((thumb.x - _arg2) >= track.x){
thumb.x = (thumb.x - _arg2);
} else {
thumb.x = track.x;
};
} else {
if (_arg1 == 1){
if ((thumb.x + _arg2) <= ((track.x + track.width) - thumb.width)){
thumb.x = (thumb.x + _arg2);
} else {
thumb.x = ((track.x + track.width) - thumb.width);
};
};
};
}
private function dragThumb(_arg1:MouseEvent):void{
thumb.startDrag(false, new Rectangle(track.x, track.y, (track.width - thumb.width), 0));
}
private function dropThumb(_arg1:MouseEvent):void{
thumb.stopDrag();
}
private function moveCont(_arg1:Event):void{
resizeThumb();
var _local2:Number = ((track.x - thumb.x) * (_cont.width / track.width));
_cont.x = _local2;
}
private function placeThumb(_arg1:MouseEvent):void{
var _local2:Number = track.parent.mouseX;
thumb.x = ((track.x + _local2) - (thumb.width / 2));
if (thumb.x < track.x){
thumb.x = track.x;
};
if ((thumb.x + thumb.width) > (track.x + track.width)){
thumb.x = ((track.x + track.width) - thumb.width);
};
}
private function shiftThumb(_arg1:Event):void{
moveThumb(_moveDir, SPEED);
}
private function scrollThumb(_arg1:MouseEvent):void{
if (_arg1.delta > 0){
moveThumb(-1, SPEED);
} else {
if (_arg1.delta < 0){
moveThumb(1, SPEED);
};
};
}
private function startMoveLeft(_arg1:MouseEvent):void{
_moveDir = -1;
}
private function stepLeft(_arg1:MouseEvent):void{
moveThumb(-1, SPEED);
}
private function startMoveRight(_arg1:MouseEvent):void{
_moveDir = 1;
}
private function stepRight(_arg1:MouseEvent):void{
moveThumb(1, SPEED);
}
private function stopMove(_arg1:MouseEvent):void{
_moveDir = 0;
}
}
}//package lp.pge.gui
Section 310
//InteractiveScreen (lp.pge.gui.InteractiveScreen)
package lp.pge.gui {
import lp.pge.*;
public class InteractiveScreen extends Screen {
protected var _mute:Boolean;
public function InteractiveScreen(){
GameApplication.instance.addEventListener(GameApplicationEvent.APP_MUTE, onAppMute);
GameApplication.instance.addEventListener(GameApplicationEvent.APP_UNMUTE, onAppUnmute);
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
if (_arg1 == _mute){
return;
};
dispatchEvent(new ScreenEvent((_arg1) ? ScreenEvent.MUTE : ScreenEvent.UNMUTE, true));
_mute = _arg1;
dispatchEvent(new ScreenEvent((_arg1) ? ScreenEvent.MUTED : ScreenEvent.UNMUTED, true));
}
protected function onAppMute(_arg1:GameApplicationEvent):void{
mute = true;
}
protected function onAppUnmute(_arg1:GameApplicationEvent):void{
mute = false;
}
}
}//package lp.pge.gui
Section 311
//Screen (lp.pge.gui.Screen)
package lp.pge.gui {
import flash.events.*;
import flash.display.*;
public class Screen extends Sprite {
public function refresh():void{
}
public function get hidden():Boolean{
return (!(visible));
}
public function get shown():Boolean{
return (visible);
}
public function hide(_arg1:Event=null):void{
dispatchEvent(new ScreenEvent(ScreenEvent.HIDE, true));
visible = false;
dispatchEvent(new ScreenEvent(ScreenEvent.HIDDEN, true));
}
public function show(_arg1:Event=null):void{
dispatchEvent(new ScreenEvent(ScreenEvent.SHOW, true));
visible = true;
dispatchEvent(new ScreenEvent(ScreenEvent.SHOWN, true));
}
}
}//package lp.pge.gui
Section 312
//ScreenEvent (lp.pge.gui.ScreenEvent)
package lp.pge.gui {
import flash.events.*;
import lp.pge.*;
public class ScreenEvent extends GameApplicationEvent {
public static const HIDE:String = "screenHide";
public static const HIDDEN:String = "screenHidden";
public static const SHOW:String = "screenShow";
public static const SHOWN:String = "screenShown";
public static const MUTE:String = "screenMute";
public static const MUTED:String = "screenMuted";
public static const UNMUTE:String = "screenUnmute";
public static const UNMUTED:String = "screenUnmuted";
public function ScreenEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4=null){
super(_arg1, _arg2, _arg3, _arg4);
}
override public function clone():Event{
return (new ScreenEvent(type, bubbles, cancelable, _data));
}
}
}//package lp.pge.gui
Section 313
//Window (lp.pge.gui.Window)
package lp.pge.gui {
import flash.display.*;
import flash.geom.*;
import lp.pge.*;
public class Window extends MovieClip {
protected var _exists:Boolean;
public function Window(){
_exists = true;
}
public function get exists():Boolean{
return (_exists);
}
public function refresh():void{
}
public function destroy():void{
if (_exists){
stop();
_exists = false;
};
}
public function alignToCenter(_arg1:Boolean=false):void{
var _local2:Rectangle;
_local2 = getBounds(this);
if (((stage) && (!(_arg1)))){
x = (((stage.stageWidth - width) / 2) - _local2.x);
y = (((stage.stageHeight - height) / 2) - _local2.y);
} else {
x = (((GameApplication.APPL_WIDTH - width) / 2) - _local2.x);
y = (((GameApplication.APPL_HEIGHT - height) / 2) - _local2.y);
};
}
public function close():void{
var _local1:WindowManager = (parent) ? (parent.parent as WindowManager) : null;
if (_local1){
_local1.closeActiveWindow();
} else {
onClose();
};
}
public function hide(_arg1:Function=null):void{
var _local2:WindowManager = (parent) ? (parent.parent as WindowManager) : null;
if (_local2){
_local2.hideActiveWindow(_arg1);
} else {
onHide();
};
}
public function sendMessage(_arg1:String, ... _args){
if (_arg1 == "show"){
onShow();
} else {
if (_arg1 == "hide"){
onHide();
} else {
if (_arg1 == "open"){
onOpen();
} else {
if (_arg1 == "close"){
onClose();
};
};
};
};
return (null);
}
protected function onShow():void{
}
protected function onHide():void{
destroy();
}
protected function onOpen():void{
}
protected function onClose():void{
destroy();
}
}
}//package lp.pge.gui
Section 314
//WindowManager (lp.pge.gui.WindowManager)
package lp.pge.gui {
import flash.media.*;
import flash.display.*;
import com.greensock.*;
public class WindowManager extends Sprite {
protected const WINDOW_HIDE_TIME:Number = 0.5;
protected const WINDOW_HIDE_POSITION:Number = -400;
protected var _activeWindow:Window;
protected var _windowsLayer:Sprite;
protected var _curtainLayer:WMCurtain;
protected var _curtainTween:TweenLite;
protected var _showTween:TweenLite;
protected var _hideTween:TweenLite;
protected var _mute:Boolean;
public function WindowManager(){
_curtainLayer = new WMCurtain();
_curtainLayer.name = "curtainLayer";
hideCurtain();
addChild(_curtainLayer);
_windowsLayer = new Sprite();
_windowsLayer.name = "windowsLayer";
addChild(_windowsLayer);
}
public function refresh():void{
if (_activeWindow){
_activeWindow.refresh();
};
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
if (_arg1 == _mute){
return;
};
_mute = _arg1;
soundTransform = new SoundTransform((_mute) ? 0 : 1);
}
public function get activeWindow():Window{
return (_activeWindow);
}
public function closeActiveWindow():void{
if (!_activeWindow){
throw (new Error("[WindowManager] : <closeActiveWindow> : There is no active window."));
};
var _local1:Window = _activeWindow;
_windowsLayer.removeChild(_activeWindow);
_activeWindow.name = "window";
_activeWindow = undefined;
hideCurtain();
_local1.sendMessage("close");
}
public function openActiveWindow(_arg1:Window):void{
var _local2:Window;
if (!_arg1){
throw (new Error("[WindowManager] : <openActiveWindow> : Can't open non-existing window."));
};
if (_activeWindow){
_local2 = _activeWindow;
_windowsLayer.removeChild(_activeWindow);
_activeWindow.name = "window";
_local2.sendMessage("close");
};
showCurtain();
_activeWindow = _arg1;
_activeWindow.name = "activeWindow";
_windowsLayer.addChild(_activeWindow);
_activeWindow.sendMessage("open");
}
public function showActiveWindow(_arg1:Window, _arg2:Function=null):void{
var $window = _arg1;
var $callback = _arg2;
if (!$window){
throw (new Error("[WindowManager] : <showActiveWindow> : Can't show non-existing window."));
};
if (_activeWindow){
hideActiveWindow(function ():void{
showActiveWindow($window);
});
return;
};
if (_showTween){
_showTween.kill();
_showTween = undefined;
};
if (((_hideTween) && ((_hideTween.target == $window)))){
_hideTween.kill();
_hideTween = undefined;
};
$window.alpha = 0;
$window.y = WINDOW_HIDE_POSITION;
_activeWindow = $window;
_activeWindow.name = "activeWindow";
_windowsLayer.addChild(_activeWindow);
var da:Number = Math.abs((1 - _activeWindow.alpha));
var dy:Number = Math.abs(_activeWindow.y);
var dt:Number = (da * WINDOW_HIDE_TIME);
showCurtain(true, dt);
_showTween = new TweenLite(_activeWindow, dt, {alpha:1, y:0, onComplete:function ():void{
_activeWindow.sendMessage("show");
if ($callback != null){
$callback();
};
}});
}
public function hideActiveWindow(_arg1:Function=null):void{
var $callback = _arg1;
if (!_activeWindow){
throw (new Error("[WindowManager] : <hideActiveWindow> : There is no active window."));
};
if (_hideTween){
_hideTween.kill();
_hideTween = undefined;
};
if (((_showTween) && ((_showTween.target == _activeWindow)))){
_showTween.kill();
_showTween = undefined;
};
var da:Number = Math.abs(_activeWindow.alpha);
var dy:Number = Math.abs((WINDOW_HIDE_POSITION - _activeWindow.y));
var dt:Number = (da * WINDOW_HIDE_TIME);
_hideTween = new TweenLite(_activeWindow, dt, {alpha:0, y:WINDOW_HIDE_POSITION, onComplete:function ():void{
var _local1:* = _activeWindow;
_windowsLayer.removeChild(_activeWindow);
_activeWindow.name = "window";
_activeWindow = undefined;
_curtainLayer.visible = false;
_local1.sendMessage("hide");
if ($callback != null){
$callback();
};
}});
hideCurtain(true, dt);
}
protected function showCurtain(_arg1:Boolean=false, _arg2:Number=NaN):void{
var da:Number;
var $useTween = _arg1;
var $time = _arg2;
if ($useTween){
if (_curtainTween){
_curtainTween.kill();
};
_curtainLayer.visible = true;
da = (1 - _curtainLayer.alpha);
_curtainTween = new TweenLite(_curtainLayer, (isNaN($time)) ? da : $time, {alpha:1, onComplete:function ():void{
_curtainTween = undefined;
}});
} else {
_curtainLayer.alpha = 1;
_curtainLayer.visible = true;
};
}
protected function hideCurtain(_arg1:Boolean=false, _arg2:Number=NaN):void{
var da:Number;
var $useTween = _arg1;
var $time = _arg2;
if ($useTween){
if (_curtainTween){
_curtainTween.kill();
};
_curtainLayer.visible = true;
da = _curtainLayer.alpha;
_curtainTween = new TweenLite(_curtainLayer, (isNaN($time)) ? da : $time, {alpha:0, onComplete:function ():void{
_curtainTween = undefined;
_curtainLayer.visible = false;
}});
} else {
_curtainLayer.visible = false;
_curtainLayer.alpha = 0;
};
}
}
}//package lp.pge.gui
Section 315
//VScrollBar (lp.pge.gui.VScrollBar)
package lp.pge.gui {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class VScrollBar extends Sprite {
private const SPEED:Number = 8;
public var track:Sprite;
public var thumb:Sprite;
public var upButton:Sprite;
public var downButton:Sprite;
private var _cont:Sprite;
private var _mask:Sprite;
private var _moveDir:int;// = 0
public function attach(_arg1:Sprite, _arg2:Sprite):void{
if (((!(_arg1)) || (!(_arg2)))){
throw (new Error("[VScrollBar] : <attach> : Wrong target (container or mask)."));
};
_cont = _arg1;
_mask = _arg2;
_cont.mask = _mask;
resizeThumb();
thumb.addEventListener(MouseEvent.MOUSE_DOWN, dragThumb);
thumb.addEventListener(MouseEvent.MOUSE_UP, dropThumb);
thumb.addEventListener(Event.ENTER_FRAME, moveCont);
stage.addEventListener(MouseEvent.MOUSE_UP, dropThumb);
track.addEventListener(MouseEvent.CLICK, placeThumb);
track.addEventListener(Event.ENTER_FRAME, shiftThumb);
if (upButton){
upButton.addEventListener(MouseEvent.MOUSE_DOWN, startMoveUp);
upButton.addEventListener(MouseEvent.MOUSE_UP, stopMove);
upButton.addEventListener(MouseEvent.CLICK, stepUp);
};
if (downButton){
downButton.addEventListener(MouseEvent.MOUSE_DOWN, startMoveDown);
downButton.addEventListener(MouseEvent.MOUSE_UP, stopMove);
downButton.addEventListener(MouseEvent.CLICK, stepDown);
};
track.parent.addEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
_mask.parent.addEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
}
public function detach():void{
thumb.removeEventListener(MouseEvent.MOUSE_DOWN, dragThumb);
thumb.removeEventListener(MouseEvent.MOUSE_UP, dropThumb);
thumb.removeEventListener(Event.ENTER_FRAME, moveCont);
stage.removeEventListener(MouseEvent.MOUSE_UP, dropThumb);
track.removeEventListener(MouseEvent.CLICK, placeThumb);
track.removeEventListener(Event.ENTER_FRAME, shiftThumb);
if (upButton){
upButton.removeEventListener(MouseEvent.MOUSE_DOWN, startMoveUp);
upButton.removeEventListener(MouseEvent.MOUSE_UP, stopMove);
upButton.removeEventListener(MouseEvent.CLICK, stepUp);
};
if (downButton){
downButton.removeEventListener(MouseEvent.MOUSE_DOWN, startMoveDown);
downButton.removeEventListener(MouseEvent.MOUSE_UP, stopMove);
downButton.removeEventListener(MouseEvent.CLICK, stepDown);
};
track.parent.removeEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
_mask.parent.removeEventListener(MouseEvent.MOUSE_WHEEL, scrollThumb);
_cont = undefined;
_mask = undefined;
}
public function get isAttached():Boolean{
return (((_cont) && (_mask)));
}
private function resizeThumb():void{
var _local1:Number;
if (_cont.height > 0){
_local1 = (_cont.height / _mask.height);
thumb.height = ((_local1)>=1) ? (track.height / _local1) : track.height;
} else {
thumb.height = track.height;
};
}
private function moveThumb(_arg1:int, _arg2:Number):void{
if (_arg1 == -1){
if ((thumb.y - _arg2) >= track.y){
thumb.y = (thumb.y - _arg2);
} else {
thumb.y = track.y;
};
} else {
if (_arg1 == 1){
if ((thumb.y + _arg2) <= ((track.y + track.height) - thumb.height)){
thumb.y = (thumb.y + _arg2);
} else {
thumb.y = ((track.y + track.height) - thumb.height);
};
};
};
}
private function dragThumb(_arg1:MouseEvent):void{
thumb.startDrag(false, new Rectangle(track.x, track.y, 0, (track.height - thumb.height)));
}
private function dropThumb(_arg1:MouseEvent):void{
thumb.stopDrag();
}
private function moveCont(_arg1:Event):void{
resizeThumb();
var _local2:Number = ((track.y - thumb.y) * (_cont.height / track.height));
_cont.y = _local2;
}
private function placeThumb(_arg1:MouseEvent):void{
var _local2:Number = track.parent.mouseY;
thumb.y = ((track.y + _local2) - (thumb.height / 2));
if (thumb.y < track.y){
thumb.y = track.y;
};
if ((thumb.y + thumb.height) > (track.y + track.height)){
thumb.y = ((track.y + track.height) - thumb.height);
};
}
private function shiftThumb(_arg1:Event):void{
moveThumb(_moveDir, SPEED);
}
private function scrollThumb(_arg1:MouseEvent):void{
if (_arg1.delta > 0){
moveThumb(-1, SPEED);
} else {
if (_arg1.delta < 0){
moveThumb(1, SPEED);
};
};
}
private function startMoveUp(_arg1:MouseEvent):void{
_moveDir = -1;
}
private function stepUp(_arg1:MouseEvent):void{
moveThumb(-1, SPEED);
}
private function startMoveDown(_arg1:MouseEvent):void{
_moveDir = 1;
}
private function stepDown(_arg1:MouseEvent):void{
moveThumb(1, SPEED);
}
private function stopMove(_arg1:MouseEvent):void{
_moveDir = 0;
}
}
}//package lp.pge.gui
Section 316
//MusicPlayer (lp.pge.media.MusicPlayer)
package lp.pge.media {
import flash.media.*;
import flash.events.*;
import com.greensock.*;
import flash.utils.*;
public class MusicPlayer {
private var _sound:Sound;
private var _soundChannel:SoundChannel;
private var _volume:Number;
private var _pan:Number;
private var _mute:Boolean;
private var _position:Number;
private var _tween:TweenLite;
private static var _instance:MusicPlayer;
public function MusicPlayer(){
if (_instance){
throw (new Error("[MusicPlayer] : <MusicPlayer> : Only one instance of this class is allowed."));
};
_instance = this;
_volume = 1;
_pan = 0;
_mute = false;
}
public function get soundClass():Class{
return ((_sound) ? (getDefinitionByName(getQualifiedClassName(_sound)) as Class) : null);
}
public function tweenVolume(_arg1:Number, _arg2:Function=null):void{
var $value = _arg1;
var $callback = _arg2;
if (_tween){
_tween.kill();
};
if ($value < 0){
$value = 0;
};
if ($value > 1){
$value = 1;
};
if ($value == _volume){
if ($callback != null){
$callback();
};
};
_tween = new TweenLite(this, (Math.abs((_volume - $value)) * 2), {volume:$value, onComplete:function ():void{
_tween = undefined;
if ($callback != null){
$callback();
};
}});
}
public function stopTween():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
}
public function isTween():Boolean{
return (Boolean(_tween));
}
public function fadeIn():void{
var _local1:Number;
if (_mute){
_local1 = _volume;
volume = 0;
mute = false;
tweenVolume(_local1);
};
}
public function fadeOut():void{
var vol:Number;
if (!_mute){
vol = _volume;
tweenVolume(0, function ():void{
volume = vol;
mute = true;
});
};
}
public function get volume():Number{
return (_volume);
}
public function set volume(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
_volume = _arg1;
if (_soundChannel){
setSoundTransform();
};
}
public function get pan():Number{
return (_pan);
}
public function set pan(_arg1:Number):void{
if (_arg1 < -1){
_arg1 = -1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_pan = _arg1;
if (_soundChannel){
setSoundTransform();
};
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
_mute = _arg1;
if (_soundChannel){
setSoundTransform();
};
}
public function get isPlaying():Boolean{
return (Boolean(_soundChannel));
}
public function dispose():void{
if (_soundChannel){
_soundChannel.stop();
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restartSound);
};
_sound = undefined;
_soundChannel = undefined;
_volume = undefined;
_pan = undefined;
_mute = undefined;
_position = undefined;
_instance = undefined;
}
public function play(_arg1:Sound=null, _arg2:Number=0):void{
if (_arg1){
_sound = _arg1;
};
if (_soundChannel){
stopSound();
};
if (_sound){
_position = _arg2;
playSound();
} else {
throw (new Error("[MusicPlayer] : <play> : There is no sound to play."));
};
}
public function stop():void{
if (_soundChannel){
stopSound();
_position = 0;
};
}
public function pause():void{
if (_soundChannel){
_position = _soundChannel.position;
stopSound();
} else {
throw (new Error("[MusicPlayer] : <pause> : Sound isn't playing."));
};
}
public function resume():void{
if (!_soundChannel){
if (_sound){
playSound();
} else {
throw (new Error("[MusicPlayer] : <resume> : There is no sound to resume."));
};
} else {
throw (new Error("[MusicPlayer] : <resume> : Sound not paused."));
};
}
private function playSound():void{
if (!_soundChannel){
if (_sound){
_soundChannel = _sound.play(_position);
if (_soundChannel){
setSoundTransform();
_soundChannel.addEventListener(Event.SOUND_COMPLETE, restartSound);
};
} else {
throw (new Error("[SoundPlayer] : <playSound> : There is no sound to play."));
};
} else {
throw (new Error("[SoundPlayer] : <playSound> : Sound is playing."));
};
}
private function stopSound():void{
if (_soundChannel){
_soundChannel.stop();
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restartSound);
_soundChannel = undefined;
} else {
throw (new Error("[SoundPlayer] : <stopSound> : Sound not playing."));
};
}
private function restartSound(_arg1:Event):void{
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restartSound);
_soundChannel = _sound.play();
setSoundTransform();
_soundChannel.addEventListener(Event.SOUND_COMPLETE, restartSound);
}
private function setSoundTransform():void{
if (_soundChannel){
_soundChannel.soundTransform = new SoundTransform((int(!(_mute)) * _volume), _pan);
};
}
public static function get instance():MusicPlayer{
return (_instance);
}
}
}//package lp.pge.media
Section 317
//SoundManager (lp.pge.media.SoundManager)
package lp.pge.media {
import flash.events.*;
import flash.utils.*;
public class SoundManager extends EventDispatcher {
private var _mute:Boolean;
private var _playing:Boolean;
private var _players:Dictionary;
private static var _instance:SoundManager;
public function SoundManager(){
if (_instance){
throw (new Error("[SoundManager] : <SoundManager> : Only one instance of this class is allowed."));
};
_instance = this;
_mute = false;
_playing = true;
_players = new Dictionary();
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
var _local2:SoundPlayer;
_mute = _arg1;
for each (_local2 in _players) {
_local2.mute = _mute;
};
}
public function get isPlaying():Boolean{
return (_playing);
}
public function createPlayer(_arg1:Boolean=false):SoundPlayer{
var _local2:SoundPlayer = new SoundPlayer(_arg1);
_players[_local2] = _local2;
onPlayerAdd(_local2);
return (_local2);
}
public function addPlayer(_arg1:SoundPlayer):void{
if (!_arg1){
throw (new Error("[SoundManager] : <addPlayer> : Can't add non-existing player."));
};
if (!_players[_arg1]){
_players[_arg1] = _arg1;
onPlayerAdd(_arg1);
};
}
public function getPlayer(_arg1:String):SoundPlayer{
var _local2:SoundPlayer;
for each (_local2 in _players) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function hasPlayer(_arg1:SoundPlayer):Boolean{
if (!_arg1){
throw (new Error("[SoundManager] : <hasPlayer> : Can't have non-existing player."));
};
return (Boolean(_players[_arg1]));
}
public function removePlayer(_arg1:SoundPlayer):void{
if (!_arg1){
throw (new Error("[SoundManager] : <removePlayer> : Can't remove non-existing player."));
};
if (_players[_arg1]){
delete _players[_arg1];
onPlayerRemove(_arg1);
};
}
public function disposePlayer(_arg1:SoundPlayer):void{
if (!_arg1){
throw (new Error("[SoundManager] : <disposePlayer> : Can't dispose non-existing player."));
};
if (_players[_arg1]){
delete _players[_arg1];
onPlayerDispose(_arg1);
_arg1.dispose();
};
}
public function play():void{
var _local1:SoundPlayer;
_playing = true;
for each (_local1 in _players) {
if (!_local1.isPlaying){
_local1.play();
};
};
}
public function pause():void{
var _local1:SoundPlayer;
_playing = false;
for each (_local1 in _players) {
if (_local1.isPlaying){
_local1.pause();
};
};
}
public function resume():void{
var _local1:SoundPlayer;
_playing = true;
for each (_local1 in _players) {
if (!_local1.isPlaying){
_local1.resume();
};
};
}
public function stop():void{
var _local1:SoundPlayer;
_playing = false;
for each (_local1 in _players) {
if (_local1.isPlaying){
_local1.stop();
};
};
}
private function onPlayerAdd(_arg1:SoundPlayer):void{
if (((_arg1) && (!((_arg1.mute == _mute))))){
_arg1.mute = _mute;
};
_arg1.addEventListener("dispose", disposeHandler);
}
private function onPlayerRemove(_arg1:SoundPlayer):void{
if (((_arg1) && (_arg1.isPlaying))){
_arg1.stop();
};
_arg1.removeEventListener("dispose", disposeHandler);
}
private function onPlayerDispose(_arg1:SoundPlayer):void{
if (((_arg1) && (_arg1.isPlaying))){
_arg1.stop();
};
_arg1.removeEventListener("dispose", disposeHandler);
}
private function disposeHandler(_arg1:Event):void{
var _local2:SoundPlayer = (_arg1.target as SoundPlayer);
if (!_local2){
throw (new Error("[SoundManager] : <disposeHandler> : Event target isn't player."));
};
_local2.removeEventListener("dispose", disposeHandler);
if (_players[_local2]){
delete _players[_local2];
onPlayerRemove(_local2);
};
}
public static function get instance():SoundManager{
return (_instance);
}
}
}//package lp.pge.media
Section 318
//SoundPlayer (lp.pge.media.SoundPlayer)
package lp.pge.media {
import flash.media.*;
import flash.events.*;
public class SoundPlayer extends EventDispatcher {
public var id:String;
private var _sound:Sound;
private var _soundChannel:SoundChannel;
private var _volume:Number;
private var _pan:Number;
private var _mute:Boolean;
private var _loop:Boolean;
private var _position:Number;
private var _playOnce:Boolean;
public function SoundPlayer(_arg1:Boolean=false){
_volume = 1;
_pan = 0;
_mute = false;
_loop = false;
_playOnce = _arg1;
}
public function get playOnce():Boolean{
return (_playOnce);
}
public function set playOnce(_arg1:Boolean):void{
_playOnce = _arg1;
}
public function get volume():Number{
return (_volume);
}
public function set volume(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
_volume = _arg1;
if (_soundChannel != null){
setSoundTransform();
};
}
public function get pan():Number{
return (_pan);
}
public function set pan(_arg1:Number):void{
if (_arg1 < -1){
_arg1 = -1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_pan = _arg1;
if (_soundChannel != null){
setSoundTransform();
};
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
_mute = _arg1;
if (_soundChannel != null){
setSoundTransform();
};
}
public function get loop():Boolean{
return (_loop);
}
public function set loop(_arg1:Boolean):void{
_loop = _arg1;
}
public function get isPlaying():Boolean{
return (Boolean(_soundChannel));
}
public function dispose():void{
if (_soundChannel){
_soundChannel.stop();
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restartSound);
};
_sound = undefined;
_soundChannel = undefined;
_volume = undefined;
_pan = undefined;
_mute = undefined;
_loop = undefined;
_position = undefined;
}
public function play(_arg1:Sound=null, _arg2:Number=0):void{
if (_arg1){
_sound = _arg1;
};
if (_soundChannel){
stopSound();
};
if (_sound){
_position = _arg2;
playSound();
} else {
throw (new Error("[SoundPlayer] : <play> : There is no sound to play."));
};
}
public function stop():void{
if (_soundChannel){
stopSound();
_position = 0;
};
}
public function pause():void{
if (_soundChannel){
_position = _soundChannel.position;
stopSound();
} else {
throw (new Error("[SoundPlayer] : <pause> : Sound isn't playing."));
};
}
public function resume():void{
if (!_soundChannel){
if (_sound){
playSound();
} else {
throw (new Error("[SoundPlayer] : <resume> : There is no sound to resume."));
};
} else {
throw (new Error("[SoundPlayer] : <resume> : Sound not paused."));
};
}
private function playSound():void{
if (!_soundChannel){
if (_sound){
_soundChannel = _sound.play(_position);
if (_soundChannel){
setSoundTransform();
_soundChannel.addEventListener(Event.SOUND_COMPLETE, restartSound);
};
} else {
throw (new Error("[SoundPlayer] : <playSound> : There is no sound to play."));
};
} else {
throw (new Error("[SoundPlayer] : <playSound> : Sound is playing."));
};
}
private function stopSound():void{
if (_soundChannel){
_soundChannel.stop();
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restartSound);
_soundChannel = undefined;
} else {
throw (new Error("[SoundPlayer] : <stopSound> : Sound not playing."));
};
}
private function restartSound(_arg1:Event):void{
_soundChannel.removeEventListener(Event.SOUND_COMPLETE, restartSound);
if (_loop){
_soundChannel = _sound.play();
setSoundTransform();
_soundChannel.addEventListener(Event.SOUND_COMPLETE, restartSound);
} else {
dispatchEvent(_arg1);
if (_playOnce){
dispose();
dispatchEvent(new Event("dispose"));
};
};
}
private function setSoundTransform():void{
if (_soundChannel != null){
_soundChannel.soundTransform = new SoundTransform((int(!(_mute)) * _volume), _pan);
};
}
}
}//package lp.pge.media
Section 319
//AchievementsButton (lp.pge.menu.buttons.AchievementsButton)
package lp.pge.menu.buttons {
import lp.pge.menu.*;
import lp.pge.gui.*;
public class AchievementsButton extends Button {
public function AchievementsButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
Menu.instance.openAchievements();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 320
//BackButton (lp.pge.menu.buttons.BackButton)
package lp.pge.menu.buttons {
import flash.display.*;
import lp.pge.gui.*;
public class BackButton extends Button {
public function BackButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
if ((parent is Window)){
(parent as MovieClip).stop();
(parent as Window).close();
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 321
//CardButton (lp.pge.menu.buttons.CardButton)
package lp.pge.menu.buttons {
import com.greensock.*;
import lp.pge.game.*;
import flash.display.*;
import lp.pge.menu.windows.*;
public class CardButton extends MovieClip {
private const MIN_SCALE:Number;
private const MAX_SCALE:Number;
private const SCALE_TIME:Number = 1;
private var _selected:Boolean;
private var _index:int;// = -1
private var _title:String;// = ""
private var _tween:TweenLite;
private var _numStars:int;// = -1
public var stars:Sprite;
public var hit:Sprite;
private static const BITMAP_CACHE:Boolean = false;
public function CardButton(_arg1:String=""){
MIN_SCALE = LevelSelectionWindow.MIN_SCALE;
MAX_SCALE = LevelSelectionWindow.MAX_SCALE;
super();
_title = _arg1;
hitArea = hit;
}
public function get index():int{
return (_index);
}
public function set index(_arg1:int):void{
if (_arg1 == _index){
return;
};
_index = _arg1;
refresh();
}
public function get title():String{
return (_title);
}
public function set title(_arg1:String):void{
if (_arg1 == _title){
return;
};
_title = _arg1;
refresh();
}
public function get selected():Boolean{
return (_selected);
}
public function set selected(_arg1:Boolean):void{
if (_arg1 == _selected){
return;
};
_selected = _arg1;
}
public function refresh():void{
if ((((_index < 0)) || ((_title == "")))){
return;
};
var _local1:LevelManager = LevelManager.instance;
var _local2:uint = ((GameAchievements.getAchievementOrderBySID(_title) + 1) * 3);
if (_local1.isLevelCompleted((_local2 + 2))){
gotoAndStop((1 + GameAchievements.getAchievementBySID(_title)));
} else {
gotoAndStop(1);
};
var _local3:uint = ((_local1.getLevelNumStars(_local2) + _local1.getLevelNumStars((_local2 + 1))) + _local1.getLevelNumStars((_local2 + 2)));
if (_local3 != _numStars){
_numStars = _local3;
setNumStars(_numStars);
};
}
public function dispose():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
}
public function get isScaling():Boolean{
return (Boolean(_tween));
}
public function scaleUp():void{
var t:CardButton;
if (((!((scaleX == MAX_SCALE))) || (!((scaleY == MAX_SCALE))))){
if (_tween){
_tween.kill();
};
t = this;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
_tween = new TweenLite(this, SCALE_TIME, {scaleX:MAX_SCALE, scaleY:MAX_SCALE, onComplete:function ():void{
_tween = undefined;
mouseChildren = true;
}});
};
}
public function scaleDown():void{
var t:CardButton;
if (((!((scaleX == MIN_SCALE))) || (!((scaleY == MIN_SCALE))))){
if (_tween){
_tween.kill();
};
t = this;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
_tween = new TweenLite(this, SCALE_TIME, {scaleX:MIN_SCALE, scaleY:MIN_SCALE, onComplete:function ():void{
_tween = undefined;
mouseChildren = false;
if (BITMAP_CACHE){
cacheAsBitmap = true;
};
}});
};
}
public function scaleUpNow():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
scaleX = (scaleY = MAX_SCALE);
mouseChildren = true;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
}
public function scaleDownNow():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
scaleX = (scaleY = MIN_SCALE);
mouseChildren = false;
if (BITMAP_CACHE){
cacheAsBitmap = true;
};
}
private function setNumStars(_arg1:uint):void{
var _local2:uint;
(stars.getChildByName("star1") as MovieClip).gotoAndStop(((_arg1)>0) ? 2 : 1);
(stars.getChildByName("star2") as MovieClip).gotoAndStop(((_arg1)>1) ? 2 : 1);
(stars.getChildByName("star3") as MovieClip).gotoAndStop(((_arg1)>2) ? 2 : 1);
(stars.getChildByName("star4") as MovieClip).gotoAndStop(((_arg1)>3) ? 2 : 1);
(stars.getChildByName("star5") as MovieClip).gotoAndStop(((_arg1)>4) ? 2 : 1);
(stars.getChildByName("star6") as MovieClip).gotoAndStop(((_arg1)>5) ? 2 : 1);
(stars.getChildByName("star7") as MovieClip).gotoAndStop(((_arg1)>6) ? 2 : 1);
(stars.getChildByName("star8") as MovieClip).gotoAndStop(((_arg1)>7) ? 2 : 1);
(stars.getChildByName("star9") as MovieClip).gotoAndStop(((_arg1)>8) ? 2 : 1);
if (LevelManager.instance.isLevelCompleted((((GameAchievements.getAchievementOrderBySID(_title) + 1) * 3) + 2))){
_local2 = (1 + GameAchievements.getAchievementBySID(_title));
if (_local2 > 1){
(stars.getChildByName("star1") as MovieClip).gotoAndStop(3);
(stars.getChildByName("star2") as MovieClip).gotoAndStop(3);
(stars.getChildByName("star3") as MovieClip).gotoAndStop(3);
};
if (_local2 > 2){
(stars.getChildByName("star4") as MovieClip).gotoAndStop(3);
(stars.getChildByName("star5") as MovieClip).gotoAndStop(3);
(stars.getChildByName("star6") as MovieClip).gotoAndStop(3);
};
if (_local2 > 3){
(stars.getChildByName("star7") as MovieClip).gotoAndStop(3);
(stars.getChildByName("star8") as MovieClip).gotoAndStop(3);
(stars.getChildByName("star9") as MovieClip).gotoAndStop(3);
};
};
}
}
}//package lp.pge.menu.buttons
Section 322
//ContinueIntroButton (lp.pge.menu.buttons.ContinueIntroButton)
package lp.pge.menu.buttons {
import lp.pge.*;
import flash.media.*;
import flash.display.*;
import lp.pge.gui.*;
public class ContinueIntroButton extends Button {
private var _sound:Sound;
public function ContinueIntroButton(){
_sound = new ButtonClickSound();
addFrameScript(0, frame1);
super();
clickAction = function ():void{
GameApplication.instance.trackEvent("/replay-intro");
_soundPlayer.play(_sound);
if (((parent) && ((parent.parent is MovieClip)))){
(parent.parent as MovieClip).gotoAndPlay("intro2");
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 323
//CreditsButton (lp.pge.menu.buttons.CreditsButton)
package lp.pge.menu.buttons {
import lp.pge.menu.*;
import flash.media.*;
import lp.pge.gui.*;
public class CreditsButton extends Button {
private var _sound:Sound;
public function CreditsButton(){
_sound = new ButtonClickSound();
addFrameScript(0, frame1);
super();
clickAction = function ():void{
_soundPlayer.play(_sound);
Menu.instance.openCredits();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 324
//GuideButton (lp.pge.menu.buttons.GuideButton)
package lp.pge.menu.buttons {
import lp.pge.menu.*;
import flash.media.*;
import lp.pge.gui.*;
public class GuideButton extends Button {
private var _sound:Sound;
public function GuideButton(){
_sound = new ButtonClickSound();
addFrameScript(0, frame1);
super();
clickAction = function ():void{
_soundPlayer.play(_sound);
trace("[GuideButton] click");
Menu.instance.openGuide();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 325
//LandButton (lp.pge.menu.buttons.LandButton)
package lp.pge.menu.buttons {
import com.greensock.*;
import flash.events.*;
import lp.pge.*;
import lp.pge.game.*;
import flash.display.*;
import lp.pge.menu.windows.*;
public class LandButton extends MovieClip {
private const MIN_SCALE:Number;
private const MAX_SCALE:Number;
private const SCALE_TIME:Number = 1;
private var _selected:Boolean;
private var _index:int;// = -1
private var _tween:TweenLite;
private var _playDir:int;// = 0
public var trial1:TrialButton;
public var trial2:TrialButton;
public var trial3:TrialButton;
public var padlock:Sprite;
private var _locked:Boolean;
private static const BITMAP_CACHE:Boolean = false;
public function LandButton(){
MIN_SCALE = LevelSelectionWindow.MIN_SCALE;
MAX_SCALE = LevelSelectionWindow.MAX_SCALE;
super();
mouseChildren = _selected;
padlock.mouseChildren = false;
padlock.mouseEnabled = false;
}
public function get index():int{
return (_index);
}
public function set index(_arg1:int):void{
if (_arg1 == _index){
return;
};
_index = _arg1;
refresh();
}
public function get selected():Boolean{
return (_selected);
}
public function set selected(_arg1:Boolean):void{
if (_arg1 == _selected){
return;
};
_selected = _arg1;
}
public function get locked():Boolean{
return (_locked);
}
public function refresh():void{
var _local1:LevelManager;
var _local2:uint;
var _local3:uint;
var _local4:uint;
if (_index >= 0){
_local1 = LevelManager.instance;
_local2 = (_index * 3);
_local3 = (_local2 + 1);
_local4 = (_local2 + 2);
if (((((trial1) && (trial2))) && (trial3))){
_locked = ((((_local1.isLevelLocked(_local2)) && (_local1.isLevelLocked(_local3)))) && (_local1.isLevelLocked(_local4)));
} else {
if (trial1){
_locked = _local1.isLevelLocked(_local2);
};
};
padlock.visible = ((_locked) && (!(GameApplication.LEVELS_DEBUGGING)));
if (trial1){
trial1.index = _local2;
trial1.active = ((((!(_locked)) && (!(_local1.isLevelLocked(_local2))))) || (GameApplication.LEVELS_DEBUGGING));
};
if (trial2){
trial2.index = _local3;
trial2.active = ((((!(_locked)) && (!(_local1.isLevelLocked(_local3))))) || (GameApplication.LEVELS_DEBUGGING));
};
if (trial3){
trial3.index = _local4;
trial3.active = ((((!(_locked)) && (!(_local1.isLevelLocked(_local4))))) || (GameApplication.LEVELS_DEBUGGING));
};
};
}
public function dispose():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
stopPlay();
if (trial1){
trial1.dispose();
removeChild(trial1);
trial1 = undefined;
};
if (trial2){
trial2.dispose();
removeChild(trial2);
trial2 = undefined;
};
if (trial3){
trial3.dispose();
removeChild(trial3);
trial3 = undefined;
};
removeChild(padlock);
padlock = undefined;
_locked = undefined;
}
public function get isScaling():Boolean{
return (Boolean(_tween));
}
public function scaleUp():void{
var t:LandButton;
if (((!((scaleX == MAX_SCALE))) || (!((scaleY == MAX_SCALE))))){
if (_tween){
_tween.kill();
};
t = this;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
_tween = new TweenLite(this, SCALE_TIME, {scaleX:MAX_SCALE, scaleY:MAX_SCALE, onComplete:function ():void{
_tween = undefined;
mouseChildren = true;
}});
};
}
public function scaleDown():void{
var t:LandButton;
if (((!((scaleX == MIN_SCALE))) || (!((scaleY == MIN_SCALE))))){
if (_tween){
_tween.kill();
};
t = this;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
_tween = new TweenLite(this, SCALE_TIME, {scaleX:MIN_SCALE, scaleY:MIN_SCALE, onComplete:function ():void{
_tween = undefined;
mouseChildren = false;
if (BITMAP_CACHE){
if (_playDir == 0){
cacheAsBitmap = true;
};
};
}});
};
}
public function scaleUpNow():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
scaleX = (scaleY = MAX_SCALE);
mouseChildren = true;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
}
public function scaleDownNow():void{
if (_tween){
_tween.kill();
_tween = undefined;
};
scaleX = (scaleY = MIN_SCALE);
mouseChildren = false;
if (BITMAP_CACHE){
if (_playDir == 0){
cacheAsBitmap = true;
};
};
}
public function get playDirection():int{
return (_playDir);
}
public function get isPlaying():Boolean{
return (!((_playDir == 0)));
}
public function directPlay(_arg1:Boolean=false):void{
if (_playDir == -1){
removeEventListener(Event.ENTER_FRAME, reversePlayHandler);
_playDir = 0;
};
if (_playDir == 1){
if (_arg1){
gotoAndStop(1);
};
} else {
if (_arg1){
gotoAndStop(1);
} else {
if (currentFrame == totalFrames){
return;
};
};
addEventListener(Event.ENTER_FRAME, directPlayHandler);
_playDir = 1;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
};
}
public function reversePlay(_arg1:Boolean=false):void{
if (_playDir == 1){
removeEventListener(Event.ENTER_FRAME, directPlayHandler);
_playDir = 0;
};
if (_playDir == -1){
if (_arg1){
gotoAndStop(totalFrames);
};
} else {
if (_arg1){
gotoAndStop(totalFrames);
} else {
if (currentFrame == 1){
return;
};
};
addEventListener(Event.ENTER_FRAME, reversePlayHandler);
_playDir = -1;
if (BITMAP_CACHE){
cacheAsBitmap = false;
};
};
}
public function stopPlay():void{
if (_playDir == -1){
removeEventListener(Event.ENTER_FRAME, reversePlayHandler);
} else {
if (_playDir == 1){
removeEventListener(Event.ENTER_FRAME, directPlayHandler);
};
};
if (BITMAP_CACHE){
if (((!(_tween)) && (!(_selected)))){
cacheAsBitmap = true;
};
};
}
public function gotoStart():void{
stopPlay();
gotoAndStop(1);
if (BITMAP_CACHE){
if (((!(_tween)) && (!(_selected)))){
cacheAsBitmap = true;
};
};
}
public function gotoEnd():void{
stopPlay();
gotoAndStop(totalFrames);
if (BITMAP_CACHE){
if (((!(_tween)) && (!(_selected)))){
cacheAsBitmap = true;
};
};
}
private function reversePlayHandler(_arg1:Event):void{
if (currentFrame == 1){
removeEventListener(Event.ENTER_FRAME, reversePlayHandler);
_playDir = 0;
if (BITMAP_CACHE){
if (((!(_tween)) && (!(_selected)))){
cacheAsBitmap = true;
};
};
} else {
prevFrame();
};
}
private function directPlayHandler(_arg1:Event):void{
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, directPlayHandler);
_playDir = 0;
if (BITMAP_CACHE){
if (((!(_tween)) && (!(_selected)))){
cacheAsBitmap = true;
};
};
} else {
nextFrame();
};
}
}
}//package lp.pge.menu.buttons
Section 326
//MapButton (lp.pge.menu.buttons.MapButton)
package lp.pge.menu.buttons {
import lp.pge.menu.*;
import lp.pge.gui.*;
public class MapButton extends Button {
public function MapButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
Menu.instance.openLevelSelection();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 327
//MenuButton (lp.pge.menu.buttons.MenuButton)
package lp.pge.menu.buttons {
import lp.pge.menu.*;
import lp.pge.gui.*;
public class MenuButton extends Button {
public function MenuButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
Menu.instance.returnToMenu();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 328
//MoreGamesButton (lp.pge.menu.buttons.MoreGamesButton)
package lp.pge.menu.buttons {
import lp.pge.*;
import flash.media.*;
import lp.pge.gui.*;
import flash.net.*;
public class MoreGamesButton extends Button {
private var _sound:Sound;
public function MoreGamesButton(){
_sound = new ButtonClickSound();
addFrameScript(0, frame1);
super();
clickAction = function ():void{
GameApplication.instance.trackEvent("/more-games");
_soundPlayer.play(_sound);
if (GameApplication.linksOut){
if (((GameApplication.moreLink) && (GameApplication.moreLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.moreLink), "_blank");
} catch(error:Error) {
};
};
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 329
//PlayButton (lp.pge.menu.buttons.PlayButton)
package lp.pge.menu.buttons {
import lp.pge.menu.*;
import flash.media.*;
import lp.pge.gui.*;
public class PlayButton extends Button {
private var _sound:Sound;
public function PlayButton(){
_sound = new ButtonClickSound();
addFrameScript(0, frame1);
super();
clickAction = function ():void{
_soundPlayer.play(_sound);
Menu.instance.openLevelSelection();
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 330
//SkipButton (lp.pge.menu.buttons.SkipButton)
package lp.pge.menu.buttons {
import flash.display.*;
import lp.pge.gui.*;
public class SkipButton extends Button {
public function SkipButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
_soundPlayer.play(new ButtonClickSound());
var _local1:MovieClip = (parent as MovieClip);
if (_local1){
if (_local1.currentFrame < 714){
_local1.gotoAndStop(_local1.totalFrames);
} else {
_local1.play();
};
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 331
//TrialButton (lp.pge.menu.buttons.TrialButton)
package lp.pge.menu.buttons {
import flash.events.*;
import lp.pge.*;
import lp.pge.menu.*;
import lp.pge.game.*;
import flash.display.*;
import lp.pge.media.*;
public class TrialButton extends MovieClip {
public var numberMC:MovieClip;
public var numberLockedMC:MovieClip;
public var hit:Sprite;
public var bg:MovieClip;
private var _index:int;// = -1
private var _numStars:uint;
private var _active:Boolean;
protected var _soundPlayer:SoundPlayer;
public function TrialButton(_arg1:uint=0){
_numStars = _arg1;
var _local2:uint = (1 + _numStars);
if (currentFrame != _local2){
gotoAndStop(_local2);
};
mouseChildren = false;
numberMC.visible = false;
_soundPlayer = new SoundPlayer(true);
SoundManager.instance.addPlayer(_soundPlayer);
}
public function get index():int{
return (_index);
}
public function set index(_arg1:int):void{
if (_arg1 == _index){
return;
};
_index = _arg1;
if (_index >= 0){
numberMC.gotoAndStop((_index + 2));
numberLockedMC.gotoAndStop((_index + 2));
numStars = LevelManager.instance.getLevelNumStars(_index);
} else {
numberMC.gotoAndStop(1);
numberLockedMC.gotoAndStop(1);
numStars = 0;
};
}
public function get numStars():uint{
return (_numStars);
}
public function set numStars(_arg1:uint):void{
if (_arg1 == _numStars){
return;
};
_numStars = _arg1;
var _local2:uint = (1 + _numStars);
if (currentFrame != _local2){
gotoAndStop(_local2);
};
}
public function dispose():void{
if (_active){
removeEventListener(MouseEvent.CLICK, onClick);
removeEventListener(MouseEvent.MOUSE_OUT, onOut);
removeEventListener(MouseEvent.MOUSE_OVER, onOver);
};
_active = undefined;
removeChild(numberMC);
numberMC = undefined;
removeChild(numberLockedMC);
numberLockedMC = undefined;
if (_soundPlayer){
if (_soundPlayer.isPlaying){
_soundPlayer.stop();
};
SoundManager.instance.disposePlayer(_soundPlayer);
_soundPlayer = undefined;
};
}
public function get active():Boolean{
return (_active);
}
public function set active(_arg1:Boolean):void{
if (_arg1 != _active){
_active = _arg1;
if (_active){
buttonMode = (useHandCursor = true);
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
numberMC.visible = true;
numberLockedMC.visible = false;
} else {
buttonMode = (useHandCursor = false);
removeEventListener(MouseEvent.CLICK, onClick);
removeEventListener(MouseEvent.MOUSE_OUT, onOut);
removeEventListener(MouseEvent.MOUSE_OVER, onOver);
numberMC.visible = false;
numberLockedMC.visible = true;
};
bg.gotoAndStop((_active) ? 2 : 1);
};
}
private function onClick(_arg1:MouseEvent):void{
_soundPlayer.play(new ButtonClickSound());
if (_index >= 0){
if (Game.instance.hasLevelAt(_index)){
if (((!(Game.instance.isLevelLocked(_index))) || (GameApplication.LEVELS_DEBUGGING))){
Menu.instance.returnToMenu();
Game.instance.loadLevel(_index);
Game.instance.startLevel();
GameApplication.instance.goToGame();
};
};
};
}
private function onOut(_arg1:MouseEvent):void{
var _local2:MovieClip = (numberMC.getChildByName("btn") as MovieClip);
if (_local2){
_local2.gotoAndStop(1);
};
}
private function onOver(_arg1:MouseEvent):void{
var _local2:MovieClip = (numberMC.getChildByName("btn") as MovieClip);
if (_local2){
_local2.gotoAndStop(2);
};
}
}
}//package lp.pge.menu.buttons
Section 332
//WalkthroughButton (lp.pge.menu.buttons.WalkthroughButton)
package lp.pge.menu.buttons {
import lp.pge.*;
import lp.pge.gui.*;
import flash.net.*;
public class WalkthroughButton extends Button {
public function WalkthroughButton(){
addFrameScript(0, frame1);
super();
_soundPlayer.playOnce = true;
clickAction = function ():void{
GameApplication.instance.trackEvent("/walkthrough");
_soundPlayer.play(new ButtonClickSound());
if (GameApplication.linksOut){
if (((GameApplication.helpLink) && (GameApplication.helpLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.helpLink), "_blank");
} catch(error:Error) {
};
};
};
};
}
function frame1(){
stop();
}
}
}//package lp.pge.menu.buttons
Section 333
//AchievementsWindow (lp.pge.menu.windows.AchievementsWindow)
package lp.pge.menu.windows {
import com.greensock.*;
import flash.events.*;
import lp.pge.game.*;
import lp.pge.menu.buttons.*;
import flash.display.*;
import lp.pge.gui.*;
public class AchievementsWindow extends Window {
public var cards:Sprite;
public var buttonsAnim:MovieClip;
private var _cards:Array;
private var _selectedCard:CardButton;
private var _tween:TweenLite;
private static const CENTER_X:Number = 360;
private static const CENTER_Y:Number = 190;
private static const CARDS_GAP:Number = 250;
public static const MIN_SCALE:Number = 0.5;
public static const MAX_SCALE:Number = 1;
public function AchievementsWindow(){
var _local1:CardButton;
super();
_cards = new Array();
addCard(new CardPants());
addCard(new CardShirt());
addCard(new CardJerkin());
addCard(new CardVest());
addCard(new CardHelmet());
addCard(new CardShield());
addCard(new CardAxe());
addCard(new CardBoots());
_cards[0].title = GameAchievements.PANTS_SID;
_cards[1].title = GameAchievements.SHIRT_SID;
_cards[2].title = GameAchievements.JERKIN_SID;
_cards[3].title = GameAchievements.VEST_SID;
_cards[4].title = GameAchievements.HELMET_SID;
_cards[5].title = GameAchievements.SHIELD_SID;
_cards[6].title = GameAchievements.AXE_SID;
_cards[7].title = GameAchievements.BOOTS_SID;
_selectedCard = _cards[0];
_selectedCard.selected = true;
_selectedCard.scaleUpNow();
cards.setChildIndex(_selectedCard, (cards.numChildren - 1));
buttonsAnim.gotoAndPlay(2);
addEventListener(Event.ENTER_FRAME, update);
}
override protected function onClose():void{
var _local1:CardButton;
removeEventListener(Event.ENTER_FRAME, update);
for each (_local1 in _cards) {
removeCard(_local1);
_local1.dispose();
};
}
private function update(_arg1:Event):void{
var _local2:int;
if (!_tween){
if ((((100 < mouseY)) && ((mouseY < 380)))){
_local2 = 0;
if (mouseX < 175){
_local2 = _cards.indexOf(_selectedCard);
if (_local2 > 0){
selectCard(_cards[(_local2 - 1)]);
};
} else {
if (mouseX > 545){
_local2 = _cards.indexOf(_selectedCard);
if (_local2 < (_cards.length - 1)){
selectCard(_cards[(_local2 + 1)]);
};
};
};
};
};
}
private function addCard(_arg1:CardButton):void{
_arg1.gotoAndStop(1);
var _local2:uint = _cards.length;
_cards.push(_arg1);
_arg1.name = ("land" + ((_local2)<10) ? ("0" + _local2) : _local2);
_arg1.index = _local2;
_arg1.scaleDownNow();
_arg1.x = (CENTER_X + (CARDS_GAP * _local2));
_arg1.y = CENTER_Y;
cards.addChild(_arg1);
}
private function removeCard(_arg1:CardButton):void{
cards.removeChild(_arg1);
}
private function onCardClick(_arg1:MouseEvent):void{
var _local2:CardButton = (_arg1.target as CardButton);
selectCard(_local2);
}
private function selectCard(_arg1:CardButton):void{
var $card = _arg1;
if ((($card) && (!($card.selected)))){
if (_tween){
_tween.kill();
};
if (_selectedCard){
_selectedCard.scaleDown();
_selectedCard.selected = false;
_selectedCard = undefined;
};
_selectedCard = $card;
_selectedCard.selected = true;
_selectedCard.scaleUp();
cards.setChildIndex(_selectedCard, (cards.numChildren - 1));
_tween = new TweenLite(cards, 1, {x:(-($card.x) + CENTER_X), onComplete:function ():void{
_tween = undefined;
}});
};
}
}
}//package lp.pge.menu.windows
Section 334
//CreditsWindow (lp.pge.menu.windows.CreditsWindow)
package lp.pge.menu.windows {
import flash.events.*;
import flash.display.*;
import lp.pge.gui.*;
public class CreditsWindow extends Window {
public var linkButton:MovieClip;
public function CreditsWindow(){
addFrameScript(19, frame20);
alignToCenter();
}
public function execute():void{
addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent):void{
if ((((_arg1.target == linkButton)) || ((_arg1.currentTarget == linkButton)))){
return;
};
removeEventListener(MouseEvent.CLICK, onClick);
close();
}
function frame20(){
stop();
execute();
}
}
}//package lp.pge.menu.windows
Section 335
//GuideWindow (lp.pge.menu.windows.GuideWindow)
package lp.pge.menu.windows {
import com.greensock.*;
import flash.events.*;
import flash.display.*;
import lp.pge.gui.*;
import flash.geom.*;
public class GuideWindow extends Window {
public var content:Sprite;
public var track:Sprite;
public var thumb:Sprite;
private var contStartPos:Number;
private var pathLength:Number;
private var thumbStartPos:Number;
private var thumbBounds:Rectangle;
private var scrollLength:Number;
private var tween:TweenLite;
public function GuideWindow(){
contStartPos = content.y;
pathLength = (track.height - thumb.height);
thumbStartPos = track.y;
thumbBounds = new Rectangle(thumb.x, thumbStartPos, 0, pathLength);
scrollLength = (content.height - 330);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
thumb.buttonMode = true;
thumb.useHandCursor = true;
}
private function mouseDownHandler(_arg1:MouseEvent):void{
thumb.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
thumb.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
thumb.startDrag(false, thumbBounds);
}
private function mouseUpHandler(_arg1:MouseEvent):void{
thumb.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
thumb.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
thumb.stopDrag();
}
private function mouseMoveHandler(_arg1:MouseEvent):void{
var $event = _arg1;
var progress:Number = ((thumb.y - thumbStartPos) / pathLength);
var ty:Number = (contStartPos - (scrollLength * progress));
if (tween){
tween.kill();
};
var dy:Number = (ty - content.y);
var dPr:Number = Math.abs((dy / scrollLength));
var speed:Number = (50 + (250 * dPr));
var time:Number = Math.abs((dy / speed));
tween = new TweenLite(content, time, {y:ty, onComplete:function ():void{
tween = undefined;
}});
}
}
}//package lp.pge.menu.windows
Section 336
//InstructionsWindow (lp.pge.menu.windows.InstructionsWindow)
package lp.pge.menu.windows {
import lp.pge.gui.*;
public class InstructionsWindow extends Window {
public function InstructionsWindow(){
alignToCenter();
}
}
}//package lp.pge.menu.windows
Section 337
//LevelSelectionWindow (lp.pge.menu.windows.LevelSelectionWindow)
package lp.pge.menu.windows {
import com.greensock.*;
import flash.events.*;
import lp.pge.menu.buttons.*;
import flash.display.*;
import lp.pge.gui.*;
public class LevelSelectionWindow extends Window {
public var lands:Sprite;
public var buttonsAnim:MovieClip;
private var _lands:Array;
private var _selectedLand:LandButton;
private var _tween:TweenLite;
private static const CENTER_X:Number = 360;
private static const CENTER_Y:Number = 240;
private static const LANDS_GAP:Number = 250;
public static const MIN_SCALE:Number = 0.5;
public static const MAX_SCALE:Number = 1;
public function LevelSelectionWindow(_arg1:uint=0){
var _local2:LandButton;
super();
_lands = new Array();
addLand(new Land00());
addLand(new Land01());
addLand(new Land02());
addLand(new Land03());
addLand(new Land04());
addLand(new Land05());
addLand(new Land06());
addLand(new Land07());
addLand(new Land08());
addLand(new Land09());
selectLandNow(_lands[_arg1]);
lands.setChildIndex(_selectedLand, (lands.numChildren - 1));
buttonsAnim.gotoAndPlay(2);
addEventListener(Event.ENTER_FRAME, update);
}
override protected function onClose():void{
var _local1:LandButton;
removeEventListener(Event.ENTER_FRAME, update);
for each (_local1 in _lands) {
removeLand(_local1);
_local1.dispose();
};
}
private function update(_arg1:Event):void{
var _local2:int;
if (!_tween){
if ((((100 < mouseY)) && ((mouseY < 380)))){
_local2 = 0;
if (mouseX < 175){
_local2 = _lands.indexOf(_selectedLand);
if (_local2 > 0){
selectLand(_lands[(_local2 - 1)]);
};
} else {
if (mouseX > 545){
_local2 = _lands.indexOf(_selectedLand);
if (_local2 < (_lands.length - 1)){
selectLand(_lands[(_local2 + 1)]);
};
};
};
};
};
}
private function addLand(_arg1:LandButton):void{
_arg1.gotoAndStop(1);
var _local2:uint = _lands.length;
_lands.push(_arg1);
_arg1.name = ("land" + ((_local2)<10) ? ("0" + _local2) : _local2);
_arg1.index = _local2;
_arg1.scaleDownNow();
_arg1.x = (CENTER_X + (LANDS_GAP * _local2));
_arg1.y = CENTER_Y;
lands.addChild(_arg1);
}
private function removeLand(_arg1:LandButton):void{
_arg1.stopPlay();
lands.removeChild(_arg1);
}
private function onLandClick(_arg1:MouseEvent):void{
var _local2:LandButton = (_arg1.target as LandButton);
selectLand(_local2);
}
private function selectLand(_arg1:LandButton):void{
var $land = _arg1;
if ((($land) && (!($land.selected)))){
if (_tween){
_tween.kill();
};
if (_selectedLand){
_selectedLand.selected = false;
_selectedLand.scaleDown();
if (!_selectedLand.locked){
_selectedLand.reversePlay();
};
_selectedLand = undefined;
};
_selectedLand = $land;
_selectedLand.selected = true;
_selectedLand.scaleUp();
lands.setChildIndex(_selectedLand, (lands.numChildren - 1));
_tween = new TweenLite(lands, 1, {x:(-($land.x) + CENTER_X), onComplete:function ():void{
_tween = undefined;
}, onUpdate:function ():void{
if (((!((_selectedLand.playDirection == 1))) && ((_tween.currentTime >= 0.25)))){
if (!_selectedLand.locked){
_selectedLand.directPlay();
};
};
}});
};
}
private function selectLandNow(_arg1:LandButton):void{
if (((_arg1) && (!(_arg1.selected)))){
if (_tween){
_tween.kill();
};
if (_selectedLand){
_selectedLand.selected = false;
_selectedLand.scaleDownNow();
_selectedLand.gotoStart();
_selectedLand = undefined;
};
_selectedLand = _arg1;
_selectedLand.selected = true;
_selectedLand.scaleUpNow();
_selectedLand.gotoEnd();
lands.setChildIndex(_selectedLand, (lands.numChildren - 1));
lands.x = (-(_arg1.x) + CENTER_X);
};
}
}
}//package lp.pge.menu.windows
Section 338
//MoviesWindow (lp.pge.menu.windows.MoviesWindow)
package lp.pge.menu.windows {
import lp.pge.gui.*;
public class MoviesWindow extends Window {
}
}//package lp.pge.menu.windows
Section 339
//Menu (lp.pge.menu.Menu)
package lp.pge.menu {
import flash.events.*;
import lp.pge.*;
import flash.display.*;
import lp.pge.gui.*;
public class Menu extends InteractiveScreen {
public var windowManager:MenuWindowManager;
public var cover:MovieClip;
private var _firstRun:Boolean;// = true
private static var _instance:Menu;
public function Menu(){
if (_instance){
throw (new Error("[Menu] : <Menu> : Only one instance of this class is allowed."));
};
_instance = this;
}
override public function show(_arg1:Event=null):void{
super.show();
if (!_firstRun){
if (cover.currentFrame < cover.totalFrames){
cover.gotoAndStop(cover.totalFrames);
};
cover.initButtons();
} else {
_firstRun = false;
};
}
override public function hide(_arg1:Event=null):void{
returnToMenu();
if (cover.currentFrame < cover.totalFrames){
cover.gotoAndStop(cover.totalFrames);
};
super.hide();
}
override public function set mute(_arg1:Boolean):void{
if (_arg1 == _mute){
return;
};
_mute = _arg1;
windowManager.mute = _mute;
}
public function openInstructions():void{
GameApplication.instance.trackEvent("/instructions");
if (cover.currentFrame < cover.totalFrames){
cover.gotoAndStop(cover.totalFrames);
};
windowManager.openInstructionsWindow();
}
public function openLevelSelection(_arg1:uint=0):void{
GameApplication.instance.trackEvent("/selection");
if (cover.currentFrame < cover.totalFrames){
cover.gotoAndStop(cover.totalFrames);
};
windowManager.openLevelSelectionWindow(_arg1);
}
public function openAchievements():void{
GameApplication.instance.trackEvent("/achievements");
windowManager.openAchievementsWindow();
}
public function openCredits():void{
GameApplication.instance.trackEvent("/credits");
windowManager.openCreditsWindow();
}
public function openMovies():void{
windowManager.openMoviesWindows();
}
public function openGuide():void{
GameApplication.instance.trackEvent("/guide");
windowManager.openGuideWindow();
}
public function returnToMenu():void{
if (windowManager.activeWindow){
windowManager.closeActiveWindow();
};
if (!_firstRun){
if (cover.currentFrame < cover.totalFrames){
cover.gotoAndStop(cover.totalFrames);
};
cover.initButtons();
};
}
public static function get instance():Menu{
return (_instance);
}
}
}//package lp.pge.menu
Section 340
//MenuWindowManager (lp.pge.menu.MenuWindowManager)
package lp.pge.menu {
import lp.pge.gui.*;
import lp.pge.menu.windows.*;
public class MenuWindowManager extends WindowManager {
private static var _instance:MenuWindowManager;
public function MenuWindowManager(){
if (_instance){
throw (new Error("[MenuWindowManager] : <MenuWindowManager> : Only one instance of this class is allowed."));
};
_instance = this;
}
public function openInstructionsWindow():void{
openActiveWindow(new InstructionsWindow());
}
public function openLevelSelectionWindow(_arg1:uint=0):void{
openActiveWindow(new LevelSelectionWindow(_arg1));
}
public function openAchievementsWindow():void{
openActiveWindow(new AchievementsWindow());
}
public function openCreditsWindow():void{
openActiveWindow(new CreditsWindow());
}
public function openMoviesWindows():void{
openActiveWindow(new MoviesWindow());
}
public function openGuideWindow():void{
openActiveWindow(new GuideWindow());
}
public static function get instance():MenuWindowManager{
return (_instance);
}
}
}//package lp.pge.menu
Section 341
//Console (lp.pge.system.Console)
package lp.pge.system {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.*;
import lp.pge.gui.*;
import lp.pge.*;
public class Console extends Sprite {
public var hScrollBar:HScrollBar;
public var vScrollBar:VScrollBar;
public var display:Sprite;
public var command_tf:TextField;
public var closeButton:Sprite;
private var _cont_mc:Sprite;
private var _mask_mc:Sprite;
private var _history_tf:TextField;
private static var _instance:Console;
public function Console(){
_instance = this;
_cont_mc = (display.getChildByName("cont_mc") as Sprite);
_mask_mc = (display.getChildByName("mask_mc") as Sprite);
_history_tf = (_cont_mc.getChildByName("history_tf") as TextField);
hScrollBar.attach(_cont_mc, _mask_mc);
vScrollBar.attach(_cont_mc, _mask_mc);
closeButton.addEventListener(MouseEvent.CLICK, onCloseButtonClick);
visible = false;
if (GameApplication.gameMode == "debug"){
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyboardKeyDown);
};
}
public function get active():Boolean{
return (((visible) && ((GameApplication.gameMode == "debug"))));
}
public function show():void{
visible = true;
}
public function hide():void{
visible = false;
}
public function clearHistory():void{
_history_tf.text = "";
}
public function clearCommand():void{
command_tf.text = "";
}
public function clearAll():void{
_history_tf.text = "";
command_tf.text = "";
}
public function addHistory(_arg1:String):void{
_history_tf.appendText((("> " + _arg1) + "\n"));
}
public function addMessage(_arg1:String):void{
_history_tf.appendText((_arg1 + "\n"));
}
public function getCommand():String{
return (command_tf.text);
}
public function executeCommand(_arg1:String):void{
var _local2:Array = _arg1.split(" ", 2);
var _local3:String = _local2[0];
var _local4:String = _local2[1];
var _local5:uint = _local2.length;
var _local6:uint = 1;
while (_local6 < _local5) {
if (_local2[_local6] == "/h"){
hide();
};
_local6++;
};
switch (_local3){
case "menu":
goToMenu();
addHistory(((_local3 + " : ") + _local4));
break;
case "game":
goToGame();
addHistory(((_local3 + " : ") + _local4));
break;
case "wipe":
wipeGameData();
addHistory(((_local3 + " : ") + _local4));
break;
case "loadLevel":
loadLevel(uint(_local4));
addHistory(((_local3 + " : ") + _local4));
break;
case "unloadLevel":
unloadLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "reloadLevel":
reloadLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "prevLevel":
prevLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "nextLevel":
nextLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "startLevel":
startLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "restartLevel":
restartLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "finishLevel":
finishLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "playLevel":
playLevel(uint(_local4));
addHistory(((_local3 + " : ") + _local4));
break;
case "replayLevel":
replayLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "winLevel":
winLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "loseLevel":
loseLevel();
addHistory(((_local3 + " : ") + _local4));
break;
case "skipLevel":
skipLevel(uint(_local4));
addHistory(((_local3 + " : ") + _local4));
break;
case "help":
addHistory(((_local3 + " : ") + _local4));
addMessage("Commands list:");
addMessage(" menu ()");
addMessage(" game ()");
addMessage(" loadLevel (arg1)");
addMessage(" arg1 - zero-based index of level");
addMessage(" unloadLevel ()");
addMessage(" reloadLevel ()");
addMessage(" prevLevel ()");
addMessage(" nextLevel ()");
addMessage(" startLevel ()");
addMessage(" finishLevel ()");
addMessage(" playLevel ()");
addMessage(" replayLevel ()");
addMessage(" winLevel ()");
addMessage(" loseLevel ()");
addMessage(" enableLevel ()");
addMessage(" disableLevel ()");
addMessage(" help ()");
addMessage(" clear ()");
addMessage(" quit ()");
addMessage(" exit ()");
break;
case "exit":
addHistory(((_local3 + " : ") + _local4));
visible = false;
break;
case "quit":
addHistory(((_local3 + " : ") + _local4));
visible = false;
break;
case "clear":
clearHistory();
break;
default:
if (_local3 != ""){
addHistory((("Unknown command '" + _local3) + "'."));
};
};
}
private function onCloseButtonClick(_arg1:MouseEvent):void{
hide();
}
private function onKeyboardKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 67){
if (!visible){
show();
} else {
if (stage.focus != command_tf){
hide();
};
};
} else {
if (_arg1.keyCode == 13){
if (stage.focus == command_tf){
executeCommand(command_tf.text);
};
};
};
}
public static function get instance():Console{
return (_instance);
}
public static function goToMenu():void{
GameApplication.instance.goToMenu();
}
public static function goToGame():void{
GameApplication.instance.goToGame();
}
public static function wipeGameData():void{
if (LevelManager.instance){
LevelManager.instance.wipe();
};
}
public static function registerLevel(_arg1:Class, _arg2:uint):void{
if (Game.instance){
Game.instance.registerLevel(_arg1, _arg2);
} else {
throw (new Error("[Console] : <registerLevel> : Game instance isn't exists."));
};
}
public static function unregisterLevel(_arg1:uint):void{
if (Game.instance){
Game.instance.unregisterLevel(_arg1);
} else {
throw (new Error("[Console] : <unregisterLevel> : Game instance isn't exists."));
};
}
public static function getCurrentLevel():Level{
if (Game.instance){
return (Game.instance.getCurrentLevel());
};
throw (new Error("[Console] : <getCurrentLevel> : Game instance isn't exists."));
}
public static function getCurrentLevelIndex():int{
if (Game.instance){
return (Game.instance.getCurrentLevelIndex());
};
throw (new Error("[Console] : <getCurrentLevelIndex> : Game instance isn't exists."));
}
public static function loadLevel(_arg1:uint):void{
if (Game.instance){
Game.instance.loadLevel(_arg1);
} else {
throw (new Error("[Console] : <loadLevel> : Game instance isn't exists."));
};
}
public static function unloadLevel():void{
if (Game.instance){
Game.instance.unloadLevel();
} else {
throw (new Error("[Console] : <unloadLevel> : Game instance isn't exists."));
};
}
public static function reloadLevel():void{
var _local1:int;
if (Game.instance){
_local1 = Game.instance.getCurrentLevelIndex();
Game.instance.unloadLevel();
Game.instance.loadLevel(_local1);
} else {
throw (new Error("[Console] : <reloadLevel> : Game instance isn't exists."));
};
}
public static function prevLevel():void{
if (Game.instance){
Game.instance.prevLevel();
} else {
throw (new Error("[Console] : <prevLevel> : Game instance isn't exists."));
};
}
public static function nextLevel():void{
if (Game.instance){
Game.instance.nextLevel();
} else {
throw (new Error("[Console] : <nextLevel> : Game instance isn't exists."));
};
}
public static function startLevel():void{
if (Game.instance){
Game.instance.startLevel();
} else {
throw (new Error("[Console] : <startLevel> : Game instance isn't exists."));
};
}
public static function restartLevel():void{
if (Game.instance){
Game.instance.restartLevel();
} else {
throw (new Error("[Console] : <restartLevel> : Game instance isn't exists."));
};
}
public static function finishLevel():void{
if (Game.instance){
Game.instance.finishLevel();
} else {
throw (new Error("[Console] : <finishLevel> : Game instance isn't exists."));
};
}
public static function playLevel(_arg1:uint):void{
if (Game.instance){
Game.instance.loadLevel(_arg1);
} else {
throw (new Error("[Console] : <playLevel> : Game instance isn't exists."));
};
}
public static function replayLevel():void{
if (Game.instance){
Game.instance.restartLevel();
} else {
throw (new Error("[Console] : <replayLevel> : Game instance isn't exists."));
};
}
public static function winLevel():void{
if (Game.instance){
Game.instance.getCurrentLevel().win();
} else {
throw (new Error("[Console] : <winLevel> : Game instance isn't exists."));
};
}
public static function loseLevel():void{
if (Game.instance){
Game.instance.getCurrentLevel().lose();
} else {
throw (new Error("[Console] : <loseLevel> : Game instance isn't exists."));
};
}
public static function skipLevel(_arg1:uint=0):void{
if (Game.instance){
Game.instance.getCurrentLevel().skip(_arg1);
} else {
throw (new Error("[Console] : <skipLevel> : Game instance isn't exists."));
};
}
public static function isPrevLevel():Boolean{
if (Game.instance){
return (Game.instance.isPrevLevel());
};
throw (new Error("[Console] : <isPrevLevel> : Game instance isn't exists."));
}
public static function isNextLevel():Boolean{
if (Game.instance){
return (Game.instance.isNextLevel());
};
throw (new Error("[Console] : <isNextLevel> : Game instance isn't exists."));
}
}
}//package lp.pge.system
Section 342
//Key (lp.pge.ui.keyboard.Key)
package lp.pge.ui.keyboard {
import flash.events.*;
import flash.display.*;
import flash.errors.*;
public class Key {
public static const BACKSPACE:uint = 8;
public static const TAB:uint = 9;
public static const ENTER:uint = 13;
public static const SHIFT:uint = 16;
public static const CONTROL:uint = 17;
public static const ALT:uint = 18;
public static const PAUSE:uint = 19;
public static const CAPSLOCK:uint = 20;
public static const ESCAPE:uint = 27;
public static const INSERT:uint = 45;
public static const DELETE:uint = 46;
public static const SPACE:uint = 32;
public static const PAGEUP:uint = 33;
public static const PAGEDOWN:uint = 34;
public static const END:uint = 35;
public static const HOME:uint = 36;
public static const LEFT:uint = 37;
public static const UP:uint = 38;
public static const RIGHT:uint = 39;
public static const DOWN:uint = 40;
public static const DIGIT_0:uint = 48;
public static const DIGIT_1:uint = 49;
public static const DIGIT_2:uint = 50;
public static const DIGIT_3:uint = 51;
public static const DIGIT_4:uint = 52;
public static const DIGIT_5:uint = 53;
public static const DIGIT_6:uint = 54;
public static const DIGIT_7:uint = 55;
public static const DIGIT_8:uint = 56;
public static const DIGIT_9:uint = 57;
public static const A:uint = 65;
public static const B:uint = 66;
public static const C:uint = 67;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const H:uint = 72;
public static const I:uint = 73;
public static const J:uint = 74;
public static const K:uint = 75;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const O:uint = 79;
public static const P:uint = 80;
public static const Q:uint = 81;
public static const R:uint = 82;
public static const S:uint = 83;
public static const T:uint = 84;
public static const U:uint = 85;
public static const V:uint = 86;
public static const W:uint = 87;
public static const X:uint = 88;
public static const Y:uint = 89;
public static const Z:uint = 90;
public static const F1:uint = 112;
public static const F2:uint = 113;
public static const F3:uint = 114;
public static const F4:uint = 115;
public static const F5:uint = 116;
public static const F6:uint = 117;
public static const F7:uint = 118;
public static const F8:uint = 119;
public static const F9:uint = 120;
public static const F10:uint = 121;
public static const F11:uint = 122;
public static const F12:uint = 123;
public static const NUMLOCK:uint = 144;
public static const SCROLLLOCK:uint = 145;
private static var _stage:Stage;
private static var _keyCode:int;
private static var _keys:Array;
private static var _listeners:Array;
private static var _accessible:Boolean;
public function Key(){
throw (new IllegalOperationError("[Key] : <Key> : This class is static and can't be instantiated."));
}
public static function activate(_arg1:DisplayObject):void{
if (!_accessible){
_keyCode = -1;
_keys = new Array();
_listeners = new Array();
_stage = _arg1.stage;
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_accessible = true;
};
}
public static function deactivate():void{
if (_accessible){
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_keys = undefined;
_listeners = undefined;
_keyCode = -1;
_accessible = false;
_stage = undefined;
};
}
public static function addListener(_arg1:Object):Boolean{
if (_accessible){
_listeners.push(_arg1);
return (true);
};
return (false);
}
public static function removeListener(_arg1:Object):Boolean{
var _local2:uint;
var _local3:uint;
if (_accessible){
_local2 = _listeners.length;
_local3 = 0;
while (_local3 < _local2) {
if (_listeners[_local3] == _arg1){
_listeners.splice(_local3, 1);
return (true);
};
_local3++;
};
};
return (false);
}
public static function getAscii():int{
return (_keyCode);
}
public static function getCode():int{
return (_keyCode);
}
public static function isAccessible():Boolean{
return (_accessible);
}
public static function isDown(_arg1:uint):Boolean{
return (_keys[_arg1]);
}
public static function isToggled(_arg1:Number):Boolean{
if ((((_arg1 == CAPSLOCK)) || ((_arg1 == NUMLOCK)))){
return (_keys[_arg1]);
};
return (false);
}
private static function keyDownHandler(_arg1:KeyboardEvent):void{
var _local4:Object;
_keys[_arg1.keyCode] = true;
_keyCode = _arg1.keyCode;
var _local2:uint = _listeners.length;
var _local3:uint;
while (_local3 < _local2) {
_local4 = _listeners[_local3];
if ((_local4.onKeyDown is Function)){
_local4.onKeyDown();
};
_local3++;
};
}
private static function keyUpHandler(_arg1:KeyboardEvent):void{
var _local4:Object;
_keys[_arg1.keyCode] = false;
_keyCode = _arg1.keyCode;
var _local2:uint = _listeners.length;
var _local3:uint;
while (_local3 < _local2) {
_local4 = _listeners[_local3];
if ((_local4.onKeyUp is Function)){
_local4.onKeyUp();
};
_local3++;
};
}
}
}//package lp.pge.ui.keyboard
Section 343
//KeyboardController (lp.pge.ui.keyboard.KeyboardController)
package lp.pge.ui.keyboard {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.errors.*;
public class KeyboardController {
private static var _keysConf:Array = new Array();
private static var _keysTime:Array = new Array();
private static var _keysDown:Array = new Array();
private static var _listener:DisplayObject;
private static var _lastKey:int = -1;
private static var _clickTimeLimit:Number = 250;
private static var _enabled:Boolean = true;
public function KeyboardController(){
throw (new IllegalOperationError("[KeyboardController] : <KeyboardController> : This class is static and can't be instantiated."));
}
public function enabled():Boolean{
return (_enabled);
}
public function added():Boolean{
return (Boolean(_listener));
}
public static function get clickTimeLimit():Number{
return (_clickTimeLimit);
}
public static function set clickTimeLimit(_arg1:Number):void{
if (_arg1 > 0){
_clickTimeLimit = _arg1;
} else {
throw (new Error("[KeyboardController] : <clickTimeLimit> : Value must be greater than 0."));
};
}
public static function enable():void{
_enabled = true;
}
public static function disable():void{
_enabled = false;
}
public static function isKeyDown(_arg1:uint):Boolean{
return (_keysDown[_arg1]);
}
public static function isKeyUp(_arg1:uint):Boolean{
return (!(_keysDown[_arg1]));
}
public static function addController(_arg1:DisplayObject):void{
if (_listener){
throw (new Error("[KeyboardController] : <addController> : Controller already added."));
};
_listener = _arg1;
initController();
}
public static function removeController():void{
if (!_listener){
throw (new Error("[KeyboardController] : <removeController> : Controller isn't added."));
};
haltController();
_listener = undefined;
}
public static function changeController(_arg1:DisplayObject):void{
if (_listener){
haltController();
_listener = undefined;
};
_listener = _arg1;
initController();
}
public static function bindKey(_arg1:uint, _arg2:Function=null, _arg3:String="full", _arg4:Object=null):void{
if (_keysConf[_arg1]){
trace("[KeyboardController] : <bindKey> : Key functionality changed.");
};
var _local5:Function = (((_arg4) && ((_arg4["onDown"] is Function)))) ? _arg4["onDown"] : null;
var _local6:Function = (((_arg4) && ((_arg4["onUp"] is Function)))) ? _arg4["onUp"] : null;
var _local7:Function = (((_arg4) && ((_arg4["onClick"] is Function)))) ? _arg4["onClick"] : null;
_keysConf[_arg1] = {handler:_arg2, mode:_arg3, onDown:_local5, onUp:_local6, onClick:_local7};
}
public static function unbindKey(_arg1:uint):void{
if (!_keysConf[_arg1]){
throw (new Error("[KeyboardController] : <unbindKey> : Key has no functionality."));
};
_keysConf[_arg1] = undefined;
}
public static function bindKeyClick(_arg1:uint, _arg2:Function):void{
if (_keysConf[_arg1]){
trace("[KeyboardController] : <bindKeyClick> : Key functionality changed.");
};
_keysConf[_arg1] = {handler:null, mode:"click", onDown:null, onUp:null, onClick:_arg2};
}
public static function bindKeyDown(_arg1:uint, _arg2:Function, _arg3:Boolean=true):void{
if (_keysConf[_arg1]){
trace("[KeyboardController] : <bindKeyDown> : Key functionality changed.");
};
_keysConf[_arg1] = {handler:null, mode:"down", onDown:_arg2, onUp:null, onClick:null, repeat:_arg3};
}
public static function bindKeyUp(_arg1:uint, _arg2:Function):void{
if (_keysConf[_arg1]){
trace("[KeyboardController] : <bindKeyUp> : Key functionality changed.");
};
_keysConf[_arg1] = {handler:null, mode:"up", onDown:null, onUp:_arg2, onClick:null};
}
private static function initController():void{
if (_listener){
_listener.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_listener.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_listener.addEventListener(Event.ENTER_FRAME, keyRepeater);
};
}
private static function haltController():void{
if (_listener){
if (_listener.hasEventListener(KeyboardEvent.KEY_DOWN)){
_listener.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
if (_listener.hasEventListener(KeyboardEvent.KEY_UP)){
_listener.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
if (_listener.hasEventListener(Event.ENTER_FRAME)){
_listener.removeEventListener(Event.ENTER_FRAME, keyRepeater);
};
};
}
private static function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int = _arg1.keyCode;
_keysDown[_local2] = true;
if (_lastKey == _local2){
return;
};
if (_keysConf[_local2]){
if ((((((_keysConf[_local2].mode == "down")) || ((_keysConf[_local2].mode == "full")))) || ((_keysConf[_local2].mode == "click")))){
if (!_keysTime[_local2]){
_keysTime[_local2] = getTimer();
};
if (_lastKey != _local2){
_lastKey = _local2;
};
if (!_enabled){
return;
};
if ((_keysConf[_local2].handler is Function)){
_keysConf[_local2].handler({keyCode:_local2, keyLocation:_arg1.keyLocation, charCode:_arg1.charCode, state:"DOWN"});
};
if ((_keysConf[_local2].onDown is Function)){
_keysConf[_local2].onDown({keyCode:_local2});
};
};
};
}
private static function keyUpHandler(_arg1:KeyboardEvent):void{
var _local4:Number;
var _local2:int = _arg1.keyCode;
delete _keysDown[_local2];
_lastKey = -1;
var _local3:Object = _keysConf[_local2];
if (_local3){
if ((((((_local3.mode == "up")) || ((_local3.mode == "full")))) || ((_local3.mode == "click")))){
_local4 = (getTimer() - _keysTime[_local2]);
if (_local3.mode == "up"){
_local4 = 0;
};
_keysTime[_local2] = 0;
if (!_enabled){
return;
};
if ((_local3.handler is Function)){
_local3.handler({keyCode:_local2, keyLocation:_arg1.keyLocation, charCode:_arg1.charCode, state:"UP"});
};
if ((_local3.onUp is Function)){
_local3.onUp({keyCode:_local2});
};
if (_local4 <= _clickTimeLimit){
if ((_local3.onClick is Function)){
_local3.onClick({keyCode:_local2});
};
};
};
};
}
private static function keyRepeater(_arg1:Event):void{
var _local4:Object;
if (!_enabled){
return;
};
var _local2:uint = _keysDown.length;
var _local3:uint;
while (_local3 < _local2) {
if (_keysDown[_local3]){
_local4 = _keysConf[_local3];
if (_local4){
if (!_local4.repeat){
} else {
if ((_local4["onDown"] is Function)){
var _local5 = _local4;
_local5["onDown"]();
};
};
};
};
_local3++;
};
}
}
}//package lp.pge.ui.keyboard
Section 344
//GameApplication (lp.pge.GameApplication)
package lp.pge {
import lp.pge.media.*;
import flash.events.*;
import flash.display.*;
import com.google.analytics.*;
import lp.pge.system.*;
import lp.pge.gui.*;
import lp.pge.ui.keyboard.*;
import flash.utils.*;
public class GameApplication extends MovieClip {
public var preloader:MovieClip;
public var cursor:Cursor;
public var content:MovieClip;
public var console:Console;
public var message:MovieClip;
private var _menu:InteractiveScreen;
private var _game:InteractiveScreen;
private var _music:MusicPlayer;
private var _soundMan:SoundManager;
private var _verified:Boolean;
private var _ready:Boolean;
private var _mute:Boolean;
private var _active:Boolean;
private var _soundMode:uint;
private var _tracker:AnalyticsTracker;
public static const APPL_FPS:Number = 24;
public static const APPL_HEIGHT:Number = 480;
public static const APPL_WIDTH:Number = 720;
public static const NONE_SOUND_MODE:uint = 0;
public static const MENU_SOUND_MODE:uint = 1;
public static const INFO_SOUND_MODE:uint = 2;
public static const PLAY_SOUND_MODE:uint = 3;
public static const DONE_SOUND_MODE:uint = 4;
public static const LEVELS_DEBUGGING:Boolean = false;
private static const GAME_NAME:String = "viking";
private static const GAME_MODE:String = "normal";
private static const PERMITTED_HOSTS:Array = ["sogood.com"];
private static const FORBIDDEN_HOSTS:Array = [];
private static const HOST_LOCK:Boolean = false;
private static const BAN_HOSTS:Boolean = false;
private static const LINKS_OUT:Boolean = true;
private static const LOGO_LINK:String = "http://www.paraart.com";
private static const MORE_LINK:String = "http://sogood.com";
private static const HELP_LINK:String = "http://sogood.com/game/310/Armed_To_The_Teeth_walkthrough.html";
private static var _instance:GameApplication;
private static var _fullURL:String;
private static var _baseURL:String;
private static var _hostName:String;
private static var _fileName:String;
private static var _protocol:String;
private static var _wwwFound:Boolean;
public function GameApplication(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
if (_instance){
throw (new Error("[GameApplication] : <GameApplication> : Only one instance of this class is allowed."));
};
_instance = this;
try {
MochiBot.track(this, "b1557fcc");
} catch(error:Error) {
};
try {
MochiBot.track(this, "38c8c26d");
} catch(error:Error) {
};
_tracker = new GATracker(this, "UA-43605778-1", "AS3", false);
trackEvent("/launch");
stage.addEventListener(Event.ACTIVATE, onActivate);
stage.addEventListener(Event.DEACTIVATE, onDeactivate);
verify();
}
public function get ready():Boolean{
return (_ready);
}
public function get verified():Boolean{
return (_verified);
}
public function trackEvent(_arg1:String):void{
var $eventId = _arg1;
try {
_tracker.trackPageview($eventId);
} catch(error:Error) {
};
}
public function init():void{
if (_ready){
throw (new Error("[GameApplication] : <init> : Application already initialized."));
};
trackEvent("/view");
stage.stageFocusRect = false;
KeyboardController.addController(stage);
_soundMan = new SoundManager();
var _local1:Class = (getDefinitionByName("lp.pge.menu.Menu") as Class);
var _local2:Class = (getDefinitionByName("lp.pge.game.Game") as Class);
_menu = new (_local1);
_game = new (_local2);
_music = new MusicPlayer();
_music.volume = 1;
_music.play(new MainTheme());
_ready = true;
cursor.launch();
}
public function get mute():Boolean{
return (_mute);
}
public function set mute(_arg1:Boolean):void{
var _local2:*;
_soundMan.mute = (_mute = _arg1);
if (!_mute){
if (isInMenu){
_music.mute = false;
} else {
if (isInGame){
_local2 = _game["getCurrentLevel"]();
if (_local2){
_music.mute = (((_local2.state == "playing")) || ((_local2.state == "paused")));
} else {
_music.mute = false;
};
};
};
} else {
_music.mute = _mute;
};
dispatchEvent(new GameApplicationEvent((_mute) ? GameApplicationEvent.APP_MUTE : GameApplicationEvent.APP_UNMUTE));
}
public function get soundMode():uint{
return (_soundMode);
}
public function set soundMode(_arg1:uint):void{
if (_arg1 == _soundMode){
return;
};
_soundMode = _arg1;
if (_soundMode == MENU_SOUND_MODE){
_music.play(null, 0);
_music.mute = _mute;
_menu.mute = _mute;
_game.mute = true;
} else {
if (_soundMode == INFO_SOUND_MODE){
_music.play(null, 6000);
_music.mute = _mute;
_menu.mute = true;
_game["soundMode"] = _soundMode;
_game.mute = _mute;
} else {
if (_soundMode == PLAY_SOUND_MODE){
_music.mute = true;
_menu.mute = true;
_game["soundMode"] = _soundMode;
_game.mute = _mute;
} else {
if (_soundMode == DONE_SOUND_MODE){
_music.play(null, 6000);
_music.mute = _mute;
_menu.mute = true;
_game["soundMode"] = _soundMode;
_game.mute = _mute;
} else {
mute = false;
};
};
};
};
}
public function get isInGame():Boolean{
return ((content.getChildAt(0) == _game));
}
public function get isInMenu():Boolean{
return ((content.getChildAt(0) == _menu));
}
public function goToGame():void{
if (!_ready){
throw (new Error("[GameApplication] : <goToGame> : Application not ready."));
};
if (content.numChildren){
if (content.getChildAt(0) != _game){
hideMenu();
showGame();
};
} else {
showGame();
};
}
public function goToMenu():void{
if (!_ready){
throw (new Error("[GameApplication] : <goToMenu> : Application not ready."));
};
if (content.numChildren){
if (content.getChildAt(0) != _menu){
hideGame();
showMenu();
};
} else {
showMenu();
};
}
private function hideGame():void{
_game.hide();
content.removeChild(_game);
}
private function showGame():void{
soundMode = PLAY_SOUND_MODE;
cursor.show();
_game.show();
content.addChildAt(_game, 0);
stage.focus = _game;
}
private function hideMenu():void{
_menu.hide();
content.removeChild(_menu);
}
private function showMenu():void{
soundMode = MENU_SOUND_MODE;
cursor.hide();
_menu.show();
content.addChildAt(_menu, 0);
stage.focus = _menu;
}
private function verify():void{
var _local1:Boolean;
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:Array;
stop();
_fullURL = loaderInfo.url;
if (_fullURL.indexOf("http://") != -1){
_protocol = "http";
_local2 = _fullURL.split("http://")[1];
_baseURL = _local2;
_hostName = _local2.split("/")[0];
} else {
if (_fullURL.indexOf("https://") != -1){
_protocol = "https";
_local3 = _fullURL.split("https://")[1];
_baseURL = _local3;
_hostName = _local3.split("/")[0];
} else {
if (_fullURL.indexOf("app:/") != -1){
_protocol = "app";
_baseURL = "app:/";
_hostName = "androidapp";
_fileName = _fullURL.split("app:/")[1];
} else {
_protocol = "file";
_local4 = _fullURL.split("file://")[1];
_baseURL = _local4;
_hostName = "localhost";
};
};
};
if (_hostName.indexOf("www.") != -1){
_wwwFound = true;
_hostName = _hostName.split("www.")[1];
};
if (_protocol != "app"){
_local5 = _baseURL.split("/");
_fileName = _local5.pop();
_baseURL = _local5.join("/");
_baseURL = ((_protocol + "://") + _baseURL);
};
trace("VERIFICATION RESULT:");
trace((" full URL : " + _fullURL));
trace((" protocol : " + _protocol));
trace((" base URL : " + _baseURL));
trace((" www found: " + _wwwFound));
trace((" host name: " + _hostName));
trace((" file name: " + _fileName));
if (((_hostName) && (_hostName.length))){
_verified = !((PERMITTED_HOSTS.indexOf(_hostName) == -1));
};
if (HOST_LOCK){
_local1 = _verified;
} else {
_local1 = ((!(BAN_HOSTS)) || (((BAN_HOSTS) && ((FORBIDDEN_HOSTS.indexOf(_hostName) == -1)))));
};
if (_local1){
if ((((loaderInfo.bytesTotal > 0)) && ((loaderInfo.bytesLoaded == loaderInfo.bytesTotal)))){
preloader.gotoAndStop(300);
trace((((loaderInfo.bytesLoaded + "/") + loaderInfo.bytesTotal) + " (100%)"));
trace("[%] LOADING COMPLETE");
nextFrame();
} else {
loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgressClient);
loaderInfo.addEventListener(Event.COMPLETE, whenCompleteClient);
};
} else {
if (preloader){
preloader.gotoAndStop(1);
};
visible = false;
};
}
private function showProgress(_arg1:ProgressEvent):void{
if (_arg1.bytesTotal <= 0){
return;
};
var _local2:Number = (_arg1.bytesLoaded / _arg1.bytesTotal);
var _local3:Number = Math.floor((_local2 * 100));
if (preloader){
preloader.progress = _local2;
};
trace((((((_arg1.bytesLoaded + "/") + _arg1.bytesTotal) + " (") + _local3) + "%)"));
if (_arg1.bytesLoaded == _arg1.bytesTotal){
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, showProgress);
loaderInfo.removeEventListener(Event.COMPLETE, whenComplete);
trace("[%] LOADING COMPLETE");
nextFrame();
};
}
private function whenComplete(_arg1:Event):void{
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, showProgress);
loaderInfo.removeEventListener(Event.COMPLETE, whenComplete);
trace("[%] LOADING COMPLETE");
nextFrame();
}
private function showProgressClient(_arg1:ProgressEvent):void{
if (_arg1.bytesTotal <= 0){
return;
};
var _local2:Number = (_arg1.bytesLoaded / _arg1.bytesTotal);
var _local3:Number = Math.floor((_local2 * 100));
preloader.gotoAndStop(Math.floor((_local2 * 300)));
trace((((((_arg1.bytesLoaded + "/") + _arg1.bytesTotal) + " (") + _local3) + "%)"));
}
private function whenCompleteClient(_arg1:Event):void{
preloader.gotoAndStop(300);
trace((((loaderInfo.bytesLoaded + "/") + loaderInfo.bytesTotal) + " (100%)"));
trace("[%] LOADING COMPLETE");
nextFrame();
}
private function onActivate(_arg1:Event):void{
}
private function onDeactivate(_arg1:Event):void{
}
private function activate():void{
stage.frameRate = APPL_FPS;
}
private function deactivate():void{
stage.frameRate = 0;
}
function frame1(){
trace("+------------------------------------------------+");
trace("| LOADING |");
trace("+------------------------------------------------+");
stop();
}
function frame2(){
trace("+------------------------------------------------+");
trace("| CLIENT SPLASH SCREEN |");
trace("+------------------------------------------------+");
stop();
}
function frame3(){
trace("+------------------------------------------------+");
trace("| PARAART SPLASH SCREEN |");
trace("+------------------------------------------------+");
stop();
}
function frame4(){
trace("+------------------------------------------------+");
trace("| EXPORTING CLASSES |");
trace("+------------------------------------------------+");
nextFrame();
}
function frame5(){
trace("+------------------------------------------------+");
trace("| RUNNING |");
trace("+------------------------------------------------+");
stop();
}
public static function get instance():GameApplication{
return (_instance);
}
public static function get gameName():String{
return (GAME_NAME);
}
public static function get gameMode():String{
return (GAME_MODE);
}
public static function get hostLock():Boolean{
return (HOST_LOCK);
}
public static function get banHosts():Boolean{
return (BAN_HOSTS);
}
public static function get hostName():String{
return (_hostName);
}
public static function get fileName():String{
return (_fileName);
}
public static function get linksOut():Boolean{
return (LINKS_OUT);
}
public static function get logoLink():String{
return (LOGO_LINK);
}
public static function get moreLink():String{
return (MORE_LINK);
}
public static function get helpLink():String{
return (HELP_LINK);
}
public static function get isDesktop():Boolean{
return (!((_protocol == "app")));
}
public static function get isMobile():Boolean{
return ((_protocol == "app"));
}
}
}//package lp.pge
Section 345
//GameApplicationEvent (lp.pge.GameApplicationEvent)
package lp.pge {
import flash.events.*;
public class GameApplicationEvent extends Event {
protected var _data;
public static const APP_MUTE:String = "appMute";
public static const APP_UNMUTE:String = "appUnmute";
public static const LOAD_DATA_COMPLETE:String = "loadDataComplete";
public static const LOAD_DATA_ERROR:String = "loadDataError";
public static const SAVE_DATA_COMPLETE:String = "saveDataComplete";
public static const SAVE_DATA_ERROR:String = "saveDataError";
public function GameApplicationEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4=null){
super(_arg1, _arg2, _arg3);
_data = _arg4;
}
public function get data(){
return (_data);
}
public function set data(_arg1):void{
_data = _arg1;
}
override public function clone():Event{
return (new GameApplicationEvent(type, bubbles, cancelable, _data));
}
}
}//package lp.pge
Section 346
//_00_1077 (Viking_fla._00_1077)
package Viking_fla {
import flash.display.*;
public dynamic class _00_1077 extends MovieClip {
public function _00_1077(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 347
//_01_1078 (Viking_fla._01_1078)
package Viking_fla {
import flash.display.*;
public dynamic class _01_1078 extends MovieClip {
public function _01_1078(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 348
//_02_1079 (Viking_fla._02_1079)
package Viking_fla {
import flash.display.*;
public dynamic class _02_1079 extends MovieClip {
public function _02_1079(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 349
//_03_1080 (Viking_fla._03_1080)
package Viking_fla {
import flash.display.*;
public dynamic class _03_1080 extends MovieClip {
public function _03_1080(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 350
//_04_1081 (Viking_fla._04_1081)
package Viking_fla {
import flash.display.*;
public dynamic class _04_1081 extends MovieClip {
public function _04_1081(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 351
//_05_1082 (Viking_fla._05_1082)
package Viking_fla {
import flash.display.*;
public dynamic class _05_1082 extends MovieClip {
public function _05_1082(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 352
//_06_1083 (Viking_fla._06_1083)
package Viking_fla {
import flash.display.*;
public dynamic class _06_1083 extends MovieClip {
public function _06_1083(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 353
//_07_1084 (Viking_fla._07_1084)
package Viking_fla {
import flash.display.*;
public dynamic class _07_1084 extends MovieClip {
public function _07_1084(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 354
//_08_1085 (Viking_fla._08_1085)
package Viking_fla {
import flash.display.*;
public dynamic class _08_1085 extends MovieClip {
public function _08_1085(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 355
//_09_1086 (Viking_fla._09_1086)
package Viking_fla {
import flash.display.*;
public dynamic class _09_1086 extends MovieClip {
public function _09_1086(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 356
//_10_1087 (Viking_fla._10_1087)
package Viking_fla {
import flash.display.*;
public dynamic class _10_1087 extends MovieClip {
public function _10_1087(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 357
//_11_1088 (Viking_fla._11_1088)
package Viking_fla {
import flash.display.*;
public dynamic class _11_1088 extends MovieClip {
public function _11_1088(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 358
//_12_1089 (Viking_fla._12_1089)
package Viking_fla {
import flash.display.*;
public dynamic class _12_1089 extends MovieClip {
public function _12_1089(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 359
//_13_1090 (Viking_fla._13_1090)
package Viking_fla {
import flash.display.*;
public dynamic class _13_1090 extends MovieClip {
public function _13_1090(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 360
//_14_1091 (Viking_fla._14_1091)
package Viking_fla {
import flash.display.*;
public dynamic class _14_1091 extends MovieClip {
public function _14_1091(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 361
//_15_1092 (Viking_fla._15_1092)
package Viking_fla {
import flash.display.*;
public dynamic class _15_1092 extends MovieClip {
public function _15_1092(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 362
//_16_1093 (Viking_fla._16_1093)
package Viking_fla {
import flash.display.*;
public dynamic class _16_1093 extends MovieClip {
public function _16_1093(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 363
//_17_1094 (Viking_fla._17_1094)
package Viking_fla {
import flash.display.*;
public dynamic class _17_1094 extends MovieClip {
public function _17_1094(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 364
//_18_1095 (Viking_fla._18_1095)
package Viking_fla {
import flash.display.*;
public dynamic class _18_1095 extends MovieClip {
public function _18_1095(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 365
//_19_1096 (Viking_fla._19_1096)
package Viking_fla {
import flash.display.*;
public dynamic class _19_1096 extends MovieClip {
public function _19_1096(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 366
//_20_1097 (Viking_fla._20_1097)
package Viking_fla {
import flash.display.*;
public dynamic class _20_1097 extends MovieClip {
public function _20_1097(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 367
//_21_1098 (Viking_fla._21_1098)
package Viking_fla {
import flash.display.*;
public dynamic class _21_1098 extends MovieClip {
public function _21_1098(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 368
//_22_1099 (Viking_fla._22_1099)
package Viking_fla {
import flash.display.*;
public dynamic class _22_1099 extends MovieClip {
public function _22_1099(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 369
//_23_1100 (Viking_fla._23_1100)
package Viking_fla {
import flash.display.*;
public dynamic class _23_1100 extends MovieClip {
public function _23_1100(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 370
//_24_1101 (Viking_fla._24_1101)
package Viking_fla {
import flash.display.*;
public dynamic class _24_1101 extends MovieClip {
public function _24_1101(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 371
//_25_1102 (Viking_fla._25_1102)
package Viking_fla {
import flash.display.*;
public dynamic class _25_1102 extends MovieClip {
public function _25_1102(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 372
//_26_1103 (Viking_fla._26_1103)
package Viking_fla {
import flash.display.*;
public dynamic class _26_1103 extends MovieClip {
public function _26_1103(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 373
//_27_1104 (Viking_fla._27_1104)
package Viking_fla {
import flash.display.*;
public dynamic class _27_1104 extends MovieClip {
public function _27_1104(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 374
//_28_1105 (Viking_fla._28_1105)
package Viking_fla {
import flash.display.*;
public dynamic class _28_1105 extends MovieClip {
public function _28_1105(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 375
//BallSkin_252 (Viking_fla.BallSkin_252)
package Viking_fla {
import flash.display.*;
public dynamic class BallSkin_252 extends MovieClip {
public function BallSkin_252(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
}
}//package Viking_fla
Section 376
//BonusAnim_324 (Viking_fla.BonusAnim_324)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class BonusAnim_324 extends MovieClip {
public function BonusAnim_324(){
addFrameScript(0, frame1, 21, frame22, 39, frame40, 54, frame55);
}
function frame1(){
stop();
}
function frame22(){
gotoAndPlay(2);
}
function frame40(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
dispatchEvent(new GameEvent(GameEvent.ANIM_DISPOSE));
}
function frame55(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
}
}//package Viking_fla
Section 377
//BouncyBlockArcBottomAnim_1154 (Viking_fla.BouncyBlockArcBottomAnim_1154)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class BouncyBlockArcBottomAnim_1154 extends MovieClip {
public var sprite:MovieClip;
public function BouncyBlockArcBottomAnim_1154(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 378
//BouncyBlockArcTopAnim_276 (Viking_fla.BouncyBlockArcTopAnim_276)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class BouncyBlockArcTopAnim_276 extends MovieClip {
public var sprite:MovieClip;
public function BouncyBlockArcTopAnim_276(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 379
//BouncyBlockBottomAnim_431 (Viking_fla.BouncyBlockBottomAnim_431)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class BouncyBlockBottomAnim_431 extends MovieClip {
public var sprite:MovieClip;
public function BouncyBlockBottomAnim_431(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 380
//BouncyBlockCircleAnim_304 (Viking_fla.BouncyBlockCircleAnim_304)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class BouncyBlockCircleAnim_304 extends MovieClip {
public var sprite:MovieClip;
public function BouncyBlockCircleAnim_304(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 381
//BouncyBlockTopAnim_757 (Viking_fla.BouncyBlockTopAnim_757)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class BouncyBlockTopAnim_757 extends MovieClip {
public var sprite:MovieClip;
public function BouncyBlockTopAnim_757(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 382
//button_shine_1010 (Viking_fla.button_shine_1010)
package Viking_fla {
import flash.display.*;
public dynamic class button_shine_1010 extends MovieClip {
public function button_shine_1010(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package Viking_fla
Section 383
//buttons_anim_129 (Viking_fla.buttons_anim_129)
package Viking_fla {
import flash.display.*;
public dynamic class buttons_anim_129 extends MovieClip {
public function buttons_anim_129(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
mouseChildren = true;
mouseEnabled = true;
}
}
}//package Viking_fla
Section 384
//buttons_anim_135 (Viking_fla.buttons_anim_135)
package Viking_fla {
import flash.display.*;
public dynamic class buttons_anim_135 extends MovieClip {
public function buttons_anim_135(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package Viking_fla
Section 385
//buttons_anim_145 (Viking_fla.buttons_anim_145)
package Viking_fla {
import flash.display.*;
public dynamic class buttons_anim_145 extends MovieClip {
public function buttons_anim_145(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package Viking_fla
Section 386
//buttons_anim_34 (Viking_fla.buttons_anim_34)
package Viking_fla {
import flash.display.*;
public dynamic class buttons_anim_34 extends MovieClip {
public function buttons_anim_34(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
function frame2(){
mouseChildren = false;
mouseEnabled = false;
}
function frame11(){
stop();
mouseChildren = true;
mouseEnabled = true;
}
}
}//package Viking_fla
Section 387
//buttons_anim_40 (Viking_fla.buttons_anim_40)
package Viking_fla {
import flash.display.*;
public dynamic class buttons_anim_40 extends MovieClip {
public function buttons_anim_40(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
function frame2(){
mouseChildren = false;
mouseEnabled = false;
}
function frame11(){
stop();
mouseChildren = true;
mouseEnabled = true;
}
}
}//package Viking_fla
Section 388
//buttons_anim_46 (Viking_fla.buttons_anim_46)
package Viking_fla {
import flash.display.*;
public dynamic class buttons_anim_46 extends MovieClip {
public function buttons_anim_46(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
function frame2(){
mouseChildren = false;
mouseEnabled = false;
}
function frame11(){
stop();
mouseChildren = true;
mouseEnabled = true;
}
}
}//package Viking_fla
Section 389
//ButtonsAnim_1035 (Viking_fla.ButtonsAnim_1035)
package Viking_fla {
import flash.display.*;
public dynamic class ButtonsAnim_1035 extends MovieClip {
public function ButtonsAnim_1035(){
addFrameScript(0, frame1, 1, frame2, 19, frame20);
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
function frame2(){
mouseChildren = false;
mouseEnabled = false;
}
function frame20(){
stop();
mouseChildren = true;
mouseEnabled = true;
}
}
}//package Viking_fla
Section 390
//Cards_115 (Viking_fla.Cards_115)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import lp.pge.menu.buttons.*;
import flash.display.*;
public dynamic class Cards_115 extends MovieClip {
public function Cards_115(){
addFrameScript(0, frame1);
}
public function refreshCard(_arg1:Event=null):void{
var _local2:CardButton = (getChildAt(0) as CardButton);
if (_local2){
_local2.index = (GameAchievements.getAchievementNID(currentLabel) - 1);
_local2.title = currentLabel;
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, refreshCard);
};
} else {
if (!hasEventListener(Event.ENTER_FRAME)){
addEventListener(Event.ENTER_FRAME, refreshCard);
};
};
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 391
//ClientLogoButton_1008 (Viking_fla.ClientLogoButton_1008)
package Viking_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class ClientLogoButton_1008 extends MovieClip {
public var facebookButton:SimpleButton;
public var twitterButton:SimpleButton;
public var logoButton:SimpleButton;
public function ClientLogoButton_1008(){
addFrameScript(0, frame1);
}
public function onLogoPress(_arg1:MouseEvent):void{
var $event = _arg1;
try {
navigateToURL(new URLRequest("http://www.sogood.com"), "_blank");
} catch(error:Error) {
};
}
public function onFacebookPress(_arg1:MouseEvent):void{
var $event = _arg1;
try {
navigateToURL(new URLRequest("https://www.facebook.com/SogoodTM"), "_blank");
} catch(error:Error) {
};
}
public function onTwitterPress(_arg1:MouseEvent):void{
var $event = _arg1;
try {
navigateToURL(new URLRequest("https://twitter.com/SogoodOfficial"), "_blank");
} catch(error:Error) {
};
}
function frame1(){
logoButton.addEventListener(MouseEvent.MOUSE_UP, onLogoPress);
facebookButton.addEventListener(MouseEvent.MOUSE_UP, onFacebookPress);
twitterButton.addEventListener(MouseEvent.MOUSE_UP, onTwitterPress);
}
}
}//package Viking_fla
Section 392
//ClientPreloadButton_4 (Viking_fla.ClientPreloadButton_4)
package Viking_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class ClientPreloadButton_4 extends MovieClip {
public function ClientPreloadButton_4(){
addFrameScript(0, frame1);
}
public function onPress(_arg1:MouseEvent){
var $event = _arg1;
try {
navigateToURL(new URLRequest("http://www.sogood.com"), "_blank");
} catch(error:Error) {
};
}
function frame1(){
addEventListener(MouseEvent.MOUSE_UP, onPress);
}
}
}//package Viking_fla
Section 393
//ClientPreloader_5 (Viking_fla.ClientPreloader_5)
package Viking_fla {
import flash.display.*;
public dynamic class ClientPreloader_5 extends MovieClip {
public function ClientPreloader_5(){
addFrameScript(299, frame300);
}
function frame300(){
stop();
}
}
}//package Viking_fla
Section 394
//ClientSplashScreen_6 (Viking_fla.ClientSplashScreen_6)
package Viking_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class ClientSplashScreen_6 extends MovieClip {
public var logo_btn:SimpleButton;
public var play_btn:SimpleButton;
public function ClientSplashScreen_6(){
addFrameScript(190, frame191, 499, frame500);
}
public function PlayIntro(_arg1:MouseEvent):void{
play_btn.removeEventListener(MouseEvent.MOUSE_UP, PlayIntro);
MovieClip(root).nextFrame();
}
public function logobtn(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.sogood.com"), "_blank");
}
function frame191(){
play_btn.addEventListener(MouseEvent.MOUSE_UP, PlayIntro);
logo_btn.addEventListener(MouseEvent.MOUSE_UP, logobtn);
}
function frame500(){
gotoAndPlay(234);
}
}
}//package Viking_fla
Section 395
//cont_1045 (Viking_fla.cont_1045)
package Viking_fla {
import flash.display.*;
import flash.text.*;
public dynamic class cont_1045 extends MovieClip {
public var history_tf:TextField;
public function cont_1045(){
addFrameScript(0, frame1);
}
function frame1(){
history_tf.autoSize = "left";
}
}
}//package Viking_fla
Section 396
//Content_1057 (Viking_fla.Content_1057)
package Viking_fla {
import lp.pge.*;
import lp.pge.game.*;
import com.greensock.plugins.*;
import flash.display.*;
public dynamic class Content_1057 extends MovieClip {
public var lm:LevelManager;
public function Content_1057(){
addFrameScript(0, frame1);
}
function frame1(){
TweenPlugin.activate([ShakeEffect]);
GameApplication.instance.init();
lm = LevelManager.instance;
lm.registerLevel(Level01, 0);
lm.registerLevel(Level02, 1);
lm.registerLevel(Level03, 2);
lm.registerLevel(Level04, 3);
lm.registerLevel(Level05, 4);
lm.registerLevel(Level06, 5);
lm.registerLevel(Level07, 6);
lm.registerLevel(Level08, 7);
lm.registerLevel(Level09, 8);
lm.registerLevel(Level10, 9);
lm.registerLevel(Level11, 10);
lm.registerLevel(Level12, 11);
lm.registerLevel(Level13, 12);
lm.registerLevel(Level14, 13);
lm.registerLevel(Level15, 14);
lm.registerLevel(Level16, 15);
lm.registerLevel(Level17, 16);
lm.registerLevel(Level18, 17);
lm.registerLevel(Level19, 18);
lm.registerLevel(Level20, 19);
lm.registerLevel(Level21, 20);
lm.registerLevel(Level22, 21);
lm.registerLevel(Level23, 22);
lm.registerLevel(Level24, 23);
lm.registerLevel(Level25, 24);
lm.registerLevel(Level26, 25);
lm.registerLevel(Level27, 26);
lm.registerLevel(Level28, 27);
lm.load();
lm.unlockLevel(0);
lm.unlockLevel(1);
lm.unlockLevel(2);
lm.unlockLevel(3);
if (GameApplication.LEVELS_DEBUGGING){
lm.unlockLevel(4);
lm.unlockLevel(5);
lm.unlockLevel(6);
lm.unlockLevel(7);
lm.unlockLevel(8);
lm.unlockLevel(9);
lm.unlockLevel(10);
lm.unlockLevel(11);
lm.unlockLevel(12);
lm.unlockLevel(13);
lm.unlockLevel(14);
lm.unlockLevel(15);
lm.unlockLevel(16);
lm.unlockLevel(17);
lm.unlockLevel(18);
lm.unlockLevel(19);
lm.unlockLevel(20);
lm.unlockLevel(21);
lm.unlockLevel(22);
lm.unlockLevel(23);
lm.unlockLevel(24);
lm.unlockLevel(25);
lm.unlockLevel(26);
lm.unlockLevel(27);
};
GameApplication.instance.goToMenu();
}
}
}//package Viking_fla
Section 397
//Cover_1033 (Viking_fla.Cover_1033)
package Viking_fla {
import flash.display.*;
public dynamic class Cover_1033 extends MovieClip {
public var buttonsAnim:MovieClip;
public var noButtonsAnim:Boolean;
public function Cover_1033(){
addFrameScript(0, frame1, 713, frame714, 723, frame724);
}
public function initButtons():void{
if (buttonsAnim){
buttonsAnim.gotoAndPlay("move");
};
}
function frame1(){
}
function frame714(){
stop();
}
function frame724(){
stop();
initButtons();
}
}
}//package Viking_fla
Section 398
//display_numbers_996 (Viking_fla.display_numbers_996)
package Viking_fla {
import flash.display.*;
public dynamic class display_numbers_996 extends MovieClip {
public function display_numbers_996(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 399
//Exporter_15 (Viking_fla.Exporter_15)
package Viking_fla {
import flash.display.*;
public dynamic class Exporter_15 extends MovieClip {
public function Exporter_15(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Viking_fla
Section 400
//HiddenBlockCentral_320 (Viking_fla.HiddenBlockCentral_320)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.buttons.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HiddenBlockCentral_320 extends MovieClip {
public var blockButton2:BlockButton;
public var blockButton3:BlockButton;
public var blockButton1:BlockButton;
public var sign:MovieClip;
public function HiddenBlockCentral_320(){
addFrameScript(0, frame1, 10, frame11);
}
public function reset():void{
stop();
var _local1:DisplayObject = getChildByName("blockButton1");
if (_local1){
var _local4 = _local1;
_local4["remove"]();
};
var _local2:DisplayObject = getChildByName("blockButton2");
if (_local2){
_local4 = _local2;
_local4["remove"]();
};
var _local3:DisplayObject = getChildByName("blockButton3");
if (_local3){
_local4 = _local3;
_local4["remove"]();
};
gotoAndStop(1);
}
function frame1(){
stop();
mouseChildren = false;
}
function frame11(){
stop();
mouseChildren = true;
}
}
}//package Viking_fla
Section 401
//HiddenBlockLeft_316 (Viking_fla.HiddenBlockLeft_316)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.buttons.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HiddenBlockLeft_316 extends MovieClip {
public var blockButton2:BlockButton;
public var blockButton3:BlockButton;
public var blockButton1:BlockButton;
public var sign:MovieClip;
public function HiddenBlockLeft_316(){
addFrameScript(0, frame1, 10, frame11);
}
public function reset():void{
stop();
var _local1:DisplayObject = getChildByName("blockButton1");
if (_local1){
var _local4 = _local1;
_local4["remove"]();
};
var _local2:DisplayObject = getChildByName("blockButton2");
if (_local2){
_local4 = _local2;
_local4["remove"]();
};
var _local3:DisplayObject = getChildByName("blockButton3");
if (_local3){
_local4 = _local3;
_local4["remove"]();
};
gotoAndStop(1);
}
function frame1(){
stop();
mouseChildren = false;
}
function frame11(){
stop();
mouseChildren = true;
}
}
}//package Viking_fla
Section 402
//HiddenBlockRight_321 (Viking_fla.HiddenBlockRight_321)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.buttons.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HiddenBlockRight_321 extends MovieClip {
public var blockButton2:BlockButton;
public var blockButton3:BlockButton;
public var blockButton1:BlockButton;
public var sign:MovieClip;
public function HiddenBlockRight_321(){
addFrameScript(0, frame1, 10, frame11);
}
public function reset():void{
stop();
var _local1:DisplayObject = getChildByName("blockButton1");
if (_local1){
var _local4 = _local1;
_local4["remove"]();
};
var _local2:DisplayObject = getChildByName("blockButton2");
if (_local2){
_local4 = _local2;
_local4["remove"]();
};
var _local3:DisplayObject = getChildByName("blockButton3");
if (_local3){
_local4 = _local3;
_local4["remove"]();
};
gotoAndStop(1);
}
function frame1(){
stop();
mouseChildren = false;
}
function frame11(){
stop();
mouseChildren = true;
}
}
}//package Viking_fla
Section 403
//HPosIndicator1_283 (Viking_fla.HPosIndicator1_283)
package Viking_fla {
import flash.display.*;
public dynamic class HPosIndicator1_283 extends MovieClip {
public function HPosIndicator1_283(){
addFrameScript(0, frame1);
}
public function align():void{
rotation = (parent) ? -(parent.rotation) : 0;
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 404
//HPosIndicator2_298 (Viking_fla.HPosIndicator2_298)
package Viking_fla {
import flash.display.*;
public dynamic class HPosIndicator2_298 extends MovieClip {
public function HPosIndicator2_298(){
addFrameScript(0, frame1);
}
public function align():void{
rotation = (parent) ? -(parent.rotation) : 0;
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 405
//IceCrackAnim_544 (Viking_fla.IceCrackAnim_544)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class IceCrackAnim_544 extends MovieClip {
public function IceCrackAnim_544(){
addFrameScript(0, frame1, 39, frame40);
}
function frame1(){
stop();
}
function frame40(){
stop();
var _local1 = parent;
_local1["giveWater"]();
}
}
}//package Viking_fla
Section 406
//JumpingSpikesAnim_386 (Viking_fla.JumpingSpikesAnim_386)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class JumpingSpikesAnim_386 extends MovieClip {
public function JumpingSpikesAnim_386(){
addFrameScript(0, frame1, 12, frame13);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
}
}//package Viking_fla
Section 407
//L01Hint_984 (Viking_fla.L01Hint_984)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L01Hint_984 extends MovieClip {
public function L01Hint_984(){
addFrameScript(0, frame1, 72, frame73);
}
function frame1(){
stop();
}
function frame73(){
stop();
if ((parent is LevelAnimation)){
var _local1 = parent;
_local1["execHintCB"]();
};
}
}
}//package Viking_fla
Section 408
//L02Hint_977 (Viking_fla.L02Hint_977)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L02Hint_977 extends MovieClip {
public function L02Hint_977(){
addFrameScript(0, frame1, 72, frame73);
}
function frame1(){
stop();
}
function frame73(){
stop();
if ((parent is LevelAnimation)){
var _local1 = parent;
_local1["execHintCB"]();
};
}
}
}//package Viking_fla
Section 409
//L03Hint_968 (Viking_fla.L03Hint_968)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L03Hint_968 extends MovieClip {
public function L03Hint_968(){
addFrameScript(0, frame1, 86, frame87);
}
function frame1(){
stop();
}
function frame87(){
stop();
if ((parent is LevelAnimation)){
var _local1 = parent;
_local1["execHintCB"]();
};
}
}
}//package Viking_fla
Section 410
//LandNumber_1076 (Viking_fla.LandNumber_1076)
package Viking_fla {
import flash.display.*;
public dynamic class LandNumber_1076 extends MovieClip {
public var btn:MovieClip;
public function LandNumber_1076(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 411
//laugh_ani_8 (Viking_fla.laugh_ani_8)
package Viking_fla {
import flash.display.*;
public dynamic class laugh_ani_8 extends MovieClip {
public function laugh_ani_8(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package Viking_fla
Section 412
//LavaAnim_909 (Viking_fla.LavaAnim_909)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LavaAnim_909 extends MovieClip {
public var _running:Boolean;
public var _timer:Timer;
public function LavaAnim_909(){
addFrameScript(0, frame1, 1, frame2, 106, frame107);
}
public function _onTimerComplete(_arg1:TimerEvent):void{
_timer.reset();
gotoAndPlay(2);
}
public function _getDelay():uint{
return ((Math.round((1 + (2 * Math.random()))) * 1000));
}
public function run():void{
if (!_running){
_running = true;
if (!_timer){
_timer = new Timer(_getDelay(), 1);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, _onTimerComplete);
};
waitAndPlay();
};
}
public function halt():void{
if (_running){
_running = false;
if (_timer){
_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, _onTimerComplete);
_timer = undefined;
};
stop();
};
}
public function waitAndPlay():void{
if (_running){
_timer.delay = _getDelay();
_timer.start();
};
}
public function reset():void{
if (_timer){
_timer.stop();
_timer.reset();
} else {
_timer = new Timer(_getDelay(), 1);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, _onTimerComplete);
};
gotoAndStop(1);
waitAndPlay();
}
function frame1(){
stop();
}
function frame2(){
var _local1 = parent;
_local1["playSound"](new VolcanoExplodesSound());
}
function frame107(){
stop();
var _local1 = parent;
_local1["stopSound"]();
waitAndPlay();
}
}
}//package Viking_fla
Section 413
//Level01Data_986 (Viking_fla.Level01Data_986)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level01Data_986 extends MovieClip {
public var target:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level01Data_986(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L01_THORN_BROKEN;
};
numPackets = 1;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 414
//Level02Data_979 (Viking_fla.Level02Data_979)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level02Data_979 extends MovieClip {
public var target1:TargetDummy;
public var target2:TargetDummy;
public var bBlock:BouncyBlockCircleDummy;
public var bBlock$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level02Data_979(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L02_THORN_1_BROKEN;
};
_local2 = target2;
with (_local2) {
event = ScriptEvent.L02_THORN_2_BROKEN;
};
bBlock.numSteps = 3;
numPackets = 5;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 415
//Level03Data_972 (Viking_fla.Level03Data_972)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level03Data_972 extends MovieClip {
public var bBlock:BouncyBlockCircleDummy;
public var target:TargetDummy;
public var bBlock$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level03Data_972(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L03_THORN_BROKEN;
};
bBlock.numSteps = 3;
numPackets = 5;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 416
//Level04Data_952 (Viking_fla.Level04Data_952)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level04Data_952 extends MovieClip {
public var nBlock$mvr:Waymark;
public var nBlock:NormalBlockCircleDummy;
public var target:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level04Data_952(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L04_TREE_HIT;
};
nBlock.numSteps = 3;
numPackets = ((1 * 4) + ((3 - 1) * 4));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 417
//Level05Data_941 (Viking_fla.Level05Data_941)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level05Data_941 extends MovieClip {
public var nBlock$mvr:Waymark;
public var nBlock:NormalBlockCircleDummy;
public var target:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level05Data_941(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L05_VOLCANO_BLOCKED;
packetAction = "stuck";
};
nBlock.numSteps = 3;
numPackets = ((1 * 4) + ((3 - 1) * 4));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 418
//Level06Data_936 (Viking_fla.Level06Data_936)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level06Data_936 extends MovieClip {
public var nBlock$mvr:Waymark;
public var nBlock:NormalBlockCircleDummy;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level06Data_936(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L06_VOLCANO_1_BLOCKED;
packetAction = "stuck";
};
_local2 = target2;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L06_VOLCANO_2_BLOCKED;
packetAction = "stuck";
};
nBlock.numSteps = 3;
numPackets = ((2 * 4) + ((3 - 1) * 4));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 419
//Level07Data_927 (Viking_fla.Level07Data_927)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level07Data_927 extends MovieClip {
public var nBlock1$mvr:Waymark;
public var trigger:TriggerL01Dummy;
public var target:TargetDummy;
public var nBlock1:NormalBlockCircleDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level07Data_927(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = trigger;
with (_local2) {
event = ScriptEvent.L07_BIG_STONE_HIT;
};
_local2 = target;
with (_local2) {
event = ScriptEvent.L07_BIG_STONE_PUSH;
};
nBlock1.numSteps = 3;
numPackets = ((1 * 4) + (3 * 4));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 420
//Level08Data_920 (Viking_fla.Level08Data_920)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level08Data_920 extends MovieClip {
public var nBlock$mvr:Waymark;
public var nBlock:NormalBlockCircleDummy;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level08Data_920(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L08_VOLCANO_1_BLOCKED;
packetAction = "stuck";
};
_local2 = target2;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L08_VOLCANO_2_BLOCKED;
packetAction = "stuck";
};
nBlock.numSteps = 3;
numPackets = ((2 * 4) + (3 * 4));
ambienceSound = CavernAmb;
backgroundMusic = CaveTheme;
}
function frame1(){
}
}
}//package Viking_fla
Section 421
//Level09Data_915 (Viking_fla.Level09Data_915)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level09Data_915 extends MovieClip {
public var sBlock2$mvr:Waymark;
public var bBlock:BouncyBlockCircleDummy;
public var target:TargetDummy;
public var bBlock$mvr:Waymark;
public var sBlock2:StickyBlockTopDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level09Data_915(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L09_VOLCANO_BLOCKED;
packetAction = "stuck";
};
bBlock.numSteps = 3;
sBlock2.numSteps = 3;
numPackets = ((1 * 4) + (3 * 4));
ambienceSound = CavernAmb;
backgroundMusic = CaveTheme;
}
function frame1(){
}
}
}//package Viking_fla
Section 422
//Level10Data_894 (Viking_fla.Level10Data_894)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level10Data_894 extends MovieClip {
public var target1:TargetDummy;
public var target2:TargetDummy;
public var bBlock:BouncyBlockCircleDummy;
public var bBlock$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level10Data_894(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L10_ICICLE_1_BROKEN;
};
_local2 = target2;
with (_local2) {
event = ScriptEvent.L10_ICICLE_2_BROKEN;
};
bBlock.numSteps = 3;
numPackets = ((2 * 3) + (3 * 3));
ambienceSound = CavernAmb;
backgroundMusic = CaveTheme;
}
function frame1(){
}
}
}//package Viking_fla
Section 423
//Level11Data_887 (Viking_fla.Level11Data_887)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level11Data_887 extends MovieClip {
public var nBlock$mvr:Waymark;
public var nBlock:NormalBlockCircleDummy;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var target3:TargetDummy;
public var bBlock:BouncyBlockCircleDummy;
public var bBlock$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level11Data_887(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L11_ICICLE_1_BROKEN;
};
_local2 = target2;
with (_local2) {
event = ScriptEvent.L11_ICICLE_2_BROKEN;
};
_local2 = target3;
with (_local2) {
event = ScriptEvent.L11_ICICLE_3_BROKEN;
};
bBlock.numSteps = 3;
nBlock.numSteps = 3;
numPackets = ((3 * 3) + (3 * 3));
ambienceSound = CavernAmb;
backgroundMusic = CaveTheme;
}
function frame1(){
}
}
}//package Viking_fla
Section 424
//Level12Data_845 (Viking_fla.Level12Data_845)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level12Data_845 extends MovieClip {
public var nBlock$mvr:Waymark;
public var nBlock:NormalBlockCircleDummy;
public var target:TargetDummy;
public var bBlock1:BouncyBlockCircleDummy;
public var bBlock1$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level12Data_845(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L12_WATERFALL_BLOCKED;
packetAction = "stuck";
};
bBlock1.numSteps = 3;
nBlock.numSteps = 3;
numPackets = 18;
ambienceSound = RiverAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 425
//Level13Data_808 (Viking_fla.Level13Data_808)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level13Data_808 extends MovieClip {
public var nBlock1$mvr:Waymark;
public var hBlock:HiddenBlock;
public var target:TargetDummy;
public var nBlock1:NormalBlockCircleDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level13Data_808(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L13_ROCK_HIT;
};
nBlock1.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.NORMAL_GIRDER_B};
blockData2 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData3 = {id:HiddenBlock.BOUNCY_GIRDER_BL};
};
numPackets = ((1 * 3) + (3 * 3));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 426
//Level14Data_792 (Viking_fla.Level14Data_792)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level14Data_792 extends MovieClip {
public var bBlock2$mvr:Waymark;
public var hBlock:HiddenBlock;
public var target:TargetDummy;
public var bBlock1:BouncyBlockCircleDummy;
public var bBlock2:BouncyBlockRightDummy;
public var bBlock1$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level14Data_792(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L14_BRANCH_HIT;
};
bBlock1.numSteps = 3;
bBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData2 = {id:HiddenBlock.BOUNCY_GIRDER_B};
blockData3 = {id:HiddenBlock.NORMAL_GIRDER_B};
};
numPackets = ((1 * 3) + (3 * 3));
ambienceSound = ForestAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 427
//Level15Data_785 (Viking_fla.Level15Data_785)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level15Data_785 extends MovieClip {
public var nBlock3:NormalBlockSlopeTLDummy;
public var nBlock1$mvr:Waymark;
public var nBlock3$mvr:Waymark;
public var target:TargetDummy;
public var nBlock1:NormalBlockCircleDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level15Data_785(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L15_CROCODILE_HIT;
};
nBlock1.numSteps = 3;
nBlock3.numSteps = 3;
numPackets = ((1 * 3) + (3 * 3));
ambienceSound = RiverAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 428
//Level16Data_748 (Viking_fla.Level16Data_748)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level16Data_748 extends MovieClip {
public var nBlock1$mvr:Waymark;
public var hBlock:HiddenBlock;
public var bBlock:BouncyBlockCircleDummy;
public var target:TargetDummy;
public var bBlock$mvr:Waymark;
public var nBlock1:NormalBlockCircleDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level16Data_748(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L16_DEBRIS_HIT;
};
bBlock.numSteps = 3;
nBlock1.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.STICKY_GIRDER_T};
blockData2 = {id:HiddenBlock.BOUNCY_GIRDER_TR};
blockData3 = {id:HiddenBlock.NORMAL_CIRCLE};
};
numPackets = 12;
ambienceSound = RiverAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 429
//Level17Data_739 (Viking_fla.Level17Data_739)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level17Data_739 extends MovieClip {
public var hBlock1:HiddenBlock;
public var hBlock2:HiddenBlock;
public var target:TargetDummy;
public var bBlock1:BouncyBlockCircleDummy;
public var bBlock1$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level17Data_739(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L17_WATERFALL_BLOCKED;
};
bBlock1.numSteps = 3;
_local2 = hBlock1;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_GIRDER_TL};
blockData2 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData3 = {id:HiddenBlock.NORMAL_SLOPE_TL};
};
_local2 = hBlock2;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_ARC};
blockData2 = {id:HiddenBlock.NORMAL_GIRDER_B};
blockData3 = {id:HiddenBlock.NORMAL_CIRCLE};
};
numPackets = 10;
ambienceSound = RiverAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 430
//Level18Data_695 (Viking_fla.Level18Data_695)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level18Data_695 extends MovieClip {
public var nBlock2:BouncyBlockCircleDummy;
public var hBlock:HiddenBlock;
public var nBlock2$mvr:Waymark;
public var target:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level18Data_695(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L18_DRAGON_HIT;
};
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData2 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData3 = {id:HiddenBlock.NORMAL_GIRDER_R};
};
numPackets = 10;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 431
//Level19Data_684 (Viking_fla.Level19Data_684)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level19Data_684 extends MovieClip {
public var mSpikes$mvr:Waymark;
public var nBlock1$mvr:Waymark;
public var mSpikes:MovingSpikesDummy;
public var hBlock:HiddenBlock;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var target3:TargetDummy;
public var bBlock1:BouncyBlockCircleDummy;
public var nBlock1:NormalBlockCircleDummy;
public var bBlock1$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level19Data_684(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L19_DRAGON_1_HIT;
};
_local2 = target2;
with (_local2) {
event = ScriptEvent.L19_DRAGON_2_HIT;
};
_local2 = target3;
with (_local2) {
event = ScriptEvent.L19_DRAGON_3_HIT;
};
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData2 = {id:HiddenBlock.NORMAL_GIRDER_TR};
blockData3 = {id:HiddenBlock.BOUNCY_GIRDER_TR};
};
bBlock1.numSteps = 3;
nBlock1.numSteps = 3;
numPackets = 17;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 432
//Level20Data_594 (Viking_fla.Level20Data_594)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level20Data_594 extends MovieClip {
public var mSpikes$mvr:Waymark;
public var nBlock2:NormalBlockCircleDummy;
public var hBlock:HiddenBlock;
public var mSpikes:MovingSpikesDummy;
public var nBlock2$mvr:Waymark;
public var target:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level20Data_594(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L20_GEYSER_BLOCKED;
packetAction = "stuck";
};
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.STICKY_GIRDER_TR};
blockData2 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData3 = {id:HiddenBlock.NORMAL_GIRDER_R};
};
numPackets = ((1 * 2) + (3 * 2));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 433
//Level21Data_589 (Viking_fla.Level21Data_589)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level21Data_589 extends MovieClip {
public var mSpikes$mvr:Waymark;
public var nBlock$mvr:Waymark;
public var mSpikes:MovingSpikesDummy;
public var hBlock:HiddenBlock;
public var nBlock:NormalBlockCircleDummy;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var target3:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level21Data_589(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L21_GEYSER_1_BLOCKED;
packetAction = "stuck";
};
_local2 = target2;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L21_GEYSER_2_BLOCKED;
packetAction = "stuck";
};
_local2 = target3;
with (_local2) {
hitDistance = 20;
event = ScriptEvent.L21_GEYSER_3_BLOCKED;
packetAction = "stuck";
};
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.NORMAL_SLOPE_TR};
blockData2 = {id:HiddenBlock.NORMAL_GIRDER_R};
blockData3 = {id:HiddenBlock.BOUNCY_CIRCLE};
};
nBlock.numSteps = 3;
numPackets = 14;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 434
//Level22Data_579 (Viking_fla.Level22Data_579)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level22Data_579 extends MovieClip {
public var mSpikes$mvr:Waymark;
public var nBlock2:NormalBlockCircleDummy;
public var mSpikes:MovingSpikesDummy;
public var hBlock:HiddenBlock;
public var nBlock2$mvr:Waymark;
public var target:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level22Data_579(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L22_ICE_CRACK_BROKEN;
};
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_GIRDER_TR};
blockData2 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData3 = {id:HiddenBlock.NORMAL_SLOPE_TR};
};
numPackets = 8;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 435
//Level23Data_539 (Viking_fla.Level23Data_539)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level23Data_539 extends MovieClip {
public var mSpikes$mvr:Waymark;
public var mSpikes:JumpingSpikesDummy;
public var hBlock:HiddenBlock;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var target3:TargetDummy;
public var bBlock1:BouncyBlockCircleDummy;
public var bBlock1$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level23Data_539(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L23_ICICLE_1_BROKEN;
};
_local2 = target2;
with (_local2) {
event = ScriptEvent.L23_ICICLE_2_BROKEN;
};
_local2 = target3;
with (_local2) {
event = ScriptEvent.L23_ICICLE_3_BROKEN;
};
bBlock1.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_GIRDER_BR};
blockData2 = {id:HiddenBlock.NORMAL_GIRDER_R};
blockData3 = {id:HiddenBlock.NORMAL_CIRCLE};
};
numPackets = 12;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 436
//Level24Data_478 (Viking_fla.Level24Data_478)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level24Data_478 extends MovieClip {
public var nBlock$mvr:Waymark;
public var hBlock:HiddenBlock;
public var nBlock:NormalBlockRightDummy;
public var bBlock:BouncyBlockCircleDummy;
public var jSpikes:JumpingSpikesDummy;
public var target:TargetDummy;
public var jSpikes$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level24Data_478(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L24_ICICLE_BROKEN;
};
nBlock.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData2 = {id:HiddenBlock.STICKY_GIRDER_T};
blockData3 = {id:HiddenBlock.BOUNCY_GIRDER_T};
};
numPackets = 8;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 437
//Level25Data_465 (Viking_fla.Level25Data_465)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level25Data_465 extends MovieClip {
public var mSpikes$mvr:Waymark;
public var nBlock2:NormalBlockCircleDummy;
public var mSpikes:MovingSpikesDummy;
public var hBlock:HiddenBlock;
public var nBlock2$mvr:Waymark;
public var target1:TargetDummy;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level25Data_465(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L25_ICE_ROCK_HIT;
};
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData2 = {id:HiddenBlock.STICKY_GIRDER_T};
blockData3 = {id:HiddenBlock.BOUNCY_CIRCLE};
};
numPackets = 6;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 438
//Level26Data_426 (Viking_fla.Level26Data_426)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level26Data_426 extends MovieClip {
public var nBlock2:NormalBlockCircleDummy;
public var hBlock:HiddenBlock;
public var nBlock2$mvr:Waymark;
public var target1:TargetDummy;
public var target2:TargetDummy;
public var jSpikes:JumpingSpikesDummy;
public var bBlock1:BouncyBlockBottomDummy;
public var jSpikes$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level26Data_426(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target1;
with (_local2) {
event = ScriptEvent.L26_ICICLE_1_BROKEN;
};
_local2 = target2;
with (_local2) {
event = ScriptEvent.L26_ICICLE_2_BROKEN;
};
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.NORMAL_GIRDER_TL};
blockData2 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData3 = {id:HiddenBlock.BOUNCY_GIRDER_T};
};
numPackets = 6;
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 439
//Level27Data_372 (Viking_fla.Level27Data_372)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level27Data_372 extends MovieClip {
public var nBlock2:NormalBlockCircleDummy;
public var hBlock:HiddenBlock;
public var nBlock2$mvr:Waymark;
public var jSpikes:JumpingSpikesDummy;
public var target:TargetDummy;
public var jSpikes$mvr:Waymark;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level27Data_372(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L27_BEAR_HIT;
};
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_CIRCLE};
blockData2 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData3 = {id:HiddenBlock.BOUNCY_GIRDER_T};
};
numPackets = ((1 * 1) + (3 * 1));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 440
//Level28Data_245 (Viking_fla.Level28Data_245)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import lp.pge.game.gui.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level28Data_245 extends MovieClip {
public var nBlock2:NormalBlockCircleDummy;
public var mSpikes1:MovingSpikesDummy;
public var hBlock:HiddenBlock;
public var nBlock2$mvr:Waymark;
public var target:TargetDummy;
public var bBlock1:BouncyBlockCircleDummy;
public var mSpikes2$mvr:Waymark;
public var mSpikes1$mvr:Waymark;
public var mSpikes2:MovingSpikesDummy;
public var phases:Array;
public var numPackets:int;
public var ambienceSound:Class;
public var backgroundMusic:Class;
public function Level28Data_245(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = target;
with (_local2) {
event = ScriptEvent.L28_ICE_ROOF_BROKEN;
};
phases = [function ():void{
this.wait();
}];
nBlock2.numSteps = 3;
_local2 = hBlock;
with (_local2) {
blockData1 = {id:HiddenBlock.BOUNCY_GIRDER_T};
blockData2 = {id:HiddenBlock.NORMAL_CIRCLE};
blockData3 = {id:HiddenBlock.BOUNCY_CIRCLE};
};
numPackets = ((2 * 1) + (3 * 1));
ambienceSound = MountainsAmb;
}
function frame1(){
}
}
}//package Viking_fla
Section 441
//LinkButton_29 (Viking_fla.LinkButton_29)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import flash.display.*;
import flash.net.*;
public dynamic class LinkButton_29 extends MovieClip {
public function LinkButton_29(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var $event = _arg1;
GameApplication.instance.trackEvent("/credits-logo");
try {
navigateToURL(new URLRequest("http://www.paraart.com"), "_blank");
} catch(error:Error) {
};
}
function frame1(){
buttonMode = true;
useHandCursor = true;
addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package Viking_fla
Section 442
//MainMenuButton_1025 (Viking_fla.MainMenuButton_1025)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import lp.pge.game.*;
import flash.display.*;
public dynamic class MainMenuButton_1025 extends MovieClip {
public var action:Function;
public function MainMenuButton_1025(){
addFrameScript(0, frame1);
}
public function onOut(_arg1:MouseEvent):void{
if (currentLabel != "out"){
gotoAndStop("out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (currentLabel != "over"){
gotoAndStop("over");
};
}
public function onClick(_arg1:MouseEvent):void{
if (action != null){
action();
};
}
function frame1(){
stop();
action = function ():void{
Game.instance.finishLevel();
Game.instance.unloadLevel();
GameApplication.instance.goToMenu();
GameMenu.instance.hideNow();
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
}
}//package Viking_fla
Section 443
//MapAnim_157 (Viking_fla.MapAnim_157)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MapAnim_157 extends MovieClip {
public function MapAnim_157(){
addFrameScript(36, frame37);
}
function frame37(){
stop();
var _local1 = parent;
_local1["goNow"]();
}
}
}//package Viking_fla
Section 444
//MapButton_1026 (Viking_fla.MapButton_1026)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import lp.pge.menu.*;
import lp.pge.game.*;
import flash.display.*;
public dynamic class MapButton_1026 extends MovieClip {
public var action:Function;
public function MapButton_1026(){
addFrameScript(0, frame1);
}
public function onOut(_arg1:MouseEvent):void{
if (currentLabel != "out"){
gotoAndStop("out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (currentLabel != "over"){
gotoAndStop("over");
};
}
public function onClick(_arg1:MouseEvent):void{
if (action != null){
action();
};
}
function frame1(){
stop();
action = function ():void{
Game.instance.finishLevel();
Game.instance.unloadLevel();
GameApplication.instance.goToMenu();
Menu.instance.openLevelSelection(Math.floor((Game.instance.getCurrentLevelIndex() / 3)));
GameMenu.instance.hideNow();
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
}
}//package Viking_fla
Section 445
//Message_1058 (Viking_fla.Message_1058)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Message_1058 extends MovieClip {
public function Message_1058(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
if (!parent["console"].visible){
parent["console"].show();
} else {
parent["console"].hide();
};
}
function frame1(){
stop();
if (GameApplication.gameMode == "debug"){
addEventListener(MouseEvent.CLICK, onClick);
} else {
visible = false;
};
}
}
}//package Viking_fla
Section 446
//MovingSpikesAnim_311 (Viking_fla.MovingSpikesAnim_311)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class MovingSpikesAnim_311 extends MovieClip {
public function MovingSpikesAnim_311(){
addFrameScript(0, frame1, 12, frame13);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
}
}//package Viking_fla
Section 447
//NormalBlockBottomAnim_700 (Viking_fla.NormalBlockBottomAnim_700)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class NormalBlockBottomAnim_700 extends MovieClip {
public var sprite:MovieClip;
public function NormalBlockBottomAnim_700(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 448
//NormalBlockCircleAnim_292 (Viking_fla.NormalBlockCircleAnim_292)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class NormalBlockCircleAnim_292 extends MovieClip {
public var sprite:MovieClip;
public function NormalBlockCircleAnim_292(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 449
//NormalBlockLeftAnim_813 (Viking_fla.NormalBlockLeftAnim_813)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class NormalBlockLeftAnim_813 extends MovieClip {
public var sprite:MovieClip;
public function NormalBlockLeftAnim_813(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 450
//NormalBlockRightAnim_483 (Viking_fla.NormalBlockRightAnim_483)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class NormalBlockRightAnim_483 extends MovieClip {
public var sprite:MovieClip;
public function NormalBlockRightAnim_483(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 451
//NormalBlockSlopeTLAnim_470 (Viking_fla.NormalBlockSlopeTLAnim_470)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class NormalBlockSlopeTLAnim_470 extends MovieClip {
public var sprite:MovieClip;
public function NormalBlockSlopeTLAnim_470(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 452
//NormalBlockSlopeTRAnim_377 (Viking_fla.NormalBlockSlopeTRAnim_377)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class NormalBlockSlopeTRAnim_377 extends MovieClip {
public var sprite:MovieClip;
public function NormalBlockSlopeTRAnim_377(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 453
//PacketAnim_251 (Viking_fla.PacketAnim_251)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class PacketAnim_251 extends MovieClip {
public var skin:MovieClip;
public function PacketAnim_251(){
addFrameScript(0, frame1, 8, frame9, 33, frame34);
}
public function updateSkin(_arg1:Number):void{
var _local2:uint;
if (((skin) && ((skin.totalFrames > 1)))){
_local2 = Math.round((skin.totalFrames * _arg1));
if (_local2 < 1){
_local2 = 1;
};
skin.gotoAndStop(_local2);
};
}
function frame1(){
stop();
}
function frame9(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
dispatchEvent(new GameEvent(GameEvent.ANIM_DISPOSE));
}
function frame34(){
gotoAndPlay(11);
}
}
}//package Viking_fla
Section 454
//PALogo_1007 (Viking_fla.PALogo_1007)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import flash.display.*;
import flash.net.*;
public dynamic class PALogo_1007 extends MovieClip {
public function PALogo_1007(){
addFrameScript(0, frame1);
}
public function init():void{
buttonMode = true;
useHandCursor = true;
mouseChildren = false;
addEventListener(MouseEvent.CLICK, onClick);
}
public function destroy():void{
removeEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
var event = _arg1;
GameApplication.instance.trackEvent("/in-game-logo");
if (((GameApplication.logoLink) && (GameApplication.logoLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.logoLink), "_blank");
} catch(error:Error) {
};
};
}
function frame1(){
init();
}
}
}//package Viking_fla
Section 455
//Panel_1022 (Viking_fla.Panel_1022)
package Viking_fla {
import flash.display.*;
public dynamic class Panel_1022 extends MovieClip {
public function Panel_1022(){
addFrameScript(0, frame1);
}
public function enable():void{
mouseChildren = true;
mouseEnabled = true;
}
public function disable():void{
mouseChildren = false;
mouseEnabled = false;
}
function frame1(){
}
}
}//package Viking_fla
Section 456
//PASplash_12 (Viking_fla.PASplash_12)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import flash.display.*;
import flash.net.*;
public dynamic class PASplash_12 extends MovieClip {
public function PASplash_12(){
addFrameScript(0, frame1, 99, frame100);
}
public function init():void{
buttonMode = true;
useHandCursor = true;
mouseChildren = false;
addEventListener(MouseEvent.CLICK, onClick);
}
public function destroy():void{
removeEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
var event = _arg1;
GameApplication.instance.trackEvent("/splash-screen");
if (((GameApplication.logoLink) && (GameApplication.logoLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.logoLink), "_blank");
} catch(error:Error) {
};
};
}
function frame1(){
init();
}
function frame100(){
stop();
if (((parent) && ((parent is MovieClip)))){
(parent as MovieClip).nextFrame();
};
}
}
}//package Viking_fla
Section 457
//PauseButton_1001 (Viking_fla.PauseButton_1001)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.media.*;
import flash.display.*;
import lp.pge.media.*;
public dynamic class PauseButton_1001 extends MovieClip {
public var _sound:Sound;
public var _soundPlayer:SoundPlayer;
public var action:Function;
public function PauseButton_1001(){
addFrameScript(0, frame1, 6, frame7);
}
public function onOut(_arg1:MouseEvent):void{
if (((!((currentLabel == "out"))) && (!((currentLabel == "go_out"))))){
gotoAndPlay("go_out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (((!((currentLabel == "over"))) && (!((currentLabel == "go_over"))))){
gotoAndPlay("go_over");
};
}
public function onClick(_arg1:MouseEvent):void{
_soundPlayer.play(_sound);
if (action != null){
action();
};
}
function frame1(){
stop();
_sound = new ButtonClickSound();
_soundPlayer = new SoundPlayer();
SoundManager.instance.addPlayer(_soundPlayer);
action = function ():void{
Game.instance.pauseLevel();
GameMenu.instance.show();
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
function frame7(){
stop();
}
}
}//package Viking_fla
Section 458
//ReplayButton_1024 (Viking_fla.ReplayButton_1024)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.display.*;
public dynamic class ReplayButton_1024 extends MovieClip {
public var action:Function;
public function ReplayButton_1024(){
addFrameScript(0, frame1);
}
public function onOut(_arg1:MouseEvent):void{
if (currentLabel != "out"){
gotoAndStop("out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (currentLabel != "over"){
gotoAndStop("over");
};
}
public function onClick(_arg1:MouseEvent):void{
if (action != null){
action();
};
}
function frame1(){
stop();
action = function ():void{
GameStatistics.submitRestart(Game.instance.getCurrentLevelIndex());
Game.instance.restartLevel();
GameMenu.instance.hide();
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
}
}//package Viking_fla
Section 459
//ResetButton_999 (Viking_fla.ResetButton_999)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.media.*;
import flash.display.*;
import lp.pge.media.*;
public dynamic class ResetButton_999 extends MovieClip {
public var _sound:Sound;
public var _soundPlayer:SoundPlayer;
public var action:Function;
public function ResetButton_999(){
addFrameScript(0, frame1, 6, frame7);
}
public function onOut(_arg1:MouseEvent):void{
if (((!((currentLabel == "out"))) && (!((currentLabel == "go_out"))))){
gotoAndPlay("go_out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (((!((currentLabel == "over"))) && (!((currentLabel == "go_over"))))){
gotoAndPlay("go_over");
};
}
public function onClick(_arg1:MouseEvent):void{
_soundPlayer.play(_sound);
if (action != null){
action();
};
}
function frame1(){
stop();
_sound = new ButtonClickSound();
_soundPlayer = new SoundPlayer();
SoundManager.instance.addPlayer(_soundPlayer);
action = function ():void{
GameStatistics.submitRestart(Game.instance.getCurrentLevelIndex());
Game.instance.restartLevel();
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
function frame7(){
stop();
}
}
}//package Viking_fla
Section 460
//ResumeButton_1023 (Viking_fla.ResumeButton_1023)
package Viking_fla {
import flash.events.*;
import lp.pge.game.*;
import flash.display.*;
public dynamic class ResumeButton_1023 extends MovieClip {
public var action:Function;
public function ResumeButton_1023(){
addFrameScript(0, frame1);
}
public function onOut(_arg1:MouseEvent):void{
if (currentLabel != "out"){
gotoAndStop("out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (currentLabel != "over"){
gotoAndStop("over");
};
}
public function onClick(_arg1:MouseEvent):void{
if (action != null){
action();
};
}
function frame1(){
stop();
action = function ():void{
Game.instance.resumeLevel();
GameMenu.instance.hide();
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
}
}//package Viking_fla
Section 461
//RisingWaterAnim_563 (Viking_fla.RisingWaterAnim_563)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class RisingWaterAnim_563 extends MovieClip {
public var raftAnim:MovieClip;
public function RisingWaterAnim_563(){
addFrameScript(0, frame1, 215, frame216, 235, frame236);
}
function frame1(){
stop();
}
function frame216(){
var _local1 = parent;
_local1["goBlack"]();
}
function frame236(){
stop();
}
}
}//package Viking_fla
Section 462
//selection_sign_anim_317 (Viking_fla.selection_sign_anim_317)
package Viking_fla {
import flash.display.*;
public dynamic class selection_sign_anim_317 extends MovieClip {
public var callback:Function;
public var cb:Function;
public function selection_sign_anim_317(){
addFrameScript(0, frame1, 6, frame7);
}
function frame1(){
stop();
}
function frame7(){
stop();
if (callback != null){
cb = callback;
callback = undefined;
cb();
};
}
}
}//package Viking_fla
Section 463
//shade_mc_1014 (Viking_fla.shade_mc_1014)
package Viking_fla {
import flash.display.*;
public dynamic class shade_mc_1014 extends MovieClip {
public function shade_mc_1014(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package Viking_fla
Section 464
//SoundButton_22 (Viking_fla.SoundButton_22)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import flash.display.*;
public dynamic class SoundButton_22 extends MovieClip {
public var action:Function;
public function SoundButton_22(){
addFrameScript(0, frame1);
}
public function onAppMute(_arg1:GameApplicationEvent):void{
if (currentLabel != "off"){
gotoAndStop("off");
};
}
public function onAppUnmute(_arg1:GameApplicationEvent):void{
if (currentLabel != "on"){
gotoAndStop("on");
};
}
public function onClick(_arg1:MouseEvent):void{
var _local2:Boolean;
if (currentLabel != "off"){
gotoAndStop("off");
_local2 = false;
} else {
gotoAndStop("on");
_local2 = true;
};
if (action != null){
action(!(_local2));
};
}
function frame1(){
stop();
GameApplication.instance.addEventListener(GameApplicationEvent.APP_MUTE, onAppMute);
GameApplication.instance.addEventListener(GameApplicationEvent.APP_UNMUTE, onAppUnmute);
if (GameApplication.instance.mute){
if (currentLabel != "off"){
gotoAndStop("off");
};
} else {
if (currentLabel != "on"){
gotoAndStop("on");
};
};
action = function (_arg1:Boolean):void{
GameApplication.instance.mute = _arg1;
};
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
}
}//package Viking_fla
Section 465
//Star_119 (Viking_fla.Star_119)
package Viking_fla {
import flash.display.*;
public dynamic class Star_119 extends MovieClip {
public function Star_119(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 466
//star_mc_1012 (Viking_fla.star_mc_1012)
package Viking_fla {
import flash.display.*;
public dynamic class star_mc_1012 extends MovieClip {
public function star_mc_1012(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package Viking_fla
Section 467
//star_s_mc_1016 (Viking_fla.star_s_mc_1016)
package Viking_fla {
import flash.display.*;
public dynamic class star_s_mc_1016 extends MovieClip {
public function star_s_mc_1016(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package Viking_fla
Section 468
//StaticSpikesAnim_753 (Viking_fla.StaticSpikesAnim_753)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class StaticSpikesAnim_753 extends MovieClip {
public function StaticSpikesAnim_753(){
addFrameScript(0, frame1, 12, frame13);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
}
}//package Viking_fla
Section 469
//StickyBlockTopAnim_899 (Viking_fla.StickyBlockTopAnim_899)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class StickyBlockTopAnim_899 extends MovieClip {
public var sprite:MovieClip;
public function StickyBlockTopAnim_899(){
addFrameScript(0, frame1, 12, frame13, 37, frame38);
}
function frame1(){
stop();
}
function frame13(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
function frame38(){
gotoAndPlay(14);
}
}
}//package Viking_fla
Section 470
//TargetAnim_270 (Viking_fla.TargetAnim_270)
package Viking_fla {
import lp.pge.game.*;
import flash.display.*;
public dynamic class TargetAnim_270 extends MovieClip {
public function TargetAnim_270(){
addFrameScript(0, frame1, 41, frame42, 56, frame57);
}
function frame1(){
stop();
}
function frame42(){
stop();
}
function frame57(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
dispatchEvent(new GameEvent(GameEvent.ANIM_DISPOSE));
}
}
}//package Viking_fla
Section 471
//throw_numbers_53 (Viking_fla.throw_numbers_53)
package Viking_fla {
import flash.display.*;
public dynamic class throw_numbers_53 extends MovieClip {
public function throw_numbers_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Viking_fla
Section 472
//thumbclip_2 (Viking_fla.thumbclip_2)
package Viking_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class thumbclip_2 extends MovieClip {
public var mainscroll_btn:SimpleButton;
public function thumbclip_2(){
addFrameScript(0, frame1);
}
public function mainscroll(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.sogood.com"), "_blank");
}
function frame1(){
mainscroll_btn.addEventListener(MouseEvent.MOUSE_UP, mainscroll);
}
}
}//package Viking_fla
Section 473
//WalkthroughButton_1027 (Viking_fla.WalkthroughButton_1027)
package Viking_fla {
import flash.events.*;
import lp.pge.*;
import lp.pge.game.*;
import flash.display.*;
import flash.net.*;
public dynamic class WalkthroughButton_1027 extends MovieClip {
public var action:Function;
public function WalkthroughButton_1027(){
addFrameScript(0, frame1);
}
public function onOut(_arg1:MouseEvent):void{
if (currentLabel != "out"){
gotoAndStop("out");
};
}
public function onOver(_arg1:MouseEvent):void{
if (currentLabel != "over"){
gotoAndStop("over");
};
}
public function onClick(_arg1:MouseEvent):void{
if (action != null){
action();
};
}
function frame1(){
stop();
action = function ():void{
GameApplication.instance.trackEvent(("/hint#" + Game.instance.getCurrentLevelIndex()));
if (GameApplication.linksOut){
if (((GameApplication.helpLink) && (GameApplication.helpLink.length))){
try {
navigateToURL(new URLRequest(GameApplication.helpLink), "_blank");
} catch(error:Error) {
};
};
};
};
addEventListener(MouseEvent.MOUSE_OUT, onOut);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.CLICK, onClick);
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
}
}
}//package Viking_fla
Section 474
//WaterAnim_585 (Viking_fla.WaterAnim_585)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WaterAnim_585 extends MovieClip {
public var _running:Boolean;
public var _timer:Timer;
public function WaterAnim_585(){
addFrameScript(0, frame1, 1, frame2, 106, frame107);
}
public function _onTimerComplete(_arg1:TimerEvent):void{
_timer.reset();
gotoAndPlay(2);
}
public function _getDelay():uint{
return ((Math.round((1 + (2 * Math.random()))) * 1000));
}
public function run():void{
if (!_running){
_running = true;
if (!_timer){
_timer = new Timer(_getDelay(), 1);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, _onTimerComplete);
};
waitAndPlay();
};
}
public function halt():void{
if (_running){
_running = false;
if (_timer){
_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, _onTimerComplete);
_timer = undefined;
};
stop();
};
}
public function waitAndPlay():void{
if (_running){
_timer.delay = _getDelay();
_timer.start();
};
}
public function reset():void{
if (_timer){
_timer.stop();
_timer.reset();
} else {
_timer = new Timer(_getDelay(), 1);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, _onTimerComplete);
};
gotoAndStop(1);
waitAndPlay();
}
function frame1(){
stop();
}
function frame2(){
var _local1 = parent;
_local1["playSound"](new VolcanoExplodesSound());
}
function frame107(){
stop();
var _local1 = parent;
_local1["stopSound"]();
waitAndPlay();
}
}
}//package Viking_fla
Section 475
//WaterAnim_837 (Viking_fla.WaterAnim_837)
package Viking_fla {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WaterAnim_837 extends MovieClip {
public var levelAnim:MovieClip;
public function WaterAnim_837(){
addFrameScript(0, frame1, 1, frame2, 25, frame26, 45, frame46);
}
function frame1(){
stop();
}
function frame2(){
}
function frame26(){
levelAnim.goNow();
}
function frame46(){
stop();
}
}
}//package Viking_fla
Section 476
//win_bg_map_left_side_32 (Viking_fla.win_bg_map_left_side_32)
package Viking_fla {
import flash.display.*;
public dynamic class win_bg_map_left_side_32 extends MovieClip {
public function win_bg_map_left_side_32(){
addFrameScript(0, frame1);
}
function frame1(){
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 477
//win_bg_map_right_side_33 (Viking_fla.win_bg_map_right_side_33)
package Viking_fla {
import flash.display.*;
public dynamic class win_bg_map_right_side_33 extends MovieClip {
public function win_bg_map_right_side_33(){
addFrameScript(0, frame1);
}
function frame1(){
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 478
//VPosIndicator1_284 (Viking_fla.VPosIndicator1_284)
package Viking_fla {
import flash.display.*;
public dynamic class VPosIndicator1_284 extends MovieClip {
public function VPosIndicator1_284(){
addFrameScript(0, frame1);
}
public function align():void{
rotation = (parent) ? (90 - parent.rotation) : 90;
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 479
//VPosIndicator2_299 (Viking_fla.VPosIndicator2_299)
package Viking_fla {
import flash.display.*;
public dynamic class VPosIndicator2_299 extends MovieClip {
public function VPosIndicator2_299(){
addFrameScript(0, frame1);
}
public function align():void{
rotation = (parent) ? (90 - parent.rotation) : 90;
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
}
}
}//package Viking_fla
Section 480
//ApplauseSound (ApplauseSound)
package {
import flash.media.*;
public dynamic class ApplauseSound extends Sound {
}
}//package
Section 481
//ArcHArrows (ArcHArrows)
package {
import lp.pge.game.gui.*;
public dynamic class ArcHArrows extends ArrowsIcon {
}
}//package
Section 482
//ArcVArrows (ArcVArrows)
package {
import lp.pge.game.gui.*;
public dynamic class ArcVArrows extends ArrowsIcon {
}
}//package
Section 483
//BalkH2Arrows (BalkH2Arrows)
package {
import lp.pge.game.gui.*;
public dynamic class BalkH2Arrows extends ArrowsIcon {
}
}//package
Section 484
//BalkHArrows (BalkHArrows)
package {
import lp.pge.game.gui.*;
public dynamic class BalkHArrows extends ArrowsIcon {
}
}//package
Section 485
//BalkV2Arrows (BalkV2Arrows)
package {
import lp.pge.game.gui.*;
public dynamic class BalkV2Arrows extends ArrowsIcon {
}
}//package
Section 486
//BalkVArrows (BalkVArrows)
package {
import lp.pge.game.gui.*;
public dynamic class BalkVArrows extends ArrowsIcon {
}
}//package
Section 487
//BearAnim (BearAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BearAnim extends MediaAnimation {
public function BearAnim(){
addFrameScript(0, frame1, 1, frame2, 79, frame80, 80, frame81, 101, frame102, 102, frame103, 151, frame152, 152, frame153, 241, frame242);
}
public function walk():void{
gotoAndPlay("walk");
}
public function idle():void{
randomIdle();
}
public function down():void{
gotoAndPlay("down");
}
public function randomIdle():void{
var _local1:uint = Math.round((4 * Math.random()));
if (_local1 == 0){
gotoAndPlay("idle1");
} else {
gotoAndPlay("idle2");
};
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new BearSound());
}
function frame80(){
var _local1 = parent;
_local1["introEnd"]();
}
function frame81(){
playSound(new BearSound(), 3300);
}
function frame102(){
randomIdle();
}
function frame103(){
playSound(new BearSound(), 4300);
}
function frame152(){
randomIdle();
}
function frame153(){
playSound(new BearSound(), 6300);
}
function frame242(){
stop();
stopSound();
var _local1 = parent;
_local1["goNow"]();
}
}
}//package
Section 488
//BearSound (BearSound)
package {
import flash.media.*;
public dynamic class BearSound extends Sound {
}
}//package
Section 489
//BigRockRollsOutSound (BigRockRollsOutSound)
package {
import flash.media.*;
public dynamic class BigRockRollsOutSound extends Sound {
}
}//package
Section 490
//BlackScreenAnim (BlackScreenAnim)
package {
import lp.pge.game.*;
public dynamic class BlackScreenAnim extends MediaAnimation {
public var callback:Function;
public var cb:Function;
public function BlackScreenAnim(){
addFrameScript(0, frame1, 1, frame2, 16, frame17);
}
public function show(_arg1:Function=null):void{
this.callback = _arg1;
gotoAndPlay("appear");
}
public function hide():void{
gotoAndStop("none");
}
public function isShown():Boolean{
return ((currentLabel == "appear"));
}
public function isHidden():Boolean{
return (!((currentLabel == "appear")));
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new GatesClosingSound());
}
function frame17(){
stop();
stopSound();
if (callback != null){
cb = callback;
callback = null;
cb();
};
}
}
}//package
Section 491
//BonusImage (BonusImage)
package {
import flash.display.*;
public dynamic class BonusImage extends Sprite {
public var anim:MovieClip;
}
}//package
Section 492
//BonusShapePattern (BonusShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class BonusShapePattern extends AbstractShapePattern {
}
}//package
Section 493
//BonusSound (BonusSound)
package {
import flash.media.*;
public dynamic class BonusSound extends Sound {
}
}//package
Section 494
//BouncyBlockArcBottomDummy (BouncyBlockArcBottomDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class BouncyBlockArcBottomDummy extends BouncyBlockDummy {
}
}//package
Section 495
//BouncyBlockArcBottomImage (BouncyBlockArcBottomImage)
package {
import flash.display.*;
public dynamic class BouncyBlockArcBottomImage extends Sprite {
public var vArrows:MovieClip;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:MovieClip;
public var hPosInd:MovieClip;
}
}//package
Section 496
//BouncyBlockArcBottomShapePattern (BouncyBlockArcBottomShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BouncyBlockArcBottomShapePattern extends AbstractShapePattern {
public function BouncyBlockArcBottomShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard1.userData = "hazard";
hazard2.userData = "hazard";
hazard3.userData = "hazard";
hazard4.userData = "hazard";
hazard5.userData = "hazard";
hazard6.userData = "hazard";
hazard7.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 497
//BouncyBlockArcShapeSampler (BouncyBlockArcShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class BouncyBlockArcShapeSampler extends PolygonShapeSampler {
}
}//package
Section 498
//BouncyBlockArcTopDummy (BouncyBlockArcTopDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class BouncyBlockArcTopDummy extends BouncyBlockDummy {
}
}//package
Section 499
//BouncyBlockArcTopImage (BouncyBlockArcTopImage)
package {
import flash.display.*;
public dynamic class BouncyBlockArcTopImage extends Sprite {
public var vArrows:CupVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:CupHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 500
//BouncyBlockArcTopShapePattern (BouncyBlockArcTopShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BouncyBlockArcTopShapePattern extends AbstractShapePattern {
public function BouncyBlockArcTopShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard1.userData = "hazard";
hazard2.userData = "hazard";
hazard3.userData = "hazard";
hazard4.userData = "hazard";
hazard5.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 501
//BouncyBlockBottomDummy (BouncyBlockBottomDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class BouncyBlockBottomDummy extends BouncyBlockDummy {
}
}//package
Section 502
//BouncyBlockBottomImage (BouncyBlockBottomImage)
package {
import flash.display.*;
public dynamic class BouncyBlockBottomImage extends Sprite {
public var vArrows:BalkVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 503
//BouncyBlockBottomShapePattern (BouncyBlockBottomShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BouncyBlockBottomShapePattern extends AbstractShapePattern {
public function BouncyBlockBottomShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
hazard1.userData = "hazard";
hazard2.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 504
//BouncyBlockBottomShapeSampler (BouncyBlockBottomShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class BouncyBlockBottomShapeSampler extends PolygonShapeSampler {
}
}//package
Section 505
//BouncyBlockBottomShapeSampler2 (BouncyBlockBottomShapeSampler2)
package {
import lp.pge.game.samplers.*;
public dynamic class BouncyBlockBottomShapeSampler2 extends PolygonShapeSampler {
}
}//package
Section 506
//BouncyBlockCircleDummy (BouncyBlockCircleDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class BouncyBlockCircleDummy extends BouncyBlockDummy {
}
}//package
Section 507
//BouncyBlockCircleImage (BouncyBlockCircleImage)
package {
import flash.display.*;
public dynamic class BouncyBlockCircleImage extends Sprite {
public var vArrows:OrbVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:OrbHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 508
//BouncyBlockCircleShapePattern (BouncyBlockCircleShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class BouncyBlockCircleShapePattern extends AbstractShapePattern {
}
}//package
Section 509
//BouncyBlockRightDummy (BouncyBlockRightDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class BouncyBlockRightDummy extends BouncyBlockDummy {
}
}//package
Section 510
//BouncyBlockRightImage (BouncyBlockRightImage)
package {
import flash.display.*;
public dynamic class BouncyBlockRightImage extends Sprite {
public var vArrows:BalkV2Arrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkH2Arrows;
public var hPosInd:MovieClip;
}
}//package
Section 511
//BouncyBlockRightShapePattern (BouncyBlockRightShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BouncyBlockRightShapePattern extends AbstractShapePattern {
public function BouncyBlockRightShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
hazard1.userData = "hazard";
hazard2.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 512
//BouncyBlockTopDummy (BouncyBlockTopDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class BouncyBlockTopDummy extends BouncyBlockDummy {
}
}//package
Section 513
//BouncyBlockTopImage (BouncyBlockTopImage)
package {
import flash.display.*;
public dynamic class BouncyBlockTopImage extends Sprite {
public var vArrows:BalkVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 514
//BouncyBlockTopShapePattern (BouncyBlockTopShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BouncyBlockTopShapePattern extends AbstractShapePattern {
public function BouncyBlockTopShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
hazard1.userData = "hazard";
hazard2.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 515
//BouncyBlockTopShapeSampler (BouncyBlockTopShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class BouncyBlockTopShapeSampler extends PolygonShapeSampler {
}
}//package
Section 516
//BouncyBlockTopShapeSampler2 (BouncyBlockTopShapeSampler2)
package {
import lp.pge.game.samplers.*;
public dynamic class BouncyBlockTopShapeSampler2 extends PolygonShapeSampler {
}
}//package
Section 517
//BranchAnim (BranchAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BranchAnim extends MediaAnimation {
public function BranchAnim(){
addFrameScript(0, frame1, 1, frame2, 25, frame26, 60, frame61);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new BranchFallsSound());
}
function frame26(){
var _local1 = parent;
_local1["goNow"]();
}
function frame61(){
stop();
stopSound();
}
}
}//package
Section 518
//BranchFallsSound (BranchFallsSound)
package {
import flash.media.*;
public dynamic class BranchFallsSound extends Sound {
}
}//package
Section 519
//ButtonClickSound (ButtonClickSound)
package {
import flash.media.*;
public dynamic class ButtonClickSound extends Sound {
}
}//package
Section 520
//CardAxe (CardAxe)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardAxe extends CardButton {
public function CardAxe(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 521
//CardBoots (CardBoots)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardBoots extends CardButton {
public function CardBoots(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 522
//CardHelmet (CardHelmet)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardHelmet extends CardButton {
public function CardHelmet(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 523
//CardJerkin (CardJerkin)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardJerkin extends CardButton {
public function CardJerkin(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 524
//CardPants (CardPants)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardPants extends CardButton {
public function CardPants(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 525
//CardShield (CardShield)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardShield extends CardButton {
public function CardShield(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 526
//CardShirt (CardShirt)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardShirt extends CardButton {
public function CardShirt(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 527
//CardVest (CardVest)
package {
import lp.pge.menu.buttons.*;
public dynamic class CardVest extends CardButton {
public function CardVest(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 528
//CavernAmb (CavernAmb)
package {
import flash.media.*;
public dynamic class CavernAmb extends Sound {
}
}//package
Section 529
//CaveTheme (CaveTheme)
package {
import flash.media.*;
public dynamic class CaveTheme extends Sound {
}
}//package
Section 530
//CrashSound (CrashSound)
package {
import flash.media.*;
public dynamic class CrashSound extends Sound {
}
}//package
Section 531
//CrocodileAnim (CrocodileAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class CrocodileAnim extends MediaAnimation {
public function CrocodileAnim(){
addFrameScript(0, frame1, 39, frame40, 40, frame41, 77, frame78, 78, frame79, 105, frame106);
}
function frame1(){
playSound(new CrocodileSound());
}
function frame40(){
if (Math.round((3 * Math.random())) == 3){
gotoAndPlay("raise");
} else {
gotoAndPlay(1);
};
}
function frame41(){
playSound(new CrocodileSound(), 1700);
}
function frame78(){
gotoAndPlay(1);
}
function frame79(){
playSound(new CrocodileHitSound(), 3300);
}
function frame106(){
stop();
stopSound();
var _local1 = parent;
_local1["goNow"]();
}
}
}//package
Section 532
//CrocodileHitSound (CrocodileHitSound)
package {
import flash.media.*;
public dynamic class CrocodileHitSound extends Sound {
}
}//package
Section 533
//CrocodileSound (CrocodileSound)
package {
import flash.media.*;
public dynamic class CrocodileSound extends Sound {
}
}//package
Section 534
//CupHArrows (CupHArrows)
package {
import lp.pge.game.gui.*;
public dynamic class CupHArrows extends ArrowsIcon {
}
}//package
Section 535
//CupVArrows (CupVArrows)
package {
import lp.pge.game.gui.*;
public dynamic class CupVArrows extends ArrowsIcon {
}
}//package
Section 536
//DamExplodesSound (DamExplodesSound)
package {
import flash.media.*;
public dynamic class DamExplodesSound extends Sound {
}
}//package
Section 537
//DebrisAnim (DebrisAnim)
package {
import lp.pge.game.*;
public dynamic class DebrisAnim extends MediaAnimation {
public function DebrisAnim(){
addFrameScript(0, frame1, 1, frame2, 39, frame40);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new DamExplodesSound());
}
function frame40(){
stop();
stopSound();
}
}
}//package
Section 538
//Dragon1Anim (Dragon1Anim)
package {
import lp.pge.game.*;
public dynamic class Dragon1Anim extends MediaAnimation {
public var chance:uint;
public function Dragon1Anim(){
addFrameScript(0, frame1, 140, frame141, 178, frame179, 228, frame229, 0xFF, frame256, 0x0100, frame257, 331, frame332);
}
public function fly():void{
gotoAndPlay("fly");
}
public function flyAway():void{
gotoAndPlay("flyAway");
}
public function land():void{
gotoAndPlay("land");
}
public function idle():void{
gotoAndPlay("idle");
}
public function destroyThis():void{
stop();
}
function frame1(){
stop();
}
function frame141(){
gotoAndPlay(2);
}
function frame179(){
chance = Math.round((3 * Math.random()));
if (chance == 3){
playSound(new DragonSound());
};
}
function frame229(){
gotoAndPlay(179);
}
function frame256(){
gotoAndPlay(205);
}
function frame257(){
stopSound();
}
function frame332(){
stop();
}
}
}//package
Section 539
//Dragon2Anim (Dragon2Anim)
package {
import lp.pge.game.*;
public dynamic class Dragon2Anim extends MediaAnimation {
public function Dragon2Anim(){
addFrameScript(0, frame1, 140, frame141, 178, frame179, 228, frame229, 0xFF, frame256, 0x0100, frame257, 321, frame322);
}
public function fly():void{
gotoAndPlay("fly");
}
public function flyAway():void{
gotoAndPlay("flyAway");
}
public function land():void{
gotoAndPlay("land");
}
public function idle():void{
gotoAndPlay("idle");
}
public function destroyThis():void{
stop();
}
function frame1(){
stop();
}
function frame141(){
gotoAndPlay(2);
}
function frame179(){
}
function frame229(){
gotoAndPlay(179);
}
function frame256(){
gotoAndPlay(205);
}
function frame257(){
}
function frame322(){
stop();
}
}
}//package
Section 540
//Dragon3Anim (Dragon3Anim)
package {
import lp.pge.game.*;
public dynamic class Dragon3Anim extends MediaAnimation {
public function Dragon3Anim(){
addFrameScript(0, frame1, 140, frame141, 178, frame179, 228, frame229, 0xFF, frame256, 0x0100, frame257, 321, frame322);
}
public function fly():void{
gotoAndPlay("fly");
}
public function flyAway():void{
gotoAndPlay("flyAway");
}
public function land():void{
gotoAndPlay("land");
}
public function idle():void{
gotoAndPlay("idle");
}
public function destroyThis():void{
stop();
}
function frame1(){
stop();
}
function frame141(){
gotoAndPlay(2);
}
function frame179(){
}
function frame229(){
gotoAndPlay(179);
}
function frame256(){
gotoAndPlay(205);
}
function frame257(){
}
function frame322(){
stop();
}
}
}//package
Section 541
//DragonSound (DragonSound)
package {
import flash.media.*;
public dynamic class DragonSound extends Sound {
}
}//package
Section 542
//EvilWindFaceAnim (EvilWindFaceAnim)
package {
import lp.pge.game.*;
public dynamic class EvilWindFaceAnim extends MediaAnimation {
public function EvilWindFaceAnim(){
addFrameScript(0, frame1, 1, frame2, 47, frame48, 48, frame49, 95, frame96);
}
public function randomAction():void{
var _local1:uint = Math.round((4 * Math.random()));
if ((((_local1 == 0)) && (!((currentLabel == "laugh"))))){
gotoAndPlay("laugh");
} else {
playSound(new EvilWindIdleSound());
gotoAndPlay("idle");
};
}
public function stopAction():void{
gotoAndStop(1);
stopSound();
}
public function laugh():void{
gotoAndPlay("laugh");
}
public function idle():void{
playSound(new EvilWindIdleSound());
gotoAndPlay("idle");
}
function frame1(){
}
function frame2(){
playSound(new EvilWindLaughSound());
}
function frame48(){
stop();
randomAction();
}
function frame49(){
playSound(new EvilWindIdleSound());
}
function frame96(){
stop();
randomAction();
}
}
}//package
Section 543
//EvilWindIdleSound (EvilWindIdleSound)
package {
import flash.media.*;
public dynamic class EvilWindIdleSound extends Sound {
}
}//package
Section 544
//EvilWindLaughSound (EvilWindLaughSound)
package {
import flash.media.*;
public dynamic class EvilWindLaughSound extends Sound {
}
}//package
Section 545
//EvilWindSound (EvilWindSound)
package {
import flash.media.*;
public dynamic class EvilWindSound extends Sound {
}
}//package
Section 546
//ForestAmb (ForestAmb)
package {
import flash.media.*;
public dynamic class ForestAmb extends Sound {
}
}//package
Section 547
//GatesClosingSound (GatesClosingSound)
package {
import flash.media.*;
public dynamic class GatesClosingSound extends Sound {
}
}//package
Section 548
//GeyserAnim (GeyserAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class GeyserAnim extends MediaAnimation {
public var waterAnim:MovieClip;
public function GeyserAnim(){
addFrameScript(0, frame1, 1, frame2, 12, frame13);
}
public function run():void{
waterAnim.run();
}
public function halt():void{
waterAnim.halt();
}
public function reset():void{
gotoAndStop(1);
waterAnim.reset();
}
public function destroyThis():void{
stop();
waterAnim.halt();
}
function frame1(){
stop();
run();
}
function frame2(){
stopSound;
}
function frame13(){
stop();
}
}
}//package
Section 549
//HeavenLightAnim (HeavenLightAnim)
package {
import flash.display.*;
import lp.pge.game.*;
public dynamic class HeavenLightAnim extends MediaAnimation {
public var light:MovieClip;
public function HeavenLightAnim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 13, frame14);
}
public function disappear():void{
gotoAndPlay("disappear");
}
public function animate():void{
gotoAndStop("anim");
}
public function terminate():void{
gotoAndStop("none");
}
function frame1(){
stop();
mouseChildren = false;
mouseEnabled = false;
stopSound();
}
function frame2(){
stop();
light.gotoAndPlay(2);
playSound(new HolyLightSound());
}
function frame3(){
light.gotoAndStop(1);
stopSound();
}
function frame14(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
}
}
}//package
Section 550
//HolyBallSound (HolyBallSound)
package {
import flash.media.*;
public dynamic class HolyBallSound extends Sound {
}
}//package
Section 551
//HolyLightSound (HolyLightSound)
package {
import flash.media.*;
public dynamic class HolyLightSound extends Sound {
}
}//package
Section 552
//IceRock (IceRock)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class IceRock extends MediaAnimation {
public function IceRock(){
addFrameScript(0, frame1, 1, frame2, 14, frame15);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new IceRockBreaksSound());
}
function frame15(){
stop();
stopSound();
var _local1 = parent;
_local1["goNow"]();
}
}
}//package
Section 553
//IceRockBreaksSound (IceRockBreaksSound)
package {
import flash.media.*;
public dynamic class IceRockBreaksSound extends Sound {
}
}//package
Section 554
//IceRoofAnim (IceRoofAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class IceRoofAnim extends MediaAnimation {
public function IceRoofAnim(){
addFrameScript(0, frame1, 2, frame3, 32, frame33);
}
function frame1(){
stop();
stopSound();
}
function frame3(){
playSound(new IcicleBreaksSound());
}
function frame33(){
stop();
stopSound();
var _local1 = parent;
_local1["initPhase2"]();
}
}
}//package
Section 555
//IcicleAnim1 (IcicleAnim1)
package {
import lp.pge.game.*;
public dynamic class IcicleAnim1 extends MediaAnimation {
public function IcicleAnim1(){
addFrameScript(0, frame1, 1, frame2, 13, frame14);
}
public function reset():void{
gotoAndStop(1);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new IcicleBreaksSound());
}
function frame14(){
stop();
stopSound();
}
}
}//package
Section 556
//IcicleAnim2 (IcicleAnim2)
package {
import lp.pge.game.*;
public dynamic class IcicleAnim2 extends MediaAnimation {
public function IcicleAnim2(){
addFrameScript(0, frame1, 1, frame2, 13, frame14);
}
public function reset():void{
gotoAndStop(1);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new IcicleBreaksSound());
}
function frame14(){
stop();
stopSound();
}
}
}//package
Section 557
//IcicleAnim3 (IcicleAnim3)
package {
import lp.pge.game.*;
public dynamic class IcicleAnim3 extends MediaAnimation {
public function IcicleAnim3(){
addFrameScript(0, frame1, 1, frame2, 12, frame13);
}
public function reset():void{
gotoAndStop(1);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new IcicleBreaksSound());
}
function frame13(){
stop();
stopSound();
}
}
}//package
Section 558
//IcicleAnim4 (IcicleAnim4)
package {
import lp.pge.game.*;
public dynamic class IcicleAnim4 extends MediaAnimation {
public function IcicleAnim4(){
addFrameScript(0, frame1, 1, frame2, 12, frame13);
}
public function reset():void{
gotoAndStop(1);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new IcicleBreaksSound());
}
function frame13(){
stop();
stopSound();
}
}
}//package
Section 559
//IcicleAnim5 (IcicleAnim5)
package {
import lp.pge.game.*;
public dynamic class IcicleAnim5 extends MediaAnimation {
public function IcicleAnim5(){
addFrameScript(0, frame1, 1, frame2, 13, frame14);
}
public function reset():void{
gotoAndStop(1);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new IcicleBreaksSound());
}
function frame14(){
stop();
stopSound();
}
}
}//package
Section 560
//IcicleBreaksSound (IcicleBreaksSound)
package {
import flash.media.*;
public dynamic class IcicleBreaksSound extends Sound {
}
}//package
Section 561
//IronHit (IronHit)
package {
import flash.media.*;
public dynamic class IronHit extends Sound {
}
}//package
Section 562
//JumpingSpikesImage (JumpingSpikesImage)
package {
import flash.display.*;
public dynamic class JumpingSpikesImage extends Sprite {
public var anim:MovieClip;
}
}//package
Section 563
//L01GeometryDummy (L01GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L01GeometryDummy extends GeometryDummy {
}
}//package
Section 564
//L01GeometryShapePattern (L01GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L01GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 565
//L02GeometryDummy (L02GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L02GeometryDummy extends GeometryDummy {
}
}//package
Section 566
//L02GeometryShapePattern (L02GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L02GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 567
//L03GeometryDummy (L03GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L03GeometryDummy extends GeometryDummy {
}
}//package
Section 568
//L03GeometryShapePattern (L03GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L03GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 569
//L04GeometryDummy (L04GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L04GeometryDummy extends GeometryDummy {
}
}//package
Section 570
//L04GeometryShapePattern (L04GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L04GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 571
//L05GeometryDummy (L05GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L05GeometryDummy extends GeometryDummy {
}
}//package
Section 572
//L05GeometryShapePattern (L05GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L05GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 573
//L06GeometryDummy (L06GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L06GeometryDummy extends GeometryDummy {
}
}//package
Section 574
//L06GeometryShapePattern (L06GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L06GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 575
//L07GeometryDummy (L07GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L07GeometryDummy extends GeometryDummy {
}
}//package
Section 576
//L07GeometryShapePattern (L07GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L07GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 577
//L08GeometryDummy (L08GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L08GeometryDummy extends GeometryDummy {
}
}//package
Section 578
//L08GeometryShapePattern (L08GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L08GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 579
//L09GeometryDummy (L09GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L09GeometryDummy extends GeometryDummy {
}
}//package
Section 580
//L09GeometryShapePattern (L09GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L09GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 581
//L10GeometryDummy (L10GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L10GeometryDummy extends GeometryDummy {
}
}//package
Section 582
//L10GeometryShapePattern (L10GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L10GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 583
//L11GeometryDummy (L11GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L11GeometryDummy extends GeometryDummy {
}
}//package
Section 584
//L11GeometryShapePattern (L11GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L11GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 585
//L12GeometryDummy (L12GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L12GeometryDummy extends GeometryDummy {
}
}//package
Section 586
//L12GeometryShapePattern (L12GeometryShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L12GeometryShapePattern extends AbstractShapePattern {
public function L12GeometryShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
water.userData = "water";
};
}
function frame1(){
}
}
}//package
Section 587
//L13GeometryDummy (L13GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L13GeometryDummy extends GeometryDummy {
}
}//package
Section 588
//L13GeometryShapePattern (L13GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L13GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 589
//L14GeometryDummy (L14GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L14GeometryDummy extends GeometryDummy {
}
}//package
Section 590
//L14GeometryShapePattern (L14GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L14GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 591
//L15GeometryDummy (L15GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L15GeometryDummy extends GeometryDummy {
}
}//package
Section 592
//L15GeometryShapePattern (L15GeometryShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L15GeometryShapePattern extends AbstractShapePattern {
public function L15GeometryShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
water.userData = "water";
};
}
function frame1(){
}
}
}//package
Section 593
//L16GeometryDummy (L16GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L16GeometryDummy extends GeometryDummy {
}
}//package
Section 594
//L16GeometryShapePattern (L16GeometryShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L16GeometryShapePattern extends AbstractShapePattern {
public function L16GeometryShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
water.userData = "water";
};
}
function frame1(){
}
}
}//package
Section 595
//L17GeometryDummy (L17GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L17GeometryDummy extends GeometryDummy {
}
}//package
Section 596
//L17GeometryShapePattern (L17GeometryShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class L17GeometryShapePattern extends AbstractShapePattern {
public function L17GeometryShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
water.userData = "water";
};
}
function frame1(){
}
}
}//package
Section 597
//L18GeometryDummy (L18GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L18GeometryDummy extends GeometryDummy {
}
}//package
Section 598
//L18GeometryShapePattern (L18GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L18GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 599
//L19GeometryDummy (L19GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L19GeometryDummy extends GeometryDummy {
}
}//package
Section 600
//L19GeometryShapePattern (L19GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L19GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 601
//L20GeometryDummy (L20GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L20GeometryDummy extends GeometryDummy {
}
}//package
Section 602
//L20GeometryShapePattern (L20GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L20GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 603
//L21GeometryDummy (L21GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L21GeometryDummy extends GeometryDummy {
}
}//package
Section 604
//L21GeometryShapePattern (L21GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L21GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 605
//L22GeometryDummy (L22GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L22GeometryDummy extends GeometryDummy {
}
}//package
Section 606
//L22GeometryShapePattern (L22GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L22GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 607
//L23GeometryDummy (L23GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L23GeometryDummy extends GeometryDummy {
}
}//package
Section 608
//L23GeometryShapePattern (L23GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L23GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 609
//L24GeometryDummy (L24GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L24GeometryDummy extends GeometryDummy {
}
}//package
Section 610
//L24GeometryShapePattern (L24GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L24GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 611
//L25GeometryDummy (L25GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L25GeometryDummy extends GeometryDummy {
}
}//package
Section 612
//L25GeometryShapePattern (L25GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L25GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 613
//L26GeometryDummy (L26GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L26GeometryDummy extends GeometryDummy {
}
}//package
Section 614
//L26GeometryShapePattern (L26GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L26GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 615
//L27GeometryDummy (L27GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L27GeometryDummy extends GeometryDummy {
}
}//package
Section 616
//L27GeometryShapePattern (L27GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L27GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 617
//L28GeometryDummy (L28GeometryDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class L28GeometryDummy extends GeometryDummy {
}
}//package
Section 618
//L28GeometryShapePattern (L28GeometryShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class L28GeometryShapePattern extends AbstractShapePattern {
}
}//package
Section 619
//Land00 (Land00)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land00 extends LandButton {
public function Land00(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package
Section 620
//Land01 (Land01)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land01 extends LandButton {
public function Land01(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package
Section 621
//Land02 (Land02)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land02 extends LandButton {
public function Land02(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package
Section 622
//Land03 (Land03)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land03 extends LandButton {
public function Land03(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package
Section 623
//Land04 (Land04)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land04 extends LandButton {
public function Land04(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package
Section 624
//Land05 (Land05)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land05 extends LandButton {
public function Land05(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package
Section 625
//Land06 (Land06)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land06 extends LandButton {
public function Land06(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package
Section 626
//Land07 (Land07)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land07 extends LandButton {
public function Land07(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package
Section 627
//Land08 (Land08)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land08 extends LandButton {
public function Land08(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package
Section 628
//Land09 (Land09)
package {
import lp.pge.menu.buttons.*;
public dynamic class Land09 extends LandButton {
public function Land09(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package
Section 629
//Level01 (Level01)
package {
import lp.pge.game.*;
public dynamic class Level01 extends Level {
}
}//package
Section 630
//Level01Anim (Level01Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level01Anim extends LevelAnimation {
public var thornAnim:MovieClip;
public function Level01Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
thornAnim.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
thornAnim.destroy();
removeEventListener(ScriptEvent.L01_THORN_BROKEN, onThornBroken);
};
addEventListener(ScriptEvent.L01_THORN_BROKEN, onThornBroken);
}
public function onThornBroken(_arg1:ScriptEvent):void{
thornAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 631
//Level02 (Level02)
package {
import lp.pge.game.*;
public dynamic class Level02 extends Level {
}
}//package
Section 632
//Level02Anim (Level02Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level02Anim extends LevelAnimation {
public var thornAnim1:MovieClip;
public var thornAnim2:MovieClip;
public function Level02Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
thornAnim1.reset();
thornAnim2.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
thornAnim1.destroy();
thornAnim2.destroy();
removeEventListener(ScriptEvent.L02_THORN_1_BROKEN, onThorn1Broken);
removeEventListener(ScriptEvent.L02_THORN_2_BROKEN, onThorn2Broken);
};
addEventListener(ScriptEvent.L02_THORN_1_BROKEN, onThorn1Broken);
addEventListener(ScriptEvent.L02_THORN_2_BROKEN, onThorn2Broken);
}
public function onThorn1Broken(_arg1:ScriptEvent):void{
thornAnim1.gotoAndPlay(2);
}
public function onThorn2Broken(_arg1:ScriptEvent):void{
thornAnim2.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 633
//Level03 (Level03)
package {
import lp.pge.game.*;
public dynamic class Level03 extends Level {
}
}//package
Section 634
//Level03Anim (Level03Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level03Anim extends LevelAnimation {
public var thornAnim:MovieClip;
public function Level03Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
thornAnim.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
thornAnim.destroy();
removeEventListener(ScriptEvent.L03_THORN_BROKEN, onThornBroken);
};
addEventListener(ScriptEvent.L03_THORN_BROKEN, onThornBroken);
}
public function onThornBroken(_arg1:ScriptEvent):void{
thornAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 635
//Level04 (Level04)
package {
import lp.pge.game.*;
public dynamic class Level04 extends Level {
}
}//package
Section 636
//Level04Anim (Level04Anim)
package {
import lp.pge.game.*;
import flash.display.*;
public dynamic class Level04Anim extends LevelAnimation {
public var treeAnim:MovieClip;
public var tr01;
public var tr02;
public var tr03;
public var tr04:MovieClip;
public function Level04Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
treeAnim.gotoAndStop(1);
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
treeAnim.stop();
removeEventListener(ScriptEvent.L04_TREE_HIT, onTreeHit);
};
addEventListener(ScriptEvent.L04_TREE_HIT, onTreeHit);
}
public function onTreeHit(_arg1:ScriptEvent):void{
treeAnim.gotoAndPlay(2);
}
public function goNow():void{
charAnim.walk([null, tr01, tr02, tr03, {x:tr04.x, y:tr04.y, r:tr04.rotation, cb:goBlack}, {x:(charXPos + STD_OFFSET_RIGHT), y:424}], charAnim.halt);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 637
//Level05 (Level05)
package {
import lp.pge.game.*;
public dynamic class Level05 extends Level {
}
}//package
Section 638
//Level05Anim (Level05Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level05Anim extends LevelAnimation {
public var volcanoAnim:MovieClip;
public function Level05Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
volcanoAnim.reset();
};
onLevelComplete = function ():void{
stdLeave();
volcanoAnim.halt();
};
onLevelUnload = function ():void{
volcanoAnim.destroy();
removeEventListener(ScriptEvent.L05_VOLCANO_BLOCKED, onVolcanoBlocked);
};
addEventListener(ScriptEvent.L05_VOLCANO_BLOCKED, onVolcanoBlocked);
}
public function onVolcanoBlocked(_arg1:ScriptEvent):void{
volcanoAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 639
//Level06 (Level06)
package {
import lp.pge.game.*;
public dynamic class Level06 extends Level {
}
}//package
Section 640
//Level06Anim (Level06Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level06Anim extends LevelAnimation {
public var volcanoAnim1:MovieClip;
public var volcanoAnim2:MovieClip;
public function Level06Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
volcanoAnim1.reset();
volcanoAnim2.reset();
};
onLevelComplete = function ():void{
stdLeave();
volcanoAnim1.halt();
volcanoAnim2.halt();
};
onLevelUnload = function ():void{
volcanoAnim1.destroy();
volcanoAnim2.destroy();
removeEventListener(ScriptEvent.L06_VOLCANO_1_BLOCKED, onVolcano1Blocked);
removeEventListener(ScriptEvent.L06_VOLCANO_2_BLOCKED, onVolcano2Blocked);
};
addEventListener(ScriptEvent.L06_VOLCANO_1_BLOCKED, onVolcano1Blocked);
addEventListener(ScriptEvent.L06_VOLCANO_2_BLOCKED, onVolcano2Blocked);
}
public function onVolcano1Blocked(_arg1:ScriptEvent):void{
volcanoAnim1.gotoAndPlay(2);
}
public function onVolcano2Blocked(_arg1:ScriptEvent):void{
volcanoAnim2.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 641
//Level07 (Level07)
package {
import lp.pge.game.*;
public dynamic class Level07 extends Level {
}
}//package
Section 642
//Level07Anim (Level07Anim)
package {
import lp.pge.game.*;
import flash.display.*;
public dynamic class Level07Anim extends LevelAnimation {
public var stoneAnim:MovieClip;
public function Level07Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
stoneAnim.gotoAndStop(1);
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
stoneAnim.stop();
removeEventListener(ScriptEvent.L07_BIG_STONE_HIT, onBigStoneHit);
removeEventListener(ScriptEvent.L07_BIG_STONE_PUSH, onBigStonePush);
};
addEventListener(ScriptEvent.L07_BIG_STONE_HIT, onBigStoneHit);
addEventListener(ScriptEvent.L07_BIG_STONE_PUSH, onBigStonePush);
}
public function goNow():void{
stdLeave();
}
public function onBigStoneHit(_arg1:ScriptEvent):void{
stoneAnim.gotoAndPlay("rock");
}
public function onBigStonePush(_arg1:ScriptEvent):void{
stoneAnim.gotoAndPlay("fall");
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 643
//Level08 (Level08)
package {
import lp.pge.game.*;
public dynamic class Level08 extends Level {
}
}//package
Section 644
//Level08Anim (Level08Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level08Anim extends LevelAnimation {
public var volcanoAnim1:MovieClip;
public var volcanoAnim2:MovieClip;
public function Level08Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
volcanoAnim1.reset();
volcanoAnim2.reset();
};
onLevelComplete = function ():void{
stdLeave();
volcanoAnim1.halt();
volcanoAnim2.halt();
};
onLevelUnload = function ():void{
volcanoAnim1.destroy();
volcanoAnim2.destroy();
removeEventListener(ScriptEvent.L08_VOLCANO_1_BLOCKED, onVolcano1Blocked);
removeEventListener(ScriptEvent.L08_VOLCANO_2_BLOCKED, onVolcano2Blocked);
};
addEventListener(ScriptEvent.L08_VOLCANO_1_BLOCKED, onVolcano1Blocked);
addEventListener(ScriptEvent.L08_VOLCANO_2_BLOCKED, onVolcano2Blocked);
}
public function onVolcano1Blocked(_arg1:ScriptEvent):void{
volcanoAnim1.gotoAndPlay(2);
}
public function onVolcano2Blocked(_arg1:ScriptEvent):void{
volcanoAnim2.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 645
//Level09 (Level09)
package {
import lp.pge.game.*;
public dynamic class Level09 extends Level {
}
}//package
Section 646
//Level09Anim (Level09Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level09Anim extends LevelAnimation {
public var volcanoAnim:MovieClip;
public function Level09Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
volcanoAnim.reset();
};
onLevelComplete = function ():void{
stdLeave();
volcanoAnim.halt();
};
onLevelUnload = function ():void{
volcanoAnim.destroy();
removeEventListener(ScriptEvent.L09_VOLCANO_BLOCKED, onVolcanoBlocked);
};
addEventListener(ScriptEvent.L09_VOLCANO_BLOCKED, onVolcanoBlocked);
}
public function onVolcanoBlocked(_arg1:ScriptEvent):void{
volcanoAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 647
//Level10 (Level10)
package {
import lp.pge.game.*;
public dynamic class Level10 extends Level {
}
}//package
Section 648
//Level10Anim (Level10Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level10Anim extends LevelAnimation {
public var icicleAnim1:MovieClip;
public var icicleAnim2:MovieClip;
public function Level10Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
icicleAnim1.reset();
icicleAnim2.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
icicleAnim1.destroy();
icicleAnim2.destroy();
removeEventListener(ScriptEvent.L10_ICICLE_1_BROKEN, onIcicle1Broken);
removeEventListener(ScriptEvent.L10_ICICLE_2_BROKEN, onIcicle2Broken);
};
addEventListener(ScriptEvent.L10_ICICLE_1_BROKEN, onIcicle1Broken);
addEventListener(ScriptEvent.L10_ICICLE_2_BROKEN, onIcicle2Broken);
}
public function onIcicle1Broken(_arg1:ScriptEvent):void{
icicleAnim1.gotoAndPlay(2);
}
public function onIcicle2Broken(_arg1:ScriptEvent):void{
icicleAnim2.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 649
//Level11 (Level11)
package {
import lp.pge.game.*;
public dynamic class Level11 extends Level {
}
}//package
Section 650
//Level11Anim (Level11Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level11Anim extends LevelAnimation {
public var icicleAnim1:MovieClip;
public var icicleAnim2:MovieClip;
public var icicleAnim3:MovieClip;
public function Level11Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
icicleAnim1.reset();
icicleAnim2.reset();
icicleAnim3.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
icicleAnim1.destroy();
icicleAnim2.destroy();
icicleAnim3.destroy();
removeEventListener(ScriptEvent.L11_ICICLE_1_BROKEN, onIcicle1Broken);
removeEventListener(ScriptEvent.L11_ICICLE_2_BROKEN, onIcicle2Broken);
removeEventListener(ScriptEvent.L11_ICICLE_3_BROKEN, onIcicle3Broken);
};
addEventListener(ScriptEvent.L11_ICICLE_1_BROKEN, onIcicle1Broken);
addEventListener(ScriptEvent.L11_ICICLE_2_BROKEN, onIcicle2Broken);
addEventListener(ScriptEvent.L11_ICICLE_3_BROKEN, onIcicle3Broken);
}
public function onIcicle1Broken(_arg1:ScriptEvent):void{
icicleAnim1.gotoAndPlay(2);
}
public function onIcicle2Broken(_arg1:ScriptEvent):void{
icicleAnim2.gotoAndPlay(2);
}
public function onIcicle3Broken(_arg1:ScriptEvent):void{
icicleAnim3.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 651
//Level12 (Level12)
package {
import lp.pge.game.*;
public dynamic class Level12 extends Level {
}
}//package
Section 652
//Level12Anim (Level12Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level12Anim extends LevelAnimation {
public var waterAnim:MovieClip;
public var waterfallAnim:MovieClip;
public function Level12Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
var _local2 = this;
with (_local2) {
overlayObjects = [waterAnim, leftShore, rightShore];
};
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
waterAnim.gotoAndStop(1);
waterfallAnim.gotoAndStop(1);
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
waterAnim.gotoAndStop(1);
waterAnim.levelAnim = undefined;
waterfallAnim.destroy();
removeEventListener(ScriptEvent.L12_WATERFALL_BLOCKED, onWaterfallBlocked);
};
addEventListener(ScriptEvent.L12_WATERFALL_BLOCKED, onWaterfallBlocked);
}
public function goNow():void{
stdLeave();
}
public function onWaterfallBlocked(_arg1:ScriptEvent):void{
waterfallAnim.gotoAndPlay(2);
waterAnim.levelAnim = this;
waterAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 653
//Level13 (Level13)
package {
import lp.pge.game.*;
public dynamic class Level13 extends Level {
}
}//package
Section 654
//Level13Anim (Level13Anim)
package {
import lp.pge.game.*;
import flash.display.*;
public dynamic class Level13Anim extends LevelAnimation {
public var rockAnim:MovieClip;
public function Level13Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
rockAnim.gotoAndStop(1);
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
rockAnim.gotoAndStop(1);
removeEventListener(ScriptEvent.L13_ROCK_HIT, onRockHit);
};
addEventListener(ScriptEvent.L13_ROCK_HIT, onRockHit);
}
public function onRockHit(_arg1:ScriptEvent):void{
rockAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 655
//Level14 (Level14)
package {
import lp.pge.game.*;
public dynamic class Level14 extends Level {
}
}//package
Section 656
//Level14Anim (Level14Anim)
package {
import lp.pge.game.*;
import flash.display.*;
public dynamic class Level14Anim extends LevelAnimation {
public var branchAnim:MovieClip;
public function Level14Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
branchAnim.gotoAndStop(1);
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
branchAnim.gotoAndStop(1);
removeEventListener(ScriptEvent.L14_BRANCH_HIT, onBranchHit);
};
addEventListener(ScriptEvent.L14_BRANCH_HIT, onBranchHit);
}
public function goNow():void{
stdLeave();
}
public function onBranchHit(_arg1:ScriptEvent):void{
branchAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 657
//Level15 (Level15)
package {
import lp.pge.game.*;
public dynamic class Level15 extends Level {
}
}//package
Section 658
//Level15Anim (Level15Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level15Anim extends LevelAnimation {
public var crocodile:MovieClip;
public function Level15Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
var _local2 = this;
with (_local2) {
overlayObjects = [water, shore];
};
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
crocodile.gotoAndPlay(1);
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
crocodile.gotoAndStop(1);
removeEventListener(ScriptEvent.L15_CROCODILE_HIT, onCrocodileHit);
};
addEventListener(ScriptEvent.L15_CROCODILE_HIT, onCrocodileHit);
}
public function goNow():void{
charAnim.walk([null, {x:(charXPos + 75), cb:goBlack}, {x:(charXPos + 125)}], charAnim.halt);
}
public function onCrocodileHit(_arg1:ScriptEvent):void{
crocodile.gotoAndPlay("down");
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 659
//Level16 (Level16)
package {
import lp.pge.game.*;
public dynamic class Level16 extends Level {
}
}//package
Section 660
//Level16Anim (Level16Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level16Anim extends LevelAnimation {
public var debrisAnim:MovieClip;
public var crocAnim:MovieClip;
public function Level16Anim(){
addFrameScript(0, frame1, 71, frame72, 72, frame73, 130, frame131, 145, frame146);
}
public function init():void{
var _local2 = this;
with (_local2) {
overlayObjects = [water];
};
onLevelStart = function ():void{
crocAnim.charAnim.randomIdle();
};
onLevelRestart = function ():void{
crocAnim.charAnim.randomIdle();
debrisAnim.gotoAndStop(1);
};
onLevelUnload = function ():void{
stop();
debrisAnim.gotoAndStop(1);
removeEventListener(ScriptEvent.L16_DEBRIS_HIT, onDebrisHit);
};
addEventListener(ScriptEvent.L16_DEBRIS_HIT, onDebrisHit);
}
public function onDebrisHit(_arg1:ScriptEvent):void{
debrisAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame72(){
introEnd();
}
function frame73(){
stop();
}
function frame131(){
goBlack();
}
function frame146(){
stop();
}
}
}//package
Section 661
//Level17 (Level17)
package {
import lp.pge.game.*;
public dynamic class Level17 extends Level {
}
}//package
Section 662
//Level17Anim (Level17Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level17Anim extends LevelAnimation {
public var waterfallAnim:MovieClip;
public var crocAnim:MovieClip;
public function Level17Anim(){
addFrameScript(0, frame1, 71, frame72, 72, frame73, 105, frame106, 120, frame121);
}
public function init():void{
var _local2 = this;
with (_local2) {
overlayObjects = [water, shore];
};
onLevelStart = function ():void{
crocAnim.charAnim.randomIdle();
};
onLevelRestart = function ():void{
crocAnim.charAnim.randomIdle();
waterfallAnim.gotoAndStop(1);
};
onLevelUnload = function ():void{
stop();
waterfallAnim.destroy();
removeEventListener(ScriptEvent.L17_WATERFALL_BLOCKED, onWaterfallBlocked);
};
addEventListener(ScriptEvent.L17_WATERFALL_BLOCKED, onWaterfallBlocked);
}
public function onWaterfallBlocked(_arg1:ScriptEvent):void{
waterfallAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame72(){
introEnd();
}
function frame73(){
stop();
}
function frame106(){
goBlack();
}
function frame121(){
stop();
}
}
}//package
Section 663
//Level18 (Level18)
package {
import lp.pge.game.*;
public dynamic class Level18 extends Level {
}
}//package
Section 664
//Level18Anim (Level18Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level18Anim extends LevelAnimation {
public var dragonAnim:MovieClip;
public var startPos:Number;
public function Level18Anim(){
addFrameScript(0, frame1, 99, frame100, 228, frame229, 229, frame230, 251, frame252, 305, frame306);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
var _local1:Number = (Math.ceil(((charXPos - SUFF_POS_LEFT) / SHIFT_PER_STEP)) * SHIFT_PER_STEP);
charAnim.x = (charXPos - _local1);
};
onLevelRestart = function ():void{
resetCharAnim();
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
stop();
if (dragonAnim){
dragonAnim.destroy();
};
removeEventListener(ScriptEvent.L18_DRAGON_HIT, onDragonHit);
};
addEventListener(ScriptEvent.L18_DRAGON_HIT, onDragonHit);
}
public function onDragonHit(_arg1:ScriptEvent):void{
}
function frame1(){
stop();
}
function frame100(){
startPos = (Math.ceil(((charXPos - SUFF_POS_LEFT) / SHIFT_PER_STEP)) * SHIFT_PER_STEP);
charAnim.walk([{x:(charXPos - startPos)}, {x:charXPos}], function ():void{
charAnim.halt(charAnim.randomIdle);
});
}
function frame229(){
introEnd();
}
function frame230(){
stop();
dragonAnim.gotoAndPlay("idle");
}
function frame252(){
stdLeave();
}
function frame306(){
stop();
}
}
}//package
Section 665
//Level19 (Level19)
package {
import lp.pge.game.*;
public dynamic class Level19 extends Level {
}
}//package
Section 666
//Level19Anim (Level19Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level19Anim extends LevelAnimation {
public var dragonAnim1:MovieClip;
public var dragonAnim2:MovieClip;
public var dragonAnim3:MovieClip;
public function Level19Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelLoad = function ():void{
dragonAnim1.gotoAndPlay(179);
dragonAnim2.gotoAndPlay((179 + 17));
dragonAnim3.gotoAndPlay((179 + (2 * 17)));
};
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
dragonAnim1.gotoAndPlay(179);
dragonAnim2.gotoAndPlay((179 + 17));
dragonAnim3.gotoAndPlay((179 + (2 * 17)));
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
stop();
dragonAnim1.destroy();
dragonAnim2.destroy();
dragonAnim3.destroy();
removeEventListener(ScriptEvent.L19_DRAGON_1_HIT, onDragon1Hit);
removeEventListener(ScriptEvent.L19_DRAGON_2_HIT, onDragon2Hit);
removeEventListener(ScriptEvent.L19_DRAGON_3_HIT, onDragon3Hit);
};
addEventListener(ScriptEvent.L19_DRAGON_1_HIT, onDragon1Hit);
addEventListener(ScriptEvent.L19_DRAGON_2_HIT, onDragon2Hit);
addEventListener(ScriptEvent.L19_DRAGON_3_HIT, onDragon3Hit);
}
public function onDragon1Hit(_arg1:ScriptEvent):void{
dragonAnim1.flyAway();
}
public function onDragon2Hit(_arg1:ScriptEvent):void{
dragonAnim2.flyAway();
}
public function onDragon3Hit(_arg1:ScriptEvent):void{
dragonAnim3.flyAway();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 667
//Level20 (Level20)
package {
import lp.pge.game.*;
public dynamic class Level20 extends Level {
}
}//package
Section 668
//Level20Anim (Level20Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level20Anim extends LevelAnimation {
public var geyserAnim:MovieClip;
public function Level20Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
geyserAnim.reset();
};
onLevelComplete = function ():void{
stdLeave();
geyserAnim.halt();
};
onLevelUnload = function ():void{
geyserAnim.destroy();
removeEventListener(ScriptEvent.L20_GEYSER_BLOCKED, onGeyserBlocked);
};
addEventListener(ScriptEvent.L20_GEYSER_BLOCKED, onGeyserBlocked);
}
public function onGeyserBlocked(_arg1:ScriptEvent):void{
geyserAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 669
//Level21 (Level21)
package {
import lp.pge.game.*;
public dynamic class Level21 extends Level {
}
}//package
Section 670
//Level21Anim (Level21Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level21Anim extends LevelAnimation {
public var geyserAnim1:MovieClip;
public var geyserAnim2:MovieClip;
public var geyserAnim3:MovieClip;
public function Level21Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
geyserAnim1.reset();
geyserAnim2.reset();
geyserAnim3.reset();
};
onLevelComplete = function ():void{
stdLeave();
geyserAnim1.halt();
geyserAnim2.halt();
geyserAnim3.halt();
};
onLevelUnload = function ():void{
geyserAnim1.destroy();
geyserAnim2.destroy();
geyserAnim3.destroy();
removeEventListener(ScriptEvent.L21_GEYSER_1_BLOCKED, onGeyser1Blocked);
removeEventListener(ScriptEvent.L21_GEYSER_2_BLOCKED, onGeyser2Blocked);
removeEventListener(ScriptEvent.L21_GEYSER_3_BLOCKED, onGeyser3Blocked);
};
addEventListener(ScriptEvent.L21_GEYSER_1_BLOCKED, onGeyser1Blocked);
addEventListener(ScriptEvent.L21_GEYSER_2_BLOCKED, onGeyser2Blocked);
addEventListener(ScriptEvent.L21_GEYSER_3_BLOCKED, onGeyser3Blocked);
}
public function onGeyser1Blocked(_arg1:ScriptEvent):void{
geyserAnim1.gotoAndPlay(2);
}
public function onGeyser2Blocked(_arg1:ScriptEvent):void{
geyserAnim2.gotoAndPlay(2);
}
public function onGeyser3Blocked(_arg1:ScriptEvent):void{
geyserAnim3.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 671
//Level22 (Level22)
package {
import lp.pge.game.*;
public dynamic class Level22 extends Level {
}
}//package
Section 672
//Level22Anim (Level22Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level22Anim extends LevelAnimation {
public var risingWaterAnim:MovieClip;
public var iceCrackAnim:MovieClip;
public function Level22Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
onLevelStart = function ():void{
risingWaterAnim.raftAnim.charAnim.randomIdle();
introEnd();
};
onLevelRestart = function ():void{
risingWaterAnim.gotoAndStop(1);
iceCrackAnim.gotoAndStop(1);
};
onLevelUnload = function ():void{
risingWaterAnim.stop();
iceCrackAnim.stop();
removeEventListener(ScriptEvent.L22_ICE_CRACK_BROKEN, onIceCrackBroken);
};
addEventListener(ScriptEvent.L22_ICE_CRACK_BROKEN, onIceCrackBroken);
}
public function onIceCrackBroken(_arg1:ScriptEvent):void{
iceCrackAnim.gotoAndPlay(2);
}
public function giveWater():void{
risingWaterAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 673
//Level23 (Level23)
package {
import lp.pge.game.*;
public dynamic class Level23 extends Level {
}
}//package
Section 674
//Level23Anim (Level23Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level23Anim extends LevelAnimation {
public var icicleAnim1:MovieClip;
public var icicleAnim2:MovieClip;
public var icicleAnim3:MovieClip;
public function Level23Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
icicleAnim1.reset();
icicleAnim2.reset();
icicleAnim3.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
icicleAnim1.destroy();
icicleAnim2.destroy();
icicleAnim3.destroy();
removeEventListener(ScriptEvent.L23_ICICLE_1_BROKEN, onIcicle1Broken);
removeEventListener(ScriptEvent.L23_ICICLE_2_BROKEN, onIcicle2Broken);
removeEventListener(ScriptEvent.L23_ICICLE_3_BROKEN, onIcicle3Broken);
};
addEventListener(ScriptEvent.L23_ICICLE_1_BROKEN, onIcicle1Broken);
addEventListener(ScriptEvent.L23_ICICLE_2_BROKEN, onIcicle2Broken);
addEventListener(ScriptEvent.L23_ICICLE_3_BROKEN, onIcicle3Broken);
}
public function onIcicle1Broken(_arg1:ScriptEvent):void{
icicleAnim1.gotoAndPlay(2);
}
public function onIcicle2Broken(_arg1:ScriptEvent):void{
icicleAnim2.gotoAndPlay(2);
}
public function onIcicle3Broken(_arg1:ScriptEvent):void{
icicleAnim3.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 675
//Level24 (Level24)
package {
import lp.pge.game.*;
public dynamic class Level24 extends Level {
}
}//package
Section 676
//Level24Anim (Level24Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level24Anim extends LevelAnimation {
public var icicleAnim:MovieClip;
public function Level24Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
icicleAnim.reset();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelUnload = function ():void{
icicleAnim.destroy();
removeEventListener(ScriptEvent.L24_ICICLE_BROKEN, onIcicleBroken);
};
addEventListener(ScriptEvent.L24_ICICLE_BROKEN, onIcicleBroken);
}
public function onIcicleBroken(_arg1:ScriptEvent):void{
icicleAnim.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 677
//Level25 (Level25)
package {
import lp.pge.game.*;
public dynamic class Level25 extends Level {
}
}//package
Section 678
//Level25Anim (Level25Anim)
package {
import lp.pge.game.*;
import flash.display.*;
public dynamic class Level25Anim extends LevelAnimation {
public var iceRockAnim:MovieClip;
public var tr01;
public var tr02;
public var tr03;
public var tr04;
public var tr05:MovieClip;
public function Level25Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
iceRockAnim.gotoAndStop(1);
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
iceRockAnim.gotoAndStop(1);
removeEventListener(ScriptEvent.L25_ICE_ROCK_HIT, onIceRockHit);
};
addEventListener(ScriptEvent.L25_ICE_ROCK_HIT, onIceRockHit);
}
public function onIceRockHit(_arg1:ScriptEvent):void{
iceRockAnim.gotoAndPlay(2);
}
public function goNow():void{
charAnim.walk([null, tr01, tr02, tr03, tr04, {x:tr05.x, y:tr05.y, r:tr05.rotation, cb:goBlack}, {x:(charXPos + STD_OFFSET_RIGHT), y:424}], charAnim.halt);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 679
//Level26 (Level26)
package {
import lp.pge.game.*;
public dynamic class Level26 extends Level {
}
}//package
Section 680
//Level26Anim (Level26Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level26Anim extends LevelAnimation {
public var icicleAnim1:MovieClip;
public var icicleAnim2:MovieClip;
public function Level26Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
stdEnter();
};
onLevelComplete = function ():void{
stdLeave();
};
onLevelRestart = function ():void{
resetCharAnim();
icicleAnim1.reset();
icicleAnim2.reset();
};
onLevelUnload = function ():void{
icicleAnim1.destroy();
icicleAnim2.destroy();
removeEventListener(ScriptEvent.L26_ICICLE_1_BROKEN, onIcicle1Broken);
removeEventListener(ScriptEvent.L26_ICICLE_2_BROKEN, onIcicle2Broken);
};
addEventListener(ScriptEvent.L26_ICICLE_1_BROKEN, onIcicle1Broken);
addEventListener(ScriptEvent.L26_ICICLE_2_BROKEN, onIcicle2Broken);
}
public function onIcicle1Broken(_arg1:ScriptEvent):void{
icicleAnim1.gotoAndPlay(2);
}
public function onIcicle2Broken(_arg1:ScriptEvent):void{
icicleAnim2.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 681
//Level27 (Level27)
package {
import lp.pge.game.*;
public dynamic class Level27 extends Level {
}
}//package
Section 682
//Level27Anim (Level27Anim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level27Anim extends LevelAnimation {
public var bearAnim:MovieClip;
public function Level27Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelStart = function ():void{
var startPos:Number = (Math.ceil(((charXPos - SUFF_POS_LEFT) / SHIFT_PER_STEP)) * SHIFT_PER_STEP);
charAnim.walk([{x:(charXPos - startPos)}, {x:charXPos}], function ():void{
charAnim.halt(charAnim.randomIdle);
});
bearAnim.walk();
};
onLevelRestart = function ():void{
resetCharAnim();
bearAnim.idle();
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
stop();
bearAnim.gotoAndStop(1);
removeEventListener(ScriptEvent.L27_BEAR_HIT, onBearHit);
};
addEventListener(ScriptEvent.L27_BEAR_HIT, onBearHit);
}
public function onBearHit(_arg1:ScriptEvent):void{
bearAnim.down();
}
public function goNow():void{
stdLeave();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 683
//Level28 (Level28)
package {
import lp.pge.game.*;
public dynamic class Level28 extends Level {
}
}//package
Section 684
//Level28Anim (Level28Anim)
package {
import com.greensock.*;
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import lp.pge.game.dummies.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
import lp.pge.game.core.managers.*;
import lp.pge.game.core.entities.*;
import asp.entities.*;
public dynamic class Level28Anim extends LevelAnimation {
public var iceRoofAnim:MovieClip;
public var windAnim:MovieClip;
public var mapAnim:MovieClip;
public var toDisappear:uint;
public function Level28Anim(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init():void{
charXPos = charAnim.x;
charYPos = charAnim.y;
charRot = charAnim.rotation;
onLevelLoad = function ():void{
windAnim.visible = false;
if (windAnim.tween){
windAnim.tween.kill();
windAnim.tween = undefined;
};
windAnim.x = 0;
windAnim.y = -290;
windAnim.faceAnim.stopAction();
mapAnim.gotoAndStop(1);
mapAnim.visible = false;
};
onLevelStart = function ():void{
stdEnter();
};
onLevelRestart = function ():void{
resetCharAnim();
iceRoofAnim.gotoAndStop(1);
mapAnim.gotoAndStop(1);
mapAnim.visible = false;
windAnim.visible = false;
windAnim.map.visible = true;
if (windAnim.tween){
windAnim.tween.kill();
windAnim.tween = undefined;
};
windAnim.x = 0;
windAnim.y = -290;
windAnim.faceAnim.stopAction();
};
onLevelComplete = function ():void{
};
onLevelUnload = function ():void{
iceRoofAnim.gotoAndStop(1);
mapAnim.gotoAndStop(1);
if (windAnim.tween){
windAnim.tween.kill();
windAnim.tween = undefined;
};
windAnim.faceAnim.stopAction();
removeEventListener(ScriptEvent.L28_ICE_ROOF_BROKEN, onIceRoofBroken);
removeEventListener(ScriptEvent.L28_WIND_HIT, onWindHit);
};
addEventListener(ScriptEvent.L28_ICE_ROOF_BROKEN, onIceRoofBroken);
addEventListener(ScriptEvent.L28_WIND_HIT, onWindHit);
}
public function onIceRoofBroken(_arg1:ScriptEvent):void{
iceRoofAnim.gotoAndPlay(2);
}
public function onWindHit(_arg1:ScriptEvent):void{
driveWind();
}
public function initPhase2():void{
var _local1:GameManager = GameManager.instance;
toDisappear = 2;
var _local2:Spikes = (_local1.getEntity("mSpikes1") as Spikes);
_local2.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_local2.playAnim("disappear");
var _local3:Spikes = (_local1.getEntity("mSpikes2") as Spikes);
_local3.addEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
_local3.playAnim("disappear");
}
public function onDisappearComplete(_arg1:GameEvent):void{
(_arg1.target as EventDispatcher).removeEventListener(GameEvent.ANIM_COMPLETE, onDisappearComplete);
GameManager.instance.disposeEntity((_arg1.target as IEntity));
toDisappear--;
if (!toDisappear){
bringWind();
};
}
public function bringWind():void{
windAnim.faceAnim.laugh();
windAnim.visible = true;
windAnim.tween = new TweenLite(windAnim, 2, {x:85, y:-75, onComplete:function ():void{
windAnim.tween = undefined;
var target:* = new TargetDummy();
var _local2 = target;
with (_local2) {
x = 292;
y = 197;
hitDistance = 20;
event = ScriptEvent.L28_WIND_HIT;
};
var spikes:* = new JumpingSpikesDummy();
_local2 = spikes;
with (_local2) {
x = 380;
y = 260;
wp0 = new Point((x - 150), y);
wp1 = new Point((x + 150), y);
};
dispatchEvent(new GameEvent(GameEvent.MOVIE_COMPLETE, false, false, {addTargets:[target], addSpikes:[spikes]}));
}});
}
public function driveWind():void{
windAnim.map.visible = false;
windAnim.faceAnim.idle();
windAnim.tween = new TweenLite(windAnim, 2, {x:0, y:-290, onComplete:function ():void{
windAnim.faceAnim.stopAction();
windAnim.tween = undefined;
}});
mapAnim.visible = true;
mapAnim.gotoAndPlay(2);
}
public function goNow():void{
var _local1:Number = (Math.ceil(((((SUFF_POS_RIGHT - charXPos) - STEPS_1) - STEPS_2) / DIST_PER_STEP)) * DIST_PER_STEP);
charAnim.walk([null, {x:(charXPos + STEPS_1)}, {x:((charXPos + STEPS_1) + STEPS_2), an:"walk2"}, {x:540, an:"walk3", cb:goBlack}, {x:(((charXPos + STEPS_1) + STEPS_2) + _local1), an:"walk3"}], charAnim.halt);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package
Section 685
//MainTheme (MainTheme)
package {
import flash.media.*;
public dynamic class MainTheme extends Sound {
}
}//package
Section 686
//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 687
//MountainsAmb (MountainsAmb)
package {
import flash.media.*;
public dynamic class MountainsAmb extends Sound {
}
}//package
Section 688
//MoviesWindow (MoviesWindow)
package {
import lp.pge.menu.windows.*;
public dynamic class MoviesWindow extends MoviesWindow {
public function MoviesWindow(){
addFrameScript(717, frame718, 723, frame724);
}
function frame718(){
stop();
}
function frame724(){
stop();
close();
}
}
}//package
Section 689
//MovingSpikesImage (MovingSpikesImage)
package {
import flash.display.*;
public dynamic class MovingSpikesImage extends Sprite {
public var anim:MovieClip;
}
}//package
Section 690
//NormalBlockBottomDummy (NormalBlockBottomDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class NormalBlockBottomDummy extends NormalBlockDummy {
}
}//package
Section 691
//NormalBlockBottomImage (NormalBlockBottomImage)
package {
import flash.display.*;
public dynamic class NormalBlockBottomImage extends Sprite {
public var vArrows:BalkVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 692
//NormalBlockBottomShapePattern (NormalBlockBottomShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class NormalBlockBottomShapePattern extends AbstractShapePattern {
public function NormalBlockBottomShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
hazard1.userData = "hazard";
hazard2.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 693
//NormalBlockBottomShapeSampler (NormalBlockBottomShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class NormalBlockBottomShapeSampler extends PolygonShapeSampler {
}
}//package
Section 694
//NormalBlockBottomShapeSampler2 (NormalBlockBottomShapeSampler2)
package {
import lp.pge.game.samplers.*;
public dynamic class NormalBlockBottomShapeSampler2 extends PolygonShapeSampler {
}
}//package
Section 695
//NormalBlockCircleDummy (NormalBlockCircleDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class NormalBlockCircleDummy extends NormalBlockDummy {
}
}//package
Section 696
//NormalBlockCircleImage (NormalBlockCircleImage)
package {
import flash.display.*;
public dynamic class NormalBlockCircleImage extends Sprite {
public var vArrows:OrbVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:OrbHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 697
//NormalBlockCircleShapePattern (NormalBlockCircleShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class NormalBlockCircleShapePattern extends AbstractShapePattern {
}
}//package
Section 698
//NormalBlockLeftDummy (NormalBlockLeftDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class NormalBlockLeftDummy extends NormalBlockDummy {
}
}//package
Section 699
//NormalBlockLeftImage (NormalBlockLeftImage)
package {
import flash.display.*;
public dynamic class NormalBlockLeftImage extends Sprite {
public var vArrows:BalkV2Arrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkH2Arrows;
public var hPosInd:MovieClip;
}
}//package
Section 700
//NormalBlockLeftShapePattern (NormalBlockLeftShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class NormalBlockLeftShapePattern extends AbstractShapePattern {
public function NormalBlockLeftShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
hazard1.userData = "hazard";
hazard2.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 701
//NormalBlockLeftShapeSampler (NormalBlockLeftShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class NormalBlockLeftShapeSampler extends PolygonShapeSampler {
}
}//package
Section 702
//NormalBlockLeftShapeSampler2 (NormalBlockLeftShapeSampler2)
package {
import lp.pge.game.samplers.*;
public dynamic class NormalBlockLeftShapeSampler2 extends PolygonShapeSampler {
}
}//package
Section 703
//NormalBlockRightDummy (NormalBlockRightDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class NormalBlockRightDummy extends NormalBlockDummy {
}
}//package
Section 704
//NormalBlockRightImage (NormalBlockRightImage)
package {
import flash.display.*;
public dynamic class NormalBlockRightImage extends Sprite {
public var vArrows:BalkV2Arrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkH2Arrows;
public var hPosInd:MovieClip;
}
}//package
Section 705
//NormalBlockRightShapePattern (NormalBlockRightShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class NormalBlockRightShapePattern extends AbstractShapePattern {
public function NormalBlockRightShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
hazard1.userData = "hazard";
hazard2.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 706
//NormalBlockRightShapeSampler (NormalBlockRightShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class NormalBlockRightShapeSampler extends PolygonShapeSampler {
}
}//package
Section 707
//NormalBlockRightShapeSampler2 (NormalBlockRightShapeSampler2)
package {
import lp.pge.game.samplers.*;
public dynamic class NormalBlockRightShapeSampler2 extends PolygonShapeSampler {
}
}//package
Section 708
//NormalBlockSlopeTLDummy (NormalBlockSlopeTLDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class NormalBlockSlopeTLDummy extends NormalBlockDummy {
}
}//package
Section 709
//NormalBlockSlopeTLhapePattern (NormalBlockSlopeTLhapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class NormalBlockSlopeTLhapePattern extends AbstractShapePattern {
}
}//package
Section 710
//NormalBlockSlopeTLImage (NormalBlockSlopeTLImage)
package {
import flash.display.*;
public dynamic class NormalBlockSlopeTLImage extends Sprite {
public var vArrows:SlopeVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:SlopeHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 711
//NormalBlockSlopeTRDummy (NormalBlockSlopeTRDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class NormalBlockSlopeTRDummy extends NormalBlockDummy {
}
}//package
Section 712
//NormalBlockSlopeTRImage (NormalBlockSlopeTRImage)
package {
import flash.display.*;
public dynamic class NormalBlockSlopeTRImage extends Sprite {
public var vArrows:SlopeVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:SlopeHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 713
//NormalBlockSlopeTRShapePattern (NormalBlockSlopeTRShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class NormalBlockSlopeTRShapePattern extends AbstractShapePattern {
}
}//package
Section 714
//OrbHArrows (OrbHArrows)
package {
import lp.pge.game.gui.*;
public dynamic class OrbHArrows extends ArrowsIcon {
}
}//package
Section 715
//OrbVArrows (OrbVArrows)
package {
import lp.pge.game.gui.*;
public dynamic class OrbVArrows extends ArrowsIcon {
}
}//package
Section 716
//PacketShapePattern (PacketShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class PacketShapePattern extends AbstractShapePattern {
}
}//package
Section 717
//PlayerImage (PlayerImage)
package {
import flash.display.*;
public dynamic class PlayerImage extends Sprite {
public var anim:MovieClip;
}
}//package
Section 718
//ProgressDisplay (ProgressDisplay)
package {
import flash.display.*;
public dynamic class ProgressDisplay extends MovieClip {
public var levelNum:MovieClip;
public function ProgressDisplay(){
addFrameScript(0, frame1);
}
public function update(_arg1:int):void{
levelNum.gotoAndStop((1 + _arg1));
}
function frame1(){
}
}
}//package
Section 719
//RiverAmb (RiverAmb)
package {
import flash.media.*;
public dynamic class RiverAmb extends Sound {
}
}//package
Section 720
//RockAnim (RockAnim)
package {
import lp.pge.game.*;
import flash.display.*;
public dynamic class RockAnim extends MediaAnimation {
public function RockAnim(){
addFrameScript(0, frame1, 1, frame2, 25, frame26, 42, frame43);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new RockFallsSound());
}
function frame26(){
MovieClip(parent).gotoAndPlay("outro");
}
function frame43(){
stop();
stopSound();
}
}
}//package
Section 721
//RockFallsSound (RockFallsSound)
package {
import flash.media.*;
public dynamic class RockFallsSound extends Sound {
}
}//package
Section 722
//ShakeSFX (ShakeSFX)
package {
import flash.media.*;
public dynamic class ShakeSFX extends Sound {
}
}//package
Section 723
//SlopeHArrows (SlopeHArrows)
package {
import lp.pge.game.gui.*;
public dynamic class SlopeHArrows extends ArrowsIcon {
}
}//package
Section 724
//SlopeVArrows (SlopeVArrows)
package {
import lp.pge.game.gui.*;
public dynamic class SlopeVArrows extends ArrowsIcon {
}
}//package
Section 725
//SparksAnim (SparksAnim)
package {
import flash.display.*;
import lp.pge.game.*;
public dynamic class SparksAnim extends MovieClip {
public function SparksAnim(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
dispatchEvent(new GameEvent(GameEvent.ANIM_COMPLETE));
dispatchEvent(new GameEvent(GameEvent.ANIM_DISPOSE));
}
}
}//package
Section 726
//SpikesShapePattern (SpikesShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class SpikesShapePattern extends AbstractShapePattern {
}
}//package
Section 727
//StaticSpikesImage (StaticSpikesImage)
package {
import flash.display.*;
public dynamic class StaticSpikesImage extends Sprite {
public var anim:MovieClip;
}
}//package
Section 728
//StepTrace (StepTrace)
package {
import flash.display.*;
public dynamic class StepTrace extends MovieClip {
}
}//package
Section 729
//StickyBlockTopDummy (StickyBlockTopDummy)
package {
import lp.pge.game.dummies.*;
public dynamic class StickyBlockTopDummy extends StickyBlockDummy {
}
}//package
Section 730
//StickyBlockTopImage (StickyBlockTopImage)
package {
import flash.display.*;
public dynamic class StickyBlockTopImage extends Sprite {
public var vArrows:BalkVArrows;
public var vPosInd:MovieClip;
public var anim:MovieClip;
public var hArrows:BalkHArrows;
public var hPosInd:MovieClip;
}
}//package
Section 731
//StickyBlockTopShapePattern (StickyBlockTopShapePattern)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import lp.pge.game.patterns.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class StickyBlockTopShapePattern extends AbstractShapePattern {
public function StickyBlockTopShapePattern(){
addFrameScript(0, frame1);
}
public function init():void{
var _local2 = this;
with (_local2) {
hazard.userData = "hazard";
};
}
function frame1(){
}
}
}//package
Section 732
//StickyBlockTopShapeSampler (StickyBlockTopShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class StickyBlockTopShapeSampler extends PolygonShapeSampler {
}
}//package
Section 733
//StickyBlockTopShapeSampler2 (StickyBlockTopShapeSampler2)
package {
import lp.pge.game.samplers.*;
public dynamic class StickyBlockTopShapeSampler2 extends PolygonShapeSampler {
}
}//package
Section 734
//StoneAnim (StoneAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class StoneAnim extends MediaAnimation {
public function StoneAnim(){
addFrameScript(0, frame1, 24, frame25, 25, frame26, 40, frame41, 58, frame59);
}
function frame1(){
stop();
stopSound();
}
function frame25(){
gotoAndStop(1);
}
function frame26(){
playSound(new BigRockRollsOutSound());
}
function frame41(){
var _local1 = parent;
_local1["goNow"]();
}
function frame59(){
stop();
stopSound();
}
}
}//package
Section 735
//TargetImage (TargetImage)
package {
import flash.display.*;
public dynamic class TargetImage extends Sprite {
public var anim:MovieClip;
}
}//package
Section 736
//TargetShapePattern (TargetShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class TargetShapePattern extends AbstractShapePattern {
}
}//package
Section 737
//ThornAnim (ThornAnim)
package {
import lp.pge.game.*;
public dynamic class ThornAnim extends MediaAnimation {
public function ThornAnim(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
public function reset():void{
gotoAndStop(1);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new ThornBreaksSound());
}
function frame11(){
stop();
stopSound();
}
}
}//package
Section 738
//ThornBreaksSound (ThornBreaksSound)
package {
import flash.media.*;
public dynamic class ThornBreaksSound extends Sound {
}
}//package
Section 739
//ThrowsDisplay (ThrowsDisplay)
package {
import flash.display.*;
public dynamic class ThrowsDisplay extends MovieClip {
public var numThrows:MovieClip;
public function ThrowsDisplay(){
addFrameScript(0, frame1);
}
public function update(_arg1:int, _arg2:int):void{
numThrows.gotoAndStop((1 + _arg1));
}
function frame1(){
}
}
}//package
Section 740
//TreeAnim (TreeAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TreeAnim extends MediaAnimation {
public function TreeAnim(){
addFrameScript(0, frame1, 1, frame2, 30, frame31, 47, frame48);
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new TreeFallsSound());
}
function frame31(){
var _local1 = parent;
_local1["goNow"]();
}
function frame48(){
stop();
stopSound();
}
}
}//package
Section 741
//TreeFallsSound (TreeFallsSound)
package {
import flash.media.*;
public dynamic class TreeFallsSound extends Sound {
}
}//package
Section 742
//TrialButton1 (TrialButton1)
package {
import lp.pge.menu.buttons.*;
public dynamic class TrialButton1 extends TrialButton {
public function TrialButton1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
hitArea = hit;
}
}
}//package
Section 743
//TrialButton2 (TrialButton2)
package {
import lp.pge.menu.buttons.*;
public dynamic class TrialButton2 extends TrialButton {
public function TrialButton2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
hitArea = hit;
}
}
}//package
Section 744
//TriggerL01Dummy (TriggerL01Dummy)
package {
import lp.pge.game.dummies.*;
public dynamic class TriggerL01Dummy extends TriggerDummy {
}
}//package
Section 745
//TriggerL01ShapePattern (TriggerL01ShapePattern)
package {
import lp.pge.game.patterns.*;
public dynamic class TriggerL01ShapePattern extends AbstractShapePattern {
}
}//package
Section 746
//TriggerL01ShapeSampler (TriggerL01ShapeSampler)
package {
import lp.pge.game.samplers.*;
public dynamic class TriggerL01ShapeSampler extends PolygonShapeSampler {
}
}//package
Section 747
//WaterfallAnim (WaterfallAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WaterfallAnim extends MediaAnimation {
public var waterfallAnim:MovieClip;
public function WaterfallAnim(){
addFrameScript(0, frame1, 1, frame2, 30, frame31, 44, frame45);
}
public function destroyThis():void{
stop();
stopSound();
if (waterfallAnim){
waterfallAnim.stop();
waterfallAnim.stopSound();
};
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new WaterfallDisappearsSound());
waterfallAnim.stopSound();
}
function frame31(){
waterfallAnim.stop();
}
function frame45(){
stop();
stopSound();
}
}
}//package
Section 748
//WaterfallAnim2 (WaterfallAnim2)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WaterfallAnim2 extends MediaAnimation {
public var waterfallAnim:MovieClip;
public function WaterfallAnim2(){
addFrameScript(0, frame1, 1, frame2, 37, frame38);
}
public function destroyThis():void{
stop();
stopSound();
if (waterfallAnim){
waterfallAnim.stop();
waterfallAnim.stopSound();
};
}
function frame1(){
stop();
stopSound();
}
function frame2(){
playSound(new WaterfallDisappearsSound());
waterfallAnim.stopSound();
}
function frame38(){
stop();
waterfallAnim.stop();
stopSound();
}
}
}//package
Section 749
//WaterfallAnimL12 (WaterfallAnimL12)
package {
import lp.pge.game.*;
public dynamic class WaterfallAnimL12 extends MediaAnimation {
public function WaterfallAnimL12(){
addFrameScript(0, frame1, 19, frame20, 38, frame39, 57, frame58, 76, frame77);
}
function frame1(){
playSound(new WaterfallSound());
}
function frame20(){
playSound();
}
function frame39(){
playSound();
}
function frame58(){
playSound();
}
function frame77(){
playSound();
}
}
}//package
Section 750
//WaterfallAnimL17 (WaterfallAnimL17)
package {
import lp.pge.game.*;
public dynamic class WaterfallAnimL17 extends MediaAnimation {
public function WaterfallAnimL17(){
addFrameScript(0, frame1, 19, frame20, 38, frame39, 57, frame58);
}
function frame1(){
playSound(new WaterfallSound());
}
function frame20(){
playSound();
}
function frame39(){
playSound();
}
function frame58(){
playSound();
}
}
}//package
Section 751
//WaterfallDisappearsSound (WaterfallDisappearsSound)
package {
import flash.media.*;
public dynamic class WaterfallDisappearsSound extends Sound {
}
}//package
Section 752
//WaterfallSound (WaterfallSound)
package {
import flash.media.*;
public dynamic class WaterfallSound extends Sound {
}
}//package
Section 753
//WaterSplashAnim (WaterSplashAnim)
package {
import lp.pge.game.*;
public dynamic class WaterSplashAnim extends MediaAnimation {
public function WaterSplashAnim(){
addFrameScript(0, frame1, 64, frame65);
}
public function destroyThis():void{
stop();
if (parent){
parent.removeChild(this);
};
}
function frame1(){
playSound(new WaterSplashSound());
}
function frame65(){
destroy();
stopSound();
}
}
}//package
Section 754
//WaterSplashSound (WaterSplashSound)
package {
import flash.media.*;
public dynamic class WaterSplashSound extends Sound {
}
}//package
Section 755
//Waymark (Waymark)
package {
import flash.display.*;
public dynamic class Waymark extends Sprite {
}
}//package
Section 756
//VikingSound (VikingSound)
package {
import flash.media.*;
public dynamic class VikingSound extends Sound {
}
}//package
Section 757
//WMCurtain (WMCurtain)
package {
import flash.display.*;
public dynamic class WMCurtain extends Sprite {
}
}//package
Section 758
//VolcanoAnim (VolcanoAnim)
package {
import flash.events.*;
import lp.pge.game.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class VolcanoAnim extends MediaAnimation {
public var lavaAnim:MovieClip;
public function VolcanoAnim(){
addFrameScript(0, frame1, 1, frame2, 12, frame13);
}
public function run():void{
lavaAnim.run();
}
public function halt():void{
lavaAnim.halt();
}
public function reset():void{
gotoAndStop(1);
lavaAnim.reset();
}
public function destroyThis():void{
stop();
lavaAnim.halt();
}
function frame1(){
stop();
run();
}
function frame2(){
stopSound();
}
function frame13(){
stop();
}
}
}//package
Section 759
//VolcanoExplodesSound (VolcanoExplodesSound)
package {
import flash.media.*;
public dynamic class VolcanoExplodesSound extends Sound {
}
}//package
Section 760
//WoodHit (WoodHit)
package {
import flash.media.*;
public dynamic class WoodHit extends Sound {
}
}//package