projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Tux walking backwards after automatic backflipping, fixes #1063
[supertux.git]
/
src
/
worldmap
/
tux.cpp
diff --git
a/src/worldmap/tux.cpp
b/src/worldmap/tux.cpp
index
c76af1c
..
365b985
100644
(file)
--- a/
src/worldmap/tux.cpp
+++ b/
src/worldmap/tux.cpp
@@
-34,7
+34,7
@@
static const float map_message_TIME = 2.8f;
Tux::Tux(WorldMap* worldmap_) :
back_direction(),
worldmap(worldmap_),
Tux::Tux(WorldMap* worldmap_) :
back_direction(),
worldmap(worldmap_),
- sprite(),
+ sprite(
SpriteManager::current()->create("images/worldmap/common/tux.sprite")
),
controller(),
input_direction(),
direction(),
controller(),
input_direction(),
direction(),
@@
-43,8
+43,6
@@
Tux::Tux(WorldMap* worldmap_) :
moving(),
ghost_mode()
{
moving(),
ghost_mode()
{
- sprite = sprite_manager->create("images/worldmap/common/tux.sprite");
-
offset = 0;
moving = false;
direction = D_NONE;
offset = 0;
moving = false;
direction = D_NONE;
@@
-70,6
+68,12
@@
Tux::draw(DrawingContext& context)
case ICE_BONUS:
sprite->set_action(moving ? "ice-walking" : "ice-stop");
break;
case ICE_BONUS:
sprite->set_action(moving ? "ice-walking" : "ice-stop");
break;
+ case AIR_BONUS:
+ sprite->set_action(moving ? "air-walking" : "air-stop");
+ break;
+ case EARTH_BONUS:
+ sprite->set_action(moving ? "earth-walking" : "earth-stop");
+ break;
case NO_BONUS:
sprite->set_action(moving ? "small-walking" : "small-stop");
break;
case NO_BONUS:
sprite->set_action(moving ? "small-walking" : "small-stop");
break;
@@
-291,14
+295,14
@@
Tux::tryContinueWalking(float elapsed_time)
void
Tux::updateInputDirection()
{
void
Tux::updateInputDirection()
{
- Controller* controller
= g_input_manager
->get_controller();
- if(controller->hold(Controller::UP))
+ Controller* controller
_ = InputManager::current()
->get_controller();
+ if(controller
_
->hold(Controller::UP))
input_direction = D_NORTH;
input_direction = D_NORTH;
- else if(controller->hold(Controller::DOWN))
+ else if(controller
_
->hold(Controller::DOWN))
input_direction = D_SOUTH;
input_direction = D_SOUTH;
- else if(controller->hold(Controller::LEFT))
+ else if(controller
_
->hold(Controller::LEFT))
input_direction = D_WEST;
input_direction = D_WEST;
- else if(controller->hold(Controller::RIGHT))
+ else if(controller
_
->hold(Controller::RIGHT))
input_direction = D_EAST;
}
input_direction = D_EAST;
}