From: Christoph Sommer Date: Tue, 30 May 2006 21:22:44 +0000 (+0000) Subject: Stalactites no longer fall while Tux is more than 400px below them X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2ecc5c71bc6bf4a4877c15c6b6e05faa55947c25;p=supertux.git Stalactites no longer fall while Tux is more than 400px below them SVN-Revision: 3613 --- diff --git a/src/badguy/stalactite.cpp b/src/badguy/stalactite.cpp index 33a160646..f53a94409 100644 --- a/src/badguy/stalactite.cpp +++ b/src/badguy/stalactite.cpp @@ -22,9 +22,10 @@ #include "stalactite.hpp" #include "random_generator.hpp" -static const int SHAKE_RANGE = 40; +static const int SHAKE_RANGE_X = 40; static const float SHAKE_TIME = .8; static const float SQUISH_TIME = 2; +static const float SHAKE_RANGE_Y = 400; Stalactite::Stalactite(const lisp::Lisp& lisp) : BadGuy(lisp, "images/creatures/stalactite/stalactite.sprite"), state(STALACTITE_HANGING) @@ -47,9 +48,10 @@ Stalactite::active_update(float elapsed_time) if(state == STALACTITE_HANGING) { Player* player = this->get_nearest_player(); if (player) { - if(player->get_bbox().p2.x > bbox.p1.x - SHAKE_RANGE - && player->get_bbox().p1.x < bbox.p2.x + SHAKE_RANGE - && player->get_bbox().p2.y > bbox.p1.y) { + if(player->get_bbox().p2.x > bbox.p1.x - SHAKE_RANGE_X + && player->get_bbox().p1.x < bbox.p2.x + SHAKE_RANGE_X + && player->get_bbox().p2.y > bbox.p1.y + && player->get_bbox().p1.y < bbox.p2.y + SHAKE_RANGE_Y) { timer.start(SHAKE_TIME); state = STALACTITE_SHAKING; }