From: Christoph Sommer Date: Thu, 31 Jan 2008 23:20:10 +0000 (+0000) Subject: Player::get_velocity X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=99c2090ca3e52ef5dd9f5383e2ad66a124726c15;p=supertux.git Player::get_velocity SVN-Revision: 5304 --- diff --git a/src/object/player.cpp b/src/object/player.cpp index 5e68d1d58..fdbe8f2b8 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -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& ) { diff --git a/src/object/player.hpp b/src/object/player.hpp index c65b6892e..81aad0026 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -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);