[Super-tux-commit] supertux/src badguy.cpp,1.72,1.73
Brought to you by:
wkendrick
From: Ryan F. <sik...@us...> - 2004-05-13 21:02:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/src Modified Files: badguy.cpp Log Message: - made mriceblock break blocks when kicked into them Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- badguy.cpp 13 May 2004 12:44:28 -0000 1.72 +++ badguy.cpp 13 May 2004 21:02:14 -0000 1.73 @@ -32,6 +32,7 @@ #include "tile.h" #include "resources.h" #include "sprite_manager.h" +#include "gameloop.h" Sprite* img_mriceblock_flat_left; Sprite* img_mriceblock_flat_right; @@ -296,12 +297,18 @@ float halfheight = base.height / 2; if (dir == LEFT && issolid( base.x, (int) base.y + halfheight)) { + if (kind == BAD_MRICEBLOCK && mode == KICK) + World::current()->trybreakbrick(base.x, (int) base.y + halfheight, false); + dir = RIGHT; physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y()); return; } if (dir == RIGHT && issolid( base.x + base.width, (int)base.y + halfheight)) { + if (kind == BAD_MRICEBLOCK && mode == KICK) + World::current()->trybreakbrick(base.x + base.width, (int) base.y + halfheight, false); + dir = LEFT; physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y()); return; |