From 99c2090ca3e52ef5dd9f5383e2ad66a124726c15 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Thu, 31 Jan 2008 23:20:10 +0000 Subject: [PATCH] Player::get_velocity SVN-Revision: 5304 --- src/object/player.cpp | 6 ++++++ src/object/player.hpp | 5 +++++ 2 files changed, 11 insertions(+) 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); -- 2.11.0