home *** CD-ROM | disk | FTP | other *** search
- package Code.LOGIC.OBJECTS.ACTORS.RECTS
- {
- import Code.LOGIC.OBJECTS.ACTORS.INTERFACES._mk516;
- import Code.LOGIC.OBJECTS.GRAPHICS._jy145;
- import Code.org.cove.ape._be271;
- import flash.geom.Point;
-
- public class _dt98 extends _gg531 implements _mk516
- {
-
- public static const ORIENTATION_UP:int = 0;
-
- public static const ORIENTATION_RIGHT:int = 3;
-
- public static const stTime:int = 0;
-
- public static const stPop:int = 1;
-
- public static const ORIENTATION_DOWN:int = 1;
-
- public static const ORIENTATION_LEFT:int = 2;
-
- public static const stPush:int = 2;
-
-
- private var _orientation:int;
-
- private var initalPos:_be271;
-
- private var progress:int;
-
- private var timer:int;
-
- private var startPos:Point;
-
- private var state:int;
-
- private var vel:Point;
-
- private var maxProgress:int;
-
- private var timeDelay:int;
-
- public function _dt98(param1:Object)
- {
- super(param1);
- this._orientation = param1.orientation;
- this.timeDelay = param1.timeDelay;
- this.startPos = new Point(0,0);
- this.vel = new Point(0,0);
- this._yt549 = true;
- initalPos = new _be271(param1.x,param1.y);
- State = stTime;
- _mb474(new _jy145(this));
- }
-
- public static function _lu255() : Object
- {
- var _loc1_:Object = null;
- return {
- "toolClass":_dt98,
- "name":"trap",
- "params":{
- "_tp253":0,
- "timeDelay":100,
- "width":120,
- "height":50,
- "orientation":[["down",_dt98.ORIENTATION_DOWN],["left",_dt98.ORIENTATION_LEFT],["right",_dt98.ORIENTATION_RIGHT],["up",_dt98.ORIENTATION_UP]]
- }
- };
- }
-
- public function _eu538() : Object
- {
- var _loc1_:Object = null;
- _loc1_ = new Object();
- _loc1_._tp253 = _tp253;
- _loc1_.prClass = "TTRap";
- _loc1_.x = initalPos.x;
- _loc1_.y = initalPos.y;
- _loc1_.width = width;
- _loc1_.height = height;
- _loc1_.orientation = orientation;
- _loc1_.timeDelay = timeDelay;
- return _loc1_;
- }
-
- private function _uy215() : void
- {
- this.vel.x = 0;
- this.vel.y = 0;
- switch(this.orientation)
- {
- case ORIENTATION_LEFT:
- this.vel.x = -1;
- this.maxProgress = width;
- break;
- case ORIENTATION_RIGHT:
- this.vel.x = 1;
- this.maxProgress = width;
- break;
- case ORIENTATION_UP:
- this.vel.y = -1;
- this.maxProgress = height;
- break;
- case ORIENTATION_DOWN:
- this.vel.y = 1;
- this.maxProgress = height;
- }
- }
-
- public function _ur45() : Object
- {
- var _loc1_:Object = null;
- _loc1_ = _lu255();
- _loc1_.params.x = initalPos.x;
- _loc1_.params.y = initalPos.y;
- _loc1_.params.width = width;
- _loc1_.params.height = height;
- _loc1_.params._tp253 = _tp253;
- _loc1_.params.orientation = _orientation;
- return _loc1_;
- }
-
- override public function update(param1:Number) : void
- {
- super.update(param1);
- switch(state)
- {
- case stTime:
- if(this.timeDelay == -1)
- {
- break;
- }
- if(this.timer++ > this.timeDelay)
- {
- State = stPop;
- }
- break;
- case stPop:
- this.position = new _be271(_ej28 + vel.x,_th99 + vel.y);
- if(++progress >= maxProgress)
- {
- this.vel.x *= -1;
- this.vel.y *= -1;
- State = stPush;
- }
- break;
- case stPush:
- this.position = new _be271(_ej28 + vel.x,_th99 + vel.y);
- if(--progress <= 0)
- {
- State = stTime;
- this.position = new _be271(startPos.x,startPos.y);
- }
- }
- }
-
- public function get orientation() : int
- {
- return _orientation;
- }
-
- private function set State(param1:int) : void
- {
- state = param1;
- switch(state)
- {
- case stTime:
- this.timer = 0;
- break;
- case stPop:
- startPos.x = _ej28;
- startPos.y = _th99;
- _uy215();
- this.progress = 0;
- }
- }
- }
- }
-