home *** CD-ROM | disk | FTP | other *** search
- class Wind extends smashing.Renderable
- {
- var r = 60;
- var speed = 300;
- var cMove = 0;
- var nSine = 120;
- static var nRange = 30;
- var sType = "wind";
- var windForce = 2000;
- var bDead = false;
- function Wind()
- {
- super();
- }
- function update(nElapsed)
- {
- var _loc1_ = this;
- var _loc2_ = nElapsed * _loc1_.speed;
- _loc1_.x -= _loc2_;
- _loc1_.cMove += _loc2_;
- var _loc3_ = _loc1_.x - smashing.Viewport.x;
- if(_loc3_ <= - (smashing.Viewport.halfWidth + _loc1_.r))
- {
- _loc1_.oCitizenHandler.removeCitizen(_loc1_);
- }
- }
- function render()
- {
- var _loc2_ = this;
- var _loc1_ = smashing.Viewport.getPos(_loc2_);
- _loc2_._x = _loc1_.x + smashing.Viewport.centerX;
- _loc2_._y = _loc1_.y + smashing.Viewport.centerY;
- }
- function collisionTest(oPlayer)
- {
- return this.hitTest(oPlayer);
- }
- function react(oPlayer, nElapsed)
- {
- var _loc1_ = this.windForce * nElapsed;
- oPlayer.xm -= _loc1_;
- }
- }
-