Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11680/src
Modified Files:
Tag: supertux_0_1_1_branch
badguy.cpp
Log Message:
Implemented bricks breaking by Ice Guys.
Thx Ryan for pointing out the code.
Index: badguy.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v
retrieving revision 1.68
retrieving revision 1.68.2.1
diff -u -d -r1.68 -r1.68.2.1
--- badguy.cpp 8 May 2004 23:46:43 -0000 1.68
+++ badguy.cpp 18 Jul 2004 19:39:05 -0000 1.68.2.1
@@ -288,12 +288,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, 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;
|