From: Christoph Sommer Date: Sun, 18 Jun 2006 21:22:57 +0000 (+0000) Subject: Improved ghost mode a bit X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=12997d42cea0866b90c836a6db9aaf3cbce0b4a6;p=supertux.git Improved ghost mode a bit SVN-Revision: 3675 --- 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); }