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

  1. class smashing.Phys
  2. {
  3.    static var pUp;
  4.    static var gr = 700;
  5.    static var fr = 0.75;
  6.    static var bf = 0.7;
  7.    static var height = 370;
  8.    static var width = 600;
  9.    static var TWOPI = 6.283185307179586;
  10.    function Phys()
  11.    {
  12.    }
  13.    static function drag(f, t)
  14.    {
  15.       return f * Math.pow(t,smashing.Phys.fr);
  16.    }
  17.    static function bounce(v, n)
  18.    {
  19.       var _loc3_ = v;
  20.       var _loc2_ = _loc3_.reverse();
  21.       var _loc1_ = n.multiply(n.dot(_loc2_));
  22.       _loc3_.x = _loc1_.x * smashing.Phys.bf + (_loc1_.x - _loc2_.x);
  23.       _loc3_.y = _loc1_.y * smashing.Phys.bf + (_loc1_.y - _loc2_.y);
  24.    }
  25.    static function get up()
  26.    {
  27.       return smashing.Phys.pUp != undefined ? smashing.Phys.pUp : (smashing.Phys.pUp = new smashing.Point(0,-1));
  28.    }
  29. }
  30.