home *** CD-ROM | disk | FTP | other *** search
- class FlyAwayGerm extends smashing.Renderable
- {
- var m;
- var r = 15;
- var grabbable = false;
- function FlyAwayGerm()
- {
- super();
- this.m = new smashing.Point(-200,-300);
- }
- function update(nElapsed)
- {
- var _loc1_ = this;
- var _loc2_ = nElapsed;
- _loc1_.m.y += _loc2_ * smashing.Phys.gr;
- _loc1_.x += _loc1_.m.x * _loc2_;
- _loc1_.y += _loc1_.m.y * _loc2_;
- _loc1_.render();
- }
- function render()
- {
- var _loc1_ = this;
- var _loc2_ = smashing.Viewport.getPos(_loc1_);
- if(_loc2_.x < - smashing.Viewport.halfWidth - _loc1_.r * 2)
- {
- _loc1_.handler.removeClip(_loc1_);
- }
- if(_loc2_.y > smashing.Viewport.halfHeight + _loc1_.r * 2)
- {
- _loc1_.handler.removeClip(_loc1_);
- }
- _loc1_._x = _loc2_.x + smashing.Viewport.centerX;
- _loc1_._y = _loc2_.y + smashing.Viewport.centerY;
- }
- }
-