Player::get_velocity
authorChristoph Sommer <mail@christoph-sommer.de>
Thu, 31 Jan 2008 23:20:10 +0000 (23:20 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Thu, 31 Jan 2008 23:20:10 +0000 (23:20 +0000)
SVN-Revision: 5304

src/object/player.cpp
src/object/player.hpp

index 5e68d1d..fdbe8f2 100644 (file)
@@ -1221,6 +1221,12 @@ Player::add_velocity(const Vector& velocity, const Vector& end_speed)
     physic.set_velocity_y(std::max(physic.get_velocity_y() + velocity.y, end_speed.y));
 }
 
+Vector 
+Player::get_velocity()
+{
+  return physic.get_velocity();
+}
+
 void
 Player::bounce(BadGuy& )
 {
index c65b689..81aad00 100644 (file)
@@ -197,6 +197,11 @@ public:
    * Adds velocity to the player until given end speed is reached
    */
   void add_velocity(const Vector& velocity, const Vector& end_speed);
+  
+  /**
+   * Returns the current velocity of the player
+   */
+  Vector get_velocity();
 
   void bounce(BadGuy& badguy);