From 12997d42cea0866b90c836a6db9aaf3cbce0b4a6 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sun, 18 Jun 2006 21:22:57 +0000 Subject: [PATCH] Improved ghost mode a bit SVN-Revision: 3675 --- src/object/player.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 2005f512d..ce9bc9de4 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -555,11 +555,23 @@ Player::handle_input_ghost() { float vx = 0; float vy = 0; - if (controller->hold(Controller::LEFT)) vx -= MAX_RUN_XM; - if (controller->hold(Controller::RIGHT)) vx += MAX_RUN_XM; - if ((controller->hold(Controller::UP)) || (controller->hold(Controller::JUMP))) vy += MAX_RUN_XM; - if (controller->hold(Controller::DOWN)) vy -= MAX_RUN_XM; - if (controller->hold(Controller::ACTION)) set_ghost_mode(false); + if (controller->hold(Controller::LEFT)) { + dir = LEFT; + vx -= MAX_RUN_XM * 2; + } + if (controller->hold(Controller::RIGHT)) { + dir = RIGHT; + vx += MAX_RUN_XM * 2; + } + if ((controller->hold(Controller::UP)) || (controller->hold(Controller::JUMP))) { + vy += MAX_RUN_XM * 2; + } + if (controller->hold(Controller::DOWN)) { + vy -= MAX_RUN_XM * 2; + } + if (controller->hold(Controller::ACTION)) { + set_ghost_mode(false); + } physic.set_velocity(vx, vy); physic.set_acceleration(0, 0); } -- 2.11.0