home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / germ_roundup.swf / scripts / __Packages / Wind.as < prev   
Encoding:
Text File  |  2007-03-20  |  1.0 KB  |  44 lines

  1. class Wind extends smashing.Renderable
  2. {
  3.    var r = 60;
  4.    var speed = 300;
  5.    var cMove = 0;
  6.    var nSine = 120;
  7.    static var nRange = 30;
  8.    var sType = "wind";
  9.    var windForce = 2000;
  10.    var bDead = false;
  11.    function Wind()
  12.    {
  13.       super();
  14.    }
  15.    function update(nElapsed)
  16.    {
  17.       var _loc1_ = this;
  18.       var _loc2_ = nElapsed * _loc1_.speed;
  19.       _loc1_.x -= _loc2_;
  20.       _loc1_.cMove += _loc2_;
  21.       var _loc3_ = _loc1_.x - smashing.Viewport.x;
  22.       if(_loc3_ <= - (smashing.Viewport.halfWidth + _loc1_.r))
  23.       {
  24.          _loc1_.oCitizenHandler.removeCitizen(_loc1_);
  25.       }
  26.    }
  27.    function render()
  28.    {
  29.       var _loc2_ = this;
  30.       var _loc1_ = smashing.Viewport.getPos(_loc2_);
  31.       _loc2_._x = _loc1_.x + smashing.Viewport.centerX;
  32.       _loc2_._y = _loc1_.y + smashing.Viewport.centerY;
  33.    }
  34.    function collisionTest(oPlayer)
  35.    {
  36.       return this.hitTest(oPlayer);
  37.    }
  38.    function react(oPlayer, nElapsed)
  39.    {
  40.       var _loc1_ = this.windForce * nElapsed;
  41.       oPlayer.xm -= _loc1_;
  42.    }
  43. }
  44.