[Super-tux-commit] supertux/src player.cpp,1.208,1.209
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2004-11-25 18:57:40
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1214 Modified Files: player.cpp Log Message: shrink tux bounding box to make him not fail on 1 or 2 tiles heigh places, also extend/shrink his bounding box when walking/running Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.208 retrieving revision 1.209 diff -u -d -r1.208 -r1.209 --- player.cpp 25 Nov 2004 16:38:30 -0000 1.208 +++ player.cpp 25 Nov 2004 18:57:26 -0000 1.209 @@ -131,7 +131,7 @@ { holding_something = false; - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); size = SMALL; got_power = NONE_POWER; @@ -388,6 +388,14 @@ } #endif + // extend/shrink tux collision rectangle so that we fall through/walk over 1 + // tile holes + if(vx > MAX_WALK_XM) { + bbox.set_width(33); + } else { + bbox.set_width(31.8); + } + physic.set_velocity(vx, vy); physic.set_acceleration(ax, ay); } @@ -660,13 +668,13 @@ { duck = true; bbox.move(Vector(0, 32)); - bbox.set_height(32); + bbox.set_height(31.8); } else if(input.down == UP && size == BIG && duck) { // try if we can really unduck bbox.move(Vector(0, -32)); - bbox.set_height(64); + bbox.set_height(63.8); duck = false; // FIXME #if 0 @@ -676,7 +684,7 @@ } else { // undo the ducking changes bbox.move(Vector(0, 32)); - bbox.set_height(32); + bbox.set_height(31.8); } #endif } @@ -689,7 +697,7 @@ return; size = BIG; - bbox.set_height(64); + bbox.set_height(63.8); bbox.move(Vector(0, -32)); if(animate) @@ -916,7 +924,7 @@ growing_timer.start(GROWING_TIME); safe_timer.start(TUX_SAFE_TIME + GROWING_TIME); size = SMALL; - bbox.set_height(32); + bbox.set_height(31.8); duck = false; } } @@ -938,7 +946,7 @@ { got_power = NONE_POWER; size = SMALL; - bbox.set_height(32); + bbox.set_height(31.8); } void |