From: Marek Moeckel Date: Thu, 25 Nov 2004 14:59:04 +0000 (+0000) Subject: nolok dies properly now :) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=875ef8eb7e93726bc67dfa7f05da946250e588d4;p=supertux.git nolok dies properly now :) SVN-Revision: 2188 --- diff --git a/data/levels/test/noloktest.stl b/data/levels/test/noloktest.stl index f1f1e74af..859c8bb84 100644 --- a/data/levels/test/noloktest.stl +++ b/data/levels/test/noloktest.stl @@ -27,7 +27,7 @@ (speed 1) (width 25) (height 19) - (tiles 68 69 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 68 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 68) ) (tilemap (layer "foreground") diff --git a/src/badguy/nolok_01.cpp b/src/badguy/nolok_01.cpp index 69a91ddd5..b8499c544 100644 --- a/src/badguy/nolok_01.cpp +++ b/src/badguy/nolok_01.cpp @@ -87,8 +87,8 @@ Nolok_01::collision_squished(Player& player) HitResponse Nolok_01::collision_solid(GameObject& , const CollisionHit& hit) { - if(fabsf(hit.normal.y) > .5) { // hit floor or roof? - //physic.set_velocity_y(0); + if(fabsf(hit.normal.y) > .5){ // hit floor or roof? + if (action != JUMPING) physic.set_velocity_y(0); } else { // hit right or left dir = dir == LEFT ? RIGHT : LEFT; sprite->set_action(dir == LEFT ? "left" : "right"); diff --git a/src/badguy/nolok_01.h b/src/badguy/nolok_01.h index ff32034f4..61011aa0a 100644 --- a/src/badguy/nolok_01.h +++ b/src/badguy/nolok_01.h @@ -18,7 +18,7 @@ public: protected: bool collision_squished(Player& player); Timer2 action_timer; - enum { IDLE, WALKING, JUMPING, SHOOTING }; + enum { WALKING, JUMPING, SHOOTING }; int action; };