projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb10aef
)
Only use one type of actions for both directions.
author
Ricardo Cruz
<rick2@aeiou.pt>
Thu, 19 Aug 2004 11:05:32 +0000
(11:05 +0000)
committer
Ricardo Cruz
<rick2@aeiou.pt>
Thu, 19 Aug 2004 11:05:32 +0000
(11:05 +0000)
SVN-Revision: 1819
src/player.cpp
patch
|
blob
|
history
diff --git
a/src/player.cpp
b/src/player.cpp
index
b8be86e
..
1150832
100644
(file)
--- a/
src/player.cpp
+++ b/
src/player.cpp
@@
-736,70
+736,32
@@
Player::draw(DrawingContext& context)
/* Set Tux sprite action */
if (duck && size != SMALL)
/* 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())
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())
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)
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)
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
{
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
{
}
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(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);
}
idle_timer.start(IDLE_TIME);
}
@@
-807,10
+769,7
@@
Player::draw(DrawingContext& context)
if ((holding_something && physic.get_velocity_y() == 0) ||
shooting_timer.check() && !duck)
{
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 */
}
/* Draw Tux */
@@
-844,7
+803,7
@@
Player::draw(DrawingContext& context)
else if (safe_timer.started() && global_frame_counter%2)
; // don't draw Tux
else
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() &&
// Draw blinking star overlay
if (invincible_timer.started() &&