[Super-tux-commit] supertux/src/badguy nolok_01.cpp,1.3,1.4 nolok_01.h,1.2,1.3
Brought to you by:
wkendrick
From: Marek M. <wa...@us...> - 2004-11-25 14:59:20
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13637/src/badguy Modified Files: nolok_01.cpp nolok_01.h Log Message: nolok dies properly now :) Index: nolok_01.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/nolok_01.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- nolok_01.h 25 Nov 2004 13:19:51 -0000 1.2 +++ nolok_01.h 25 Nov 2004 14:59:04 -0000 1.3 @@ -18,7 +18,7 @@ protected: bool collision_squished(Player& player); Timer2 action_timer; - enum { IDLE, WALKING, JUMPING, SHOOTING }; + enum { WALKING, JUMPING, SHOOTING }; int action; }; Index: nolok_01.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/nolok_01.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- nolok_01.cpp 25 Nov 2004 14:38:07 -0000 1.3 +++ nolok_01.cpp 25 Nov 2004 14:59:04 -0000 1.4 @@ -87,8 +87,8 @@ 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"); |