[Super-tux-commit] supertux/src player.cpp,1.156,1.157
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-08-19 11:05:41
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9233/src Modified Files: player.cpp Log Message: Only use one type of actions for both directions. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- player.cpp 18 Aug 2004 18:27:32 -0000 1.156 +++ player.cpp 19 Aug 2004 11:05:32 -0000 1.157 @@ -736,70 +736,32 @@ /* Set Tux sprite action */ if (duck && size != SMALL) - { - if (dir == RIGHT) - tux_body->set_action("duck-right"); - else - tux_body->set_action("duck-left"); - } + tux_body->set_action("duck"); else if (skidding_timer.started()) - { - if (dir == RIGHT) - tux_body->set_action("skid-right"); - else - tux_body->set_action("skid-left"); - } + tux_body->set_action("skid"); else if (kick_timer.started()) - { - if (dir == RIGHT) - tux_body->set_action("kick-right"); - else - tux_body->set_action("kick-left"); - } + tux_body->set_action("kick"); else if (butt_jump) - { - if (dir == RIGHT) - tux_body->set_action("buttjump-right"); - else - tux_body->set_action("buttjump-left"); - } + tux_body->set_action("buttjump"); else if (physic.get_velocity_y() != 0) - { - if (dir == RIGHT) - tux_body->set_action("jump-right"); - else - tux_body->set_action("jump-left"); - } + tux_body->set_action("jump"); else { if (fabsf(physic.get_velocity_x()) < 1.0f) // standing { - if (dir == RIGHT) - tux_body->set_action("stand-right"); - else - tux_body->set_action("stand-left"); + tux_body->set_action("stand"); } else // moving { - if (dir == RIGHT) - tux_body->set_action("walk-right"); - else - tux_body->set_action("walk-left"); + tux_body->set_action("walk"); } } if(idle_timer.get_left() < 0) { - if (dir == RIGHT) - { - tux_body->head->set_action("idle-right"); - tux_body->head->start_animation(1); - } - else - { - tux_body->head->set_action("idle-right"); - tux_body->head->start_animation(1); - } + tux_body->head->set_action("idle"); + tux_body->head->start_animation(1); + idle_timer.start(IDLE_TIME); } @@ -807,10 +769,7 @@ if ((holding_something && physic.get_velocity_y() == 0) || shooting_timer.check() && !duck) { - if (dir == RIGHT) - tux_body->arms->set_action("grab-right"); - else - tux_body->arms->set_action("grab-left"); + tux_body->arms->set_action("grab"); } /* Draw Tux */ @@ -844,7 +803,7 @@ else if (safe_timer.started() && global_frame_counter%2) ; // don't draw Tux else - tux_body->draw(context, pos, layer); + tux_body->draw(context, pos, layer, dir == LEFT ? HORIZONTAL_FLIP : NONE_EFFECT); // Draw blinking star overlay if (invincible_timer.started() && |