[Super-tux-commit] supertux/src defines.h,1.21,1.22 gameloop.cpp,1.94,1.95 player.cpp,1.55,1.56 play
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-22 20:14:58
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16213 Modified Files: defines.h gameloop.cpp player.cpp player.h special.cpp Log Message: - made shrink behaviour more mariobros3 like, ie. firetux will go to largetux to smalltux, removed small-firetux Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- player.cpp 22 Apr 2004 19:15:22 -0000 1.55 +++ player.cpp 22 Apr 2004 20:14:49 -0000 1.56 @@ -527,55 +527,39 @@ cape_left[global_frame_counter % 2]->draw(base.x- scroll_x, base.y); } - if (!got_coffee) + if (!skidding_timer.started()) { - if (!skidding_timer.started()) + if (physic.get_velocity_y() != 0) { - if (physic.get_velocity_y() != 0) + if (dir == RIGHT) + smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); + else + smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); + } + else + { + if (fabsf(physic.get_velocity_x()) < 1.0f) // standing { if (dir == RIGHT) - smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); + smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); else - smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); + smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); } - else + else // moving { - if (fabsf(physic.get_velocity_x()) < 1.0f) // standing - { - if (dir == RIGHT) - smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); - else - smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); - } - else // moving - { - if (dir == RIGHT) - tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9); - else - tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9); - } + if (dir == RIGHT) + tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9); + else + tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9); } } - else - { - if (dir == RIGHT) - smalltux_skid_right->draw(base.x - scroll_x, base.y); - else - smalltux_skid_left->draw(base.x - scroll_x, base.y); - } } else { - /* Tux got coffee! */ - if (dir == RIGHT) - { - firetux_right[frame_]->draw( base.x- scroll_x, base.y); - } + smalltux_skid_right->draw(base.x - scroll_x, base.y); else - { - firetux_left[frame_]->draw( base.x- scroll_x, base.y); - } + smalltux_skid_left->draw(base.x - scroll_x, base.y); } } else // Large Tux @@ -749,7 +733,7 @@ /* Kill Player! */ void -Player::kill(int mode) +Player::kill(HurtMode mode) { play_sound(sounds[SND_HURT], SOUND_CENTER_SPEAKER); @@ -758,12 +742,15 @@ if (mode == SHRINK && size == BIG) { if (got_coffee) - got_coffee = false; - - size = SMALL; - base.height = 32; - duck = false; - + { + got_coffee = false; + } + else + { + size = SMALL; + base.height = 32; + duck = false; + } safe_timer.start(TUX_SAFE_TIME); } else Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- player.h 22 Apr 2004 16:25:32 -0000 1.35 +++ player.h 22 Apr 2004 20:14:49 -0000 1.36 @@ -112,6 +112,8 @@ class Player { public: + enum HurtMode { KILL, SHRINK }; + player_input_type input; bool got_coffee; int size; @@ -142,7 +144,7 @@ void grabdistros(); void draw(); void collision(void* p_c_object, int c_object); - void kill(int mode); + void kill(HurtMode mode); void is_dying(); bool is_dead(); void player_remove_powerups(); Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- defines.h 22 Apr 2004 17:38:56 -0000 1.21 +++ defines.h 22 Apr 2004 20:14:33 -0000 1.22 @@ -48,11 +48,6 @@ DYING_FALLING = 2 }; -/* Hurt modes: */ - -#define KILL 0 -#define SHRINK 1 - /* Sizes: */ #define SMALL 0 Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- gameloop.cpp 22 Apr 2004 11:17:34 -0000 1.94 +++ gameloop.cpp 22 Apr 2004 20:14:33 -0000 1.95 @@ -555,7 +555,7 @@ /* Handle time: */ if (!time_left.check() && world->get_tux()->dying == DYING_NOT) - world->get_tux()->kill(KILL); + world->get_tux()->kill(Player::KILL); /* Handle music: */ if(world->get_tux()->invincible_timer.check()) Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- special.cpp 22 Apr 2004 19:15:22 -0000 1.25 +++ special.cpp 22 Apr 2004 20:14:49 -0000 1.26 @@ -306,6 +306,15 @@ { play_sound(sounds[SND_COFFEE], SOUND_CENTER_SPEAKER); pplayer->got_coffee = true; + pplayer->size = BIG; + pplayer->base.height = 64; + pplayer->base.y -= 32; + if(collision_object_map(pplayer->base)) + { + pplayer->base.height = 32; + pplayer->base.y += 32; + pplayer->duck = true; + } } else if (kind == UPGRADE_HERRING) { |