Section 1
//ButtonAudio (com.nick.spongebob.clarinet.ui.ButtonAudio)
package com.nick.spongebob.clarinet.ui {
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import com.workinman.lib.display.*;
public class ButtonAudio extends WorkinMovieClip {
private var _isOutro:Boolean;
private var _isClicked:Boolean;
private var _isMuted:Boolean;
private var _isIntro:Boolean;
private var _isVisible:Boolean;
public function ButtonAudio(){
addFrameScript(0, frame1);
enable();
_isVisible = true;
_isIntro = false;
_isOutro = false;
_isClicked = false;
mouseEnabled = true;
mouseChildren = false;
_isMuted = false;
_addEventListeners();
}
public function disableClick():void{
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function set isClicked(_arg1:Boolean):void{
_isClicked = _arg1;
_onClicked();
}
public function enable():void{
_addMouseEventListeners();
buttonMode = true;
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
private function _onOverEvent(_arg1:MouseEvent):void{
_onOver();
}
protected function _click():void{
_isClicked = true;
_dispatchToPlaySound("navButton");
_onClicked();
}
private function _onOutEvent(_arg1:MouseEvent):void{
_onOut();
}
private function _addMouseEventListeners():void{
addEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
addEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
protected function _onClicked():void{
disableClick();
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_AUDIO_TOGGLE));
_toggleAudio();
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
protected function _onDown():void{
if (!_isVisible){
return;
};
if (_isMuted){
gotoAndStop("offdown");
} else {
gotoAndStop("ondown");
};
stage.addEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
}
private function _onUpEvent(_arg1:MouseEvent):void{
_onUp();
}
public function cleanup():void{
_removeEventListeners();
}
protected function _onEnableClick(_arg1:Event):void{
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function disable():void{
_removeMouseEventListeners();
buttonMode = false;
}
private function _toggleAudio():void{
if (_isMuted){
_isMuted = false;
gotoAndStop("on");
} else {
_isMuted = true;
gotoAndStop("off");
};
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
function frame1(){
stop();
}
private function _removeMouseEventListeners():void{
removeEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
removeEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
private function _testMouseOver():Boolean{
if (((_isVisible) && (hitTestPoint(stage.mouseX, stage.mouseY, true)))){
return (true);
};
return (false);
}
protected function _onOut():void{
if (!_isVisible){
return;
};
if (_isMuted){
gotoAndStop("off");
} else {
gotoAndStop("on");
};
}
protected function _onOver():void{
if (!_isVisible){
return;
};
if (_isMuted){
gotoAndStop("offover");
} else {
gotoAndStop("onover");
};
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
protected function _onUp():void{
if (!_isVisible){
return;
};
stage.removeEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
if (_testMouseOver()){
if (_isMuted){
gotoAndStop("offover");
} else {
gotoAndStop("onover");
};
_click();
} else {
if (_isMuted){
gotoAndStop("off");
} else {
gotoAndStop("on");
};
};
}
private function _onDownEvent(_arg1:MouseEvent):void{
_onDown();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 2
//ButtonPlay (com.nick.spongebob.clarinet.ui.ButtonPlay)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import com.workinman.lib.display.*;
public class ButtonPlay extends WorkinMovieClip {
private var _isOutro:Boolean;
public var _hitspot:MovieClip;
private var _isClicked:Boolean;
private var _isIntro:Boolean;
private var _isVisible:Boolean;
public function ButtonPlay(){
addFrameScript(0, frame1);
enable();
_isVisible = true;
_isIntro = false;
_isOutro = false;
_isClicked = false;
mouseEnabled = true;
mouseChildren = false;
_addEventListeners();
}
public function disableClick():void{
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function set isClicked(_arg1:Boolean):void{
_isClicked = _arg1;
_onClicked();
}
public function enable():void{
_addMouseEventListeners();
buttonMode = true;
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
private function _onOverEvent(_arg1:MouseEvent):void{
_onOver();
}
protected function _click():void{
_isClicked = true;
_onClicked();
}
private function _onOutEvent(_arg1:MouseEvent):void{
_onOut();
}
private function _addMouseEventListeners():void{
addEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
addEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
protected function _onClicked():void{
disableClick();
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_BEGIN_GAME_PLAY));
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
protected function _onDown():void{
if (!_isVisible){
return;
};
gotoAndStop("down");
stage.addEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
}
private function _onUpEvent(_arg1:MouseEvent):void{
_onUp();
}
public function cleanup():void{
_removeEventListeners();
}
protected function _onEnableClick(_arg1:Event):void{
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function disable():void{
_removeMouseEventListeners();
buttonMode = false;
}
function frame1(){
stop();
}
private function _removeMouseEventListeners():void{
removeEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
removeEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
private function _testMouseOver():Boolean{
if (((_isVisible) && (hitTestPoint(stage.mouseX, stage.mouseY, true)))){
return (true);
};
return (false);
}
protected function _onOut():void{
if (!_isVisible){
return;
};
gotoAndStop("idle");
}
protected function _onOver():void{
if (!_isVisible){
return;
};
gotoAndStop("over");
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
protected function _onUp():void{
if (!_isVisible){
return;
};
stage.removeEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
if (_testMouseOver()){
gotoAndStop("over");
_dispatchToPlaySound("navButton");
_click();
} else {
gotoAndStop("idle");
};
}
private function _onDownEvent(_arg1:MouseEvent):void{
_onDown();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 3
//ButtonPlayAgain (com.nick.spongebob.clarinet.ui.ButtonPlayAgain)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import com.workinman.lib.display.*;
public class ButtonPlayAgain extends WorkinMovieClip {
private var _isOutro:Boolean;
public var _hitspot:MovieClip;
private var _isClicked:Boolean;
private var _isIntro:Boolean;
private var _isVisible:Boolean;
public function ButtonPlayAgain(){
addFrameScript(18, frame19);
enable();
_isVisible = true;
_isIntro = false;
_isOutro = false;
_isClicked = false;
mouseEnabled = true;
mouseChildren = false;
_addEventListeners();
}
public function disableClick():void{
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function set isClicked(_arg1:Boolean):void{
_isClicked = _arg1;
_onClicked();
}
public function enable():void{
_addMouseEventListeners();
buttonMode = true;
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
private function _onOverEvent(_arg1:MouseEvent):void{
_onOver();
}
protected function _click():void{
_isClicked = true;
_onClicked();
}
private function _onOutEvent(_arg1:MouseEvent):void{
_onOut();
}
private function _addMouseEventListeners():void{
addEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
addEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
protected function _onClicked():void{
disableClick();
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_PLAY_AGAIN));
}
function frame19(){
stop();
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
protected function _onDown():void{
if (!_isVisible){
return;
};
gotoAndStop("down");
stage.addEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
}
private function _onUpEvent(_arg1:MouseEvent):void{
_onUp();
}
public function cleanup():void{
_removeEventListeners();
}
protected function _onEnableClick(_arg1:Event):void{
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function disable():void{
_removeMouseEventListeners();
buttonMode = false;
}
private function _removeMouseEventListeners():void{
removeEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
removeEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
private function _testMouseOver():Boolean{
if (((_isVisible) && (hitTestPoint(stage.mouseX, stage.mouseY, true)))){
return (true);
};
return (false);
}
protected function _onOut():void{
if (!_isVisible){
return;
};
gotoAndStop("idle");
}
protected function _onOver():void{
if (!_isVisible){
return;
};
gotoAndStop("over");
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
protected function _onUp():void{
if (!_isVisible){
return;
};
stage.removeEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
if (_testMouseOver()){
gotoAndStop("over");
_dispatchToPlaySound("navButton");
_click();
} else {
gotoAndStop("idle");
};
}
private function _onDownEvent(_arg1:MouseEvent):void{
_onDown();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 4
//ButtonPlayFromInstructions (com.nick.spongebob.clarinet.ui.ButtonPlayFromInstructions)
package com.nick.spongebob.clarinet.ui {
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import com.workinman.lib.display.*;
public class ButtonPlayFromInstructions extends WorkinMovieClip {
private var _isOutro:Boolean;
private var _isClicked:Boolean;
private var _isIntro:Boolean;
private var _isVisible:Boolean;
public function ButtonPlayFromInstructions(){
addFrameScript(0, frame1);
enable();
_isVisible = true;
_isIntro = false;
_isOutro = false;
_isClicked = false;
mouseEnabled = true;
mouseChildren = false;
_addEventListeners();
}
public function disableClick():void{
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function set isClicked(_arg1:Boolean):void{
_isClicked = _arg1;
_onClicked();
}
public function enable():void{
_addMouseEventListeners();
buttonMode = true;
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
private function _onOverEvent(_arg1:MouseEvent):void{
_onOver();
}
protected function _click():void{
_isClicked = true;
_onClicked();
}
private function _onOutEvent(_arg1:MouseEvent):void{
_onOut();
}
private function _addMouseEventListeners():void{
addEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
addEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
protected function _onClicked():void{
disableClick();
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_BEGIN_GAME_PLAY_INSTRUCT));
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_ENABLE_NAV_BUTTONS, _onEnableClick);
}
protected function _onDown():void{
if (!_isVisible){
return;
};
gotoAndStop("down");
stage.addEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
}
private function _onUpEvent(_arg1:MouseEvent):void{
_onUp();
}
public function cleanup():void{
_removeEventListeners();
}
protected function _onEnableClick(_arg1:Event):void{
addEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
public function disable():void{
_removeMouseEventListeners();
buttonMode = false;
}
function frame1(){
stop();
}
private function _removeMouseEventListeners():void{
removeEventListener(MouseEvent.MOUSE_OVER, _onOverEvent);
removeEventListener(MouseEvent.MOUSE_OUT, _onOutEvent);
removeEventListener(MouseEvent.MOUSE_DOWN, _onDownEvent);
}
private function _testMouseOver():Boolean{
if (((_isVisible) && (hitTestPoint(stage.mouseX, stage.mouseY, true)))){
return (true);
};
return (false);
}
protected function _onOut():void{
if (!_isVisible){
return;
};
gotoAndStop("idle");
}
protected function _onOver():void{
if (!_isVisible){
return;
};
gotoAndStop("over");
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
protected function _onUp():void{
if (!_isVisible){
return;
};
stage.removeEventListener(MouseEvent.MOUSE_UP, _onUpEvent);
if (_testMouseOver()){
gotoAndStop("over");
_dispatchToPlaySound("navButton");
_click();
} else {
gotoAndStop("idle");
};
}
private function _onDownEvent(_arg1:MouseEvent):void{
_onDown();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 5
//Gameplay (com.nick.spongebob.clarinet.ui.Gameplay)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import flash.text.*;
import com.workinman.lib.display.*;
public class Gameplay extends WorkinMovieClip {
public var btnAudio:MovieClip;
public var score_txt:TextField;
public var _life_bubble:MovieClip;
public var _life:MovieClip;
public function Gameplay():void{
_addEventListeners();
init();
}
override public function cleanUp():void{
_removeEventListeners();
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_UPDATED_SCORE, _onUpdatedScore, false, 0, true);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_SPONGE_HIT, _onLoseLife, false, 0, true);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_LIFE_ADDED, _onLifeAdded, false, 0, true);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_PLAY_AGAIN, _onGameReset, false, 0, true);
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_UPDATED_SCORE, _onUpdatedScore);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_SPONGE_HIT, _onLoseLife);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_LIFE_ADDED, _onLifeAdded);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_PLAY_AGAIN, _onGameReset);
}
private function _onLifeAdded(_arg1:Event):void{
_life.gotoAndStop((_life.currentFrame - 1));
_life_bubble.gotoAndPlay("healing");
var _local2:Number = (_life_bubble._arrow.rotation = (_life_bubble._arrow.rotation - 34));
(_life_bubble._arrow as WorkinMovieClip);
_life_bubble._arrow.rotateTo(_local2, 0.5);
}
private function _onLoseLife(_arg1:Event):void{
_life.gotoAndStop((_life.currentFrame + 1));
_life_bubble.gotoAndPlay("damage");
var _local2:Number = (_life_bubble._arrow.rotation = (_life_bubble._arrow.rotation + 34));
(_life_bubble._arrow as WorkinMovieClip);
_life_bubble._arrow.rotateTo(_local2, 0.5);
}
private function _onUpdatedScore(_arg1:ENumber):void{
score_txt.text = _arg1.data.toString();
}
public function init():void{
score_txt.mouseEnabled = false;
_life.mouseEnabled = false;
_life.mouseChildren = false;
_life_bubble.mouseEnabled = false;
_life_bubble.mouseChildren = false;
_resetArrow();
}
private function _resetArrow():void{
_life_bubble._arrow.rotation = 7;
}
public function resetGameplay():void{
_resetArrow();
}
private function _onGameReset(_arg1:Event):void{
_life.gotoAndStop(1);
}
}
}//package com.nick.spongebob.clarinet.ui
Section 6
//Instructions (com.nick.spongebob.clarinet.ui.Instructions)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import com.workinman.lib.display.*;
public class Instructions extends WorkinMovieClip {
public var btnInstructionsPlay:MovieClip;
public function Instructions():void{
addFrameScript(0, frame1, 124, frame125, 134, frame135);
}
function frame1(){
}
function frame135(){
stop();
}
function frame125(){
stop();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 7
//Intro (com.nick.spongebob.clarinet.ui.Intro)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import com.workinman.lib.display.*;
public class Intro extends WorkinMovieClip {
public var btnPlay:MovieClip;
public function Intro():void{
addFrameScript(92, frame93, 104, frame105);
}
function frame105(){
stop();
}
function frame93(){
stop();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 8
//Level (com.nick.spongebob.clarinet.ui.Level)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import flash.text.*;
import com.workinman.lib.display.*;
public class Level extends WorkinMovieClip {
public var _txt:TextField;
public var txtLevel:MovieClip;
public function Level():void{
addFrameScript(0, frame1, 100, frame101);
}
function frame101(){
stop();
}
function frame1(){
stop();
}
public function set levelDisplay(_arg1:Number):void{
trace(("new Level: " + _arg1.toString()));
trace(("level text:" + txtLevel._txt.text));
txtLevel._txt.text = ("Level " + _arg1.toString());
}
}
}//package com.nick.spongebob.clarinet.ui
Section 9
//Payoff (com.nick.spongebob.clarinet.ui.Payoff)
package com.nick.spongebob.clarinet.ui {
import flash.display.*;
import com.workinman.lib.display.*;
public class Payoff extends WorkinMovieClip {
public var btnPlayAgain:MovieClip;
public var _finalScore:MovieClip;
private var _endScore:Number;
public function Payoff():void{
addFrameScript(76, frame77);
}
public function set score(_arg1:Number):void{
_endScore = _arg1;
_finalScore.finalScore_txt.text = _endScore.toString();
}
function frame77(){
stop();
}
}
}//package com.nick.spongebob.clarinet.ui
Section 10
//Effect (com.nick.spongebob.clarinet.world.entitys.effects.Effect)
package com.nick.spongebob.clarinet.world.entitys.effects {
import com.nick.spongebob.clarinet.world.entitys.*;
public class Effect extends GameEntity {
private var _lifespan:Number;
public function Effect(_arg1:Object){
super(_arg1);
_lifespan = _initialLifespan;
}
override public function updatePrediction(_arg1:Number):void{
super.updatePrediction(_arg1);
if (_lifeTiedToAnimation){
if (asset.currentFrame == asset.totalFrames){
doDelete = true;
};
} else {
_lifespan = (_lifespan - _arg1);
if (_lifespan < 0){
doDelete = true;
};
};
}
protected function get _lifeTiedToAnimation():Boolean{
return (false);
}
protected function get _initialLifespan():Number{
return (1);
}
override public function get group():String{
return ("effect");
}
}
}//package com.nick.spongebob.clarinet.world.entitys.effects
Section 11
//FloatingPointsEffect (com.nick.spongebob.clarinet.world.entitys.effects.FloatingPointsEffect)
package com.nick.spongebob.clarinet.world.entitys.effects {
public class FloatingPointsEffect extends Effect {
public function FloatingPointsEffect(_arg1:Object){
super(_arg1);
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
}
public function set pointValue(_arg1:Number):void{
asset._floatingpoints._txt.text = _arg1.toString();
}
override protected function get _lifeTiedToAnimation():Boolean{
return (true);
}
override protected function get _defaultAsset():Class{
return (AssetFloatingPoints);
}
}
}//package com.nick.spongebob.clarinet.world.entitys.effects
Section 12
//GameEntity (com.nick.spongebob.clarinet.world.entitys.GameEntity)
package com.nick.spongebob.clarinet.world.entitys {
import com.workinman.paradise2.world.entitys.*;
public class GameEntity extends ParaSprite {
public var doDelete:Boolean;
public function GameEntity(_arg1:Object){
super(_arg1);
doDelete = false;
}
public function get collisionRadius():Number{
return (20);
}
public function testRadiusCollision(_arg1:GameEntity):Boolean{
return ((pos.distTo(_arg1.pos) <= (collisionRadius + _arg1.collisionRadius)));
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 13
//Health (com.nick.spongebob.clarinet.world.entitys.Health)
package com.nick.spongebob.clarinet.world.entitys {
import com.nick.spongebob.clarinet.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class Health extends HostileEntity {
private var _targetAnchor:Number;
private var _swimSpeed:Number;
private var _targetTentacle:Tentacle;
private var _scoreValue:Number;
private var _distanceToTentacleAnchor:Number;
public function Health(_arg1:Object){
super(_arg1);
_pos.x = (_pos.y = -1000);
_targetTentacle = _arg1.tentacle;
_swimSpeed = _arg1.speed;
_distanceToTentacleAnchor = 0;
_targetAnchor = 0;
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
_scoreValue = GameConfig.PointsHealth;
}
public function set targetTentacle(_arg1:Tentacle):void{
_targetTentacle = _arg1;
}
private function _deleteHealth():void{
doDelete = true;
}
override protected function get _defaultAsset():Class{
return (AssetHealth);
}
override public function updatePosition(_arg1:Number):void{
super.updatePosition(_arg1);
}
override public function onCollision():void{
_deleteHealth();
}
override public function get hostileType():String{
return ("health");
}
private function _broadcastDelivery():void{
WorkinDispatcher.getInstance().dispatchEvent(new EData(GameConfig.ON_HEALTH_DELIVERED, {tentacle:_targetTentacle}));
}
override public function get scoreValue():Number{
return (_scoreValue);
}
public function stepTargetAnchor():void{
_targetAnchor++;
}
public function set inFatalCollission(_arg1:Boolean):void{
}
override protected function _setInitialVelocity():void{
super._setInitialVelocity();
}
public function updateNoteTentacleMotion():void{
var _local1:TentacleAnchor = _targetTentacle.pts[_targetAnchor];
_velocity.toPoint(_pos.diff(_local1.chasePos));
_distanceToTentacleAnchor = _velocity.length;
_velocity.length = _swimSpeed;
}
override public function get collisionRadius():Number{
return (10);
}
public function get targetAnchor():Number{
return (_targetAnchor);
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
override public function updatePrediction(_arg1:Number):void{
super.updatePrediction(_arg1);
if (_distanceToTentacleAnchor < _motionLine.length){
_nextPos.toPoint(_targetTentacle.pts[_targetAnchor].chasePos);
stepTargetAnchor();
};
if (_targetAnchor == 8){
trace("health hit sponge base");
_broadcastDelivery();
this.doDelete = true;
};
}
override public function toString():String{
return (("[Health] : " + _pos));
}
override protected function _renderPosition(_arg1:BaseCamera):void{
if (_isReleased){
};
super._renderPosition(_arg1);
}
override public function get group():String{
return ("hostiles");
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 14
//HostileEntity (com.nick.spongebob.clarinet.world.entitys.HostileEntity)
package com.nick.spongebob.clarinet.world.entitys {
import com.workinman.lib.math.*;
public class HostileEntity extends GameEntity {
protected var _isReleased:Boolean;
private var _relationToSponge:WorkinPoint;
public function HostileEntity(_arg1:Object){
super(_arg1);
_isReleased = false;
}
public function set relationToSponge(_arg1:WorkinPoint):void{
_relationToSponge = _arg1;
}
public function get isReleased():Boolean{
return (_isReleased);
}
public function release():void{
_isReleased = true;
}
public function get relationToSponge():WorkinPoint{
return (_relationToSponge);
}
public function get hostileType():String{
return ("hostile");
}
public function onCollision():void{
}
public function get scoreValue():Number{
return (0);
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 15
//Laugh (com.nick.spongebob.clarinet.world.entitys.Laugh)
package com.nick.spongebob.clarinet.world.entitys {
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class Laugh extends GameEntity {
private var _swimSpeed:Number;
private var _targetTentacle:Tentacle;
private var _targetAnchor:Number;
private var _distanceToTentacleAnchor:Number;
public function Laugh(_arg1:Object){
super(_arg1);
_pos.x = (_pos.y = -1000);
_targetTentacle = _arg1.tentacle;
_swimSpeed = _arg1.speed;
_distanceToTentacleAnchor = 0;
_targetAnchor = 7;
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
}
public function set targetTentacle(_arg1:Tentacle):void{
_targetTentacle = _arg1;
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
override public function get collisionRadius():Number{
return (10);
}
override protected function _renderPosition(_arg1:BaseCamera):void{
super._renderPosition(_arg1);
}
override protected function get _defaultAsset():Class{
return (AssetLaugh);
}
public function updateLaughTentacleMotion():void{
var _local1:TentacleAnchor = _targetTentacle.pts[_targetAnchor];
_velocity.toPoint(_pos.diff(_local1.chasePos));
_distanceToTentacleAnchor = _velocity.length;
_velocity.length = _swimSpeed;
}
override public function updatePosition(_arg1:Number):void{
super.updatePosition(_arg1);
}
public function get targetAnchor():Number{
return (_targetAnchor);
}
override public function updatePrediction(_arg1:Number):void{
super.updatePrediction(_arg1);
this.rotateSet(motionVector.angle);
if (_distanceToTentacleAnchor < _motionLine.length){
_nextPos.toPoint(_targetTentacle.pts[_targetAnchor].chasePos);
stepTargetAnchor();
};
if (_targetAnchor == -1){
this.doDelete = true;
_broadcastSquidworthHit();
};
}
public function stepTargetAnchor():void{
_targetAnchor--;
}
override public function toString():String{
return (("[Laugh] : " + _pos));
}
private function _broadcastSquidworthHit():void{
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_SQUIDWORTH_HIT));
}
override protected function _setInitialVelocity():void{
super._setInitialVelocity();
}
override public function get group():String{
return ("laugh");
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 16
//Note (com.nick.spongebob.clarinet.world.entitys.Note)
package com.nick.spongebob.clarinet.world.entitys {
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class Note extends HostileEntity {
private var _targetAnchor:Number;
private var _inFatalCollission:Boolean;
private var _isGiantNote:Boolean;
private var _scoreValue:Number;
private var _swimSpeed:Number;
private var _distanceToTentacleAnchor:Number;
private var _isDeathNote:Boolean;
private var _wasGiantNote:Boolean;
private var _targetTentacle:Tentacle;
private var _deathNoteStrength:Number;
private var _originalWidth:Number;
private var _originalHeight:Number;
private var _wasDeathNote:Boolean;
private var _colorNote:Number;
public function Note(_arg1:Object){
super(_arg1);
_pos.x = (_pos.y = -1000);
_isGiantNote = _arg1.giant;
_wasGiantNote = false;
_isDeathNote = _arg1.death;
_wasDeathNote = false;
_colorNote = _arg1.color;
_targetTentacle = _arg1.tentacle;
_swimSpeed = _arg1.speed;
_distanceToTentacleAnchor = 0;
_targetAnchor = 0;
_deathNoteStrength = 4;
_inFatalCollission = false;
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
_initSizeAndColor();
}
private function _initSizeAndColor():void{
this.asset.gotoAndStop(_colorNote);
_originalWidth = this.width;
_originalHeight = this.height;
if (((_isGiantNote) || (_isDeathNote))){
this.width = (this.width * 1.5);
this.height = (this.height * 1.5);
};
if (_isGiantNote){
_scoreValue = GameConfig.PointsNoteGiant;
} else {
if (this._isDeathNote){
_scoreValue = GameConfig.PointsNoteDeath;
} else {
_scoreValue = GameConfig.PointsNoteStandard;
};
};
}
override public function toString():String{
return (("[Note] : " + _pos));
}
public function set targetTentacle(_arg1:Tentacle):void{
_targetTentacle = _arg1;
}
override public function updatePosition(_arg1:Number):void{
super.updatePosition(_arg1);
}
override public function onCollision():void{
if (_inFatalCollission){
_deleteNote();
};
if (noteIsGiant){
giantReduced();
} else {
if (noteIsDeath){
deathReduced();
} else {
_deleteNote();
};
};
}
public function set inFatalCollission(_arg1:Boolean):void{
_inFatalCollission = _arg1;
}
override protected function get _defaultAsset():Class{
return (AssetNote);
}
override public function get scoreValue():Number{
return (_scoreValue);
}
public function convertToDeathNote():void{
_isDeathNote = true;
_isGiantNote = false;
_colorNote = 5;
_initSizeAndColor();
}
public function stepTargetAnchor():void{
_targetAnchor++;
}
public function get noteWasDeath():Boolean{
return (_wasDeathNote);
}
public function get noteIsDeath():Boolean{
return (_isDeathNote);
}
public function updateNoteTentacleMotion():void{
var _local1:TentacleAnchor = _targetTentacle.pts[_targetAnchor];
_velocity.toPoint(_pos.diff(_local1.chasePos));
_distanceToTentacleAnchor = _velocity.length;
_velocity.length = _swimSpeed;
}
override protected function _setInitialVelocity():void{
super._setInitialVelocity();
}
public function get targetAnchor():Number{
return (_targetAnchor);
}
public function deathReduced():void{
_deathNoteStrength--;
var _local1:Number = (6 + (4 - _deathNoteStrength));
this.asset.gotoAndStop(_local1);
if (_deathNoteStrength == 1){
_isDeathNote = false;
_wasDeathNote = true;
this.width = _originalWidth;
this.height = _originalHeight;
};
}
private function _broadcastSpongeHit():void{
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_SPONGE_HIT));
}
override public function updatePrediction(_arg1:Number):void{
super.updatePrediction(_arg1);
if (_distanceToTentacleAnchor < _motionLine.length){
_nextPos.toPoint(_targetTentacle.pts[_targetAnchor].chasePos);
stepTargetAnchor();
};
if (_targetAnchor == 8){
this.doDelete = true;
_broadcastSpongeHit();
_dispatchToPlaySound("squidLaugh");
};
}
public function giantReduced():void{
_isGiantNote = false;
_wasGiantNote = true;
this.asset.gotoAndStop(5);
this.width = _originalWidth;
this.height = _originalHeight;
}
public function get targetTentacle():Tentacle{
return (_targetTentacle);
}
override public function get hostileType():String{
return ("note");
}
private function _deleteNote():void{
doDelete = true;
}
override public function get collisionRadius():Number{
return (10);
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
public function get noteIsGiant():Boolean{
return (_isGiantNote);
}
public function get noteWasGiant():Boolean{
return (_wasGiantNote);
}
override protected function _renderPosition(_arg1:BaseCamera):void{
if (_isReleased){
};
super._renderPosition(_arg1);
}
override public function get group():String{
return ("hostiles");
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 17
//Sponge (com.nick.spongebob.clarinet.world.entitys.Sponge)
package com.nick.spongebob.clarinet.world.entitys {
import flash.display.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class Sponge extends GameEntity {
private var _targetReached:Boolean;
private var _targetAnchor:Number;
private var _hasTargetTentacle:Boolean;
private var _distanceToTentacleBase:Number;
private var _swimSpeed:Number;
private var _targetTentacle:Tentacle;
public var _sponge_anime:MovieClip;
public function Sponge(_arg1:Object){
super(_arg1);
_pos.x = 325;
_pos.y = 435;
_swimSpeed = _arg1.speed;
_distanceToTentacleBase = 0;
_targetAnchor = 7;
_hasTargetTentacle = false;
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
_addEventListeners();
}
public function get targetReached():Boolean{
return (_targetReached);
}
public function get targetTentacle():Tentacle{
return (_targetTentacle);
}
public function set targetTentacle(_arg1:Tentacle):void{
if (_hasTargetTentacle){
if (_arg1.name == _targetTentacle.name){
return;
};
};
_targetReached = false;
_hasTargetTentacle = true;
_targetTentacle = _arg1;
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_LAUGH_ANIME_COMPLETE, _onLaughAnimeComplete);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_HEALTH_DELIVERED, _onHealthDelivered);
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_LAUGH_ANIME_COMPLETE, _onLaughAnimeComplete);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_HEALTH_DELIVERED, _onHealthDelivered);
}
public function spongeToLaugh():void{
asset._sponge_anime.gotoAndStop("laugh");
}
override protected function get _defaultAsset():Class{
return (AssetSponge);
}
override public function updatePosition(_arg1:Number):void{
super.updatePosition(_arg1);
}
override protected function _setInitialVelocity():void{
super._setInitialVelocity();
}
public function get targetAnchor():Number{
return (_targetAnchor);
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
private function _onLaughAnimeComplete(_arg1:Event):void{
asset._sponge_anime.gotoAndStop("idle");
}
override public function get collisionRadius():Number{
return (5);
}
override public function toString():String{
return (("[Sponge] : " + _pos));
}
private function _onHealthDelivered(_arg1:EData):void{
var _local2:Tentacle = _arg1.data.tentacle;
if ((((_local2 == _targetTentacle)) && (_targetReached))){
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_GAIN_LIFE));
};
}
override public function updatePrediction(_arg1:Number):void{
var _local2:TentacleAnchor;
if (((_hasTargetTentacle) && (!(_targetReached)))){
_local2 = _targetTentacle.pts[_targetAnchor];
_velocity.toPoint(_pos.diff(_local2.chasePos));
_distanceToTentacleBase = _velocity.length;
_velocity.length = _swimSpeed;
super.updatePrediction(_arg1);
if (_distanceToTentacleBase <= _motionLine.length){
_targetReached = true;
_nextPos.toPoint(_targetTentacle.pts[_targetAnchor].chasePos);
asset._sponge_anime.gotoAndStop("idle");
} else {
if (motionVector.angle < 0){
asset._sponge_anime.gotoAndStop("right");
} else {
asset._sponge_anime.gotoAndStop("left");
};
};
};
}
override protected function _renderPosition(_arg1:BaseCamera):void{
super._renderPosition(_arg1);
}
override public function get group():String{
return ("sponge");
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 18
//Squid (com.nick.spongebob.clarinet.world.entitys.Squid)
package com.nick.spongebob.clarinet.world.entitys {
import flash.display.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class Squid extends GameEntity {
public var _squid_anime:MovieClip;
public function Squid(_arg1:Object){
super(_arg1);
_pos.x = -3;
_pos.y = 8;
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
_squid_anime = new MovieClip();
_addEventListeners();
}
private function _onAngryAnimeComplete(_arg1:Event):void{
asset._squid_anime.gotoAndStop("idle");
}
override public function get collisionRadius():Number{
return (5);
}
private function _onSquidHit(_arg1:Event):void{
asset._squid_anime.gotoAndStop("angry");
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_SQUIDWORTH_HIT, _onSquidHit);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_ANGRY_ANIME_COMPLETE, _onAngryAnimeComplete);
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_SQUIDWORTH_HIT, _onSquidHit);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_ANGRY_ANIME_COMPLETE, _onAngryAnimeComplete);
}
override public function toString():String{
return (("[Squid] : " + _pos));
}
override protected function get _defaultAsset():Class{
return (AssetSquid);
}
override public function get group():String{
return ("sponge");
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 19
//Star (com.nick.spongebob.clarinet.world.entitys.Star)
package com.nick.spongebob.clarinet.world.entitys {
import com.workinman.lib.math.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class Star extends HostileEntity {
private var _swimSpeed:Number;
private var _distanceToTarget:Number;
private var _randomStartPoint:WorkinPoint;
private var _randomEndPoint:WorkinPoint;
private var _scoreValue:Number;
public function Star(_arg1:Object){
var _local2:Number;
var _local3:Number;
super(_arg1);
_pos.x = _arg1.x;
_pos.y = _arg1.y;
_swimSpeed = _arg1.speed;
_distanceToTarget = 0;
_local2 = _arg1.tx;
_local3 = _arg1.ty;
this.asset.mouseEnabled = false;
this.asset.mouseChildren = false;
_nextPos.toPoint(_pos);
_randomStartPoint = new WorkinPoint(_pos.x, _pos.y);
_randomEndPoint = new WorkinPoint(_local2, _local3);
_scoreValue = (GameConfig.PointsStar * GameState.instance.consecutiveStars);
}
public function updateNoteTentacleMotion():void{
}
override public function get collisionRadius():Number{
return (20);
}
override protected function _setInitialVelocity():void{
super._setInitialVelocity();
}
override public function get scoreValue():Number{
return (_scoreValue);
}
override public function onCollision():void{
doDelete = true;
}
override public function toString():String{
return (("[Star] : " + _pos));
}
override protected function _renderPosition(_arg1:BaseCamera):void{
if (_isReleased){
};
super._renderPosition(_arg1);
}
override protected function get _defaultAsset():Class{
return (AssetStar);
}
override public function updatePosition(_arg1:Number):void{
super.updatePosition(_arg1);
}
override public function get hostileType():String{
return ("star");
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
override public function updatePrediction(_arg1:Number):void{
_velocity.toPoint(_pos.diff(_randomEndPoint));
_distanceToTarget = _velocity.length;
_velocity.length = _swimSpeed;
super.updatePrediction(_arg1);
if (_distanceToTarget < _motionLine.length){
trace("--- STAR was missed");
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_STAR_MISSED));
this.doDelete = true;
};
}
public function set inFatalCollission(_arg1:Boolean):void{
}
override public function get group():String{
return ("hostiles");
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 20
//Tentacle (com.nick.spongebob.clarinet.world.entitys.Tentacle)
package com.nick.spongebob.clarinet.world.entitys {
import com.workinman.lib.math.*;
import com.workinman.paradise2.world.camera.*;
public class Tentacle extends GameEntity {
private var tentacleWidth:Number;
private var _tentacleName:String;
public var dragProps:Object;
public var ta1:TentacleAnchor;
public var ta2:TentacleAnchor;
public var ta3:TentacleAnchor;
public var ta4:TentacleAnchor;
public var ta6:TentacleAnchor;
public var ta7:TentacleAnchor;
public var ta8:TentacleAnchor;
public var pts:Array;
public var ta5:TentacleAnchor;
public function Tentacle(_arg1:Object):void{
super(_arg1);
this.alpha = _arg1.alpha;
this._tentacleName = _arg1.id;
pts = [ta1, ta2, ta3, ta4, ta5, ta6, ta7, ta8];
var _local2:Number = pts.length;
while (_local2--) {
pts[_local2].setParentPos(_pos);
};
tentacleWidth = 8;
_addEventListeners();
}
public function set TentacleName(_arg1:String):void{
_tentacleName = _arg1;
}
override public function get group():String{
return ("tentacles");
}
private function _addEventListeners():void{
}
private function _removeEventListeners():void{
}
override public function updatePosition(_arg1:Number):void{
super.updatePosition(_arg1);
}
override public function updatePrediction(_arg1:Number):void{
super.updatePrediction(_arg1);
}
public function get TentacleName():String{
return (_tentacleName);
}
public function isMouseOver(_arg1:WorkinPoint):void{
if (this.hitTestPoint(_arg1.x, _arg1.y, true)){
};
}
override protected function _renderPosition(_arg1:BaseCamera):void{
super._renderPosition(_arg1);
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 21
//Tentacle1 (com.nick.spongebob.clarinet.world.entitys.Tentacle1)
package com.nick.spongebob.clarinet.world.entitys {
public class Tentacle1 extends Tentacle {
public function Tentacle1(_arg1:Object):void{
super(_arg1);
this.name = "Tentacle1";
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 22
//Tentacle2 (com.nick.spongebob.clarinet.world.entitys.Tentacle2)
package com.nick.spongebob.clarinet.world.entitys {
public class Tentacle2 extends Tentacle {
public function Tentacle2(_arg1:Object):void{
super(_arg1);
this.name = "Tentacle2";
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 23
//Tentacle3 (com.nick.spongebob.clarinet.world.entitys.Tentacle3)
package com.nick.spongebob.clarinet.world.entitys {
public class Tentacle3 extends Tentacle {
public function Tentacle3(_arg1:Object):void{
super(_arg1);
this.name = "Tentacle3";
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 24
//Tentacle4 (com.nick.spongebob.clarinet.world.entitys.Tentacle4)
package com.nick.spongebob.clarinet.world.entitys {
public class Tentacle4 extends Tentacle {
public function Tentacle4(_arg1:Object):void{
super(_arg1);
this.name = "Tentacle4";
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 25
//TentacleAnchor (com.nick.spongebob.clarinet.world.entitys.TentacleAnchor)
package com.nick.spongebob.clarinet.world.entitys {
import com.workinman.lib.math.*;
import com.workinman.lib.display.*;
public class TentacleAnchor extends WorkinMovieClip {
private var _originalPos:WorkinPoint;
private var _chasePos:WorkinPoint;
private var _parentPos:WorkinPoint;
private var _directionRight:Boolean;
public function TentacleAnchor():void{
_saveOriginalPosition();
_directionRight = ((Math.random() < 0.5)) ? true : false;
}
public function set directionRight(_arg1:Boolean):void{
_directionRight = _arg1;
}
public function get originalPos():WorkinPoint{
return (_originalPos);
}
public function get chasePos():WorkinPoint{
return (_chasePos);
}
public function setParentPos(_arg1:WorkinPoint):void{
_parentPos = _arg1.copy();
_chasePos = _originalPos.addPointCopy(_parentPos);
}
public function get directionRight():Boolean{
return (_directionRight);
}
public function get pos():WorkinPoint{
return (_parentPos.addCopy(x, y));
}
private function _saveOriginalPosition():void{
_originalPos = new WorkinPoint(this.x, this.y);
}
}
}//package com.nick.spongebob.clarinet.world.entitys
Section 26
//WorldManager (com.nick.spongebob.clarinet.world.WorldManager)
package com.nick.spongebob.clarinet.world {
import com.workinman.lib.math.*;
import com.workinman.paradise2.*;
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.events.*;
import com.nick.spongebob.clarinet.world.entitys.*;
import com.workinman.lib.utils.*;
import com.nick.spongebob.clarinet.world.entitys.effects.*;
public class WorldManager {
private var _laughEntitys:Array;
private var _firstRun:Boolean;
private var _spawnTimer:Number;
private var _dt:Number;
private var _squid:Squid;
private var _hostileDeathEntitys:Array;
private var _mouseSpongePosDiff:WorkinPoint;
private var _laughReady:Boolean;
private var _loopIdx:Number;
private var _tentacleSelect:Tentacle;
private var _totalHostiles_1:Number;
private var _totalHostiles_2:Number;
private var _tempLaughLoop:Number;
private var _noteTentacleCurrent:Tentacle;
private var _spawnRate:Number;
private var _loop:Number;
private var _laughReadyTimer:Number;
private var _healthTimer:Number;
private var _hostileArrayEmpty:Boolean;
private var _state:GameState;
private var _starTimer:Number;
private var _viewRoom:EventDispatcher;
private var _tentacleSelectArrayPos:Number;
private var _tentacles:Array;
private var _newMousePoint:WorkinPoint;
private var _cameras:CameraManager;
private var _hostileEntitys:Array;
private var _noteTentacleAnticipated:Tentacle;
private var _levelTransition:Boolean;
private var _effects:Array;
private var _hostileEntityPlan:Array;
private var _currentLevelComplete:Boolean;
private var _sponge:Sponge;
public function WorldManager():void{
_state = GameState.instance;
_viewRoom = WorkinDispatcher.instance.getRoom(ParadiseConfig.ROOM_VIEW);
_generate();
}
private function _onMouseClick(_arg1:Event):void{
if (!_levelTransition){
_onRequestToLaunchLaugh();
};
}
private function _rampUpEnvironment():void{
_cleanupHostiles();
_cleanupLaughs();
_totalHostiles_1 = (_totalHostiles_1 + 10);
_totalHostiles_2 = (_totalHostiles_2 + 3);
if (_spawnRate > 1.75){
_spawnRate = (_spawnRate - 0.5);
} else {
if (_spawnRate < 0.5){
_spawnRate = 0.5;
} else {
_spawnRate = (_spawnRate - 0.25);
};
};
_distributeHostiles();
}
private function _onMouseDown(_arg1:Event):void{
}
private function _onToggleKeyEvent(_arg1:EData):void{
if ((((_arg1.data.keyCode == 17)) || ((_arg1.data.keyCode == 90)))){
};
}
public function get camera():BaseCamera{
return (_cameras.camera);
}
private function _onTentacleOver(_arg1:EData):void{
var _local2:Tentacle = _arg1.data.tentacle;
_tentacleSelect = _local2;
if (!_levelTransition){
_moveSpongeToLaunch(_local2);
};
}
public function get isGameOver():Boolean{
return (isGameOver);
}
private function _cleanupHostiles():void{
_loopIdx = _hostileEntitys.length;
while (_loopIdx--) {
_hostileEntitys[_loopIdx].cleanUp();
};
_hostileEntitys = [];
_loopIdx = _hostileDeathEntitys.length;
while (_loopIdx--) {
_hostileDeathEntitys[_loopIdx].cleanUp();
};
_hostileDeathEntitys = [];
}
private function _addEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(ParadiseConfig.EVENT_MOUSE_CLICK, _onMouseClick);
Updater.getInstance().addEventListener(Updater.EVENT_UPDATE, _update);
Updater.getInstance().lockFPS(60);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_TENTACLE_OVER, _onTentacleOver);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_SQUIDWORTH_HIT, _onSquidworthHit);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_START_NEW_LEVEL, _onNewLevel);
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(ParadiseConfig.EVENT_MOUSE_CLICK, _onMouseClick);
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _update);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_TENTACLE_OVER, _onTentacleOver);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_SQUIDWORTH_HIT, _onSquidworthHit);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_START_NEW_LEVEL, _onNewLevel);
}
private function _releaseHealth(_arg1:Tentacle):void{
var _local2:Health;
if ((((_arg1 == _noteTentacleAnticipated)) || ((_arg1 == _noteTentacleCurrent)))){
_spawnHealth();
} else {
_local2 = new Health({x:95, y:75, tentacle:_arg1, speed:(75 + (GameState.instance.level * 5))});
_hostileDeathEntitys.push(_local2);
_resetHealthTimer();
};
}
public function get exists():Boolean{
return (true);
}
private function _clearAllVisibleHostiles():void{
var _local1:Number = _hostileEntitys.length;
while (_local1--) {
if (!_hostileEntitys[_local1].doDelete){
_hostileEntitys[_local1].inFatalCollission = true;
_hostileEntitys[_local1].onCollision();
_spawnPoints(_hostileEntitys[_local1].pos.x, (_hostileEntitys[_local1].pos.y - 35), _hostileEntitys[_local1].scoreValue);
_state.addToScore(_hostileEntitys[_local1].scoreValue);
};
};
_local1 = _hostileDeathEntitys.length;
while (_local1--) {
_hostileDeathEntitys[_local1].inFatalCollission = true;
_hostileDeathEntitys[_local1].onCollision();
_spawnPoints(_hostileDeathEntitys[_local1].pos.x, (_hostileDeathEntitys[_local1].pos.y - 35), _hostileDeathEntitys[_local1].scoreValue);
_state.addToScore(_hostileDeathEntitys[_local1].scoreValue);
};
}
private function _distributeHostiles():void{
var _local3:Note;
trace("DISTRIBUTING HOSTILES");
_hostileEntityPlan = [];
_hostileArrayEmpty = false;
var _local1:Number = _totalHostiles_1;
var _local2:Number = _totalHostiles_2;
var _local4:Array = new Array();
while (_local1--) {
_local3 = new Note({x:95, y:75, color:Math.floor((1 + (Math.random() * 3))), giant:false, death:false, tentacle:_getRandomTentacle(), speed:(75 + (GameState.instance.level * 5))});
_local4.push(_local3);
};
while (_local2--) {
_local3 = new Note({x:95, y:75, color:4, giant:true, death:false, tentacle:_getRandomTentacle(), speed:(75 + (GameState.instance.level * 5))});
_local4.push(_local3);
};
_hostileEntityPlan = WorkinShuffle.getInstance().shuffleArray(_local4);
_spawnTimer = 0.25;
}
private function _onRequestToLaunchLaugh():void{
_loop = _tentacles.length;
while (_loop--) {
if ((((_sponge.targetTentacle == _tentacles[_loop])) && (_sponge.targetReached))){
_launchLaugh(_tentacles[_loop]);
};
};
}
private function _dispatchToPlaySound(_arg1:String):void{
WorkinDispatcher.getInstance().dispatchEvent(new EString(GameConfig.ON_PLAY_SOUND, _arg1));
}
private function _onNewLevel(_arg1:Event):void{
_currentLevelComplete = false;
_levelTransition = false;
if (_firstRun){
_firstRun = false;
_distributeHostiles();
} else {
_rampUpEnvironment();
};
}
private function _onSquidworthHit(_arg1:Event):void{
_spawnDeathHostile();
}
private function _spawnPoints(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:FloatingPointsEffect = new FloatingPointsEffect({x:_arg1, y:_arg2});
new FloatingPointsEffect({x:_arg1, y:_arg2}).scaleX = (_local4.scaleY = 0.7);
_local4.pointValue = _arg3;
_effects.push(_local4);
_dispatchToPlaySound("crash");
}
private function _distributeTentacles():void{
trace("DISTRIBUTING TENTACLES");
var _local1:Tentacle1 = new Tentacle1({x:153, y:47, alpha:0.5, id:1});
var _local2:Tentacle2 = new Tentacle2({x:123, y:69, alpha:0.5, id:2});
var _local3:Tentacle3 = new Tentacle3({x:74, y:104, alpha:0.5, id:3});
var _local4:Tentacle4 = new Tentacle4({x:48, y:124, alpha:0.5, id:4});
_tentacles = [_local1, _local2, _local3, _local4];
_tentacleSelectArrayPos = 0;
_tentacleSelect = _tentacles[_tentacleSelectArrayPos];
}
private function _spawnDeathHostile():void{
var _local1:Note;
_local1 = new Note({x:95, y:75, color:6, giant:false, death:true, tentacle:_getRandomTentacle(), speed:(75 + (GameState.instance.level * 5))});
_hostileDeathEntitys.push(_local1);
_dispatchToPlaySound("noteDeath");
}
private function _runLaughHostileCollision(_arg1:Laugh, _arg2:HostileEntity):void{
var _local3:Number;
if (_arg2.testRadiusCollision(_arg1)){
_arg2.onCollision();
if ((_arg2 is Health)){
} else {
if (_arg2.doDelete){
_local3 = _arg2.scoreValue;
_spawnPoints(_arg2.pos.x, (_arg2.pos.y - 35), _local3);
_state.addToScore(_local3);
};
};
_arg1.doDelete = true;
if ((_arg2 is Star)){
GameState.instance.starHit();
_clearAllVisibleHostiles();
};
};
}
private function _resetStarTimer():void{
_starTimer = Math.round(((Math.random() * 30) + 12));
}
private function _broadcastLevelComplete():void{
trace("LEVEL COMPLETE");
_levelTransition = true;
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_LEVEL_COMPLETE));
_cleanupLaughs();
}
private function _onMouseUp(_arg1:Event):void{
}
public function cleanUp():void{
trace("CLEAN UP WORLD");
_removeEventListeners();
_cleanupHostiles();
_cleanupLaughs();
}
private function _launchLaugh(_arg1:Tentacle):void{
var _local2:Laugh;
if ((((_arg1 == _tentacleSelect)) && (_laughReady))){
_laughReady = false;
_laughReadyTimer = GameConfig.SpongeFireRate;
_sponge.spongeToLaugh();
_local2 = new Laugh({x:_sponge.x, y:_sponge.y, tentacle:_arg1, speed:120});
_laughEntitys.push(_local2);
_dispatchToPlaySound("spongeLaugh");
};
}
public function _generate():void{
trace("[WorldManager] Generate");
_addEventListeners();
_firstRun = true;
_currentLevelComplete = false;
_totalHostiles_1 = GameConfig.TotalNoteStandardToStart;
_totalHostiles_2 = GameConfig.TotalNoteGiantToStart;
_spawnRate = GameConfig.SpawnRateToStart;
_levelTransition = true;
_laughReady = true;
_laughReadyTimer = 0;
_sponge = new Sponge({x:325, y:435, speed:600});
_squid = new Squid({x:-3, y:8});
_tentacles = [];
_distributeTentacles();
_hostileEntitys = [];
_hostileDeathEntitys = [];
_laughEntitys = [];
_cameras = new CameraManager();
_cameras.addSimpleCamera("camera", true, ParadiseConfig.SCREEN_CENTER.x, ParadiseConfig.SCREEN_CENTER.y);
_effects = [];
_starTimer = 25;
_healthTimer = 60;
}
private function _cleanupLaughs():void{
_loopIdx = _laughEntitys.length;
while (_loopIdx--) {
_laughEntitys[_loopIdx].cleanUp();
};
_laughEntitys = [];
}
private function _moveSpongeToLaunch(_arg1:Tentacle):void{
_sponge.targetTentacle = _arg1;
}
private function _resetHealthTimer():void{
_healthTimer = Math.round((((Math.random() * 30) + 12) - GameState.instance.level));
}
private function _spawnHostile():void{
var _local1:Note = _hostileEntityPlan.pop();
_local1.pos.to(100, 100);
_local1.release();
_hostileEntitys.push(_local1);
var _local2:Number = Math.floor((Math.random() * 8));
if (_local2 == 0){
_local2 = 3;
};
_dispatchToPlaySound(("note" + _local2).toString());
_noteTentacleCurrent = _local1.targetTentacle;
if (_hostileEntityPlan.length > 0){
_noteTentacleAnticipated = _hostileEntityPlan[(_hostileEntityPlan.length - 1)].targetTentacle;
};
}
private function _update(_arg1:EUpdate):void{
if (_arg1.dt > 0.2){
_dt = 0.2;
} else {
_dt = _arg1.dt;
};
if (((((((_hostileArrayEmpty) && ((_hostileEntitys.length < 1)))) && ((_hostileDeathEntitys.length < 1)))) && (!(_currentLevelComplete)))){
_currentLevelComplete = true;
_broadcastLevelComplete();
};
if (!_laughReady){
if (_laughReadyTimer > 0){
_laughReadyTimer = (_laughReadyTimer - _dt);
} else {
_laughReady = true;
};
};
_spawnTimer = (_spawnTimer - _dt);
if (_spawnTimer < 0){
_resetSpawnTimer();
if (_hostileEntityPlan.length > 0){
_spawnHostile();
} else {
_hostileArrayEmpty = true;
};
};
_starTimer = (_starTimer - _dt);
if (_starTimer < 0){
if (_levelTransition){
_resetStarTimer();
} else {
_spawnStar();
};
};
_healthTimer = (_healthTimer - _dt);
if (_healthTimer < 0){
if (((_levelTransition) || ((GameState.instance.level < GameConfig.LevelToStartHealth)))){
_resetHealthTimer();
} else {
_spawnHealth();
};
};
_newMousePoint = Main.instance.mousePoint;
_loop = _tentacles.length;
while (_loop--) {
if (_tentacles[_loop].hitTestPoint(_newMousePoint.x, _newMousePoint.y, true)){
WorkinDispatcher.getInstance().dispatchEvent(new EData(GameConfig.ON_TENTACLE_OVER, {tentacle:_tentacles[_loop]}));
};
};
_sponge.update(_dt);
_squid.update(_dt);
_loop = _tentacles.length;
while (_loop--) {
_tentacles[_loop].update(_dt);
};
_loop = _hostileEntitys.length;
while (_loop--) {
_hostileEntitys[_loop].updateNoteTentacleMotion();
_hostileEntitys[_loop].updatePrediction(_dt);
if ((((_laughEntitys.length > 0)) && ((_hostileEntitys.length > 0)))){
_tempLaughLoop = _laughEntitys.length;
while (_tempLaughLoop--) {
_runLaughHostileCollision(_laughEntitys[_tempLaughLoop], _hostileEntitys[_loop]);
};
};
if (_hostileEntitys.length > 0){
if (_hostileEntitys[_loop].doDelete){
_hostileEntitys[_loop].cleanUp();
_hostileEntitys.splice(_loop, 1);
} else {
_hostileEntitys[_loop].updatePosition(_dt);
};
};
};
_loop = _hostileDeathEntitys.length;
while (_loop--) {
_hostileDeathEntitys[_loop].updateNoteTentacleMotion();
_hostileDeathEntitys[_loop].updatePrediction(_dt);
if ((((_laughEntitys.length > 0)) && ((_hostileDeathEntitys.length > 0)))){
_tempLaughLoop = _laughEntitys.length;
while (_tempLaughLoop--) {
_runLaughHostileCollision(_laughEntitys[_tempLaughLoop], _hostileDeathEntitys[_loop]);
};
};
if (_hostileDeathEntitys.length > 0){
if (_hostileDeathEntitys[_loop].doDelete){
_hostileDeathEntitys[_loop].cleanUp();
_hostileDeathEntitys.splice(_loop, 1);
} else {
_hostileDeathEntitys[_loop].updatePosition(_dt);
};
};
};
_loop = _laughEntitys.length;
while (_loop--) {
_laughEntitys[_loop].updateLaughTentacleMotion();
_laughEntitys[_loop].updatePrediction(_dt);
if (_laughEntitys[_loop].doDelete){
_laughEntitys[_loop].cleanUp();
_laughEntitys.splice(_loop, 1);
} else {
_laughEntitys[_loop].updatePosition(_dt);
};
};
_loop = _effects.length;
while (_loop--) {
_effects[_loop].update(_dt);
if (_effects[_loop].doDelete){
_effects[_loop].cleanUp();
_effects.splice(_loop, 1);
};
};
_cameras.renderCameraView();
}
private function _spawnStar():void{
var _local1:Number = Math.round(((Math.random() * 300) + 200));
var _local2:Star = new Star({x:-100, y:_local1, tx:600, ty:(_local1 - 250), speed:100});
_hostileEntitys.push(_local2);
_resetStarTimer();
_dispatchToPlaySound("patrickLaugh");
}
private function _getRandomTentacle():Tentacle{
var _local1:Number = Math.floor((Math.random() * _tentacles.length));
if (_local1 == _tentacles.length){
_local1 = 0;
};
return (_tentacles[_local1]);
}
private function _spawnHealth():void{
var _local1:* = _getRandomTentacle();
_releaseHealth(_local1);
}
private function _resetSpawnTimer():void{
_spawnTimer = _spawnRate;
}
}
}//package com.nick.spongebob.clarinet.world
Section 27
//GameConfig (com.nick.spongebob.clarinet.GameConfig)
package com.nick.spongebob.clarinet {
public class GameConfig {
public static const ON_TENTACLE_OVER:String = "ON_TENTACLE_OVER";
public static const ON_PLAY_SOUND:String = "ON_PLAY_SOUND";
public static const ON_SPONGE_HIT:String = "ON_SPONGE_HIT";
public static const ON_GAIN_LIFE:String = "ON_GAIN_LIFE";
public static const ON_EXIT_GAME:String = "ON_EXIT_GAME";
public static const TotalNoteStandardToStart:Number = 13;
public static const PointsLevelComplete:Number = 500;
public static const ON_LEVEL_COMPLETE:String = "ON_LEVEL_COMPLETE";
public static const REQUEST_ANNOUNCEMENT:String = "REQUEST_ANNOUNCEMENT";
public static const ON_GAME_OVER:String = "ON_GAME_OVER";
public static const ON_ANGRY_ANIME_COMPLETE:String = "ON_ANGRY_ANIME_COMPLETE";
public static const ON_BEGIN_GAME_PLAY_INSTRUCT:String = "ON_BEGIN_GAME_PLAY_INSTRUCT";
public static const PointsNoteGiant:Number = 50;
public static const ON_LAUNCH_LAUGH:String = "ON_LAUNCH_LAUGH";
public static const ON_SQUIDWORTH_HIT:String = "ON_SQUIDWORTH_HIT";
public static const ON_HEALTH_DELIVERED:String = "ON_HEALTH_DELIVERED";
public static const ON_LIFE_ADDED:String = "ON_LIFE_ADDED";
public static const PointsHealth:Number = 0;
public static const LaughTravelTimeAmount:Number = 7;
public static const ON_ENABLE_NAV_BUTTONS:String = "ON_ENABLE_NAV_BUTTONS";
public static const ON_BEGIN_GAME_PLAY:String = "ON_BEGIN_GAME_PLAY";
public static const SpawnRateToStart:Number = 3;
public static const ON_START_NEW_LEVEL:String = "ON_START_NEW_LEVEL";
public static const SpongeFireRate:Number = 0.2;
public static const ON_LAUGH_ANIME_COMPLETE:String = "ON_LAUGH_ANIME_COMPLETE";
public static const TRACKING_GAME_NAME:String = "spongebob-squarepants-trouble-clef";
public static const ON_PLAY_AGAIN:String = "ON_PLAY_AGAIN";
public static const ON_STAR_MISSED:String = "ON_STAR_MISSED";
public static const EVENT_ENGINE_INIT_REQUEST:String = "EVENT_ENGINE_INIT_REQUEST";
public static const ON_AUDIO_TOGGLE:String = "ON_AUDIO_TOGGLE";
public static const ON_NOTE_BLOCKED:String = "ON_NOTE_BLOCKED";
public static const PointsNoteDeath:Number = 100;
public static const TotalLivesToStart:Number = 4;
public static const ON_RESULT_BROADCAST:String = "ON_RESULT_BROADCAST";
public static const NoteTravelTimeAmount:Number = 7;
public static const PointsNoteStandard:Number = 25;
public static const PointsStar:Number = 250;
public static const LevelToStartHealth:Number = 2;
public static const TotalNoteGiantToStart:Number = 2;
public static const ON_NOTE_INTERCEPT:String = "ON_NOTE_INTERCEPT";
public static const ON_UPDATED_SCORE:String = "ON_UPDATED_SCORE";
public static const EVENT_ENGINE_INIT_COMPLETE:String = "EVENT_ENGINE_INIT_COMPLETE";
}
}//package com.nick.spongebob.clarinet
Section 28
//GameState (com.nick.spongebob.clarinet.GameState)
package com.nick.spongebob.clarinet {
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class GameState {
private var _level:Number;
private var _livesRemaining:Number;
private var _score:Number;
private var _consecutiveStars:Number;
private static var _instance:GameState;
public function GameState():void{
_registerEventListeners();
resetGame();
}
public function get level():Number{
return (_level);
}
private function _removeEventListeners():void{
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_SPONGE_HIT, _onLoseLife);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_LEVEL_COMPLETE, _onLevelComplete);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_STAR_MISSED, _onStarMissed);
WorkinDispatcher.getInstance().removeEventListener(GameConfig.ON_GAIN_LIFE, _onGainLife);
}
public function starMissed():void{
_consecutiveStars = 1;
}
public function _onLoseLife(_arg1:Event):void{
loseLife();
}
public function nextLevel():void{
_level++;
}
public function get score():Number{
return (_score);
}
public function get consecutiveStars():Number{
return (_consecutiveStars);
}
public function gainLife():void{
if (_livesRemaining < GameConfig.TotalLivesToStart){
_livesRemaining++;
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_LIFE_ADDED));
};
if (_livesRemaining > GameConfig.TotalLivesToStart){
_livesRemaining = GameConfig.TotalLivesToStart;
};
trace(("Sponge Gained a Life - Lives Remaining = " + _livesRemaining));
}
public function resetGame():void{
_score = 0;
_level = 1;
_livesRemaining = GameConfig.TotalLivesToStart;
_consecutiveStars = 1;
WorkinDispatcher.getInstance().dispatchEvent(new ENumber(GameConfig.ON_UPDATED_SCORE, _score));
}
private function _registerEventListeners():void{
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_SPONGE_HIT, _onLoseLife);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_LEVEL_COMPLETE, _onLevelComplete);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_STAR_MISSED, _onStarMissed);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_GAIN_LIFE, _onGainLife);
}
public function starHit():void{
_consecutiveStars++;
}
public function _onStarMissed(_arg1:Event):void{
starMissed();
}
public function get livesRemaining():Number{
return (_livesRemaining);
}
public function loseLife():void{
_livesRemaining--;
trace(("Sponge Hit - Lives Remaining = " + _livesRemaining));
if (_livesRemaining < 0){
_livesRemaining = 0;
};
if (_livesRemaining == 0){
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_GAME_OVER));
};
}
public function _onGainLife(_arg1:Event):void{
gainLife();
}
public function addToScore(_arg1:Number):void{
_score = (_score + _arg1);
if (_score < 0){
_score = 0;
};
WorkinDispatcher.getInstance().dispatchEvent(new ENumber(GameConfig.ON_UPDATED_SCORE, _score));
}
public function _onLevelComplete(_arg1:Event):void{
addToScore(GameConfig.PointsLevelComplete);
}
public static function get instance():GameState{
if (_instance == null){
_instance = new (GameState);
};
return (_instance);
}
}
}//package com.nick.spongebob.clarinet
Section 29
//GameTimeline (com.nick.spongebob.clarinet.GameTimeline)
package com.nick.spongebob.clarinet {
import com.workinman.lib.math.*;
import com.workinman.paradise2.*;
import flash.display.*;
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class GameTimeline extends BaseTimeline {
public var loader_mc:MovieClip;
public var tRatio:Number;
public function GameTimeline(){
addFrameScript(0, frame1, 4, frame5);
WorkinDispatcher.instance.addEventListener("onLoadInitialize", _onLoadInitialize);
}
private function _onMouseClick(_arg1:MouseEvent):void{
WorkinDispatcher.getInstance().dispatchEvent(new Event(ParadiseConfig.EVENT_MOUSE_CLICK));
}
private function _initSecure():void{
try {
stage.dispatchEvent(new Event("stageTestEvent"));
_begin();
} catch(pError:Error) {
addEventListener(Event.ADDED_TO_STAGE, _onDrawn);
};
}
public function _update(_arg1:EUpdate):void{
tRatio = (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal);
if (tRatio == 1){
gotoAndStop(5);
Updater.instance.removeEventListener(Updater.EVENT_UPDATE, _update);
};
}
override protected function _begin():void{
transition_container = new MovieClip();
ui_container = new MovieClip();
game_container = new MovieClip();
addChild(ui_container);
addChild(game_container);
addChild(transition_container);
Main.initialize(this);
stage.addEventListener(MouseEvent.CLICK, _onMouseClick);
}
function frame1(){
Updater.instance.addEventListener(Updater.EVENT_UPDATE, _update);
stop();
}
private function _onDrawn(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onDrawn);
_begin();
}
function frame5(){
stop();
WorkinDispatcher.instance.dispatchEvent(new Event("onLoadInitialize"));
}
private function _onLoadInitialize(_arg1:Event):void{
WorkinDispatcher.instance.removeEventListener("onLoadInitialize", _onLoadInitialize);
if (!stage){
WorkinDispatcher.instance.addEventListener(GameConfig.EVENT_ENGINE_INIT_REQUEST, _onExternalInitRequest);
} else {
_initSecure();
};
}
public function get mousePosition():WorkinPoint{
return (new WorkinPoint(mouseX, mouseY));
}
private function _onExternalInitRequest(_arg1:Event):void{
WorkinDispatcher.instance.removeEventListener(GameConfig.EVENT_ENGINE_INIT_REQUEST, _onExternalInitRequest);
_initSecure();
}
}
}//package com.nick.spongebob.clarinet
Section 30
//Main (com.nick.spongebob.clarinet.Main)
package com.nick.spongebob.clarinet {
import com.workinman.lib.math.*;
import com.workinman.paradise2.*;
import com.workinman.paradise2.view.*;
import com.workinman.lib.sound.*;
import flash.display.*;
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import com.nick.spongebob.clarinet.world.*;
import com.nick.spongebob.clarinet.ui.*;
import com.workinman.lib.display.*;
import flash.ui.*;
import flash.external.*;
public class Main extends BaseEngine {
private var _instructions:Instructions;
private var _gameplay:Gameplay;
private var _level:Level;
private var _intro:Intro;
private var _state:GameState;
private var _world:WorldManager;
private var _isGameplayDisplayActive:Boolean;
private var _payoffDisplayed:Boolean;
private var _audioIsMuted:Boolean;
private var _gameUILayer:Sprite;
private var _dt:Number;
public var hasActiveWorld:Boolean;
private var _menuLayer:Sprite;
private var _currentAudio:String;
private var _instructionsDisplayed:Boolean;
private var _instructionsNoteTimer:Number;
private var _gameEnded:Boolean;
private var _payoff:Payoff;
private var _soundMgr:SoundManager;
private var _firstTimePlay:Boolean;
private var _introDisplayed:Boolean;
private var _introLayer:Sprite;
private static var _instance:Main;
public function Main(_arg1:BaseTimeline):void{
super(_arg1);
}
private function _update(_arg1:EUpdate):void{
var _local2:Number;
if (_arg1.dt > 0.2){
_dt = 0.2;
} else {
_dt = _arg1.dt;
};
_instructionsNoteTimer = (_instructionsNoteTimer - _dt);
if (_instructionsNoteTimer < 0){
_local2 = Math.floor((Math.random() * 8));
if (_local2 == 0){
_local2 = 3;
};
_playSound(("note" + _local2).toString());
_instructionsNoteTimer = 1;
};
}
private function _initGameDisplay():void{
if (!_isGameplayDisplayActive){
_gameUILayer.addChild(_gameplay);
_gameplay.init();
_isGameplayDisplayActive = true;
};
}
private function _playSound(_arg1:String):void{
if (_audioIsMuted){
return;
};
_currentAudio = _arg1;
GlobalSound.instance.playSound(_arg1);
}
public function hideMouse():void{
Mouse.hide();
}
private function _displayEndScreen():void{
_dispatchToEnableNavButtons();
_payoffDisplayed = true;
_payoff.score = _state.score;
_menuLayer.addChild(_payoff);
_payoff.gotoAndPlay("in");
GlobalSound.instance.stopMusic();
_playEndScreams("spongeScreamLong");
}
protected function _onGameOver(_arg1:Event):void{
_endGame();
}
private function _hideEndScreen():void{
_payoff.addEventListener(WorkinMovieClip.COMPLETE_TRACK, _onPayoffOutroComplete);
_payoff.trackPlay("out", 89);
}
private function _onPayoffOutroComplete(_arg1:Event):void{
_payoff.removeEventListener(WorkinMovieClip.COMPLETE_TRACK, _onPayoffOutroComplete);
_menuLayer.removeChild(_payoff);
_payoffDisplayed = false;
_beginNewGame();
}
private function _dispatchToEnableNavButtons():void{
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_ENABLE_NAV_BUTTONS));
}
private function _exitGame():void{
_cleanup();
}
protected function _cleanUpGame():void{
_world.cleanUp();
_world = null;
hasActiveWorld = false;
}
public function get state():GameState{
return (_state);
}
override protected function _generateState():void{
_state = GameState.instance;
}
protected function _resumeCurrentGame():void{
}
override protected function _generateView():void{
var _local1:MovieClip = new MovieClip();
_view = new ViewManager(_local1);
(_timeline as GameTimeline).game_container.addChild(_local1);
_view.addLayer("bg");
_view.addLayer("player");
_view.addLayer("tentacles");
_view.addLayer("hostiles");
_view.addLayer("friendlies");
_view.addLayer("effect");
_view.addLayer("sponge");
_view.addLayer("laugh");
}
private function _initIntroLayer():void{
_intro = new Intro();
_intro.gotoAndStop("in");
}
private function _initMenuLayer():void{
_instructions = new Instructions();
_level = new Level();
_payoff = new Payoff();
}
protected function _beginNewGame():void{
trace("[GameEngine] Begin New Game (create World)");
if (hasActiveWorld){
_cleanUpGame();
};
_state.resetGame();
_world = new WorldManager();
hasActiveWorld = true;
_initGameDisplay();
_gameplay.resetGameplay();
_displayLevel();
}
private function _displayIntro():void{
_introDisplayed = true;
_dispatchToEnableNavButtons();
_introLayer.addChild(_intro);
_intro.gotoAndPlay("in");
}
override protected function _generateControls():void{
super._generateControls();
}
private function _cleanUpGameDisplay():void{
if (_isGameplayDisplayActive){
_gameUILayer.removeChild(_gameplay);
_gameplay.cleanUp();
_isGameplayDisplayActive = false;
};
}
private function _endGame():void{
trace("GAME OVER ***********************");
_gameEnded = true;
_cleanUpGame();
_view.clear();
_displayEndScreen();
}
private function _onPlaySound(_arg1:EString):void{
_playSound(_arg1.data);
}
private function _onPlayAgain(_arg1:Event):void{
var pEvent = _arg1;
try {
ExternalInterface.call("trackKidsGamePlay", GameConfig.TRACKING_GAME_NAME);
} catch(pErr:Error) {
};
GlobalSound.instance.stopMusic();
_hideEndScreen();
}
public function showMouse():void{
Mouse.show();
}
override protected function _generateSounds():void{
super._generateSounds();
_soundMgr = GlobalSound.getInstance();
_soundMgr.registerSound("navButton", sfx_button);
_soundMgr.registerSound("note1", sfx_note_1);
_soundMgr.registerSound("note2", sfx_note_2);
_soundMgr.registerSound("note3", sfx_note_3);
_soundMgr.registerSound("note4", sfx_note_4);
_soundMgr.registerSound("note5", sfx_note_5);
_soundMgr.registerSound("note6", sfx_note_6);
_soundMgr.registerSound("note7", sfx_note_7);
_soundMgr.registerSound("note8", sfx_note_8);
_soundMgr.registerSound("noteDeath", sfx_note_death);
_soundMgr.registerSound("crash", sfx_crash);
_soundMgr.registerSound("spongeLaugh", sfx_sponge_laugh);
_soundMgr.registerSound("squidLaugh", sfx_squid_laugh);
_soundMgr.registerSound("patrickLaugh", sfx_patrick_laugh);
_soundMgr.registerSound("spongeScreamLong", sfx_sponge_scream_long);
_soundMgr.registerSound("spongeScreamShort", sfx_sponge_scream_short);
}
private function _onGameplayScreenOpen(_arg1:Event):void{
if (!hasActiveWorld){
_beginNewGame();
} else {
_resumeCurrentGame();
};
}
private function _playEndScreams(_arg1:String):void{
if (_audioIsMuted){
return;
};
_currentAudio = _arg1;
GlobalSound.instance.playMusic(_arg1);
}
public function pauseGameplay():void{
_suspendCurrentGame();
}
public function cleanUp():void{
_sound.cleanUp();
}
override protected function _addEventListeners():void{
super._addEventListeners();
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_BEGIN_GAME_PLAY, _onBeginGame);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_BEGIN_GAME_PLAY_INSTRUCT, _onBeginGameFromInstructions);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_GAME_OVER, _onGameOver);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_PLAY_AGAIN, _onPlayAgain);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_EXIT_GAME, _onExitGame);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_AUDIO_TOGGLE, _onAudioToggle);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_PLAY_SOUND, _onPlaySound);
WorkinDispatcher.getInstance().addEventListener(GameConfig.ON_LEVEL_COMPLETE, _onLevelComplete);
}
public function unpauseGameplay():void{
_resumeCurrentGame();
}
private function _hideIntro():void{
_intro.addEventListener(WorkinMovieClip.COMPLETE_TRACK, _onIntroOutroComplete);
_intro.trackPlay("out", 105);
}
protected function _suspendCurrentGame():void{
}
override protected function _generate(_arg1:BaseTimeline):void{
_firstTimePlay = true;
hasActiveWorld = false;
ParadiseConfig.DIMENSIONS = new WorkinPoint(400, 500);
ParadiseConfig.SCREEN_CENTER = new WorkinPoint((ParadiseConfig.DIMENSIONS.x / 2), (ParadiseConfig.DIMENSIONS.y / 2));
ParadiseConfig.SCREEN_OFFSET = new WorkinPoint(0, 0);
_state = GameState.instance;
super._generate(_arg1);
_displayIntro();
}
private function _onExitGame(_arg1:Event):void{
_exitGame();
}
private function _initGameLayer():void{
_gameplay = new Gameplay();
}
private function _displayLevel():void{
_level.levelDisplay = _state.level;
_timeline.game_container.addChild(_level);
_level.addEventListener(WorkinMovieClip.COMPLETE_TRACK, _onLevelOutroComplete);
_level.trackPlay("in", 100);
}
private function _onGameplayScreenClosed(_arg1:Event):void{
}
private function _onBeginGame(_arg1:Event):void{
var pEvent = _arg1;
try {
ExternalInterface.call("trackKidsGamePlay", GameConfig.TRACKING_GAME_NAME);
} catch(pErr:Error) {
};
_hideIntro();
}
private function _displayInstructions():void{
_instructionsDisplayed = true;
_dispatchToEnableNavButtons();
_menuLayer.addChild(_instructions);
_instructions.gotoAndPlay("in");
_instructionsNoteTimer = 2.75;
Updater.getInstance().addEventListener(Updater.EVENT_UPDATE, _update);
}
private function _onInstructionsOutroComplete(_arg1:Event):void{
_instructions.removeEventListener(WorkinMovieClip.COMPLETE_TRACK, _onInstructionsOutroComplete);
_menuLayer.removeChild(_instructions);
_instructionsDisplayed = false;
_beginGameFromInstructions();
}
private function _beginGameFromInstructions():void{
_beginNewGame();
}
private function _onLevelOutroComplete(_arg1:Event):void{
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_START_NEW_LEVEL));
}
private function _playMusic(_arg1:String):void{
if (_audioIsMuted){
return;
};
GlobalSound.instance.playMusic(_arg1);
}
public function get mousePoint():WorkinPoint{
return (new WorkinPoint(_timeline.mouseX, _timeline.mouseY, 0));
}
private function _onBeginGameFromInstructions(_arg1:Event):void{
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _update);
_hideInstructions();
}
private function _hideInstructions():void{
_instructions.addEventListener(WorkinMovieClip.COMPLETE_TRACK, _onInstructionsOutroComplete);
_instructions.trackPlay("out", 135);
}
private function _onIntroOutroComplete(_arg1:Event):void{
_intro.removeEventListener(WorkinMovieClip.COMPLETE_TRACK, _onIntroOutroComplete);
_introLayer.removeChild(_intro);
_introDisplayed = false;
_displayInstructions();
}
override protected function _generateUI():void{
_gameUILayer = new Sprite();
_introLayer = new Sprite();
_menuLayer = new Sprite();
_timeline.ui_container.addChild(_gameUILayer);
_timeline.ui_container.addChild(_introLayer);
_timeline.ui_container.addChild(_menuLayer);
_timeline.ui_container.addChild(_menuLayer);
_initGameLayer();
_initIntroLayer();
_initMenuLayer();
}
private function _onAudioToggle(_arg1:Event):void{
if (_audioIsMuted){
_audioIsMuted = false;
} else {
_audioIsMuted = true;
GlobalSound.instance.stopMusic();
};
}
private function _cleanup():void{
_removeEventListeners();
}
protected function _onLevelComplete(_arg1:Event):void{
_state.nextLevel();
GlobalSound.instance.stopMusic();
_displayLevel();
}
public static function get instance():Main{
if (_instance == null){
trace("[GameEngine] WARNING: get instance called on GameEngine before initialize().");
};
return (_instance);
}
public static function initialize(_arg1:BaseTimeline):void{
if (_instance != null){
return;
};
_instance = new Main(_arg1);
}
}
}//package com.nick.spongebob.clarinet
Section 31
//WorkinTweenBase (com.workinman.lib.display.tweener.WorkinTweenBase)
package com.workinman.lib.display.tweener {
import com.workinman.lib.math.*;
import flash.events.*;
public class WorkinTweenBase extends EventDispatcher {
protected var _dur:Number;
protected var _delay:Number;
protected var _ease:String;
protected var _change:Number;
protected var _in:Number;
protected var _scope:Object;
protected var _out:Number;
protected var _delayCounter:Number;
protected var _useCurrentIn:Boolean;
protected var _isComplete:Boolean;
protected var _formula:Function;
protected var _time:Number;
protected var _current:Number;
protected var _isError:Boolean;
public static const INVALID_IN_VALUE:Number = -10000.85412;
public static var ERROR:String = "onTweenError";
public static var COMPLETE:String = "onTweenComplete";
public function WorkinTweenBase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number, _arg6:Object){
_scope = _arg6;
_dur = _arg3;
_delay = (_delayCounter = _arg5);
if (_arg1 == INVALID_IN_VALUE){
_useCurrentIn = true;
} else {
_useCurrentIn = false;
};
_in = _arg1;
_out = _arg2;
_resetIn();
_current = _in;
_ease = _arg4;
_formula = PennerManager.getEaseFunction(_ease);
_time = 0;
_isComplete = false;
_isError = false;
}
public function complete():void{
_onComplete(false);
}
public function get dur():Number{
return (_dur);
}
public function get isComplete():Boolean{
return (_isComplete);
}
public function get isError():Boolean{
return (_isError);
}
protected function _setInToProp():void{
}
public function update(_arg1:Number):void{
if (_delayCounter > 0){
_delayCounter = (_delayCounter - _arg1);
if (_delayCounter < 0){
_arg1 = Math.abs(_delayCounter);
_resetIn();
} else {
return;
};
};
_time = (_time + _arg1);
if (_time > _dur){
_time = _dur;
};
if (_time != 0){
_current = _formula(_in, _change, _time, _dur);
};
if (_time == _dur){
complete();
};
}
public function get timeRangeTop():Number{
return ((_delay + _dur));
}
public function equals(_arg1:String, _arg2:Number, _arg3:Number):Boolean{
return (false);
}
protected function _resetIn():void{
if (_useCurrentIn){
_setInToProp();
};
_change = (_out - _in);
}
protected function _onComplete(_arg1:Boolean=true):void{
_isComplete = true;
_current = _out;
if (_arg1){
dispatchEvent(new Event(COMPLETE));
};
}
public function get doDelete():Boolean{
return ((((_delayCounter <= 0)) && (((_isComplete) || (_isError)))));
}
protected function _onError():void{
_isError = true;
dispatchEvent(new Event(ERROR));
}
public function get isRunning():Boolean{
return ((((_delayCounter <= 0)) && (!(((_isComplete) || (_isError))))));
}
public function render(_arg1:Object){
}
public function get current():Number{
return (_current);
}
public function get timeRangeBottom():Number{
return (_delay);
}
public function cleanUp():void{
_formula = null;
_scope = null;
}
}
}//package com.workinman.lib.display.tweener
Section 32
//WorkinTweener (com.workinman.lib.display.tweener.WorkinTweener)
package com.workinman.lib.display.tweener {
import com.workinman.lib.math.*;
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
public class WorkinTweener extends EventDispatcher {
public static const TWEEN_GLOW:String = "glow";
public static const TWEEN_SHADOW:String = "shadow";
public static const TWEEN_SCALE:String = "scale";
public static const TWEEN_POS:String = "pos";
public static const TWEEN_IDLE:String = "idle";
public static const TWEEN_ALPHA:String = "fade";
public static const TWEEN_POS_3D:String = "pos3d";
public static const TWEEN_ROTATE:String = "rotate";
public static const TWEEN_FRAME:String = "frame";
public static const TWEEN_BLUR:String = "blur";
public static const ROOM:String = "workinTweenerRoom";
public static const TWEEN_PROP:String = "prop";
public static const TWEEN_COLOR:String = "color";
private static var _loop:Number;
private static var _activeScopes:Array;
private static var _updateLoop:Number;
private static var _isUpdating:Boolean;
private static var _isPaused:Boolean;
public static function stopAllTweens():void{
if (_activeScopes == null){
return;
};
_loop = _activeScopes.length;
while (_loop--) {
_activeScopes[_loop].stopAllTweens();
};
_clearTweens();
}
public static function get isUpdating():Boolean{
return (_isUpdating);
}
public static function pauseAllTweens():void{
if (_isPaused){
return;
};
_stopInterval();
_isPaused = true;
}
public static function completeScope(_arg1:Object):void{
_loop = _findScope(_arg1);
if (_loop >= 0){
_activeScopes[_loop].completeAllTweens();
};
}
private static function _findScope(_arg1:Object):Number{
if (_activeScopes == null){
return (-1);
};
var _local2:Number = _activeScopes.length;
while (_local2--) {
if (_activeScopes[_local2].scope == _arg1){
return (_local2);
};
};
return (-1);
}
public static function removeScope(_arg1:Object):void{
_loop = _findScope(_arg1);
if (_loop >= 0){
_activeScopes[_loop].cleanUp();
_activeScopes.splice(_loop, 1);
trace(("Remove Scope : Splice at " + _loop));
trace(("Scopes remain: " + _activeScopes.length));
};
}
public static function completeAllTweens():void{
if (_activeScopes == null){
return;
};
_loop = _activeScopes.length;
while (_loop--) {
_activeScopes[_loop].completeAllTweens();
};
_clearTweens();
}
private static function _validateData(_arg1:String, _arg2:Object):Boolean{
if (!_arg2.hasOwnProperty("dur")){
return (false);
};
switch (_arg1){
case TWEEN_PROP:
if (!_arg2.hasOwnProperty("prop")){
return (false);
};
break;
case TWEEN_POS:
if (!((_arg2.hasOwnProperty("x")) && (_arg2.hasOwnProperty("y")))){
return (false);
};
return (true);
case TWEEN_POS_3D:
if (!((((_arg2.hasOwnProperty("x")) && (_arg2.hasOwnProperty("y")))) && (_arg2.hasOwnProperty("z")))){
return (false);
};
return (true);
case TWEEN_SCALE:
if (!((_arg2.hasOwnProperty("scaleX")) && (_arg2.hasOwnProperty("scaleY")))){
return (false);
};
return (true);
};
if (!_arg2.hasOwnProperty("end")){
return (false);
};
return (true);
}
private static function _cleanData(_arg1:Object):void{
if (((!(_arg1.hasOwnProperty("start"))) || (isNaN(_arg1.start)))){
_arg1.start = WorkinTweenBase.INVALID_IN_VALUE;
};
if (!_arg1.hasOwnProperty("ease")){
_arg1.ease = PennerManager.EASE_LINEAR;
};
if (((!(_arg1.hasOwnProperty("delay"))) || (isNaN(_arg1.delay)))){
_arg1.delay = 0;
};
}
public static function cleanUp():void{
_stopInterval();
_loop = _activeScopes.length;
while (_loop--) {
_activeScopes[_loop].cleanUp();
_activeScopes[_loop] = null;
};
_activeScopes = [];
}
private static function _stopInterval():void{
if (!_isUpdating){
return;
};
_isUpdating = false;
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _updateTweens);
}
public static function addTween(_arg1:Object, _arg2:String, _arg3:Object):void{
if (_activeScopes == null){
_activeScopes = [];
};
if (_validateData(_arg2, _arg3)){
_cleanData(_arg3);
} else {
trace((((("[WorkinTweener] Unable to add Tween of property " + _arg2) + " to scope ") + _arg1) + " due to improperly formed data object."));
return;
};
_loop = _activeScopes.length;
while (_loop--) {
if (_activeScopes[_loop].scope == _arg1){
if (_activeScopes[_loop].testTweenExists(_arg2, _arg3)){
_activeScopes[_loop].replaceTween(_arg2, _arg3);
} else {
_activeScopes[_loop].addTween(_arg2, _arg3);
};
return;
};
};
_activeScopes.push(new WorkinTweenScope(_arg1, _arg2, _arg3));
if (!_isUpdating){
_startInterval();
};
}
private static function _clearTweens():void{
if (_activeScopes == null){
return;
};
_loop = _activeScopes.length;
while (_loop--) {
_activeScopes[_loop].cleanUp();
_activeScopes[_loop] = null;
};
_activeScopes = [];
_isPaused = false;
_stopInterval();
}
private static function _startInterval():void{
if (_isUpdating){
return;
};
if (_activeScopes.length == 0){
return;
};
_isUpdating = true;
Updater.getInstance().addEventListener(Updater.EVENT_UPDATE, _updateTweens);
}
public static function unpauseScope(_arg1:Object):void{
_loop = _findScope(_arg1);
if (_loop >= 0){
_activeScopes[_loop].unpause();
};
}
private static function _updateTweens(_arg1:EUpdate):void{
_updateLoop = _activeScopes.length;
while (_updateLoop--) {
_activeScopes[_updateLoop].updateTweens(_arg1.dt);
if (_activeScopes[_updateLoop].doDelete){
_activeScopes[_updateLoop].cleanUp();
_activeScopes.splice(_updateLoop, 1);
};
};
if (_activeScopes.length == 0){
_stopInterval();
};
}
public static function stopScope(_arg1:Object):void{
_loop = _findScope(_arg1);
if (_loop >= 0){
_activeScopes[_loop].stopAllTweens();
};
}
public static function unpauseAllTweens():void{
if (!_isPaused){
return;
};
_startInterval();
_isPaused = false;
}
public static function pauseScope(_arg1:Object):void{
_loop = _findScope(_arg1);
if (_loop >= 0){
_activeScopes[_loop].pause();
};
}
}
}//package com.workinman.lib.display.tweener
Section 33
//WorkinTweenFrame (com.workinman.lib.display.tweener.WorkinTweenFrame)
package com.workinman.lib.display.tweener {
public class WorkinTweenFrame extends WorkinTweenBase {
public function WorkinTweenFrame(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number, _arg6:Object):void{
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function get prop():String{
return ("frame");
}
override public function render(_arg1:Object){
if (_current < 0){
_arg1.gotoAndStop(1);
} else {
_arg1.gotoAndStop(Math.ceil(_current));
};
}
override protected function _setInToProp():void{
_in = _scope.currentFrame;
}
override public function equals(_arg1:String, _arg2:Number, _arg3:Number):Boolean{
if (_arg1 == WorkinTweener.TWEEN_FRAME){
if (((isComplete) || (isError))){
return (false);
};
if (((((_arg2 - timeRangeBottom) < _delay)) || ((Math.abs((timeRangeBottom - _arg2)) < _arg3)))){
return (true);
};
};
return (false);
}
}
}//package com.workinman.lib.display.tweener
Section 34
//WorkinTweenProp (com.workinman.lib.display.tweener.WorkinTweenProp)
package com.workinman.lib.display.tweener {
public class WorkinTweenProp extends WorkinTweenBase {
private var _prop:String;
public function WorkinTweenProp(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number, _arg6:Object, _arg7:String):void{
_prop = _arg7;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
override protected function _setInToProp():void{
_in = _scope[_prop];
}
public function get prop():String{
return (_prop);
}
override public function render(_arg1:Object){
_arg1[_prop] = _current;
}
override public function equals(_arg1:String, _arg2:Number, _arg3:Number):Boolean{
if (_prop == _arg1){
if (((isComplete) || (isError))){
return (false);
};
if (((((_arg2 - timeRangeBottom) < _delay)) || ((Math.abs((timeRangeBottom - _arg2)) < _arg3)))){
return (true);
};
};
return (false);
}
}
}//package com.workinman.lib.display.tweener
Section 35
//WorkinTweenScope (com.workinman.lib.display.tweener.WorkinTweenScope)
package com.workinman.lib.display.tweener {
public class WorkinTweenScope {
private var _loop:Number;
private var _tweens:Array;
private var _scope:Object;
private var _isPaused:Boolean;
public function WorkinTweenScope(_arg1:Object, _arg2:String, _arg3:Object){
_tweens = [];
_scope = _arg1;
_isPaused = false;
addTween(_arg2, _arg3);
}
private function _generateNewTween(_arg1:String, _arg2:Object):void{
var _local3:Array = _getTweenProperties(_arg1, _arg2);
_loop = _local3.length;
switch (_arg1){
case WorkinTweener.TWEEN_FRAME:
_tweens.push(new WorkinTweenFrame(((_arg2.start)!=undefined) ? _arg2.start : WorkinTweenBase.INVALID_IN_VALUE, _arg2.end, _arg2.dur, _arg2.ease, _arg2.delay, _scope));
break;
case WorkinTweener.TWEEN_POS:
case WorkinTweener.TWEEN_POS_3D:
case WorkinTweener.TWEEN_SCALE:
while (_loop--) {
_tweens.push(new WorkinTweenProp(WorkinTweenBase.INVALID_IN_VALUE, _arg2[_local3[_loop]], _arg2.dur, _arg2.ease, _arg2.delay, _scope, _local3[_loop]));
};
break;
case WorkinTweener.TWEEN_BLUR:
case WorkinTweener.TWEEN_SHADOW:
case WorkinTweener.TWEEN_GLOW:
default:
while (_loop--) {
_tweens.push(new WorkinTweenProp(_arg2.start, _arg2.end, _arg2.dur, _arg2.ease, _arg2.delay, _scope, _local3[_loop]));
};
break;
};
}
public function announceComplete():void{
try {
_scope.onTweensComplete();
} catch(pErr:Error) {
};
}
public function unpause():void{
_isPaused = false;
}
public function pause():void{
_isPaused = true;
}
private function _getTweenProperties(_arg1:String, _arg2:Object):Array{
switch (_arg1){
case WorkinTweener.TWEEN_PROP:
return ([_arg2.prop]);
case WorkinTweener.TWEEN_POS:
return (["x", "y"]);
case WorkinTweener.TWEEN_POS_3D:
return (["x", "y", "z"]);
case WorkinTweener.TWEEN_SCALE:
return (["scaleX", "scaleY"]);
case WorkinTweener.TWEEN_ALPHA:
return (["alpha"]);
case WorkinTweener.TWEEN_ROTATE:
return (["rotation"]);
case WorkinTweener.TWEEN_COLOR:
case WorkinTweener.TWEEN_BLUR:
case WorkinTweener.TWEEN_GLOW:
case WorkinTweener.TWEEN_SHADOW:
case WorkinTweener.TWEEN_FRAME:
case WorkinTweener.TWEEN_IDLE:
default:
return ([]);
};
}
public function addTween(_arg1:String, _arg2:Object):void{
if (!_validateProperty(_arg1, _arg2)){
trace((((("[WorkinTween] Error adding tween of property : " + _arg1) + " to scope ") + _arg2) + " . Property not found."));
return;
};
_generateNewTween(_arg1, _arg2);
}
public function cleanUp():void{
_loop = _tweens.length;
while (_loop--) {
_tweens[_loop].cleanUp();
};
_tweens = [];
_scope = null;
}
public function completeAllTweens():void{
_loop = _tweens.length;
while (_loop--) {
_tweens[_loop].finish();
_tweens[_loop].render(_scope);
_tweens[_loop].cleanUp();
};
_tweens = [];
announceComplete();
}
public function get scope():Object{
return (_scope);
}
public function get doDelete():Boolean{
return ((_tweens.length == 0));
}
public function updateTweens(_arg1:Number):void{
if (_isPaused){
return;
};
_loop = _tweens.length;
while (_loop--) {
_tweens[_loop].update(_arg1);
_tweens[_loop].render(_scope);
if (_tweens[_loop].doDelete){
_tweens[_loop].cleanUp();
_tweens.splice(_loop, 1);
};
};
if (_tweens.length == 0){
announceComplete();
};
}
private function _validateProperty(_arg1:String, _arg2:Object):Boolean{
var _local3:Array = _getTweenProperties(_arg1, _arg2);
_loop = _local3.length;
while (_loop--) {
if (!_scope.hasOwnProperty(_local3[_loop])){
return (false);
};
};
return (true);
}
public function testTweenExists(_arg1:String, _arg2:Object):Boolean{
var _local4:Number;
var _local3:Array = _getTweenProperties(_arg1, _arg2);
_loop = _tweens.length;
while (_loop--) {
_local4 = _local3.length;
if (_local4 == 0){
if (_tweens[_loop].equals(_arg1, _arg2.delay, _arg2.dur)){
return (true);
};
} else {
while (_local4--) {
if (_tweens[_loop].equals(_local3[_local4], _arg2.delay, _arg2.dur)){
return (true);
};
};
};
};
return (false);
}
public function replaceTween(_arg1:String, _arg2:Object):void{
if (!_validateProperty(_arg1, _arg2)){
trace((((("[WorkinTween] Error adding tween of property : " + _arg1) + " to scope ") + _arg2) + " . Property not found."));
return;
};
testTweenExists(_arg1, _arg2);
_tweens[_loop].cleanUp();
_tweens.splice(_loop, 1);
_generateNewTween(_arg1, _arg2);
}
public function stopAllTweens():void{
trace("This scope stop all tweens");
_loop = _tweens.length;
while (_loop--) {
_tweens[_loop].cleanUp();
};
_tweens = [];
announceComplete();
}
}
}//package com.workinman.lib.display.tweener
Section 36
//WorkinMovieClip (com.workinman.lib.display.WorkinMovieClip)
package com.workinman.lib.display {
import flash.display.*;
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import flash.geom.*;
import com.workinman.lib.display.tweener.*;
public class WorkinMovieClip extends MovieClip {
protected var _isTracking:Boolean;
protected var _trackOutFrame:Number;
protected var _trackDelayTimer:Number;
public static var COMPLETE_TRACK:String = "onWMCCompleteTracking";
public static var COMPLETE_TWEEN:String = "onWMCTweensComplete";
public static var STOP_TRACK:String = "onWMCStopTracking";
public function onTweensComplete():void{
dispatchEvent(new Event(COMPLETE_TWEEN));
_onTweenComplete();
}
public function completeTweens():void{
WorkinTweener.completeScope(this);
}
override public function stop():void{
if (_isTracking){
stopTrack();
};
super.stop();
}
public function rotateSet(_arg1:Number):void{
rotation = _arg1;
}
public function moveBy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_POS, {x:(x + _arg1), y:(y + _arg2), dur:_arg3, ease:_arg4, delay:_arg5});
}
public function shadowOut(_arg1:Number=1, _arg2:String="linear", _arg3:Number=0):void{
}
public function glowOut(_arg1:Number=1, _arg2:String="linear", _arg3:Number=0, _arg4:uint=0):void{
}
public function rotateBy(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_ROTATE, {end:_arg1, dur:_arg2, ease:_arg3, delay:_arg4, by:true});
}
protected function _completeTrack():void{
gotoAndStop(_trackOutFrame);
dispatchEvent(new Event(COMPLETE_TRACK));
_clearTrack();
}
public function clearTweens():void{
WorkinTweener.removeScope(this);
}
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
if (_isTracking){
stopTrack();
};
super.gotoAndStop(_arg1, _arg2);
}
public function fadeTo(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
alphaTo(_arg1, _arg2, _arg3, _arg4);
}
public function colorBy(_arg1:uint, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function pauseTween():void{
WorkinTweener.pauseScope(this);
}
protected function _clearTrack():void{
if (!_isTracking){
return;
};
_isTracking = false;
_trackDelayTimer = 0;
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _onTrack);
}
public function blurBy(_arg1:Object, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function trackPlay(_arg1:Object, _arg2:Number, _arg3:Number=0):void{
if (_isTracking){
stopTrack();
};
_trackDelayTimer = _arg3;
if (_trackDelayTimer > 0){
gotoAndStop(_arg1);
} else {
gotoAndPlay(_arg1);
};
_isTracking = true;
_trackOutFrame = _arg2;
Updater.getInstance().addEventListener(Updater.EVENT_UPDATE, _onTrack, false, 0, true);
}
public function shadowSet(_arg1:Object, _arg2:Number=0):void{
}
public function alphaSet(_arg1:Number):void{
alpha = _arg1;
}
public function blurInit(_arg1:Number=0):void{
}
public function moveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_POS, {x:_arg1, y:_arg2, dur:_arg3, ease:_arg4, delay:_arg5});
}
public function glowSet(_arg1:Object, _arg2:Number=0):void{
}
public function shadowBy(_arg1:Object, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function frameSet(_arg1:Number):void{
gotoAndStop(_arg1);
}
public function rotateTo(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_ROTATE, {end:_arg1, dur:_arg2, ease:_arg3, delay:_arg4, by:false});
}
public function scaleSet(_arg1:Number, _arg2:Number):void{
scaleX = _arg1;
scaleY = _arg2;
}
public function shadowTo(_arg1:Object, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function glowInit(_arg1:Number=0):void{
}
public function colorTo(_arg1:uint, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function scaleBy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_SCALE, {scaleX:(scaleX + _arg1), scaleY:(scaleY + _arg2), dur:_arg3, ease:_arg4, delay:_arg5});
}
public function blurTo(_arg1:Object, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function cleanUp():void{
_clearTrack();
}
public function propTo(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_PROP, {prop:_arg1, end:_arg2, dur:_arg3, ease:_arg4, delay:_arg5});
}
public function fadeSet(_arg1:Number):void{
alphaSet(_arg1);
}
override public function gotoAndPlay(_arg1:Object, _arg2:String=null):void{
if (_isTracking){
stopTrack();
};
super.gotoAndPlay(_arg1, _arg2);
}
protected function _onTweenComplete():void{
}
public function addTween(_arg1:String, _arg2:Object):void{
WorkinTweener.addTween(this, _arg1, _arg2);
}
public function posBy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_POS, {x:(x + _arg1), y:(y + _arg2), dur:_arg3, ease:_arg4, delay:_arg5});
}
public function clear():void{
}
public function propTween(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String="linear", _arg6:Number=0, _arg7:MovieClip=null):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_PROP, {prop:_arg1, start:_arg2, end:_arg3, dur:_arg4, ease:_arg5, delay:_arg6});
}
public function shadowInit(_arg1:Number=0):void{
}
public function blurRemove(_arg1:Number=0):void{
}
public function glowBy(_arg1:Object, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function alphaBy(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_ALPHA, {end:(alpha + _arg1), dur:_arg2, ease:_arg3, delay:_arg4});
}
public function frameTo(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_FRAME, {end:_arg1, dur:_arg2, ease:_arg3, delay:_arg4});
}
public function scaleTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_SCALE, {scaleX:_arg1, scaleY:_arg2, dur:_arg3, ease:_arg4, delay:_arg5});
}
public function shadowRemove(_arg1:Number=0):void{
}
public function blurOut(_arg1:Number=1, _arg2:String="linear", _arg3:Number=0):void{
}
public function glowTo(_arg1:Object, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
}
public function stopTrack():void{
_clearTrack();
dispatchEvent(new Event(STOP_TRACK));
}
protected function _onTrack(_arg1:EUpdate):void{
if (_trackDelayTimer > 0){
_trackDelayTimer = (_trackDelayTimer - _arg1.dt);
if (_trackDelayTimer <= 0){
play();
};
};
if (currentFrame >= _trackOutFrame){
_completeTrack();
};
}
public function unpauseTween():void{
WorkinTweener.unpauseScope(this);
}
public function posTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_POS, {x:_arg1, y:_arg2, dur:_arg3, ease:_arg4, delay:_arg5});
}
public function glowRemove(_arg1:Number=0):void{
}
public function fadeBy(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
alphaBy(_arg1, _arg2, _arg3, _arg4);
}
public function alphaTo(_arg1:Number, _arg2:Number, _arg3:String="linear", _arg4:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_ALPHA, {end:_arg1, dur:_arg2, ease:_arg3, delay:_arg4});
}
public function blurSet(_arg1:Object, _arg2:Number=0):void{
}
public function posSet(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
public function frameTween(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String="linear", _arg5:Number=0, _arg6:MovieClip=null):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_FRAME, {start:_arg1, end:_arg2, dur:_arg3, ease:_arg4, delay:_arg5});
}
public function colorSet(_arg1:uint):void{
var _local2:ColorTransform = transform.colorTransform;
_local2.color = _arg1;
transform.colorTransform = _local2;
}
}
}//package com.workinman.lib.display
Section 37
//EData (com.workinman.lib.events.EData)
package com.workinman.lib.events {
import flash.events.*;
public class EData extends Event {
private var _data:Object;
public function EData(_arg1:String, _arg2:Object){
super(_arg1, false, false);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package com.workinman.lib.events
Section 38
//ENumber (com.workinman.lib.events.ENumber)
package com.workinman.lib.events {
import flash.events.*;
public class ENumber extends Event {
private var _data:Number;
public function ENumber(_arg1:String, _arg2:Number){
super(_arg1, false, false);
_data = _arg2;
}
public function get data():Number{
return (_data);
}
}
}//package com.workinman.lib.events
Section 39
//EString (com.workinman.lib.events.EString)
package com.workinman.lib.events {
import flash.events.*;
public class EString extends Event {
private var _data:String;
public function EString(_arg1:String, _arg2:String){
super(_arg1, false, false);
_data = _arg2;
}
public function get data():String{
return (_data);
}
}
}//package com.workinman.lib.events
Section 40
//EUpdate (com.workinman.lib.events.EUpdate)
package com.workinman.lib.events {
import flash.events.*;
public class EUpdate extends Event {
private var _dt:Number;
public function EUpdate(_arg1:String, _arg2:Number){
super(_arg1, false, false);
_dt = _arg2;
}
public function get dt():Number{
return (_dt);
}
}
}//package com.workinman.lib.events
Section 41
//InterceptResult (com.workinman.lib.math.InterceptResult)
package com.workinman.lib.math {
public class InterceptResult {
private var _success:Boolean;
private var _line1:WorkinLine;
private var _result:WorkinPoint;
private var _line2:WorkinLine;
public function InterceptResult(_arg1:Boolean, _arg2:WorkinPoint=null){
_success = _arg1;
_result = _arg2;
}
public function get success():Boolean{
return (_success);
}
public function get line1():WorkinLine{
return (_line1);
}
public function get line2():WorkinLine{
return (_line2);
}
public function set line2(_arg1:WorkinLine):void{
_line2 = _arg1;
}
public function set line1(_arg1:WorkinLine):void{
_line1 = _arg1;
}
public function toString():String{
return (("[Intercept Result] " + (_success) ? ("Collided! -> " + _result) : "Failed."));
}
public function get result():WorkinPoint{
return (_result);
}
}
}//package com.workinman.lib.math
Section 42
//PennerEasing (com.workinman.lib.math.PennerEasing)
package com.workinman.lib.math {
public class PennerEasing {
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456):Number{
if (_arg5 == -0.123456){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : ((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
--_arg1;
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456):Number{
if (_arg5 == -0.123456){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
return ((((_arg3 / 2) * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (2 - Math.sqrt((1 - (_arg1 * _arg1))))) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456):Number{
if (_arg5 == -0.123456){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
};
--_arg1;
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + 1)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456, _arg6:Number=-0.123456):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (_arg6 == -0.123456){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if ((((_arg5 == -0.123456)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
return ((((0.5 * ((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + (_arg3 / 2)) + _arg2));
};
return ((((_arg3 / 2) + (0.5 * ((_arg5 * Math.pow(2, (10 * (_arg1 - 2)))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))))) + _arg2));
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
--_arg1;
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 1)) + _arg2));
};
return ((((_arg3 / 2) * (Math.pow(2, (10 * (_arg1 - 2))) + 1)) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function linear(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456):Number{
if (_arg5 == -0.123456){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456, _arg6:Number=-0.123456):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (_arg6 == -0.123456){
_arg6 = (_arg4 * 0.3);
};
if ((((_arg5 == -0.123456)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.sin(((Math.PI * _arg1) / 2))) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / 2)) - 2)) + _arg2));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeOutBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeInBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456, _arg6:Number=-0.123456):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (_arg6 == -0.123456){
_arg6 = (_arg4 * 0.3);
};
if ((((_arg5 == -0.123456)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-0.123456, _arg6:Number=-0.123456):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (_arg6 == -0.123456){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if ((((_arg5 == -0.123456)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
}
}//package com.workinman.lib.math
Section 43
//PennerManager (com.workinman.lib.math.PennerManager)
package com.workinman.lib.math {
public class PennerManager {
public static var EASE_IN:String = "easeIn";
public static var EASE_WAVE_OUT:String = "waveOut";
public static var LINEAR:String = "linear";
public static var EASE_BOUNCE_IN:String = "bounceIn";
public static var EASE_CIRCLE_OUT:String = "circleOut";
public static var EASE_BLAST_IN:String = "blastIn";
public static var EASE_BLAST_OUT:String = "blastOut";
public static var EASE_EXPO_IN:String = "expoIn";
public static var EASE_SPACE_OUT:String = "spaceOut";
public static var EASE_BLAST:String = "blast";
public static var EASE_SPACE_IN:String = "spaceIn";
public static var EASE_CIRCLE:String = "circle";
public static var EASE_SPACE:String = "space";
public static var EASE_OUT:String = "easeOut";
public static var EASE_ELASTIC:String = "elastic";
public static var EASE_QUAD_OUT:String = "quadOut";
public static var EASE_BUMP_IN:String = "bumpIn";
public static var EASE_CUBIC_OUT:String = "cubicOut";
public static var EASE_CUBIC_IN:String = "cubicIn";
public static var EASE_EXPO_OUT:String = "expoOut";
public static var EASE_LINEAR:String = "linear";
public static var EASE_CUBIC:String = "cubic";
public static var EASE_EXPO:String = "expo";
public static var EASE_WAVE:String = "wave";
public static var EASE_QUAD_IN:String = "quadIn";
public static var EASE_ELASTIC_OUT:String = "elasticOut";
public static var EASE_BUMP_OUT:String = "bumpOut";
public static var EASE_WAVE_IN:String = "waveIn";
public static var EASE_ELASTIC_IN:String = "elasticIn";
public static var EASE_CIRCLE_IN:String = "circleIn";
public static var EASE_BUMP:String = "bump";
public static var EASE_BOUNCE_OUT:String = "bounceOut";
public static var EASE:String = "ease";
public static var EASE_QUAD:String = "quad";
public static var EASE_BOUNCE:String = "bounce";
protected static function _tweenCubicIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInCubic(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenEaseBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutQuad(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenExpoBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutExpo(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBumpOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutBack(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBlastIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInQuint(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenCubicOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutCubic(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenEaseIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInQuad(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenExpoIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInExpo(_arg3, _arg1, _arg2, _arg4));
}
public static function getGTweenEase(_arg1:String):Function{
switch (_arg1){
case EASE_IN:
case EASE_QUAD_IN:
return (PennerEasing.easeInQuad);
case EASE_OUT:
case EASE_QUAD_OUT:
return (PennerEasing.easeOutQuad);
case EASE:
case EASE_QUAD:
return (PennerEasing.easeInOutQuad);
case EASE_EXPO:
return (PennerEasing.easeInOutExpo);
case EASE_EXPO_IN:
return (PennerEasing.easeInExpo);
case EASE_EXPO_OUT:
return (PennerEasing.easeOutExpo);
case EASE_ELASTIC:
return (PennerEasing.easeInOutElastic);
case EASE_ELASTIC_IN:
return (PennerEasing.easeInElastic);
case EASE_ELASTIC_OUT:
return (PennerEasing.easeOutElastic);
case EASE_BUMP:
return (PennerEasing.easeInOutBack);
case EASE_BUMP_IN:
return (PennerEasing.easeInBack);
case EASE_BUMP_OUT:
return (PennerEasing.easeOutBack);
case EASE_BOUNCE:
return (PennerEasing.easeInOutBounce);
case EASE_BOUNCE_IN:
return (PennerEasing.easeInBounce);
case EASE_BOUNCE_OUT:
return (PennerEasing.easeOutBounce);
case EASE_CUBIC:
return (PennerEasing.easeInOutCubic);
case EASE_CUBIC_IN:
return (PennerEasing.easeInCubic);
case EASE_CUBIC_OUT:
return (PennerEasing.easeOutCubic);
case EASE_SPACE:
return (PennerEasing.easeInOutQuart);
case EASE_SPACE_IN:
return (PennerEasing.easeInQuart);
case EASE_SPACE_OUT:
return (PennerEasing.easeOutQuart);
case EASE_BLAST:
return (PennerEasing.easeInOutQuint);
case EASE_BLAST_IN:
return (PennerEasing.easeInQuint);
case EASE_BLAST_OUT:
return (PennerEasing.easeOutQuint);
case EASE_WAVE:
return (PennerEasing.easeInOutSine);
case EASE_WAVE_IN:
return (PennerEasing.easeInSine);
case EASE_WAVE_OUT:
return (PennerEasing.easeOutSine);
case EASE_CIRCLE:
return (PennerEasing.easeInOutCirc);
case EASE_CIRCLE_IN:
return (PennerEasing.easeInCirc);
case EASE_CIRCLE_OUT:
return (PennerEasing.easeOutCirc);
case EASE_LINEAR:
default:
return (PennerEasing.linear);
};
}
protected static function _tweenCircleOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutCirc(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBounceIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInBounce(_arg3, _arg1, _arg2, _arg4));
}
public static function getEaseFunction(_arg1:String):Function{
switch (_arg1){
case EASE_IN:
case EASE_QUAD_IN:
return (_tweenEaseIn);
case EASE_OUT:
case EASE_QUAD_OUT:
return (_tweenEaseOut);
case EASE:
case EASE_QUAD:
return (_tweenEaseBoth);
case EASE_EXPO:
return (_tweenExpoBoth);
case EASE_EXPO_IN:
return (_tweenExpoIn);
case EASE_EXPO_OUT:
return (_tweenExpoOut);
case EASE_ELASTIC:
return (_tweenElasticBoth);
case EASE_ELASTIC_IN:
return (_tweenElasticIn);
case EASE_ELASTIC_OUT:
return (_tweenElasticOut);
case EASE_BUMP:
return (_tweenBumpBoth);
case EASE_BUMP_IN:
return (_tweenBumpIn);
case EASE_BUMP_OUT:
return (_tweenBumpBoth);
case EASE_BOUNCE:
return (_tweenBounceBoth);
case EASE_BOUNCE_IN:
return (_tweenBounceIn);
case EASE_BOUNCE_OUT:
return (_tweenBounceOut);
case EASE_CUBIC:
return (_tweenCubicBoth);
case EASE_CUBIC_IN:
return (_tweenCubicIn);
case EASE_CUBIC_OUT:
return (_tweenCubicOut);
case EASE_SPACE:
return (_tweenSpaceBoth);
case EASE_SPACE_IN:
return (_tweenSpaceIn);
case EASE_SPACE_OUT:
return (_tweenSpaceOut);
case EASE_BLAST:
return (_tweenBlastBoth);
case EASE_BLAST_IN:
return (_tweenBlastIn);
case EASE_BLAST_OUT:
return (_tweenBlastOut);
case EASE_WAVE:
return (_tweenWaveBoth);
case EASE_WAVE_IN:
return (_tweenWaveIn);
case EASE_WAVE_OUT:
return (_tweenWaveOut);
case EASE_CIRCLE:
return (_tweenCircleBoth);
case EASE_CIRCLE_IN:
return (_tweenCircleIn);
case EASE_CIRCLE_OUT:
return (_tweenCircleOut);
case EASE_LINEAR:
default:
return (_tweenLinear);
};
}
protected static function _tweenBumpBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutBack(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenEaseOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutQuad(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBumpIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInBack(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenWaveIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInSine(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBlastBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutQuint(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenWaveOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutSine(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBounceOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutBounce(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenSpaceBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutQuart(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenCircleIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInCirc(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenWaveBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutSine(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBounceBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutBounce(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenLinear(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((_arg1 + ((_arg3 / _arg4) * _arg2)));
}
protected static function _tweenSpaceIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInQuart(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenBlastOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutQuint(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenElasticOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutElastic(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenElasticIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInElastic(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenCubicBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutCubic(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenElasticBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutElastic(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenSpaceOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutQuart(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenExpoOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeOutExpo(_arg3, _arg1, _arg2, _arg4));
}
protected static function _tweenCircleBoth(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (PennerEasing.easeInOutCirc(_arg3, _arg1, _arg2, _arg4));
}
}
}//package com.workinman.lib.math
Section 44
//WorkinBezier (com.workinman.lib.math.WorkinBezier)
package com.workinman.lib.math {
public class WorkinBezier {
private var _loop:Number;
protected var _length:Number;
protected var _c0:WorkinPoint;
protected var _c1:WorkinPoint;
private var _cVal:Object;
protected var _p0:WorkinPoint;
protected var _p1:WorkinPoint;
private var _aVal:Object;
private var _bVal:Object;
protected var _segments:Number;
public function WorkinBezier(_arg1:WorkinPoint, _arg2:WorkinPoint, _arg3:WorkinPoint, _arg4:WorkinPoint, _arg5:Number=4){
_p0 = _arg1.copy();
_p1 = _arg2.copy();
_c0 = _arg3.copy();
_c1 = _arg4.copy();
_segments = _arg5;
if (_segments < 2){
_segments = 2;
};
_calcProperties();
}
public function get p1():WorkinPoint{
return (_p1);
}
public function copy():WorkinBezier{
return (new WorkinBezier(_p0, _p1, _c0, _c1, _segments));
}
public function get p0():WorkinPoint{
return (_p0);
}
public function originTo(_arg1:Number, _arg2:Number, _arg3:Number):void{
_p0.to(_arg1, _arg2, _arg3);
_p0.clean();
_calcProperties();
}
public function set p1(_arg1:WorkinPoint):void{
_p1 = _arg1;
}
public function testPointIntercept(_arg1:WorkinPoint, _arg2:Number=3):Boolean{
var _local3:Array = getAsLines(_arg2);
_loop = _local3.length;
while (_loop--) {
if (_local3[_loop].testPointSegmentIntercept(_arg1)){
return (true);
};
};
return (false);
}
private function _calcProperties():void{
_length = (Math.round((Math.sqrt((((_p0.x - _p1.x) * (_p0.x - _p1.x)) + ((_p0.y - _p1.y) * (_p0.y - _p1.y)))) * 1000)) / 1000);
_cVal = {x:(3 * (c0.x - p0.x)), y:(3 * (c0.y - p0.y))};
_bVal = {x:((3 * (c1.x - c0.x)) - _cVal.x), y:((3 * (c1.y - c0.y)) - _cVal.y)};
_aVal = {x:(((p1.x - p0.x) - _bVal.x) - _cVal.x), y:(((p1.y - p0.y) - _bVal.y) - _cVal.y)};
}
public function set p0(_arg1:WorkinPoint):void{
_p0 = _arg1;
}
public function clean():void{
_p0.clean();
_p1.clean();
_c0.clean();
_c1.clean();
_calcProperties();
}
public function endToPoint(_arg1:WorkinPoint):void{
_p1.toPoint(_arg1);
_calcProperties();
}
public function set length(_arg1:Number):void{
_length = _arg1;
}
public function testLineIntercept(_arg1:WorkinLine, _arg2:Number=3):InterceptResult{
var _local4:InterceptResult;
var _local3:Array = getAsLines(_arg2);
_loop = _local3.length;
while (_loop--) {
_local4 = _arg1.testLineIntercept(_local3[_loop]);
if (_local4.success){
return (_local4);
};
};
return (new InterceptResult(false));
}
public function get center():WorkinPoint{
return (getPoint(0.5));
}
public function getAsLines(_arg1:Number=3):Array{
var _local2:WorkinPoint = p0;
var _local3:* = [];
var _local4:* = 0;
_loop = 1;
while (_loop <= _arg1) {
_local4 = (_loop / _arg1);
var _temp1 = _local2;
_local2 = getPoint(_local4);
_local3.push(new WorkinLine(_temp1, _local2));
_loop++;
};
return (_local3);
}
public function set c1(_arg1:WorkinPoint):void{
_c1 = _arg1;
}
public function originToPoint(_arg1:WorkinPoint):void{
_p0.toPoint(_arg1);
_calcProperties();
}
public function set c0(_arg1:WorkinPoint):void{
_c0 = _arg1;
}
public function testLineSegmentIntercept(_arg1:WorkinLine, _arg2:Number=3):InterceptResult{
var _local4:InterceptResult;
var _local3:Array = getAsLines(_arg2);
_loop = _local3.length;
while (_loop--) {
_local4 = _arg1.testLineSegmentIntercept(_local3[_loop]);
if (_local4.success){
return (_local4);
};
};
return (new InterceptResult(false));
}
public function getPoint(_arg1:Number):WorkinPoint{
return (new WorkinPoint(((((_aVal.x * ((_arg1 * _arg1) * _arg1)) + (_bVal.x * (_arg1 * _arg1))) + (_cVal.x * _arg1)) + p0.x), ((((_aVal.y * ((_arg1 * _arg1) * _arg1)) + (_bVal.y * (_arg1 * _arg1))) + (_cVal.y * _arg1)) + p0.y)));
}
public function toString():String{
return (((((((((((((("[WorkinBezier] " + "(") + _p0.x) + ", ") + _p0.y) + ", ") + _p0.z) + ") ~> (") + _p1.x) + ", ") + _p1.y) + ", ") + _p1.z) + ")"));
}
public function get c0():WorkinPoint{
return (_c0);
}
public function get c1():WorkinPoint{
return (_c1);
}
public function testBezierIntercept(_arg1:WorkinBezier, _arg2:Number=3):InterceptResult{
var _local5:InterceptResult;
var _local6:Number;
var _local3:Array = getAsLines(_arg2);
var _local4:Array = _arg1.getAsLines(_arg2);
_loop = _local3.length;
while (_loop--) {
_local6 = _local4.length;
while (_local6--) {
_local5 = _local3[_loop].testLineSegmentInterceipt(_local4[_local6]);
if (_local5.success){
return (_local5);
};
};
};
return (new InterceptResult(false));
}
public function get length():Number{
return (_length);
}
public function endTo(_arg1:Number, _arg2:Number, _arg3:Number):void{
_p1.to(_arg1, _arg2, _arg3);
_p1.clean();
_calcProperties();
}
public function getDerivative(_arg1:Number):WorkinPoint{
return (new WorkinPoint((((((3 * _aVal.x) * _arg1) * _arg1) + ((2 * _bVal.x) * _arg1)) + _cVal.x), (((((3 * _aVal.y) * _arg1) * _arg1) + ((2 * _bVal.y) * _arg1)) + _cVal.y)));
}
}
}//package com.workinman.lib.math
Section 45
//WorkinLine (com.workinman.lib.math.WorkinLine)
package com.workinman.lib.math {
public class WorkinLine {
protected var _length:Number;
protected var _normal:WorkinPoint;
protected var _slope:Number;
private var _xSegmentResult:Number;
private var _parametricDenom:WorkinPoint;
private var _inverseDeterminate:Number;
private var _ySegmentResult:Number;
protected var _p0:WorkinPoint;
protected var _p1:WorkinPoint;
protected var _vector:WorkinPoint;
protected var _yIntercept:Number;
public function WorkinLine(_arg1:WorkinPoint, _arg2:WorkinPoint){
_p0 = _arg1.copy();
_p1 = _arg2.copy();
_calcProperties();
}
private function _calcProperties():void{
_length = (Math.round((Math.sqrt((((_p0.x - _p1.x) * (_p0.x - _p1.x)) + ((_p0.y - _p1.y) * (_p0.y - _p1.y)))) * 1000)) / 1000);
_vector = new WorkinPoint((p1.x - p0.x), (p1.y - p0.y));
_slope = (_vector.y / _vector.x);
if (vector.x == 0){
_slope = 100000;
};
_yIntercept = (p0.y - (_slope * p0.x));
_parametricDenom = new WorkinPoint((p1.x - p0.x), (p1.y - p0.y));
_normal = _vector.pseudoCross();
_normal.normalize();
}
public function testPointSegmentIntercept(_arg1:WorkinPoint, _arg2:Boolean=false):Boolean{
if (_parametricDenom.x == 0){
_xSegmentResult = 0;
} else {
_xSegmentResult = ((_arg1.x - p0.x) / _parametricDenom.x);
};
if (_parametricDenom.y == 0){
_ySegmentResult = 0;
} else {
_ySegmentResult = ((_arg1.y - p0.y) / _parametricDenom.y);
};
if (_arg2){
trace(((("Seg : " + _xSegmentResult) + " , ") + _ySegmentResult));
};
if ((((((((_xSegmentResult >= 0)) && ((_xSegmentResult <= 1)))) && ((_ySegmentResult >= 0)))) && ((_ySegmentResult <= 1)))){
return (true);
};
return (false);
}
public function toLine(_arg1:WorkinLine):void{
_p0.toPoint(_arg1.p0);
_p1.toPoint(_arg1.p1);
_calcProperties();
}
public function recalculate():void{
_calcProperties();
}
public function testLineSegmentIntercept(_arg1:WorkinLine, _arg2:Boolean=false):InterceptResult{
var _local3:Number = ((-(_arg1.vector.x) * _vector.y) + (_vector.x * _arg1.vector.y));
var _local4:Number = (p0.x - _arg1.p0.x);
var _local5:Number = (p0.y - _arg1.p0.y);
var _local6:Number = (((-(_vector.y) * _local4) + (_vector.x * _local5)) / _local3);
var _local7:Number = (((_arg1.vector.x * _local5) - (_arg1.vector.y * _local4)) / _local3);
if ((((((((_local6 >= 0)) && ((_local6 <= 1)))) && ((_local7 >= 0)))) && ((_local7 <= 1)))){
return (new InterceptResult(true, new WorkinPoint((p0.x + (_local7 * _vector.x)), (p0.y + (_local7 * _vector.y)))));
};
return (new InterceptResult(false));
}
public function get centerX():Number{
return ((_p0.x + (_vector.x / 2)));
}
public function get centerY():Number{
return ((_p0.y + (_vector.y / 2)));
}
public function get slope():Number{
return (_slope);
}
public function endTo(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_p1.to(_arg1, _arg2, _arg3);
_p1.clean();
_calcProperties();
}
public function get p1():WorkinPoint{
return (_p1);
}
public function get vector():WorkinPoint{
return (_vector);
}
public function get p0():WorkinPoint{
return (_p0);
}
public function shiftOrigin(_arg1:Number):void{
var _local2:WorkinPoint = _vector.reverseCopy();
_local2.length = _arg1;
_p0.addPoint(_local2);
_calcProperties();
}
public function get yIntercept():Number{
return (_yIntercept);
}
public function testLineDot(_arg1:WorkinLine):Number{
return (_vector.dot(_arg1.normal));
}
public function testLineIntercept(_arg1:WorkinLine):InterceptResult{
_inverseDeterminate = (1 / ((_slope * -1) - (_arg1.slope * -1)));
var _local2:WorkinPoint = new WorkinPoint((((-1 * _arg1.yIntercept) - (-1 * _yIntercept)) * _inverseDeterminate), (((_arg1.slope * _yIntercept) - (slope * _arg1.yIntercept)) * _inverseDeterminate), 0);
return (new InterceptResult(true, _local2));
}
public function set length(_arg1:Number):void{
if (length == 0){
return;
};
_p1 = new WorkinPoint((_p0.x + (_vector.x * (_arg1 / length))), (_p0.y + (_vector.y * (_arg1 / length))));
_calcProperties();
}
public function toNumbers(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
_p0.to(_arg1, _arg2);
_p0.clean();
_p1.to(_arg3, _arg4);
_p1.clean();
_calcProperties();
}
public function get center():WorkinPoint{
return (new WorkinPoint((_p0.x + (_vector.x / 2)), (_p0.y + (_vector.y / 2))));
}
public function originTo(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_p0.to(_arg1, _arg2, _arg3);
_p0.clean();
_calcProperties();
}
public function getPoint(_arg1:Number):WorkinPoint{
return (new WorkinPoint((p0.x + (_vector.x * _arg1)), (p0.y + (_vector.y * _arg1))));
}
public function rotate(_arg1:Number):void{
_vector.rotate(_arg1);
_p1.toPoint(_p0.addPointCopy(_vector));
_calcProperties();
}
public function originToPoint(_arg1:WorkinPoint):void{
_p0.toPoint(_arg1);
_calcProperties();
}
public function clean():void{
_p0.clean();
_p1.clean();
_calcProperties();
}
public function get length():Number{
return (_length);
}
public function get normal():WorkinPoint{
return (_normal);
}
public function toString():String{
return (((((((((((((("[WorkinLine] " + "(") + _p0.x) + ", ") + _p0.y) + ", ") + _p0.z) + ") ~> (") + _p1.x) + ", ") + _p1.y) + ", ") + _p1.z) + ")"));
}
public function flip():void{
var _local1:WorkinPoint = _p0.copy();
_p0.toPoint(_p1);
_p1.toPoint(_local1);
_calcProperties();
}
public function copy():WorkinLine{
return (new WorkinLine(_p0, _p1));
}
public function projectOntoLine(_arg1:WorkinLine):WorkinLine{
var _local2:Number = _arg1.vector.dot(vector.normalizeCopy());
return (new WorkinLine(_arg1.p0, _arg1.p1.addPointCopy(_normal.copyAndResize(Math.sqrt(((_arg1.length * _arg1.length) - (_local2 * _local2)))))));
}
public function shiftEnd(_arg1:Number):void{
length = (length + _arg1);
}
public function endToPoint(_arg1:WorkinPoint):void{
_p1.toPoint(_arg1);
_calcProperties();
}
public function to(_arg1:WorkinPoint, _arg2:WorkinPoint):void{
_p0.toPoint(_arg1);
_p0.clean();
_p1.toPoint(_arg2);
_p1.clean();
_calcProperties();
}
}
}//package com.workinman.lib.math
Section 46
//WorkinPoint (com.workinman.lib.math.WorkinPoint)
package com.workinman.lib.math {
import com.workinman.lib.display.tweener.*;
public class WorkinPoint {
private var _length:Number;
private var _x:Number;
private var _y:Number;
private var _z:Number;
public function WorkinPoint(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
_x = (Math.round((_arg1 * 1000)) / 1000);
_y = (Math.round((_arg2 * 1000)) / 1000);
_z = (Math.round((_arg3 * 1000)) / 1000);
_calculateLength();
}
public function onTweensComplete():void{
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public function to(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_x = _arg1;
_y = _arg2;
_z = _arg3;
_calculateLength();
}
public function addPointCopy(_arg1:WorkinPoint):WorkinPoint{
return (new WorkinPoint((_x + _arg1.x), (_y + _arg1.y), (_z + _arg1.z)));
}
public function moveBy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String="linear", _arg6:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_POS_3D, {x:(x + _arg1), y:(y + _arg2), z:(z + _arg3), dur:_arg4, ease:_arg5, delay:_arg6, by:false});
}
public function get z():Number{
return (_z);
}
public function diff(_arg1:WorkinPoint):WorkinPoint{
return (new WorkinPoint((_arg1.x - _x), (_arg1.y - _y), (_arg1.z - _z)));
}
public function normalize():void{
if (_length == 0){
return;
};
_x = (_x / _length);
_y = (_y / _length);
_z = (_z / _length);
_calculateLength();
}
public function divideCopy(_arg1:Number):WorkinPoint{
return (new WorkinPoint((_x / _arg1), (_y / _arg1), (_z / _arg1)));
}
public function divide(_arg1:Number):void{
_x = (_x / _arg1);
_y = (_y / _arg1);
_z = (_z / _arg1);
clean();
_calculateLength();
}
public function subtract(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_x = (_x - _arg1);
_y = (_y - _arg2);
_z = (_z - _arg3);
clean();
_calculateLength();
}
public function normalizeTo(_arg1:Number):void{
length = _arg1;
}
public function get y():Number{
return (_y);
}
public function add(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_x = (_x + _arg1);
_y = (_y + _arg2);
_z = (_z + _arg3);
clean();
_calculateLength();
}
public function normalizeCopy():WorkinPoint{
if (_length == 0){
return (new WorkinPoint(0, 0, 0));
};
return (new WorkinPoint((_x / _length), (_y / _length), (_z / _length)));
}
public function multiply(_arg1:Number):void{
_x = (_x * _arg1);
_y = (_y * _arg1);
_z = (_z * _arg1);
clean();
_calculateLength();
}
public function subtractCopy(_arg1:Number, _arg2:Number, _arg3:Number=0):WorkinPoint{
return (new WorkinPoint((_x - _arg1), (_y - _arg2), (_z - _arg3)));
}
public function completeMove():void{
WorkinTweener.completeScope(this);
}
public function moveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String="linear", _arg6:Number=0):void{
WorkinTweener.addTween(this, WorkinTweener.TWEEN_POS_3D, {x:_arg1, y:_arg2, z:_arg3, dur:_arg4, ease:_arg5, delay:_arg6, by:false});
}
private function _calculateLength():void{
_length = Math.sqrt((((_x * _x) + (_y * _y)) + (_z * _z)));
}
public function dampenByPoint(_arg1:WorkinPoint):void{
if ((((((x < 0)) && ((_arg1.x > 0)))) || ((((x > 0)) && ((_arg1.x < 0)))))){
x = (x + _arg1.x);
};
if ((((((y < 0)) && ((_arg1.y > 0)))) || ((((y > 0)) && ((_arg1.y < 0)))))){
y = (y + _arg1.y);
};
if ((((((z < 0)) && ((_arg1.z > 0)))) || ((((z > 0)) && ((_arg1.z < 0)))))){
z = (z + _arg1.z);
};
_calculateLength();
}
public function pseudoCross():WorkinPoint{
return (new WorkinPoint(_y, -(_x), _z));
}
public function addCopy(_arg1:Number, _arg2:Number, _arg3:Number=0):WorkinPoint{
return (new WorkinPoint((_x + _arg1), (_y + _arg2), (_z + _arg3)));
}
public function multiplyCopy(_arg1:Number):WorkinPoint{
return (new WorkinPoint((_x * _arg1), (_y * _arg1), (_z * _arg1)));
}
public function decay(_arg1:Number):void{
if (length == 0){
return;
};
if ((length - _arg1) < 0){
length = 0;
return;
};
length = (length - _arg1);
}
public function normalizeCopyTo(_arg1:Number):WorkinPoint{
if (_length == 0){
return (new WorkinPoint(0, 0, 0));
};
var _local2:Number = (_arg1 / _length);
return (new WorkinPoint((_x * _local2), (_y * _local2), (z * _local2)));
}
public function equals(_arg1:WorkinPoint):Boolean{
return ((((((x == _arg1.x)) && ((y == _arg1.y)))) && ((z == _arg1.z))));
}
public function deflectOff(_arg1:WorkinPoint):void{
toPoint(projectOntoCopy(_arg1).addPointCopy(projectOntoCopy(_arg1.pseudoCross()).reverseCopy()));
}
public function distTo(_arg1:WorkinPoint):Number{
return (Math.abs(Math.sqrt(((((_x - _arg1.x) * (_x - _arg1.x)) + ((_y - _arg1.y) * (_y - _arg1.y))) + ((_z - _arg1.z) * (_z - _arg1.z))))));
}
public function cross(_arg1:WorkinPoint):WorkinPoint{
return (new WorkinPoint(((_y * _arg1.z) - (_z * _arg1.y)), ((_x * _arg1.z) - (_z * _arg1._x)), ((_x * _arg1.y) - (_y * _arg1.x))));
}
public function clean():void{
_x = (Math.round((_x * 1000)) / 1000);
_y = (Math.round((_y * 1000)) / 1000);
_z = (Math.round((_z * 1000)) / 1000);
}
public function set length(_arg1:Number):void{
if (_length == 0){
return;
};
multiply((_arg1 / _length));
}
public function dot(_arg1:WorkinPoint):Number{
return ((((_x * _arg1.x) + (_y * _arg1.y)) + (_z * _arg1.z)));
}
public function get angle():Number{
return (((Math.atan2(y, x) * 180) / Math.PI));
}
public function toPoint(_arg1:WorkinPoint):void{
_x = _arg1.x;
_y = _arg1.y;
_z = _arg1.z;
_calculateLength();
}
public function distTo2D(_arg1:WorkinPoint):Number{
return (Math.abs(Math.sqrt((((_x - _arg1.x) * (_x - _arg1.x)) + ((_y - _arg1.y) * (_y - _arg1.y))))));
}
public function rotate(_arg1:Number):void{
var _local2:Number = Math.cos(((_arg1 * Math.PI) / 180));
var _local3:Number = Math.sin(((_arg1 * Math.PI) / 180));
x = ((x * _local2) - (y * _local3));
y = ((x * _local3) - (y * _local2));
}
public function subtractPoint(_arg1:WorkinPoint):void{
_x = (_x - _arg1.x);
_y = (_y - _arg1.y);
_z = (_z - _arg1.z);
clean();
_calculateLength();
}
public function decayX(_arg1:Number):void{
if (x == 0){
return;
};
if (x > 0){
x = (x - _arg1);
if (x < 0){
x = 0;
};
} else {
if (x < 0){
x = (x + _arg1);
if (x > 0){
x = 0;
};
};
};
}
public function decayY(_arg1:Number):void{
if (y == 0){
return;
};
if (y > 0){
y = (y - _arg1);
if (y < 0){
y = 0;
};
} else {
if (y < 0){
y = (y + _arg1);
if (y > 0){
y = 0;
};
};
};
}
public function projectOnto(_arg1:WorkinPoint):void{
var _local2:WorkinPoint = _arg1.normalizeCopy();
var _local3:Number = dot(_local2);
to((_local3 * _local2.x), (_local3 * _local2.y), 0);
}
public function deflectOffCopy(_arg1:WorkinPoint):WorkinPoint{
return (projectOntoCopy(_arg1).addPointCopy(projectOntoCopy(_arg1.pseudoCross()).reverseCopy()));
}
public function get length():Number{
return (_length);
}
public function projectOntoCopy(_arg1:WorkinPoint):WorkinPoint{
var _local2:WorkinPoint = _arg1.normalizeCopy();
var _local3:Number = dot(_local2);
return (new WorkinPoint((_local3 * _local2.x), (_local3 * _local2.y), 0));
}
public function reverse():void{
x = -(x);
y = -(y);
z = -(z);
}
public function cancelMove():void{
WorkinTweener.stopScope(this);
}
public function toString():String{
return ((((((("{ WorkinPoint : " + _x) + " , ") + _y) + " , ") + _z) + " }"));
}
public function addPoint(_arg1:WorkinPoint):void{
_x = (_x + _arg1.x);
_y = (_y + _arg1.y);
_z = (_z + _arg1.z);
clean();
_calculateLength();
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function subtractPointCopy(_arg1:WorkinPoint):WorkinPoint{
return (new WorkinPoint((_x - _arg1.x), (_y - _arg1.y), (_z - _arg1.z)));
}
public function set z(_arg1:Number):void{
_z = _arg1;
}
public function copy():WorkinPoint{
return (new WorkinPoint(_x, _y, _z));
}
public function copyAndResize(_arg1:Number):WorkinPoint{
return (multiplyCopy((_arg1 / _length)));
}
public function reverseCopy():WorkinPoint{
return (new WorkinPoint((x * -1), (y * -1), (z * -1)));
}
public function get x():Number{
return (_x);
}
public function rotateCopy(_arg1:Number):WorkinPoint{
var _local2:Number = Math.cos(((_arg1 * Math.PI) / 180));
var _local3:Number = Math.sin(((_arg1 * Math.PI) / 180));
return (new WorkinPoint(((x * _local2) - (y * _local3)), ((x * _local3) - (y * _local2))));
}
}
}//package com.workinman.lib.math
Section 47
//GlobalSound (com.workinman.lib.sound.GlobalSound)
package com.workinman.lib.sound {
public class GlobalSound {
private static var _instance:SoundManager;
public static function getInstance():SoundManager{
if (_instance == null){
_instance = new SoundManager();
};
return (_instance);
}
public static function get instance():SoundManager{
return (getInstance());
}
}
}//package com.workinman.lib.sound
Section 48
//SoundManager (com.workinman.lib.sound.SoundManager)
package com.workinman.lib.sound {
import flash.events.*;
import com.workinman.lib.utils.*;
import flash.media.*;
import flash.net.*;
public class SoundManager extends EventDispatcher {
protected const _DEFAULT_GROUP:String = "def";
protected var _loop:Number;
protected var _externalSounds:Array;
protected var _isLoading:Boolean;
protected var _isMusicStoppedByMute:Boolean;
protected var _isSoundOff:Boolean;
protected var _sounds:Object;
protected var _isMusicOff:Boolean;
protected var _currentVolume:Number;
protected var _currentMusicID:String;
public function SoundManager():void{
_sounds = {};
_externalSounds = [];
_currentMusicID = "";
_isLoading = false;
_isSoundOff = false;
_isMusicOff = false;
_currentVolume = 1;
}
public function musicOff():void{
if (isMusicPlaying){
_isMusicStoppedByMute = true;
} else {
_isMusicStoppedByMute = false;
};
stopMusic();
_isMusicOff = true;
}
public function soundEffectsOff():void{
_isSoundOff = true;
}
public function get isMusicPlaying():Boolean{
return (isSoundPlaying(_currentMusicID));
}
public function muteOff(_arg1:Boolean=true):void{
_isSoundOff = false;
if (_arg1 == false){
setVolume(_currentVolume, "all");
} else {
musicOn();
};
}
public function unpauseSound(_arg1:String):void{
resumeSound(_arg1);
}
public function fadeOutMusic():void{
if (_isMusicOff){
_isMusicStoppedByMute = false;
};
if ((((_currentMusicID == "")) || (!(isSoundPlaying(_currentMusicID))))){
return;
};
fadeOutSound(_currentMusicID);
}
public function stopGroup(_arg1:String):void{
var _local2:String;
for (_local2 in _sounds) {
if ((((_sounds[_local2].group == _arg1)) && (_sounds[_local2].isPlaying))){
stopSound(_local2);
};
};
}
public function registerExternalSound(_arg1:String, _arg2:String):void{
_sounds[_arg1] = new WorkinSoundData(null, new URLRequest(_arg2));
_sounds[_arg1].id = _arg1;
_externalSounds.push(_sounds[_arg1]);
if (!_isLoading){
Updater.getInstance().addEventListener(Updater.EVENT_UPDATE, _updateExternalLoader);
};
_isLoading = true;
}
public function setVolume(_arg1:Number, _arg2:String="def"):void{
var _local3:String;
if (_isSoundOff == false){
_currentVolume = _arg1;
};
for (_local3 in _sounds) {
if ((((_arg2 == "all")) || ((_sounds[_local3].group == _arg2)))){
_sounds[_local3].volume = _arg1;
};
};
}
public function soundEffectsToggle():void{
if (_isSoundOff){
soundEffectsOn();
} else {
soundEffectsOff();
};
}
public function silence():void{
var _local1:String;
for (_local1 in _sounds) {
stopSound(_local1);
};
}
public function get isSoundOff():Boolean{
return (_isSoundOff);
}
public function registerSound(_arg1:String, _arg2:Class, _arg3:String="def"):void{
if (_sounds[_arg1] != undefined){
trace((("[SoundManager] Warning: Same sound ( " + _arg1) + " ) registered more than once."));
return;
};
_sounds[_arg1] = new WorkinSoundData(_arg2);
_sounds[_arg1].id = _arg1;
_sounds[_arg1].group = _arg3;
}
public function stopSound(_arg1:String):void{
if (!_verifySound(_arg1, true)){
return;
};
_sounds[_arg1].stop();
}
public function get isLoading():Boolean{
return (_isLoading);
}
public function pauseSound(_arg1:String):void{
if (!_verifySound(_arg1, true)){
return;
};
_sounds[_arg1].pause();
}
public function playSound(_arg1:String, _arg2:Boolean=false, _arg3:Number=0, _arg4:Number=0, _arg5:SoundTransform=null):void{
if (!_verifySound(_arg1)){
return;
};
if (_arg2){
stopSound(_arg1);
};
_sounds[_arg1].play(_arg3, _arg4, _arg5);
}
public function stopMusic():void{
if (_currentMusicID == ""){
return;
};
if (_isMusicOff){
_isMusicStoppedByMute = false;
};
stopSound(_currentMusicID);
}
public function get currentMusic():String{
return (_currentMusicID);
}
public function soundEffectsOn():void{
_isSoundOff = false;
}
public function loopSound(_arg1:String, _arg2:SoundTransform=null):void{
if (!_verifySound(_arg1)){
return;
};
_sounds[_arg1].loop(_arg2);
}
public function muteToggle():void{
if (isMute){
muteOff();
} else {
muteOn();
};
}
public function fadeInSound(_arg1:String, _arg2:Number=-1):void{
if (!_verifySound(_arg1)){
return;
};
_sounds[_arg1].fadeIn(0, 0, null, _arg2);
}
public function playMusic(_arg1:String=null, _arg2:SoundTransform=null):void{
if (_isMusicOff){
if (_arg1 != null){
_currentMusicID = _arg1;
_isMusicStoppedByMute = true;
};
return;
};
if (_arg1 == null){
_arg1 = _currentMusicID;
};
if (_sounds[_arg1] == null){
trace((("[SoundManager] Error, music " + _arg1) + " not found."));
return;
};
if (_currentMusicID != ""){
if ((((_currentMusicID == _arg1)) && ((_sounds[_currentMusicID].isPlaying == true)))){
return;
};
if (_sounds[_currentMusicID].isPlaying){
stopMusic();
};
};
_currentMusicID = _arg1;
_sounds[_arg1].loop(_arg2);
}
public function cleanUp():void{
var _local1:String;
if (_currentMusicID != ""){
stopMusic();
};
for (_local1 in _sounds) {
stopSound(_local1);
_sounds[_local1].cleanUp();
delete _sounds[_local1];
};
_externalSounds = [];
if (_isLoading){
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _updateExternalLoader);
};
}
public function get isMusicOff():Boolean{
return (_isMusicOff);
}
private function _verifySound(_arg1:String, _arg2:Boolean=false):Boolean{
return (((((_arg2) || (!(_isSoundOff)))) && (!((_sounds[_arg1] == null)))));
}
public function muteOn(_arg1:Boolean=true):void{
_isSoundOff = true;
if (_arg1 == false){
setVolume(0, "all");
} else {
musicOff();
};
}
public function getSound(_arg1:String):WorkinSoundData{
return (_sounds[_arg1]);
}
protected function _updateExternalLoader(_arg1:Number):void{
_isLoading = false;
_loop = _externalSounds.length;
while (_loop--) {
if (_externalSounds[_loop].bytesLoaded < _externalSounds[_loop].bytesTotal){
_isLoading = true;
};
};
if (!_isLoading){
trace((("[Sound Manager] All " + _externalSounds.length) + " external sounds loaded"));
_externalSounds = [];
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _updateExternalLoader);
};
}
public function musicToggle():void{
if (_isMusicOff){
musicOn();
} else {
musicOff();
};
}
public function resumeSound(_arg1:String, _arg2:Number=-1):void{
if (!_verifySound(_arg1, true)){
return;
};
_sounds[_arg1].resume(_arg2);
}
public function stopAllSounds():void{
var _local1:String;
for (_local1 in _sounds) {
if (_sounds[_local1].isPlaying){
stopSound(_local1);
};
};
}
public function musicOn():void{
_isMusicOff = false;
if (_isMusicStoppedByMute){
playMusic();
};
}
public function playExclusiveSound(_arg1:String, _arg2:Number=0, _arg3:Number=0, _arg4:SoundTransform=null):void{
if (!_verifySound(_arg1)){
return;
};
stopGroup(_sounds[_arg1].group);
_sounds[_arg1].play(_arg2, _arg3, _arg4);
}
public function isSoundPlaying(_arg1:String):Boolean{
if (_sounds[_arg1] == undefined){
return (false);
};
return ((_sounds[_arg1].isPlaying == true));
}
public function addSound(_arg1:String, _arg2:Class, _arg3:String="def"):void{
registerSound(_arg1, _arg2, _arg3);
}
public function get isMute():Boolean{
return (((_isMusicOff) && (_isSoundOff)));
}
private function _verifyMusic(_arg1:String, _arg2:Boolean=false):Boolean{
return (((((_arg2) || (!(_isMusicOff)))) && (!((_sounds[_arg1] == null)))));
}
public function fadeOutSound(_arg1:String, _arg2:Number=-1):void{
if (!_verifySound(_arg1, true)){
return;
};
_sounds[_arg1].fadeOut(_arg2);
}
}
}//package com.workinman.lib.sound
Section 49
//WorkinSound (com.workinman.lib.sound.WorkinSound)
package com.workinman.lib.sound {
import flash.media.*;
public class WorkinSound extends Sound {
}
}//package com.workinman.lib.sound
Section 50
//WorkinSoundData (com.workinman.lib.sound.WorkinSoundData)
package com.workinman.lib.sound {
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import flash.media.*;
import flash.net.*;
public class WorkinSoundData extends EventDispatcher {
private var _group:String;
private var _sound:Sound;
private var _isPlaying:Boolean;
private var _isLooping:Boolean;
private var _volume:Number;
private var _pausePosition:Number;
private var _isLoading:Boolean;
private var _channel:SoundChannel;
private var _id:String;
private var _fadeDir:Number;
private var _isPaused:Boolean;
private var _fadeRate:Number;
private var _isFading:Boolean;
private var _fadeVol:Number;
public static const COMPLETE:String = "onWorkinSoundDataComplete";
public static const SOUND_STOP:String = "onWorkinSoundStop";
public static const SOUND_PAUSE:String = "onWorkinSoundPause";
private static const _DEF_FADE_RATE:Number = 0.8;
public static const SOUND_PLAY:String = "onWorkinSoundPlay";
public static const SOUND_POSITION:String = "onWorkinSoundPosition";
public function WorkinSoundData(_arg1:Class=null, _arg2:URLRequest=null, _arg3:SoundLoaderContext=null){
var pClass = _arg1;
var pStream = _arg2;
var pContext = _arg3;
super();
if (pClass == null){
_isLoading = true;
try {
_sound = new Sound(pStream, pContext);
_addLoadingListeners();
} catch(pErr:Error) {
trace(("[WorkinSoundData] ERROr : " + pErr.message));
};
} else {
_sound = new (pClass);
_isLoading = false;
};
_volume = 1;
_fadeVol = _volume;
_isPlaying = false;
_isPaused = false;
_isLooping = false;
_isFading = false;
_fadeRate = _DEF_FADE_RATE;
}
public function stop():void{
if (!_isPlaying){
return;
};
_isPlaying = false;
_isLooping = false;
_isFading = false;
_removeChannelListener();
_channel.stop();
_channel = null;
dispatchEvent(new Event(SOUND_STOP));
}
public function get group():String{
return (_group);
}
private function _onSoundComplete(_arg1:Event):void{
_isPlaying = false;
dispatchEvent(new Event(COMPLETE));
_removeChannelListener();
if (_isLooping){
play(0, 100);
};
}
public function get bytesTotal():Number{
return (_sound.bytesTotal);
}
public function get volume():Number{
return (_volume);
}
public function get id():String{
return (_id);
}
private function _setVolume(_arg1:Number):void{
var _local2:SoundTransform = _channel.soundTransform;
_local2.volume = _arg1;
_channel.soundTransform = _local2;
}
public function loop(_arg1:SoundTransform=null):void{
if (_isLoading){
return;
};
if (_isPlaying){
if (_isLooping){
return;
};
stop();
};
play(0, 100, _arg1);
_isLooping = true;
}
private function _removeLoadingListeners():void{
if (!_isLoading){
return;
};
try {
_sound.removeEventListener(Event.COMPLETE, _onLoadComplete);
_sound.removeEventListener(IOErrorEvent.IO_ERROR, _onLoadError);
} catch(pErr:Error) {
};
}
public function get position():Number{
return ((_isPlaying) ? _channel.position : 0);
}
public function get isPlaying():Boolean{
return (_isPlaying);
}
public function resume(_arg1:Number=-1):void{
if (_arg1 >= 0){
_pausePosition = _arg1;
};
play();
}
public function fadeOut(_arg1:Number):void{
if (((!(_isPlaying)) || (_isLoading))){
return;
};
if (!_isFading){
_fadeVol = _volume;
};
_fadeDir = -1;
if (_arg1 > 0){
_fadeRate = _arg1;
};
_beginFade();
}
public function set volume(_arg1:Number):void{
_volume = _arg1;
if (_isPlaying){
_setVolume(_volume);
};
}
public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{
if (_isPaused){
_channel = _sound.play(_pausePosition);
_isPaused = false;
} else {
_channel = _sound.play(_arg1, _arg2, _arg3);
};
_isPlaying = true;
_channel.addEventListener(Event.SOUND_COMPLETE, _onSoundComplete);
if (((!((_volume == 1))) || (!((_fadeVol == _volume))))){
_setVolume(_volume);
_fadeVol = _volume;
};
dispatchEvent(new Event(SOUND_PLAY));
return (_channel);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function fadeIn(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null, _arg4:Number=-1):void{
var _local5:Number;
if (((_isLoading) || (((_isPlaying) && (!(_isFading)))))){
return;
};
if (!_isPlaying){
_local5 = _volume;
_volume = 0;
play(_arg1, _arg2, _arg3);
_volume = _local5;
};
if (!_isFading){
_fadeVol = 0;
};
if (_arg4 > 0){
_fadeRate = _arg4;
};
_fadeDir = 1;
_beginFade();
}
public function get isLooping():Boolean{
return (_isLooping);
}
private function _beginFade():void{
if (_isFading){
return;
};
_setVolume(_fadeVol);
Updater.getInstance().addEventListener(Updater.EVENT_UPDATE, _fade, false, 0, true);
_isFading = true;
}
private function _completeFade():void{
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _fade);
_isFading = false;
}
public function get isLoaded():Boolean{
return ((_sound.bytesLoaded == _sound.bytesTotal));
}
public function get bytesLoaded():Number{
return (_sound.bytesLoaded);
}
public function cleanUp():void{
_isLooping = false;
if (_isPlaying){
stop();
};
if (_isFading){
Updater.getInstance().removeEventListener(Updater.EVENT_UPDATE, _fade);
};
_removeLoadingListeners();
}
private function _removeChannelListener():void{
try {
_channel.removeEventListener(Event.SOUND_COMPLETE, _onSoundComplete);
} catch(pError:Error) {
};
}
private function _onLoadComplete(_arg1:Event):void{
_removeLoadingListeners();
_isLoading = false;
}
private function _addLoadingListeners():void{
_sound.addEventListener(Event.COMPLETE, _onLoadComplete);
_sound.addEventListener(IOErrorEvent.IO_ERROR, _onLoadError);
}
private function _onLoadError(_arg1:IOErrorEvent):void{
_removeLoadingListeners();
trace(("[WorkinSoundData] IO Error loading " + _sound.url));
}
public function get length():Number{
return (_sound.length);
}
private function _fade(_arg1:EUpdate):void{
if (_fadeDir > 0){
_fadeVol = (_fadeVol + (_arg1.dt * _fadeRate));
if (_fadeVol >= _volume){
_fadeVol = _volume;
_setVolume(_volume);
_completeFade();
return;
};
} else {
_fadeVol = (_fadeVol - (_arg1.dt * _fadeRate));
if (_fadeVol <= 0){
_fadeVol = 0;
_setVolume(_fadeVol);
_completeFade();
stop();
return;
};
};
_fadeVol = (Math.round((_fadeVol * 1000)) / 1000);
_setVolume(_fadeVol);
}
public function pause():void{
if (!_isPlaying){
return;
};
_isPlaying = false;
_isPaused = true;
_pausePosition = _channel.position;
_channel.stop();
_removeChannelListener();
_channel = null;
dispatchEvent(new Event(SOUND_PAUSE));
}
public function set fadeRate(_arg1:Number):void{
_fadeRate = _arg1;
}
public function get fadeRate():Number{
return (_fadeRate);
}
public function unpause(_arg1:Number=-1):void{
resume(_arg1);
}
public function set group(_arg1:String):void{
_group = _arg1;
}
}
}//package com.workinman.lib.sound
Section 51
//Updater (com.workinman.lib.utils.Updater)
package com.workinman.lib.utils {
import flash.events.*;
import com.workinman.lib.events.*;
import flash.utils.*;
public class Updater extends EventDispatcher {
private var _loop:Number;
private var _timer:Timer;
private var _listenerCount:Number;
private var _lastTimer:Number;
private var _isGameMode:Boolean;
private var _minimumUpdateTime:Number;
private var _deltaTime:Number;
private var _currentTimer:Number;
private var _autoStart:Boolean;
private static var _instance:Updater;
public static var EVENT_UPDATE:String = "onUpdate";
public function Updater():void{
}
public function get UPDATE():String{
return (Updater.EVENT_UPDATE);
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_listenerCount--;
super.removeEventListener(_arg1, _arg2, _arg3);
if ((((_listenerCount == 0)) && (_autoStart))){
stop();
};
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_listenerCount++;
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
if ((((_listenerCount == 1)) && (_autoStart))){
start();
};
}
public function init():void{
_timer = new Timer(0, 0);
_timer.stop();
_timer.addEventListener("timer", _timerHandler);
_deltaTime = 0;
_minimumUpdateTime = 0;
_autoStart = true;
_listenerCount = 0;
_isGameMode = false;
}
public function stop():void{
pause();
}
public function setAsGameTimer(_arg1:Boolean=true):void{
setGameMode(_arg1);
}
public function start():void{
unpause();
}
private function _timerHandler(_arg1:TimerEvent):void{
_currentTimer = getTimer();
_deltaTime = (_deltaTime + ((_currentTimer - _lastTimer) / 1000));
_lastTimer = _currentTimer;
if (_deltaTime < _minimumUpdateTime){
return;
};
dispatchEvent(new EUpdate(EVENT_UPDATE, _deltaTime));
_deltaTime = 0;
if (_isGameMode){
_arg1.updateAfterEvent();
};
}
public function enableAutoStart():void{
_autoStart = true;
}
public function disableAutoStart():void{
_autoStart = false;
}
public function pause():void{
if (!_timer.running){
return;
};
_timer.stop();
}
public function setGameMode(_arg1:Boolean=true):void{
_isGameMode = _arg1;
}
public function get autoStart():Boolean{
return (_autoStart);
}
public function unpause():void{
if (_timer.running){
return;
};
_lastTimer = getTimer();
_timer.start();
}
public function lockFPS(_arg1:Number):void{
_minimumUpdateTime = (Math.round(((1 / _arg1) * 1000)) / 1000);
}
public static function get instance():Updater{
return (getInstance());
}
public static function getInstance():Updater{
if (_instance == null){
_instance = new (Updater);
_instance.init();
};
return (_instance);
}
}
}//package com.workinman.lib.utils
Section 52
//WorkinDispatcher (com.workinman.lib.utils.WorkinDispatcher)
package com.workinman.lib.utils {
import flash.events.*;
public class WorkinDispatcher extends EventDispatcher {
private var _rooms:Object;
private static var _instance:WorkinDispatcher;
public function WorkinDispatcher():void{
}
public function getRoom(_arg1:String):EventDispatcher{
if (_rooms == null){
_rooms = {};
};
if (_rooms[_arg1] == undefined){
_rooms[_arg1] = new EventDispatcher();
};
return (_rooms[_arg1]);
}
public static function getInstance():WorkinDispatcher{
if (_instance == null){
_instance = new (WorkinDispatcher);
};
return (_instance);
}
public static function get instance():WorkinDispatcher{
return (getInstance());
}
}
}//package com.workinman.lib.utils
Section 53
//WorkinShuffle (com.workinman.lib.utils.WorkinShuffle)
package com.workinman.lib.utils {
public class WorkinShuffle {
private static var _instance:WorkinShuffle;
public function WorkinShuffle():void{
}
public function shuffleArray(_arg1:Array):Array{
var _local4:int;
var _local2:Array = new Array();
var _local3:int = _arg1.length;
while (_local3 > 0) {
_local4 = Math.floor((Math.random() * _local3));
_local2.push(_arg1[_local4]);
_arg1.splice(_local4, 1);
_local3--;
};
return (_local2);
}
public static function getInstance():WorkinShuffle{
if (_instance == null){
_instance = new (WorkinShuffle);
};
return (_instance);
}
}
}//package com.workinman.lib.utils
Section 54
//BasicAsset (com.workinman.paradise2.assets.BasicAsset)
package com.workinman.paradise2.assets {
import com.workinman.lib.math.*;
import flash.display.*;
import com.workinman.lib.events.*;
import com.workinman.lib.display.*;
public class BasicAsset extends WorkinMovieClip {
public var anim:MovieClip;
protected var _currentFrame:String;
public function BasicAsset(){
_currentFrame = "";
}
public function animate(_arg1:String):void{
if (_currentFrame == _arg1){
return;
};
_currentFrame = _arg1;
if (anim != null){
anim.gotoAndStop(1);
};
gotoAndStop(_arg1);
}
public function getFrameDimensions(_arg1:String):WorkinPoint{
trace("[BasicAsset] Frame Dimensions are unavailable for BasicAssets. Returning 0,0.");
return (new WorkinPoint());
}
public function get animCurrentFrame():Number{
if (anim == null){
return (0);
};
return (anim.currentFrame);
}
public function get animComplete():Boolean{
if (anim == null){
return (false);
};
return ((anim.currentFrame == anim.totalFrames));
}
protected function _addAnim(_arg1:String, _arg2:Class):void{
trace("[BasicAsset] If you wish to add class-based Animations, use a GameAsset class.");
}
public function getFrameArt(_arg1:String):Class{
trace("[BasicAsset] Frame Art is unavailable for BasicAssets. Returning Null.");
return (null);
}
public function dispatchToAnim(_arg1:EData):void{
if (anim == null){
return;
};
anim.dispatchEvent(_arg1);
}
public function get mc():MovieClip{
return (anim);
}
public function get animTotalFrames():Number{
if (anim == null){
return (-1);
};
return (anim.totalFrames);
}
public function get animation():String{
return (_currentFrame);
}
}
}//package com.workinman.paradise2.assets
Section 55
//ECamera (com.workinman.paradise2.events.ECamera)
package com.workinman.paradise2.events {
import flash.events.*;
import com.workinman.paradise2.world.camera.*;
public class ECamera extends Event {
private var _request:String;
private var _camera:BaseCamera;
public function ECamera(_arg1:String, _arg2:BaseCamera){
super(_arg1, false, false);
_camera = _arg2;
}
public function get camera():BaseCamera{
return (_camera);
}
}
}//package com.workinman.paradise2.events
Section 56
//EView (com.workinman.paradise2.events.EView)
package com.workinman.paradise2.events {
import flash.events.*;
import com.workinman.paradise2.world.entitys.*;
public class EView extends Event {
private var _request:String;
private var _renderable:Renderable;
public function EView(_arg1:String, _arg2:Renderable){
super(_arg1, false, false);
_renderable = _arg2;
}
public function get renderable():Renderable{
return (_renderable);
}
}
}//package com.workinman.paradise2.events
Section 57
//MotionCurve (com.workinman.paradise2.math.MotionCurve)
package com.workinman.paradise2.math {
import com.workinman.lib.math.*;
import flash.events.*;
public class MotionCurve extends EventDispatcher {
private var _current:WorkinPoint;
private var _formula:Function;
private var _pathRatio:Number;
private var _timeElapsed:Number;
private var _duration:Number;
private var _bezier:WorkinBezier;
private var _timeRatio:Number;
public static var COMPLETE:String = "onPathComplete";
public function MotionCurve(_arg1:WorkinPoint, _arg2:WorkinPoint, _arg3:WorkinPoint, _arg4:WorkinPoint, _arg5:Number, _arg6:String="linear"){
_bezier = new WorkinBezier(_arg1, _arg2, _arg3, _arg4);
_bezier.getAsLines();
_duration = _arg5;
_timeElapsed = 0;
_timeRatio = 0;
_pathRatio = 0;
_calculatePath();
_formula = PennerManager.getEaseFunction(_arg6);
}
public function get y():Number{
return (_current.y);
}
public function get isComplete():Boolean{
return ((timeRatio == 1));
}
public function get timeRatio():Number{
return (_timeRatio);
}
public function update(_arg1:Number):void{
_updatePath(_arg1);
}
protected function _updatePath(_arg1:Number):void{
if (isComplete){
return;
};
_timeElapsed = (_timeElapsed + _arg1);
if (_timeElapsed > _duration){
_timeElapsed = _duration;
};
_timeRatio = (_timeElapsed / _duration);
_pathRatio = _formula(0, 1, _timeElapsed, _duration);
_current = _bezier.getPoint(_pathRatio);
if (isComplete){
dispatchEvent(new Event(COMPLETE));
};
}
public function endToPoint(_arg1:WorkinPoint):void{
_bezier.endToPoint(_arg1);
_calculatePath();
}
public function startToPoint(_arg1:WorkinPoint):void{
_bezier.originToPoint(_arg1);
_calculatePath();
}
public function get duration():Number{
return (_duration);
}
public function get end():WorkinPoint{
return (_bezier.p1);
}
public function get start():WorkinPoint{
return (_bezier.p0);
}
public function get hasPosition():Boolean{
return (true);
}
private function _calculatePath():void{
_current = _bezier.getPoint(_pathRatio);
}
public function get pathRatio():Number{
return (_pathRatio);
}
public function endTo(_arg1:Number, _arg2:Number, _arg3:Number):void{
_bezier.endTo(_arg1, _arg2, _arg3);
_calculatePath();
}
public function get x():Number{
return (_current.x);
}
public function get current():WorkinPoint{
return (_current);
}
public function startTo(_arg1:Number, _arg2:Number, _arg3:Number):void{
_bezier.originTo(_arg1, _arg2, _arg3);
_calculatePath();
}
}
}//package com.workinman.paradise2.math
Section 58
//MotionDelay (com.workinman.paradise2.math.MotionDelay)
package com.workinman.paradise2.math {
import flash.events.*;
public class MotionDelay extends EventDispatcher {
private var _timeElapsed:Number;
private var _duration:Number;
private var _ratio:Number;
public static var COMPLETE:String = "onDelayComplete";
public function MotionDelay(_arg1:Number){
_duration = _arg1;
_timeElapsed = 0;
_ratio = 0;
}
public function get isComplete():Boolean{
return ((_ratio == 1));
}
public function get duration():Number{
return (_duration);
}
public function get hasPosition():Boolean{
return (false);
}
public function update(_arg1:Number):void{
_timeElapsed = (_timeElapsed + _arg1);
if (_timeElapsed > _duration){
_timeElapsed = _duration;
};
_ratio = (_timeElapsed / _duration);
if (isComplete){
dispatchEvent(new Event(COMPLETE));
};
}
public function get ratio():Number{
return (_ratio);
}
}
}//package com.workinman.paradise2.math
Section 59
//MotionLine (com.workinman.paradise2.math.MotionLine)
package com.workinman.paradise2.math {
import com.workinman.lib.math.*;
import flash.events.*;
public class MotionLine extends EventDispatcher {
private var _current:WorkinPoint;
private var _line:WorkinLine;
private var _formula:Function;
private var _pathRatio:Number;
private var _timeElapsed:Number;
private var _duration:Number;
private var _timeRatio:Number;
public static var COMPLETE:String = "onPathComplete";
public function MotionLine(_arg1:WorkinPoint, _arg2:WorkinPoint, _arg3:Number, _arg4:String="linear"){
_line = new WorkinLine(_arg1, _arg2);
_duration = _arg3;
_timeElapsed = 0;
_timeRatio = 0;
_pathRatio = 0;
_calculatePath();
_formula = PennerManager.getEaseFunction(_arg4);
}
public function get y():Number{
return (_current.y);
}
public function get isComplete():Boolean{
return ((timeRatio == 1));
}
public function get diff():WorkinPoint{
return (_line.vector);
}
public function update(_arg1:Number):void{
_updatePath(_arg1);
}
public function get timeRatio():Number{
return (_timeRatio);
}
public function endToPoint(_arg1:WorkinPoint):void{
_line.endToPoint(_arg1);
_calculatePath();
}
public function get duration():Number{
return (_duration);
}
public function startToPoint(_arg1:WorkinPoint):void{
_line.originToPoint(_arg1);
_calculatePath();
}
public function get end():WorkinPoint{
return (_line.p1);
}
public function get start():WorkinPoint{
return (_line.p0);
}
public function get hasPosition():Boolean{
return (true);
}
private function _calculatePath():void{
_current = _line.getPoint(_pathRatio);
}
public function get pathRatio():Number{
return (_pathRatio);
}
public function get origin():WorkinPoint{
return (_line.p0);
}
public function endTo(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_line.endTo(_arg1, _arg2, _arg3);
_calculatePath();
}
public function get x():Number{
return (_current.x);
}
public function get current():WorkinPoint{
return (_current);
}
protected function _updatePath(_arg1:Number):void{
if (isComplete){
return;
};
_timeElapsed = (_timeElapsed + _arg1);
if (_timeElapsed > _duration){
_timeElapsed = _duration;
};
_timeRatio = (_timeElapsed / _duration);
_pathRatio = _formula(0, 1, _timeElapsed, _duration);
_current = _line.getPoint(_pathRatio);
if (isComplete){
dispatchEvent(new Event(COMPLETE));
};
}
public function startTo(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_line.originTo(_arg1, _arg2, _arg3);
_calculatePath();
}
}
}//package com.workinman.paradise2.math
Section 60
//ViewGroup (com.workinman.paradise2.view.groups.ViewGroup)
package com.workinman.paradise2.view.groups {
import flash.display.*;
import com.workinman.paradise2.world.entitys.*;
public class ViewGroup {
private var _container:Sprite;
private var _loop:Number;
private var _renderables:Array;
public function ViewGroup(_arg1:Sprite){
_container = _arg1;
_renderables = [];
}
public function get container():Sprite{
return (_container);
}
public function resortZ():void{
_renderables.sortOn("depth", (Array.NUMERIC | Array.DESCENDING));
_loop = 0;
while (_loop < _renderables.length) {
_container.removeChild(_renderables[_loop]);
_container.addChild(_renderables[_loop]);
_loop++;
};
}
public function clear():void{
_loop = _renderables.length;
while (_loop--) {
_container.removeChild(_renderables[_loop]);
};
_renderables = [];
}
public function cleanUp():void{
clear();
_container = null;
}
public function eraseMC(_arg1:Renderable):void{
var pRenderable = _arg1;
_loop = _renderables.length;
while (_loop--) {
if (_renderables[_loop] == pRenderable){
_renderables.splice(_loop, 1);
_loop = 0;
};
};
try {
_container.removeChild(pRenderable);
pRenderable.onErased();
} catch(pError:Error) {
trace((("[ViewGroup]: Warning, renderable " + pRenderable) + " erased improperly."));
};
}
public function drawMC(_arg1:Renderable):void{
var _local2:Number;
if (_arg1.doDepthRender){
_renderables.push(_arg1);
_renderables.sortOn("depth", (Array.NUMERIC | Array.DESCENDING));
_loop = _renderables.length;
_local2 = 0;
while (_loop--) {
if (_renderables[_loop] == _arg1){
_local2 = _loop;
_loop = 0;
};
};
_container.addChildAt(_arg1, _local2);
} else {
_renderables.push(_arg1);
_container.addChild(_arg1);
};
_arg1.onDrawn();
}
}
}//package com.workinman.paradise2.view.groups
Section 61
//ViewManager (com.workinman.paradise2.view.ViewManager)
package com.workinman.paradise2.view {
import com.workinman.paradise2.*;
import flash.display.*;
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import com.workinman.paradise2.events.*;
import flash.geom.*;
import com.workinman.paradise2.view.groups.*;
public class ViewManager extends EventDispatcher {
private var _loop:Number;
private var _screenshotOverlay:Bitmap;
private var _timeline:MovieClip;
private var _hasScreenshot:Boolean;
private var _DEF_GROUP_NAME:String;// = "base"
private var _groups:Object;
private var _viewRoom:EventDispatcher;
public function ViewManager(_arg1:MovieClip){
_timeline = _arg1;
_viewRoom = WorkinDispatcher.getInstance().getRoom(ParadiseConfig.ROOM_VIEW);
_viewRoom.addEventListener(ParadiseConfig.EVENT_VIEW_DRAW, _draw);
_viewRoom.addEventListener(ParadiseConfig.EVENT_VIEW_ERASE, _erase);
_viewRoom.addEventListener(ParadiseConfig.EVENT_Z_SORT_ALL, _zSortAll);
_viewRoom.addEventListener(ParadiseConfig.EVENT_Z_SORT_GROUP, _zSortGroup);
_groups = {};
_hasScreenshot = false;
addGroup(_DEF_GROUP_NAME, 0);
}
public function cleanUp():void{
var _local1:*;
clearContentsBitmap();
_screenshotOverlay = null;
for (_local1 in _groups) {
_groups[_local1].cleanUp();
};
}
private function _zSortGroup(_arg1:EString):void{
_groups[_arg1.data].resortZ();
}
public function hide():void{
_timeline.visible = false;
}
public function resort():void{
}
public function clear():void{
var _local1:*;
for (_local1 in _groups) {
_groups[_local1].clear();
};
}
public function showContentsAsBitmap():void{
if (_hasScreenshot){
clearContentsBitmap();
};
_hasScreenshot = true;
_screenshotOverlay = new Bitmap(getContentsAsBitmap());
_timeline.addChild(_screenshotOverlay);
}
public function clearContentsBitmap():void{
if (!_hasScreenshot){
return;
};
_hasScreenshot = false;
_timeline.removeChild(_screenshotOverlay);
_screenshotOverlay.bitmapData.dispose();
}
public function addGroup(_arg1:String, _arg2:Number=-1, _arg3:Boolean=false):void{
addLayer(_arg1, _arg2, _arg3);
}
public function _draw(_arg1:EView):void{
if (_groups[((_arg1.renderable.group == "")) ? _DEF_GROUP_NAME : _arg1.renderable.group] == undefined){
trace([(("ViewManager] _draw : ERROR: View Group >> " + _arg1.renderable.group) + " << not found! ")]);
return;
};
_groups[((_arg1.renderable.group == "")) ? _DEF_GROUP_NAME : _arg1.renderable.group].drawMC(_arg1.renderable);
}
public function _erase(_arg1:EView):void{
_groups[((_arg1.renderable.group == "")) ? _DEF_GROUP_NAME : _arg1.renderable.group].eraseMC(_arg1.renderable);
}
private function _zSortAll(_arg1:EString):void{
var _local2:*;
for (_local2 in _groups) {
_groups[_local2].resortZ();
};
}
public function addLayer(_arg1:String, _arg2:Number=-1, _arg3:Boolean=false):void{
var _local4:Sprite = new Sprite();
_local4.x = ParadiseConfig.SCREEN_OFFSET.x;
_local4.y = ParadiseConfig.SCREEN_OFFSET.y;
if (_arg3){
_local4.scrollRect = new Rectangle(0, 0, ParadiseConfig.SCREEN_WIDTH, ParadiseConfig.SCREEN_HEIGHT);
};
if (_arg2 < 0){
_timeline.addChild(_local4);
} else {
_timeline.addChildAt(_local4, _arg2);
};
_groups[_arg1] = new ViewGroup(_local4);
}
public function getContentsAsBitmap():BitmapData{
var _local1:BitmapData = new BitmapData((ParadiseConfig.SCREEN_WIDTH + ParadiseConfig.SCREEN_OFFSET.x), (ParadiseConfig.SCREEN_HEIGHT + ParadiseConfig.SCREEN_OFFSET.y));
_local1.draw(_timeline, null, null, null, new Rectangle(ParadiseConfig.SCREEN_OFFSET.x, ParadiseConfig.SCREEN_OFFSET.y, ParadiseConfig.SCREEN_WIDTH, ParadiseConfig.SCREEN_HEIGHT));
_local1.floodFill(0, 0, 0);
return (_local1);
}
public function show():void{
_timeline.visible = true;
}
}
}//package com.workinman.paradise2.view
Section 62
//BaseCamera (com.workinman.paradise2.world.camera.BaseCamera)
package com.workinman.paradise2.world.camera {
import com.workinman.lib.math.*;
import com.workinman.paradise2.world.entitys.*;
public class BaseCamera extends Element {
protected var _screenCenter:WorkinPoint;
protected var _focusY:Number;
protected var _focusZ:Number;
protected var _dimensions:WorkinPoint;
protected var _focusPoint:WorkinPoint;
protected var _halfDimensions:WorkinPoint;
public function BaseCamera(_arg1:Object){
super(_arg1);
if ((((_arg1.fx == undefined)) || ((_arg1.fy == undefined)))){
_focusPoint = new WorkinPoint();
} else {
_focusPoint = new WorkinPoint(_arg1.fx, _arg1.fy);
};
}
public function getRelativePos(_arg1:WorkinPoint):WorkinPoint{
return (new WorkinPoint((_pos.x + (_arg1.x - _pos.x)), (_pos.y + (_arg1.y - _pos.y))));
}
public function get fx():Number{
return (_pos.x);
}
public function get fy():Number{
return (_pos.y);
}
public function get fz():Number{
return (_pos.z);
}
public function get center():WorkinPoint{
return (_screenCenter);
}
function setDimensions(_arg1:WorkinPoint):void{
_dimensions = _arg1;
_screenCenter = _dimensions.divideCopy(2);
_halfDimensions = _dimensions.divideCopy(2);
}
public function isOnscreen(_arg1:Renderable):Boolean{
if (((((Math.abs((_pos.x - (_arg1.pos.x + _arg1.displayCenter.x))) - _arg1.halfDisplayWidth) > _halfDimensions.x)) || (((Math.abs((_pos.y - (_arg1.pos.y + _arg1.displayCenter.y))) - _arg1.halfDisplayHeight) > _halfDimensions.y)))){
return (false);
};
return (true);
}
public function set fx(_arg1:Number):void{
_pos.x = _arg1;
}
public function set fy(_arg1:Number):void{
_pos.y = _arg1;
}
public function set fz(_arg1:Number):void{
_pos.z = _arg1;
}
override public function set x(_arg1:Number):void{
_pos.x = _arg1;
}
override public function set y(_arg1:Number):void{
_pos.y = _arg1;
}
override public function get x():Number{
return (_pos.x);
}
override public function get y():Number{
return (_pos.y);
}
}
}//package com.workinman.paradise2.world.camera
Section 63
//CameraManager (com.workinman.paradise2.world.camera.CameraManager)
package com.workinman.paradise2.world.camera {
import com.workinman.lib.math.*;
import com.workinman.paradise2.*;
import flash.events.*;
import com.workinman.lib.utils.*;
import com.workinman.paradise2.events.*;
public class CameraManager {
private var _activeCameraID:String;
private var _activeCamera:BaseCamera;
private var _dimensions:WorkinPoint;
private var _worldRoom:EventDispatcher;
private var _cameras:Object;
public function CameraManager():void{
_registerEventRooms();
_dimensions = ParadiseConfig.DIMENSIONS.addPointCopy(ParadiseConfig.SCREEN_OFFSET);
_cameras = {};
_activeCameraID = "";
}
public function renderCameraView():void{
_worldRoom.dispatchEvent(new ECamera(ParadiseConfig.EVENT_RENDER_FROM_CAMERA, _activeCamera));
}
public function cleanUp():void{
clear();
}
protected function _setActiveCamera(_arg1:String):void{
if ((((_activeCameraID == _arg1)) || (!(_cameras.hasOwnProperty(_arg1))))){
return;
};
_activeCameraID = _arg1;
_activeCamera = _cameras[_arg1];
_worldRoom.dispatchEvent(new ECamera(ParadiseConfig.EVENT_CAMERA_CHANGE, _activeCamera));
}
protected function _registerEventRooms():void{
_worldRoom = WorkinDispatcher.getInstance().getRoom(ParadiseConfig.ROOM_WORLD);
}
public function clear():void{
_activeCamera = null;
_worldRoom = null;
}
public function getRelativePos(_arg1:WorkinPoint):WorkinPoint{
return (_activeCamera.getRelativePos(_arg1));
}
public function changeCamera(_arg1:String):void{
_setActiveCamera(_arg1);
}
public function addCustomCamera(_arg1:BaseCamera, _arg2:String="custom", _arg3:Boolean=true):void{
if ((((_arg2 == "custom")) && (!((_cameras[_arg2] == undefined))))){
trace("[CameraManager] addCustomCamera : Warning! Overwritting old custom camera.");
};
_cameras[_arg2] = _arg1;
_cameras[_arg2].setDimensions(_dimensions);
if (((_arg3) || ((_activeCameraID == "")))){
_setActiveCamera(_arg2);
};
}
public function get camera():BaseCamera{
return (_activeCamera);
}
public function addSimpleCamera(_arg1:String, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0):void{
_cameras[_arg1] = new BaseCamera({x:_arg3, y:_arg4, z:_arg5, fx:_arg6, fy:_arg7, fz:_arg8});
_cameras[_arg1].setDimensions(_dimensions);
if (((_arg2) || ((_activeCameraID == "")))){
_setActiveCamera(_arg1);
};
}
}
}//package com.workinman.paradise2.world.camera
Section 64
//Element (com.workinman.paradise2.world.entitys.Element)
package com.workinman.paradise2.world.entitys {
import com.workinman.lib.math.*;
import com.workinman.paradise2.math.*;
import com.workinman.lib.display.*;
public class Element extends WorkinMovieClip {
protected var _driveTarget:WorkinPoint;
protected var _loop:Number;
protected var _pos:WorkinPoint;
protected var _lastMotionLine:WorkinLine;
protected var _nextPos:WorkinPoint;
protected var _lastPos:WorkinPoint;
protected var _driveVector:WorkinPoint;
protected var _overdrive:Boolean;
protected var _velocity:WorkinPoint;
protected var _isDriving:Boolean;
protected var _frictionRate:Number;
protected var _terminalRate:Number;
protected var _accelerationRate:Number;
protected var _motionLine:WorkinLine;
protected var _paths:Array;
protected var _decelerationRate:Number;
public function Element(_arg1:Object){
_validateData(_arg1);
if (_pos == null){
_pos = new WorkinPoint(_arg1.x, _arg1.y, _arg1.z);
};
_lastPos = _pos.copy();
_nextPos = _pos.copy();
_motionLine = new WorkinLine(new WorkinPoint(), new WorkinPoint());
_lastMotionLine = new WorkinLine(new WorkinPoint(), new WorkinPoint());
_setInitialVelocity();
_setInitialPath();
_setInitialRates();
}
public function get lastMotionLine():WorkinLine{
return (_lastMotionLine);
}
public function _updateDrive(_arg1:Number):void{
_driveVector = _pos.diff(_driveTarget);
var _local2:WorkinPoint = _driveVector.normalizeCopy();
if ((((_driveVector.length < (_local2.multiplyCopy((_decelerationRate * _arg1)).length / 2))) && (((!(_overdrive)) || (((_overdrive) && ((_velocity.length < 4)))))))){
_velocity.to(0, 0, 0);
completeDrive();
return;
};
if (_driveVector.length < ((_velocity.length / 2) * (_velocity.length / _decelerationRate))){
if (_overdrive){
_local2.multiply((_frictionRate * _arg1));
} else {
_local2.multiply((_decelerationRate * _arg1));
};
_local2.reverse();
} else {
_local2.multiply((_accelerationRate * _arg1));
};
if ((_velocity.x * _local2.x) < 0){
_local2.x = (_local2.x + ((_frictionRate * _arg1) * ((_local2.x > 0)) ? 1 : -1));
};
if ((_velocity.y * _local2.y) < 0){
_local2.y = (_local2.y + ((_frictionRate * _arg1) * ((_local2.y > 0)) ? 1 : -1));
};
_velocity.addPoint(_local2);
if (_velocity.length > _terminalRate){
_velocity.length = _terminalRate;
};
}
public function get accelerationRate(){
return (_accelerationRate);
}
public function get terminalRate(){
return (_terminalRate);
}
public function set accelerationRate(_arg1:Number){
_accelerationRate = _arg1;
}
public function updatePosition(_arg1:Number):void{
_lastPos.toPoint(_pos);
_pos.toPoint(_nextPos);
_lastMotionLine.toLine(_motionLine.copy());
_calculateMotion();
}
public function get isPathing():Boolean{
return ((_paths.length > 0));
}
public function get motionVector():WorkinPoint{
return (_motionLine.vector);
}
protected function _onPathComplete():void{
}
protected function _setInitialVelocity():void{
_velocity = new WorkinPoint(0, 0);
_isDriving = false;
_driveTarget = new WorkinPoint(0, 0);
_overdrive = false;
}
public function clearPaths():void{
if (_paths.length == 0){
return;
};
_paths = [];
_onPathCancelled();
}
public function driveTo(_arg1:WorkinPoint, _arg2:Boolean=false):void{
if (_arg1.equals(_pos)){
return;
};
_driveTarget = _arg1.copy();
_isDriving = true;
_overdrive = _arg2;
}
public function setPath(_arg1:WorkinPoint, _arg2:Number=-1, _arg3:String="linear"):void{
clearPaths();
addPath(_arg1, _arg2, _arg3);
}
protected function _updatePath(_arg1:Number):void{
_paths[0].update(_arg1);
if (_paths[0].hasPosition){
_nextPos.toPoint(_paths[0].current);
_velocity.to((_nextPos.x - _lastPos.x), (_nextPos.y - _lastPos.y), (_nextPos.z - _lastPos.z));
_velocity.multiply((1 / _arg1));
};
if (_paths[0].isComplete){
_paths.splice(0, 1);
if (_paths.length == 0){
_onPathComplete();
} else {
if (_paths[0].hasPosition){
_paths[0].startToPoint(_nextPos);
};
};
};
}
public function clearCurrentPath():void{
if (_paths.length == 0){
return;
};
_paths.shift();
if (_paths.length == 0){
_onPathCancelled();
};
}
protected function _onPathBegin():void{
}
public function updatePrediction(_arg1:Number):void{
if (_paths.length > 0){
_updatePath(_arg1);
} else {
_updateVelocity(_arg1);
};
_calculateMotion();
}
public function get isDriving():Boolean{
return (_isDriving);
}
private function _validateData(_arg1:Object):void{
if (_arg1.x == undefined){
_arg1.x = 0;
};
if (_arg1.y == undefined){
_arg1.y = 0;
};
if (_arg1.z == undefined){
_arg1.z = 0;
};
}
public function get decelerationRate(){
return (_decelerationRate);
}
public function predictionToPoint(_arg1:WorkinPoint):void{
_nextPos.toPoint(_arg1);
_calculateMotion();
}
public function setDelay(_arg1:Number):void{
clearPaths();
addDelay(_arg1);
}
public function update(_arg1:Number):void{
updatePrediction(_arg1);
updatePosition(_arg1);
}
public function get motionLine():WorkinLine{
return (_motionLine);
}
protected function _clearVelocity():void{
_velocity.to(0, 0);
}
public function clearDrive(_arg1:Boolean=false):void{
_driveTarget = _pos.copy();
if (!_arg1){
_velocity.to(0, 0, 0);
};
_isDriving = false;
}
public function addCurve(_arg1:WorkinPoint, _arg2:WorkinPoint, _arg3:WorkinPoint, _arg4:Number=-1, _arg5:String="linear"):void{
if (_arg4 < 0){
_arg4 = (_pos.diff(_arg1).length / _terminalRate);
};
_paths.push(new MotionCurve(_pos, _arg1, _arg2, _arg3, _arg4, _arg5));
if (_paths.length > 1){
_onPathBegin();
};
}
public function get lastMotionVector():WorkinPoint{
return (_lastMotionLine.vector);
}
public function completeDrive():void{
_nextPos.toPoint(_driveTarget);
_isDriving = false;
}
public function get pos():WorkinPoint{
return (_pos);
}
public function toPoint(_arg1:WorkinPoint):void{
_lastPos.toPoint(_pos);
_pos.toPoint(_arg1);
_nextPos.toPoint(_pos);
}
public function get velocity():WorkinPoint{
return (_velocity);
}
public function get lastPos():WorkinPoint{
return (_lastPos);
}
public function set decelerationRate(_arg1:Number){
_decelerationRate = _arg1;
}
public function addDelay(_arg1:Number):void{
_paths.push(new MotionDelay(_arg1));
}
protected function _setInitialPath():void{
_paths = [];
}
public function predictionTo(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_nextPos.to(_arg1, _arg2, _arg3);
_calculateMotion();
}
protected function _updateVelocity(_arg1:Number):void{
if (_isDriving){
_updateDrive(_arg1);
};
_nextPos.add((_velocity.x * _arg1), (_velocity.y * _arg1), (_velocity.z * _arg1));
}
public function addPath(_arg1:WorkinPoint, _arg2:Number=-1, _arg3:String="linear"):void{
if (_arg2 < 0){
_arg2 = (_pos.diff(_arg1).length / _terminalRate);
};
_paths.push(new MotionLine(_pos, _arg1, _arg2, _arg3));
if (_paths.length > 1){
_onPathBegin();
};
}
protected function _onPathCancelled():void{
}
protected function _setInitialRates():void{
decelerationRate = 260;
accelerationRate = 200;
terminalRate = 300;
frictionRate = 150;
}
override public function toString():String{
return (((("[Element] " + _pos) + " -> ") + _nextPos));
}
public function set frictionRate(_arg1:Number){
_frictionRate = _arg1;
}
public function set terminalRate(_arg1:Number){
_terminalRate = _arg1;
}
public function get frictionRate(){
return (_frictionRate);
}
public function to(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
_lastPos.toPoint(_pos);
_pos.to(_arg1, _arg2, _arg3);
_nextPos.toPoint(_pos);
_calculateMotion();
}
public function get predictedPos():WorkinPoint{
return (_nextPos);
}
protected function _calculateMotion():void{
_motionLine.to(_pos, _nextPos);
}
}
}//package com.workinman.paradise2.world.entitys
Section 65
//ParaSprite (com.workinman.paradise2.world.entitys.ParaSprite)
package com.workinman.paradise2.world.entitys {
import flash.display.*;
import com.workinman.lib.display.*;
import com.workinman.paradise2.assets.*;
public class ParaSprite extends Renderable {
protected var _assetClass:Class;
protected var _isAssetComplex:Boolean;
protected var _asset:MovieClip;
protected var _isAssetWorkinMC:Boolean;
protected var _isAssetMC:Boolean;
public function ParaSprite(_arg1:Object){
super(_arg1);
if (_arg1.asset == null){
_assetClass = _defaultAsset;
} else {
_assetClass = _arg1.asset;
};
_asset = new _assetClass();
_isAssetWorkinMC = false;
_isAssetComplex = false;
_isAssetMC = false;
if ((_asset is WorkinMovieClip)){
_isAssetWorkinMC = true;
} else {
if ((_asset is BasicAsset)){
_isAssetComplex = true;
} else {
_isAssetMC = true;
};
};
addChild(_asset);
_onGenerateAsset();
_recalculateDimensions();
}
override public function onDrawn():void{
_mcVisible = true;
}
protected function _onGenerateAsset():void{
}
public function get assetClass():Class{
return (_assetClass);
}
protected function _animate(_arg1:String):void{
if (!_isAssetComplex){
_asset.gotoAndStop(_arg1);
return;
};
_asset.animate(_arg1);
}
public function get asset():MovieClip{
return (_asset);
}
protected function get _defaultAsset():Class{
return (BasicAsset);
}
override public function cleanUp():void{
super.cleanUp();
if (_isAssetMC){
return;
};
_asset.cleanUp();
}
}
}//package com.workinman.paradise2.world.entitys
Section 66
//Renderable (com.workinman.paradise2.world.entitys.Renderable)
package com.workinman.paradise2.world.entitys {
import com.workinman.lib.math.*;
import com.workinman.paradise2.*;
import flash.events.*;
import com.workinman.paradise2.world.camera.*;
import com.workinman.lib.utils.*;
import com.workinman.paradise2.events.*;
public class Renderable extends Element {
protected var _displayWidth:Number;
protected var _displayHeight:Number;
protected var _worldRoom:EventDispatcher;
protected var _halfDisplayHeight:Number;
protected var _renderVisibility:Function;
protected var _displayCenter:WorkinPoint;
protected var _depth:Number;
protected var _halfDisplayWidth:Number;
protected var _isOnscreen:Boolean;
protected var _mcVisible:Boolean;
protected var _viewRoom:EventDispatcher;
public function Renderable(_arg1:Object){
super(_arg1);
_registerEventRooms();
_isOnscreen = false;
_mcVisible = false;
_displayWidth = 0;
_displayHeight = 0;
_halfDisplayWidth = 0;
_halfDisplayHeight = 0;
_displayCenter = new WorkinPoint();
_worldRoom.addEventListener(ParadiseConfig.EVENT_RENDER_FROM_CAMERA, _onRender);
_worldRoom.addEventListener(ParadiseConfig.EVENT_CAMERA_CHANGE, _onCameraChange);
WorkinDispatcher.instance.addEventListener(ParadiseConfig.EVENT_CLEAN_UP_WORLD, _onCleanUpEvent);
_assignRenderVisibility();
}
public function get displayHeight():Number{
return (_displayHeight);
}
public function onDrawn():void{
_mcVisible = true;
}
protected function get _padDisplayDimensionsForNonCenteredAssets():Boolean{
return (false);
}
protected function get _isAlwaysVisible():Boolean{
return (false);
}
public function get halfDisplayHeight():Number{
return (_halfDisplayHeight);
}
protected function _registerEventRooms():void{
_viewRoom = WorkinDispatcher.getInstance().getRoom(ParadiseConfig.ROOM_VIEW);
_worldRoom = WorkinDispatcher.getInstance().getRoom(ParadiseConfig.ROOM_WORLD);
}
public function get group():String{
return ("");
}
protected function _draw():void{
_updateDepth();
_viewRoom.dispatchEvent(new EView(ParadiseConfig.EVENT_VIEW_DRAW, this));
}
public function get displayWidth():Number{
return (_displayWidth);
}
public function get isDrawn():Boolean{
return (_mcVisible);
}
protected function _onRender(_arg1:ECamera):void{
_renderPosition(_arg1.camera);
_renderVisibility(_arg1.camera);
}
public function get doDepthRender():Boolean{
return (false);
}
protected function _erase():void{
if (_mcVisible){
_viewRoom.dispatchEvent(new EView(ParadiseConfig.EVENT_VIEW_ERASE, this));
};
}
public function get displayCenter():WorkinPoint{
return (_displayCenter);
}
protected function _renderCustomVisibility(_arg1:BaseCamera):void{
}
protected function _updateDepth():void{
_depth = _pos.z;
}
public function onErased():void{
_mcVisible = false;
}
protected function _recalculateDimensions():void{
if (_automaticallyDetermineDisplayDimensions){
_displayWidth = width;
_displayHeight = height;
if (_padDisplayDimensionsForNonCenteredAssets){
_halfDisplayWidth = width;
_halfDisplayHeight = height;
} else {
_halfDisplayWidth = (width / 2);
_halfDisplayHeight = (height / 2);
};
} else {
_halfDisplayWidth = (_displayWidth / 2);
_halfDisplayHeight = (_displayHeight / 2);
};
_recalculateDisplayCenter();
}
public function get depth():Number{
return (_depth);
}
protected function _recalculateDisplayCenter(_arg1:String=""):void{
switch (((_arg1)!="") ? _arg1 : _assetRegistrationPoint){
case "br":
_displayCenter.to(-(_halfDisplayWidth), -(_halfDisplayHeight));
break;
case "bc":
_displayCenter.to(0, -(_halfDisplayHeight));
break;
case "bl":
_displayCenter.to(_halfDisplayWidth, -(_halfDisplayHeight));
break;
case "cr":
_displayCenter.to(-(_halfDisplayWidth), 0);
break;
case "cl":
_displayCenter.to(_halfDisplayWidth, 0);
break;
case "tr":
_displayCenter.to(-(_halfDisplayWidth), _halfDisplayHeight);
break;
case "tc":
_displayCenter.to(0, _halfDisplayHeight);
break;
case "tl":
_displayCenter.to(_halfDisplayWidth, _halfDisplayHeight);
break;
case "cc":
default:
_displayCenter.to(0, 0);
break;
};
}
protected function get _useCustomVisibility():Boolean{
return (false);
}
override public function cleanUp():void{
super.cleanUp();
_erase();
_worldRoom.removeEventListener(ParadiseConfig.EVENT_CAMERA_CHANGE, _onCameraChange);
_worldRoom.removeEventListener(ParadiseConfig.EVENT_RENDER_FROM_CAMERA, _onRender);
WorkinDispatcher.instance.removeEventListener(ParadiseConfig.EVENT_CLEAN_UP_WORLD, _onCleanUpEvent);
}
private function _onCleanUpEvent(_arg1:Event):void{
cleanUp();
}
protected function _onCameraChange(_arg1:ECamera):void{
_onRender(_arg1);
}
private function _renderAlwaysVisibility(_arg1:BaseCamera):void{
if (!_mcVisible){
_draw();
};
}
protected function get _automaticallyDetermineDisplayDimensions():Boolean{
return (true);
}
protected function get _assetRegistrationPoint():String{
return ("cc");
}
private function _renderCameraVisibility(_arg1:BaseCamera):void{
_isOnscreen = _arg1.isOnscreen(this);
if (((_isOnscreen) && (!(_mcVisible)))){
_draw();
} else {
if (((!(_isOnscreen)) && (_mcVisible))){
_erase();
};
};
}
protected function _assignRenderVisibility():void{
if (_isAlwaysVisible){
_renderVisibility = _renderAlwaysVisibility;
} else {
if (_useCustomVisibility){
_renderVisibility = _renderCustomVisibility;
} else {
_renderVisibility = _renderCameraVisibility;
};
};
}
public function get halfDisplayWidth():Number{
return (_halfDisplayWidth);
}
protected function _renderPosition(_arg1:BaseCamera):void{
x = (_arg1.center.x + (_pos.x - _arg1.x));
y = (_arg1.center.y + (_pos.y - _arg1.y));
}
}
}//package com.workinman.paradise2.world.entitys
Section 67
//BaseController (com.workinman.paradise2.BaseController)
package com.workinman.paradise2 {
import flash.display.*;
import flash.events.*;
import com.workinman.lib.events.*;
import com.workinman.lib.utils.*;
import flash.geom.*;
import flash.ui.*;
public class BaseController {
private var _timeline:MovieClip;
private var _mouseRectangle:Rectangle;
public function BaseController(_arg1:MovieClip){
_timeline = _arg1;
}
private function _onMouseClick(_arg1:Event):void{
if (mouseInPlayArea){
WorkinDispatcher.getInstance().dispatchEvent(new EData(ParadiseConfig.EVENT_MOUSE_CLICK, {x:_timeline.stage.mouseX, y:_timeline.stage.mouseY}));
};
}
private function _onMouseUp(_arg1:Event):void{
if (mouseInPlayArea){
WorkinDispatcher.getInstance().dispatchEvent(new EData(ParadiseConfig.EVENT_MOUSE_UP, {x:_timeline.stage.mouseX, y:_timeline.stage.mouseY}));
};
}
public function activateKeyboardControl(_arg1:MovieClip=null):void{
if (_arg1 == null){
_arg1 = _timeline;
};
_arg1.stage.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown);
_arg1.stage.addEventListener(KeyboardEvent.KEY_UP, _onKeyUp);
}
private function _onMouseDown(_arg1:Event):void{
if (mouseInPlayArea){
WorkinDispatcher.getInstance().dispatchEvent(new EData(ParadiseConfig.EVENT_MOUSE_DOWN, {x:_timeline.stage.mouseX, y:_timeline.stage.mouseY}));
};
}
private function _onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
WorkinDispatcher.getInstance().dispatchEvent(new EData(ParadiseConfig.EVENT_SPACEBAR, {keyCode:_arg1.keyCode, charCode:_arg1.charCode, ctrlKey:_arg1.ctrlKey, shiftKey:_arg1.shiftKey, altKey:_arg1.altKey}));
};
WorkinDispatcher.getInstance().dispatchEvent(new EData(ParadiseConfig.EVENT_KEY_DOWN, {keyCode:_arg1.keyCode, charCode:_arg1.charCode, ctrlKey:_arg1.ctrlKey, shiftKey:_arg1.shiftKey, altKey:_arg1.altKey}));
}
public function activateMouseControl(_arg1:MovieClip=null, _arg2:Boolean=false):void{
if (_arg1 == null){
_arg1 = _timeline;
};
_mouseRectangle = new Rectangle(ParadiseConfig.SCREEN_OFFSET.x, ParadiseConfig.SCREEN_OFFSET.y, ParadiseConfig.DIMENSIONS.x, ParadiseConfig.DIMENSIONS.y);
_arg1.stage.addEventListener(MouseEvent.CLICK, _onMouseClick);
if (_arg2){
return;
};
_arg1.stage.addEventListener(MouseEvent.MOUSE_UP, _onMouseUp);
_arg1.stage.addEventListener(MouseEvent.MOUSE_DOWN, _onMouseDown);
}
public function get mouseInPlayArea():Boolean{
return (_mouseRectangle.contains(_timeline.mouseX, _timeline.mouseY));
}
private function _onKeyUp(_arg1:KeyboardEvent):void{
WorkinDispatcher.getInstance().dispatchEvent(new EData(ParadiseConfig.EVENT_KEY_UP, {keyCode:_arg1.keyCode, charCode:_arg1.charCode, ctrlKey:_arg1.ctrlKey, shiftKey:_arg1.shiftKey, altKey:_arg1.altKey}));
}
}
}//package com.workinman.paradise2
Section 68
//BaseEngine (com.workinman.paradise2.BaseEngine)
package com.workinman.paradise2 {
import com.workinman.paradise2.view.*;
import com.workinman.lib.sound.*;
import flash.display.*;
import flash.text.*;
public class BaseEngine {
protected var _view:ViewManager;
protected var _sound:SoundManager;
protected var _control:BaseController;
protected var _timeline:BaseTimeline;
protected var _debugText:TextField;
protected var _configXMLURL:String;
protected var _configXML:XML;
public function BaseEngine(_arg1:BaseTimeline){
_generate(_arg1);
}
public function clearDebug():void{
_debugText.text = "";
}
protected function _addEventListeners():void{
}
protected function _beginEngine():void{
trace("[BaseEngine] Begin!");
}
public function get sound():SoundManager{
return (_sound);
}
public function debug(_arg1:String):void{
if (!_DEBUG){
return;
};
if (_debugText == null){
_generateDebugField();
_debugText.text = "<[[ Debugger initialized ]]>";
};
_debugText.appendText("\n");
_debugText.appendText(_arg1);
}
protected function _generate(_arg1:BaseTimeline):void{
_timeline = _arg1;
_addEventListeners();
if (_timeline.configurl != null){
_configXMLURL = _timeline.configurl;
} else {
_configXMLURL = "";
};
_generateState();
_generateSounds();
_generateControls();
_generateView();
_generateUI();
}
protected function _removeEventListeners():void{
}
protected function _generateView():void{
var _local1:MovieClip = new MovieClip();
_view = new ViewManager(_local1);
_timeline.addChild(_local1);
}
protected function _generateDebugField():void{
_debugText = new TextField();
_debugText.width = (ParadiseConfig.SCREEN_WIDTH - 70);
_debugText.height = (ParadiseConfig.SCREEN_HEIGHT - 70);
_debugText.x = 50;
_debugText.y = 50;
_debugText.textColor = 0xFFFFFF;
_timeline.addChild(_debugText);
}
protected function _generateState():void{
}
public function get control():BaseController{
return (_control);
}
public function get view():ViewManager{
return (_view);
}
protected function _generateControls():void{
_control = new BaseController(_timeline);
_control.activateMouseControl();
_control.activateKeyboardControl();
}
protected function _generateUI():void{
}
protected function get _DEBUG():Boolean{
return (false);
}
protected function _generateSounds():void{
_sound = GlobalSound.getInstance();
}
}
}//package com.workinman.paradise2
Section 69
//BaseTimeline (com.workinman.paradise2.BaseTimeline)
package com.workinman.paradise2 {
import flash.display.*;
public class BaseTimeline extends MovieClip {
public var game_container:MovieClip;
public var ui_container:MovieClip;
public var transition_container:MovieClip;
public var configurl:String;
public function BaseTimeline():void{
_generate();
}
protected function _begin():void{
transition_container = new MovieClip();
ui_container = new MovieClip();
game_container = new MovieClip();
addChild(game_container);
addChild(ui_container);
addChild(transition_container);
}
protected function _generate():void{
}
}
}//package com.workinman.paradise2
Section 70
//ParadiseConfig (com.workinman.paradise2.ParadiseConfig)
package com.workinman.paradise2 {
import com.workinman.lib.math.*;
public class ParadiseConfig {
public static var EVENT_KEY_UP:String = "paraOnKeyUp";
public static var EVENT_MOUSE_DOWN:String = "paraOnMouseDown";
public static var EVENT_CAMERA_CHANGE:String = "paraCameraChange";
public static var ROOM_VIEW:String = "view";
public static var EVENT_Z_SORT_ALL:String = "paraZSortAll";
protected static var _SCREEN_CENTER:WorkinPoint;
public static var ROOM_WORLD:String = "world";
public static var EVENT_RENDER_FROM_CAMERA:String = "paraCameraRender";
public static var EVENT_CLEAN_UP_WORLD:String = "paraCleanUpWorld";
public static var EVENT_VIEW_DRAW:String = "paraViewDraw";
public static var ROOM_ENGINE:String = "engine";
public static var EVENT_Z_SORT_GROUP:String = "paraZSortGroup";
public static var EVENT_MOUSE_UP:String = "paraOnMouseUp";
protected static var _SCREEN_OFFSET:WorkinPoint;
public static var EVENT_KEY_DOWN:String = "paraOnKeyDown";
public static var EVENT_VIEW_ERASE:String = "paraViewErase";
public static var ROOM_CONTROL:String = "control";
protected static var _SCREEN_HEIGHT:Number = 400;
protected static var _DIMENSIONS:WorkinPoint;
public static var EVENT_MOUSE_CLICK:String = "paraOnMouseClick";
protected static var _SCREEN_WIDTH:Number = 600;
public static var EVENT_SPACEBAR:String = "paraOnSpacebar";
public function ParadiseConfig():void{
}
public static function get SCREEN_CENTER():WorkinPoint{
if (_SCREEN_CENTER == null){
_SCREEN_CENTER = new WorkinPoint(((_SCREEN_WIDTH / 2) + _SCREEN_OFFSET.x), ((_SCREEN_HEIGHT / 2) + _SCREEN_OFFSET.y));
};
return (_SCREEN_CENTER);
}
public static function set SCREEN_OFFSET(_arg1:WorkinPoint):void{
_SCREEN_OFFSET = _arg1.copy();
}
public static function get SCREEN_WIDTH():Number{
return (_SCREEN_WIDTH);
}
public static function set SCREEN_CENTER(_arg1:WorkinPoint):void{
_SCREEN_CENTER = _arg1.copy();
}
public static function set DIMENSIONS(_arg1:WorkinPoint):void{
_SCREEN_WIDTH = _arg1.x;
_SCREEN_HEIGHT = _arg1.y;
_SCREEN_OFFSET = new WorkinPoint(0, 0, 0);
}
public static function get SCREEN_OFFSET():WorkinPoint{
return (_SCREEN_OFFSET);
}
public static function get DIMENSIONS():WorkinPoint{
if (_DIMENSIONS == null){
_DIMENSIONS = new WorkinPoint(_SCREEN_WIDTH, _SCREEN_HEIGHT);
};
return (_DIMENSIONS);
}
public static function get SCREEN_HEIGHT():Number{
return (_SCREEN_HEIGHT);
}
public static function get SCREEN_BOTTOM():Number{
return ((_SCREEN_OFFSET.y + _SCREEN_HEIGHT));
}
public static function get SCREEN_TOP():Number{
return (_SCREEN_OFFSET.y);
}
public static function get SCREEN_RIGHT():Number{
return ((_SCREEN_OFFSET.x + _SCREEN_WIDTH));
}
public static function get SCREEN_LEFT():Number{
return (_SCREEN_OFFSET.x);
}
}
}//package com.workinman.paradise2
Section 71
//_game_char_squidward_angry_ani_51 (sb_clarinet_game_fla._game_char_squidward_angry_ani_51)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class _game_char_squidward_angry_ani_51 extends MovieClip {
public var _squid_angry_anime:game_char_squidward_angry;
public function _game_char_squidward_angry_ani_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 72
//_preloadingAssets_2 (sb_clarinet_game_fla._preloadingAssets_2)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class _preloadingAssets_2 extends MovieClip {
public function _preloadingAssets_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 73
//A_ani_283 (sb_clarinet_game_fla.A_ani_283)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class A_ani_283 extends MovieClip {
public function A_ani_283(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 74
//B_ani_221 (sb_clarinet_game_fla.B_ani_221)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class B_ani_221 extends MovieClip {
public function B_ani_221(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 75
//C_ani_227 (sb_clarinet_game_fla.C_ani_227)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class C_ani_227 extends MovieClip {
public function C_ani_227(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 76
//E1_ani__225 (sb_clarinet_game_fla.E1_ani__225)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class E1_ani__225 extends MovieClip {
public function E1_ani__225(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 77
//E2_ani_231 (sb_clarinet_game_fla.E2_ani_231)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class E2_ani_231 extends MovieClip {
public function E2_ani_231(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 78
//E3_ani_287 (sb_clarinet_game_fla.E3_ani_287)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class E3_ani_287 extends MovieClip {
public function E3_ani_287(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 79
//E4_ani_293 (sb_clarinet_game_fla.E4_ani_293)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class E4_ani_293 extends MovieClip {
public function E4_ani_293(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 80
//F_ani_233 (sb_clarinet_game_fla.F_ani_233)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class F_ani_233 extends MovieClip {
public function F_ani_233(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 81
//G2_ani_281 (sb_clarinet_game_fla.G2_ani_281)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class G2_ani_281 extends MovieClip {
public function G2_ani_281(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 82
//game_char_spongebob_32 (sb_clarinet_game_fla.game_char_spongebob_32)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class game_char_spongebob_32 extends MovieClip {
public function game_char_spongebob_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 83
//game_char_squidward_49 (sb_clarinet_game_fla.game_char_squidward_49)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class game_char_squidward_49 extends MovieClip {
public var _squid_idle:MovieClip;
public var _squid_angry:game_char_squidward_angry;
public function game_char_squidward_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 84
//game_character_sblife_108 (sb_clarinet_game_fla.game_character_sblife_108)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class game_character_sblife_108 extends MovieClip {
public function game_character_sblife_108(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 85
//game_sb_bubble_102 (sb_clarinet_game_fla.game_sb_bubble_102)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class game_sb_bubble_102 extends MovieClip {
public var _arrow:game_arrow;
public function game_sb_bubble_102(){
addFrameScript(0, frame1, 8, frame9, 14, frame15);
}
function frame15(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame9(){
gotoAndStop(1);
}
}
}//package sb_clarinet_game_fla
Section 86
//i_ani_172 (sb_clarinet_game_fla.i_ani_172)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class i_ani_172 extends MovieClip {
public function i_ani_172(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 87
//i_ani_2_188 (sb_clarinet_game_fla.i_ani_2_188)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class i_ani_2_188 extends MovieClip {
public function i_ani_2_188(){
addFrameScript(69, frame70);
}
function frame70(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 88
//instructions_C_ani_180 (sb_clarinet_game_fla.instructions_C_ani_180)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_C_ani_180 extends MovieClip {
public function instructions_C_ani_180(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 89
//instructions_letters_ani_166 (sb_clarinet_game_fla.instructions_letters_ani_166)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_letters_ani_166 extends MovieClip {
public function instructions_letters_ani_166(){
addFrameScript(89, frame90);
}
function frame90(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 90
//instructions_O_ani_182 (sb_clarinet_game_fla.instructions_O_ani_182)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_O_ani_182 extends MovieClip {
public function instructions_O_ani_182(){
addFrameScript(38, frame39);
}
function frame39(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 91
//instructions_R_ani_176 (sb_clarinet_game_fla.instructions_R_ani_176)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_R_ani_176 extends MovieClip {
public function instructions_R_ani_176(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 92
//instructions_T_ani_174 (sb_clarinet_game_fla.instructions_T_ani_174)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_T_ani_174 extends MovieClip {
public function instructions_T_ani_174(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 93
//instructions_T_ani_2_185 (sb_clarinet_game_fla.instructions_T_ani_2_185)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_T_ani_2_185 extends MovieClip {
public function instructions_T_ani_2_185(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 94
//instructions_U_ani_178 (sb_clarinet_game_fla.instructions_U_ani_178)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class instructions_U_ani_178 extends MovieClip {
public function instructions_U_ani_178(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 95
//L1_ani_223 (sb_clarinet_game_fla.L1_ani_223)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class L1_ani_223 extends MovieClip {
public function L1_ani_223(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 96
//L2_ani_229 (sb_clarinet_game_fla.L2_ani_229)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class L2_ani_229 extends MovieClip {
public function L2_ani_229(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 97
//M_ani_285 (sb_clarinet_game_fla.M_ani_285)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class M_ani_285 extends MovieClip {
public function M_ani_285(){
addFrameScript(36, frame37);
}
function frame37(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 98
//N_ani_167 (sb_clarinet_game_fla.N_ani_167)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class N_ani_167 extends MovieClip {
public function N_ani_167(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 99
//N_ani_2_184 (sb_clarinet_game_fla.N_ani_2_184)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class N_ani_2_184 extends MovieClip {
public function N_ani_2_184(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 100
//O_ani_217 (sb_clarinet_game_fla.O_ani_217)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class O_ani_217 extends MovieClip {
public function O_ani_217(){
addFrameScript(32, frame33);
}
function frame33(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 101
//O5_ani_289 (sb_clarinet_game_fla.O5_ani_289)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class O5_ani_289 extends MovieClip {
public function O5_ani_289(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 102
//R_ani_215 (sb_clarinet_game_fla.R_ani_215)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class R_ani_215 extends MovieClip {
public function R_ani_215(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 103
//R3_ani_295 (sb_clarinet_game_fla.R3_ani_295)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class R3_ani_295 extends MovieClip {
public function R3_ani_295(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 104
//S_ani_170 (sb_clarinet_game_fla.S_ani_170)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class S_ani_170 extends MovieClip {
public function S_ani_170(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 105
//S_ani_2_187 (sb_clarinet_game_fla.S_ani_2_187)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class S_ani_2_187 extends MovieClip {
public function S_ani_2_187(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 106
//scorescreen_note_snapping_1_298 (sb_clarinet_game_fla.scorescreen_note_snapping_1_298)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class scorescreen_note_snapping_1_298 extends MovieClip {
public function scorescreen_note_snapping_1_298(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 107
//T_ani_213 (sb_clarinet_game_fla.T_ani_213)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class T_ani_213 extends MovieClip {
public function T_ani_213(){
addFrameScript(26, frame27);
}
function frame27(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 108
//U_ani_219 (sb_clarinet_game_fla.U_ani_219)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class U_ani_219 extends MovieClip {
public function U_ani_219(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 109
//V_ani_291 (sb_clarinet_game_fla.V_ani_291)
package sb_clarinet_game_fla {
import flash.display.*;
public dynamic class V_ani_291 extends MovieClip {
public function V_ani_291(){
addFrameScript(32, frame33);
}
function frame33(){
stop();
}
}
}//package sb_clarinet_game_fla
Section 110
//AssetFloatingPoints (AssetFloatingPoints)
package {
import flash.display.*;
public dynamic class AssetFloatingPoints extends MovieClip {
public var _floatingpoints:MovieClip;
public function AssetFloatingPoints(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package
Section 111
//AssetHealth (AssetHealth)
package {
import flash.display.*;
public dynamic class AssetHealth extends MovieClip {
}
}//package
Section 112
//AssetLaugh (AssetLaugh)
package {
import flash.display.*;
public dynamic class AssetLaugh extends MovieClip {
}
}//package
Section 113
//AssetNote (AssetNote)
package {
import flash.display.*;
public dynamic class AssetNote extends MovieClip {
public function AssetNote(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 114
//AssetSponge (AssetSponge)
package {
import flash.display.*;
public dynamic class AssetSponge extends MovieClip {
public var _sponge_anime:MovieClip;
}
}//package
Section 115
//AssetSquid (AssetSquid)
package {
import flash.display.*;
public dynamic class AssetSquid extends MovieClip {
public var _squid_anime:MovieClip;
}
}//package
Section 116
//AssetStar (AssetStar)
package {
import flash.display.*;
public dynamic class AssetStar extends MovieClip {
}
}//package
Section 117
//game_arrow (game_arrow)
package {
import com.workinman.lib.display.*;
public dynamic class game_arrow extends WorkinMovieClip {
}
}//package
Section 118
//game_char_spongebob_laugh (game_char_spongebob_laugh)
package {
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.utils.*;
import com.workinman.lib.display.*;
public dynamic class game_char_spongebob_laugh extends WorkinMovieClip {
public function game_char_spongebob_laugh(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
gotoAndStop(1);
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_LAUGH_ANIME_COMPLETE));
}
}
}//package
Section 119
//game_char_squidward_angry (game_char_squidward_angry)
package {
import flash.events.*;
import com.nick.spongebob.clarinet.*;
import com.workinman.lib.utils.*;
import com.workinman.lib.display.*;
public dynamic class game_char_squidward_angry extends WorkinMovieClip {
public function game_char_squidward_angry(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
gotoAndStop(1);
WorkinDispatcher.getInstance().dispatchEvent(new Event(GameConfig.ON_ANGRY_ANIME_COMPLETE));
}
}
}//package
Section 120
//sfx_button (sfx_button)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_button extends WorkinSound {
}
}//package
Section 121
//sfx_crash (sfx_crash)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_crash extends WorkinSound {
}
}//package
Section 122
//sfx_note_1 (sfx_note_1)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_1 extends WorkinSound {
}
}//package
Section 123
//sfx_note_2 (sfx_note_2)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_2 extends WorkinSound {
}
}//package
Section 124
//sfx_note_3 (sfx_note_3)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_3 extends WorkinSound {
}
}//package
Section 125
//sfx_note_4 (sfx_note_4)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_4 extends WorkinSound {
}
}//package
Section 126
//sfx_note_5 (sfx_note_5)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_5 extends WorkinSound {
}
}//package
Section 127
//sfx_note_6 (sfx_note_6)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_6 extends WorkinSound {
}
}//package
Section 128
//sfx_note_7 (sfx_note_7)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_7 extends WorkinSound {
}
}//package
Section 129
//sfx_note_8 (sfx_note_8)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_8 extends WorkinSound {
}
}//package
Section 130
//sfx_note_death (sfx_note_death)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_note_death extends WorkinSound {
}
}//package
Section 131
//sfx_patrick_laugh (sfx_patrick_laugh)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_patrick_laugh extends WorkinSound {
}
}//package
Section 132
//sfx_sponge_laugh (sfx_sponge_laugh)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_sponge_laugh extends WorkinSound {
}
}//package
Section 133
//sfx_sponge_scream_long (sfx_sponge_scream_long)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_sponge_scream_long extends WorkinSound {
}
}//package
Section 134
//sfx_sponge_scream_short (sfx_sponge_scream_short)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_sponge_scream_short extends WorkinSound {
}
}//package
Section 135
//sfx_squid_laugh (sfx_squid_laugh)
package {
import com.workinman.lib.sound.*;
public dynamic class sfx_squid_laugh extends WorkinSound {
}
}//package