* Add upgrade.wav from Yaniel
[supertux.git] / src / physic.hpp
index da44f9b..f8e807d 100644 (file)
@@ -1,7 +1,8 @@
 //  $Id$
-// 
+//
 //  SuperTux
 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -12,7 +13,7 @@
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -42,7 +43,7 @@ public:
   void set_velocity_x(float vx);
   void set_velocity_y(float vy);
 
-  /// Velocities invertion.
+  /// Velocity inversion.
   void inverse_velocity_x();
   void inverse_velocity_y();
 
@@ -67,6 +68,12 @@ public:
   void enable_gravity(bool gravity_enabled);
   bool gravity_enabled() const;
 
+  /// Set gravity to apply to object when enabled
+  void set_gravity(float gravity);
+
+  /// Get gravity to apply to object when enabled
+  float get_gravity() const;
+
   Vector get_movement(float elapsed_time);
 
 private:
@@ -74,8 +81,17 @@ private:
   float ax, ay;
   /// horizontal and vertical velocity
   float vx, vy;
-  /// should we respect gravity in out calculations?
+  /// should we respect gravity in our calculations?
   bool gravity_enabled_flag;
+  /// current gravity (multiplied by 100) to apply to object, if enabled
+  float gravity;
+};
+
+class UsesPhysic
+{
+public:
+  Physic physic;
+  friend class Sector;
 };
 
 #endif