[Super-tux-commit] supertux/src gameloop.cpp,1.41,1.42 menu.cpp,1.23,1.24 player.cpp,1.19,1.20 playe
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-09 02:32:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4687 Modified Files: gameloop.cpp menu.cpp player.cpp player.h Log Message: - added new smalltux Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- player.cpp 4 Apr 2004 00:32:10 -0000 1.19 +++ player.cpp 9 Apr 2004 02:19:09 -0000 1.20 @@ -20,8 +20,13 @@ #include "screen.h" texture_type tux_life; -texture_type tux_right[3]; -texture_type tux_left[3]; +std::vector<texture_type> tux_right; +std::vector<texture_type> tux_left; +texture_type smalltux_jump_left; +texture_type smalltux_jump_right; +texture_type smalltux_stand_left; +texture_type smalltux_stand_right; + texture_type bigtux_right[3]; texture_type bigtux_left[3]; texture_type bigtux_right_jump; @@ -597,13 +602,31 @@ if (!got_coffee) { - if (dir == RIGHT) + if (physic.get_velocity_y() > 0) { - texture_draw(&tux_right[frame_], base.x- scroll_x, base.y); + if (dir == RIGHT) + texture_draw(&smalltux_jump_right, base.x - scroll_x, base.y - 10); + else + texture_draw(&smalltux_jump_left, base.x - scroll_x, base.y - 10); } else { - texture_draw(&tux_left[frame_], base.x- scroll_x, base.y); + if (fabsf(physic.get_velocity_x()) < 1.0f) // standing + { + if (dir == RIGHT) + texture_draw(&smalltux_stand_right, base.x - scroll_x, base.y - 9); + else + texture_draw(&smalltux_stand_left, base.x - scroll_x, base.y - 9); + } + else // moving + { + if (dir == RIGHT) + texture_draw(&tux_right[(global_frame_counter/2) % tux_right.size()], + base.x - scroll_x, base.y - 9); + else + texture_draw(&tux_left[(global_frame_counter/2) % tux_left.size()], + base.x - scroll_x, base.y - 9); + } } } else Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- player.h 4 Apr 2004 00:32:10 -0000 1.20 +++ player.h 9 Apr 2004 02:19:09 -0000 1.21 @@ -37,6 +37,8 @@ #define SCORE_BRICK 5 #define SCORE_DISTRO 25 +#include <vector> + struct player_keymap_type { int jump; @@ -59,8 +61,12 @@ void player_input_init(player_input_type* pplayer_input); extern texture_type tux_life; -extern texture_type tux_right[3]; -extern texture_type tux_left[3]; +extern std::vector<texture_type> tux_right; +extern std::vector<texture_type> tux_left; +extern texture_type smalltux_jump_left; +extern texture_type smalltux_jump_right; +extern texture_type smalltux_stand_left; +extern texture_type smalltux_stand_right; extern texture_type bigtux_right[3]; extern texture_type bigtux_left[3]; extern texture_type bigtux_right_jump; Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- menu.cpp 9 Apr 2004 00:49:47 -0000 1.23 +++ menu.cpp 9 Apr 2004 02:19:09 -0000 1.24 @@ -31,7 +31,7 @@ #include "high_scores.h" /* (global) menu variables */ -MenuAction menuaction; +MenuAction menuaction = MENU_ACTION_NONE; bool show_menu; bool menu_change; texture_type checkbox, checkbox_checked, back, arrow_left, arrow_right; @@ -192,6 +192,7 @@ item[active_item].list->active_item = item[active_item].list->num_items-1; } break; + case MENU_ACTION_RIGHT: if(item[active_item].kind == MN_STRINGSELECT && item[active_item].list->num_items != 0) Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- gameloop.cpp 4 Apr 2004 00:32:10 -0000 1.41 +++ gameloop.cpp 9 Apr 2004 02:19:09 -0000 1.42 @@ -822,13 +822,31 @@ int i; /* Tuxes: */ - texture_load(&tux_right[0], datadir + "/images/shared/tux-right-0.png", USE_ALPHA); - texture_load(&tux_right[1], datadir + "/images/shared/tux-right-1.png", USE_ALPHA); - texture_load(&tux_right[2], datadir + "/images/shared/tux-right-2.png", USE_ALPHA); + texture_load(&smalltux_stand_left, datadir + "/images/shared/smalltux-left-6.png", USE_ALPHA); + texture_load(&smalltux_stand_right, datadir + "/images/shared/smalltux-right-6.png", USE_ALPHA); - texture_load(&tux_left[0], datadir + "/images/shared/tux-left-0.png", USE_ALPHA); - texture_load(&tux_left[1], datadir + "/images/shared/tux-left-1.png", USE_ALPHA); - texture_load(&tux_left[2], datadir + "/images/shared/tux-left-2.png", USE_ALPHA); + texture_load(&smalltux_jump_left, datadir + "/images/shared/smalltux-jump-left.png", USE_ALPHA); + texture_load(&smalltux_jump_right, datadir + "/images/shared/smalltux-jump-right.png", USE_ALPHA); + + tux_right.resize(8); + texture_load(&tux_right[0], datadir + "/images/shared/smalltux-right-1.png", USE_ALPHA); + texture_load(&tux_right[1], datadir + "/images/shared/smalltux-right-2.png", USE_ALPHA); + texture_load(&tux_right[2], datadir + "/images/shared/smalltux-right-3.png", USE_ALPHA); + texture_load(&tux_right[3], datadir + "/images/shared/smalltux-right-4.png", USE_ALPHA); + texture_load(&tux_right[4], datadir + "/images/shared/smalltux-right-5.png", USE_ALPHA); + texture_load(&tux_right[5], datadir + "/images/shared/smalltux-right-6.png", USE_ALPHA); + texture_load(&tux_right[6], datadir + "/images/shared/smalltux-right-7.png", USE_ALPHA); + texture_load(&tux_right[7], datadir + "/images/shared/smalltux-right-8.png", USE_ALPHA); + + tux_left.resize(8); + texture_load(&tux_left[0], datadir + "/images/shared/smalltux-left-1.png", USE_ALPHA); + texture_load(&tux_left[1], datadir + "/images/shared/smalltux-left-2.png", USE_ALPHA); + texture_load(&tux_left[2], datadir + "/images/shared/smalltux-left-3.png", USE_ALPHA); + texture_load(&tux_left[3], datadir + "/images/shared/smalltux-left-4.png", USE_ALPHA); + texture_load(&tux_left[4], datadir + "/images/shared/smalltux-left-5.png", USE_ALPHA); + texture_load(&tux_left[5], datadir + "/images/shared/smalltux-left-6.png", USE_ALPHA); + texture_load(&tux_left[6], datadir + "/images/shared/smalltux-left-7.png", USE_ALPHA); + texture_load(&tux_left[7], datadir + "/images/shared/smalltux-left-8.png", USE_ALPHA); texture_load(&firetux_right[0], datadir + "/images/shared/firetux-right-0.png", USE_ALPHA); texture_load(&firetux_right[1], datadir + "/images/shared/firetux-right-1.png", USE_ALPHA); |