projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30dcd6e
)
badguy/walking_badguy.cpp: Turn the badguy around when his speed doesn't match the...
author
Florian Forster
<supertux@octo.it>
Fri, 5 Mar 2010 08:36:26 +0000
(08:36 +0000)
committer
Florian Forster
<supertux@octo.it>
Fri, 5 Mar 2010 08:36:26 +0000
(08:36 +0000)
SVN-Revision: 6551
src/badguy/walking_badguy.cpp
patch
|
blob
|
history
diff --git
a/src/badguy/walking_badguy.cpp
b/src/badguy/walking_badguy.cpp
index
8ab7d35
..
203d5f7
100644
(file)
--- a/
src/badguy/walking_badguy.cpp
+++ b/
src/badguy/walking_badguy.cpp
@@
-137,6
+137,15
@@
WalkingBadguy::active_update(float elapsed_time, float dest_x_velocity)
turn_around();
}
}
+
+ if ((dir == LEFT) && (physic.get_velocity_x () > 0.0)) {
+ dir = RIGHT;
+ set_action (walk_right_action, /* loops = */ -1);
+ }
+ else if ((dir == RIGHT) && (physic.get_velocity_x () < 0.0)) {
+ dir = LEFT;
+ set_action (walk_left_action, /* loops = */ -1);
+ }
}
void