From: Tobias Gläßer Date: Mon, 8 Mar 2004 16:06:07 +0000 (+0000) Subject: ducking is working again. a debug feature has moved to the debug-mode. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=39c886426d23b6065df57f82e05662470a0a350d;p=supertux.git ducking is working again. a debug feature has moved to the debug-mode. SVN-Revision: 193 --- diff --git a/src/gameloop.c b/src/gameloop.c index 446852e39..d012a551d 100644 --- a/src/gameloop.c +++ b/src/gameloop.c @@ -692,7 +692,7 @@ int gameloop(char * subset, int levelnb, int mode) SDL_Delay(50); } - if(tux.input.down == DOWN) + if(debug_mode && tux.input.down == DOWN) SDL_Delay(45); /*Draw the current scene to the screen */ diff --git a/src/player.c b/src/player.c index e8ae9247a..4615cbe87 100644 --- a/src/player.c +++ b/src/player.c @@ -918,7 +918,10 @@ void player_input(player_type *pplayer) if (pplayer->input.down == DOWN) { if (pplayer->size == BIG) + { pplayer->duck = YES; + pplayer->base.height = 32; + } } else { @@ -927,10 +930,15 @@ void player_input(player_type *pplayer) /* Make sure we're not standing back up into a solid! */ if (!issolid(pplayer->base.x + 16, pplayer->base.y - 16)) + { pplayer->duck = NO; + pplayer->base.height = 64; + } } else + { pplayer->duck = NO; + } } /* (Tux): */ @@ -1117,12 +1125,12 @@ void player_draw(player_type* pplayer) { if (pplayer->dir == RIGHT) { - texture_draw(&ducktux_right, pplayer->base.x- scroll_x - 8, pplayer->base.y, + texture_draw(&ducktux_right, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16, NO_UPDATE); } else { - texture_draw(&ducktux_left, pplayer->base.x- scroll_x - 8, pplayer->base.y, + texture_draw(&ducktux_left, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16, NO_UPDATE); } } @@ -1186,12 +1194,12 @@ void player_draw(player_type* pplayer) { if (pplayer->dir == RIGHT) { - texture_draw(&duckfiretux_right, pplayer->base.x- scroll_x - 8, pplayer->base.y, + texture_draw(&duckfiretux_right, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16, NO_UPDATE); } else { - texture_draw(&duckfiretux_left, pplayer->base.x- scroll_x - 8, pplayer->base.y, + texture_draw(&duckfiretux_left, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16, NO_UPDATE); } }