[Super-tux-commit] supertux/src player.cpp,1.85,1.86 player.h,1.51,1.52 world.cpp,1.68,1.69
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-05-08 10:41:51
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1584/src Modified Files: player.cpp player.h world.cpp Log Message: Fixes death in modes different than the autoscrolling. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- player.cpp 8 May 2004 00:04:00 -0000 1.85 +++ player.cpp 8 May 2004 10:41:42 -0000 1.86 @@ -194,7 +194,6 @@ base.x += frame_ratio * WALK_SPEED * (dir ? 1 : -1); previous_base = old_base = base; } - check_bounds(); // Land: if (!on_ground()) @@ -739,7 +738,7 @@ } void -Player::check_bounds() +Player::check_bounds(bool back_scrolling, bool hor_autoscroll) { /* Keep tux in bounds: */ if (base.x < 0) @@ -754,14 +753,14 @@ kill(KILL); } - if(base.x < scroll_x) // can happen if back scrolling is disabled + if(base.x < scroll_x && (!back_scrolling || hor_autoscroll)) // can happen if back scrolling is disabled base.x = scroll_x; - if(base.x == scroll_x) - if(issolid(base.x, base.y) || (size != SMALL && issolid(base.x, base.y+32))) + if(base.x == scroll_x && hor_autoscroll) + if(issolid(base.x+32, base.y) || (size != SMALL && issolid(base.x+32, base.y+32))) kill(KILL); - if(base.x + base.width > scroll_x + screen->w) + if(base.x + base.width > scroll_x + screen->w && hor_autoscroll) base.x = scroll_x + screen->w - base.width; Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- player.h 4 May 2004 13:59:00 -0000 1.51 +++ player.h 8 May 2004 10:41:42 -0000 1.52 @@ -145,7 +145,7 @@ void is_dying(); bool is_dead(); void player_remove_powerups(); - void check_bounds(); + void check_bounds(bool back_scrolling, bool hor_autoscroll); bool on_ground(); bool under_solid(); void grow(); Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- world.cpp 7 May 2004 23:09:53 -0000 1.68 +++ world.cpp 8 May 2004 10:41:42 -0000 1.69 @@ -261,6 +261,7 @@ World::action(double frame_ratio) { tux.action(frame_ratio); + tux.check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); scrolling(frame_ratio); /* Handle bouncy distros: */ |