#include "sprite/sprite_manager.hpp"
#include "supertux/globals.hpp"
#include "supertux/player_status.hpp"
+#include "supertux/savegame.hpp"
#include "supertux/tile.hpp"
#include "worldmap/level.hpp"
#include "worldmap/tux.hpp"
void
Tux::draw(DrawingContext& context)
{
- switch (worldmap->get_player_status()->bonus) {
+ switch (worldmap->get_savegame().get_player_status()->bonus) {
case GROWUP_BONUS:
sprite->set_action(moving ? "large-walking" : "large-stop");
break;
bool
Tux::canWalk(int tile_data, Direction dir)
{
- return ghost_mode ||
+ return ghost_mode ||
((tile_data & Tile::WORLDMAP_NORTH && dir == D_NORTH) ||
(tile_data & Tile::WORLDMAP_SOUTH && dir == D_SOUTH) ||
(tile_data & Tile::WORLDMAP_EAST && dir == D_EAST) ||
void
Tux::updateInputDirection()
{
- Controller* controller = g_input_manager->get_controller();
- if(controller->hold(Controller::UP))
+ Controller* controller_ = g_input_manager->get_controller();
+ if(controller_->hold(Controller::UP))
input_direction = D_NORTH;
- else if(controller->hold(Controller::DOWN))
+ else if(controller_->hold(Controller::DOWN))
input_direction = D_SOUTH;
- else if(controller->hold(Controller::LEFT))
+ else if(controller_->hold(Controller::LEFT))
input_direction = D_WEST;
- else if(controller->hold(Controller::RIGHT))
+ else if(controller_->hold(Controller::RIGHT))
input_direction = D_EAST;
}