Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26572
Modified Files:
player.cpp player.h
Log Message:
- added holding gfx, still looks rather stupid, but I think thats unavoidable without major changes to the current code
Index: player.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- player.cpp 24 Apr 2004 12:11:10 -0000 1.57
+++ player.cpp 24 Apr 2004 12:30:20 -0000 1.58
@@ -101,6 +101,8 @@
{
Level* plevel = World::current()->get_level();
+ holding_something = false;
+
base.width = 32;
base.height = 32;
@@ -190,6 +192,9 @@
{
bool jumped_in_solid = false;
+ if (input.fire == UP)
+ holding_something = false;
+
/* Move tux: */
previous_base = base;
@@ -572,6 +577,14 @@
else
smalltux_skid_left->draw(base.x - scroll_x, base.y);
}
+
+ if (holding_something && physic.get_velocity_y() == 0)
+ {
+ if (dir == RIGHT)
+ smalltux_grab_right->draw(base.x - scroll_x, base.y);
+ else
+ smalltux_grab_left->draw(base.x - scroll_x, base.y);
+ }
}
else // Large Tux
{
@@ -673,8 +686,16 @@
duckfiretux_left->draw( base.x- scroll_x - 8, base.y - 16);
}
}
+
+ if (holding_something && !duck && physic.get_velocity_y() == 0)
+ {
+ if (dir == RIGHT)
+ largetux_grab_right->draw(base.x - scroll_x, base.y);
+ else
+ largetux_grab_left->draw(base.x - scroll_x, base.y);
+ }
}
- }
+ }
}
if (debug_mode)
@@ -698,6 +719,7 @@
{
if (pbad_c->mode == BadGuy::FLAT && input.fire == DOWN)
{
+ holding_something = true;
pbad_c->mode = BadGuy::HELD;
pbad_c->base.y-=8;
}
Index: player.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/player.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- player.h 24 Apr 2004 12:11:11 -0000 1.37
+++ player.h 24 Apr 2004 12:30:21 -0000 1.38
@@ -129,6 +129,7 @@
bool got_coffee;
int size;
bool duck;
+ bool holding_something;
DyingType dying;
Direction dir;
|