[Super-tux-commit] supertux/src player.cpp,1.51,1.52 player.h,1.33,1.34 resources.cpp,1.13,1.14 titl
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-22 00:16:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15088/src Modified Files: player.cpp player.h resources.cpp title.cpp Log Message: - added small skid tux Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- player.cpp 21 Apr 2004 23:37:50 -0000 1.51 +++ player.cpp 22 Apr 2004 00:13:33 -0000 1.52 @@ -35,6 +35,9 @@ Surface* smalltux_jump_right; Surface* smalltux_stand_left; Surface* smalltux_stand_right; +Sprite* smalltux_gameover; +Sprite* smalltux_skid_left; +Sprite* smalltux_skid_right; Sprite* bigtux_right; Sprite* bigtux_left; @@ -525,30 +528,40 @@ if (!got_coffee) { - 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 (!skidding_timer.started()) { - if (fabsf(physic.get_velocity_x()) < 1.0f) // standing + if (physic.get_velocity_y() != 0) { if (dir == RIGHT) - smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); + smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); else - smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); + smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); } - else // moving + else { - 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 (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); + } } } + 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 { @@ -564,7 +577,7 @@ } } } - else + else // Large Tux { if (invincible_timer.started()) { Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- player.h 21 Apr 2004 15:15:28 -0000 1.33 +++ player.h 22 Apr 2004 00:13:33 -0000 1.34 @@ -81,6 +81,9 @@ extern Surface* smalltux_jump_right; extern Surface* smalltux_stand_left; extern Surface* smalltux_stand_right; +extern Sprite* smalltux_skid_left; +extern Sprite* smalltux_skid_right; +extern Sprite* smalltux_gameover; extern Sprite* bigtux_right; extern Sprite* bigtux_left; extern Sprite* bigtux_right_jump; Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- title.cpp 22 Apr 2004 00:02:18 -0000 1.54 +++ title.cpp 22 Apr 2004 00:13:33 -0000 1.55 @@ -358,8 +358,7 @@ frame++; SDL_Delay(25); - if(!playing_music) - play_music(music); + play_music(music); } /* Free surfaces: */ Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- resources.cpp 20 Apr 2004 11:09:34 -0000 1.13 +++ resources.cpp 22 Apr 2004 00:13:33 -0000 1.14 @@ -47,6 +47,11 @@ sprite_manager = new SpriteManager(datadir + "/supertux.strf"); /* Tuxes: */ + smalltux_gameover = sprite_manager->load("smalltux-gameover"); + + smalltux_skid_left = sprite_manager->load("smalltux-skid-left"); + smalltux_skid_right = sprite_manager->load("smalltux-skid-right"); + smalltux_stand_left = new Surface(datadir + "/images/shared/smalltux-left-6.png", USE_ALPHA); smalltux_stand_right = new Surface(datadir + "/images/shared/smalltux-right-6.png", USE_ALPHA); @@ -296,6 +301,8 @@ free_special_gfx(); + delete smalltux_gameover; + for (i = 0; i < 3; i++) { delete tux_right[i]; |