projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
B91: Tux now guesses direction to walk in during an end sequence.
[supertux.git]
/
src
/
object
/
endsequence.cpp
diff --git
a/src/object/endsequence.cpp
b/src/object/endsequence.cpp
index
c9a91d3
..
23c530f
100644
(file)
--- a/
src/object/endsequence.cpp
+++ b/
src/object/endsequence.cpp
@@
-60,7
+60,7
@@
EndSequence::draw(DrawingContext& /*context*/)
}
void
}
void
-EndSequence::start()
+EndSequence::start(
Direction dir
)
{
if (isrunning) return;
isrunning = true;
{
if (isrunning) return;
isrunning = true;
@@
-71,6
+71,8
@@
EndSequence::start()
tux.set_controller(end_sequence_controller);
tux.set_speedlimit(230); //MAX_WALK_XM
tux.set_controller(end_sequence_controller);
tux.set_speedlimit(230); //MAX_WALK_XM
+ walk_dir = dir;
+
starting();
}
starting();
}
@@
-114,7
+116,7
@@
EndSequence::running(float /*elapsed_time*/)
Player& tux = *Sector::current()->player;
if (tux_may_walk) {
Player& tux = *Sector::current()->player;
if (tux_may_walk) {
- end_sequence_controller->press(
Controller::RIGH
T);
+ end_sequence_controller->press(
(walk_dir == RIGHT) ? Controller::RIGHT : Controller::LEF
T);
if (int(last_x_pos) == int(tux.get_pos().x)) {
end_sequence_controller->press(Controller::JUMP);
}
if (int(last_x_pos) == int(tux.get_pos().x)) {
end_sequence_controller->press(Controller::JUMP);
}