home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / germ_roundup.swf / scripts / __Packages / FlyAwayGerm.as < prev    next >
Encoding:
Text File  |  2007-03-20  |  946 b   |  36 lines

  1. class FlyAwayGerm extends smashing.Renderable
  2. {
  3.    var m;
  4.    var r = 15;
  5.    var grabbable = false;
  6.    function FlyAwayGerm()
  7.    {
  8.       super();
  9.       this.m = new smashing.Point(-200,-300);
  10.    }
  11.    function update(nElapsed)
  12.    {
  13.       var _loc1_ = this;
  14.       var _loc2_ = nElapsed;
  15.       _loc1_.m.y += _loc2_ * smashing.Phys.gr;
  16.       _loc1_.x += _loc1_.m.x * _loc2_;
  17.       _loc1_.y += _loc1_.m.y * _loc2_;
  18.       _loc1_.render();
  19.    }
  20.    function render()
  21.    {
  22.       var _loc1_ = this;
  23.       var _loc2_ = smashing.Viewport.getPos(_loc1_);
  24.       if(_loc2_.x < - smashing.Viewport.halfWidth - _loc1_.r * 2)
  25.       {
  26.          _loc1_.handler.removeClip(_loc1_);
  27.       }
  28.       if(_loc2_.y > smashing.Viewport.halfHeight + _loc1_.r * 2)
  29.       {
  30.          _loc1_.handler.removeClip(_loc1_);
  31.       }
  32.       _loc1_._x = _loc2_.x + smashing.Viewport.centerX;
  33.       _loc1_._y = _loc2_.y + smashing.Viewport.centerY;
  34.    }
  35. }
  36.