(images "tiles/doodads/platter.png")
)
)
- (sprite
- (name "gold-key")
+ (sprite
+ (name "key-brass")
+ (action
+ (name "default")
+ (images "objects/keys/key_brass.png")
+ )
+ (action
+ (name "display")
+ (images "objects/keys/display_brass.png")
+ )
+ (action
+ (name "outline")
+ (images "objects/keys/outline_brass.png")
+ )
+
+ )
+ (sprite
+ (name "key-iron")
+ (action
+ (name "default")
+ (images "objects/keys/key_iron.png")
+ )
+ (action
+ (name "display")
+ (images "objects/keys/display_iron.png")
+ )
+ (action
+ (name "outline")
+ (images "objects/keys/outline_iron.png")
+ )
+ )
+ (sprite
+ (name "key-bronze")
+ (action
+ (name "default")
+ (images "objects/keys/key_bronze.png")
+ )
+ (action
+ (name "display")
+ (images "objects/keys/display_bronze.png")
+ )
+ (action
+ (name "outline")
+ (images "objects/keys/outline_bronze.png")
+ )
+ )
+ (sprite
+ (name "key-silver")
+ (action
+ (name "default")
+ (images "objects/keys/key_silver.png")
+ )
+ (action
+ (name "display")
+ (images "objects/keys/display_silver.png")
+ )
+ (action
+ (name "outline")
+ (images "objects/keys/outline_silver.png")
+ )
+ )
+ (sprite
+ (name "key-gold")
(action
(name "default")
(images "objects/keys/key_gold.png")
)
+ (action
+ (name "display")
+ (images "objects/keys/display_gold.png")
+ )
+ (action
+ (name "outline")
+ (images "objects/keys/outline_gold.png")
+ )
)
)
")
)
(powerup (x 8000) (y 352)
- (sprite "gold-key")
- (script "wait(7);
+ (sprite "key-gold")
+ (script "add_key(KEY_GOLD);
+ Sound.play_music(\"leveldone\");
+ wait(6);
+ DisplayEffect.fade_out(2);
+ wait(2);
Level.finish();")
)
(infoblock (x 2560) (y 320)
context.draw_center_text(gold_text, level->get_name(), Vector(0, 160),
LAYER_FOREGROUND1);
- sprintf(str, "TUX x %d", player_status.lives);
+ sprintf(str, "TUX x %d", player_status->lives);
context.draw_text(white_text, str, Vector(SCREEN_WIDTH/2, 210),
CENTER_ALLIGN, LAYER_FOREGROUND1);
tux.set_bonus(ICE_BONUS, false);
}
if(main_controller->check_cheatcode("lifeup")) {
- player_status.lives++;
+ player_status->lives++;
}
if(main_controller->check_cheatcode("lifedown")) {
- player_status.lives--;
+ player_status->lives--;
}
if(main_controller->check_cheatcode("grease")) {
tux.physic.set_velocity_x(tux.physic.get_velocity_x()*3);
}
if(main_controller->check_cheatcode("kill")) {
// kill Tux, but without losing a life
- player_status.lives++;
+ player_status->lives++;
tux.kill(tux.KILL);
}
#if 0
exit_status = ES_LEVEL_FINISHED;
return;
} else if (!end_sequence && tux->is_dead()) {
- if (player_status.lives < 0) { // No more lives!?
+ if (player_status->lives < 0) { // No more lives!?
exit_status = ES_GAME_OVER;
} else { // Still has lives, so reset Tux to the levelstart
restart_level();
void
GameSession::drawstatus(DrawingContext& context)
{
- player_status.draw(context);
+ player_status->draw(context);
if(config->show_fps) {
char str[60];
snprintf(str, sizeof(str), "%2.1f", fps_fps);
context.draw_text(white_text, "FPS",
Vector(SCREEN_WIDTH -
- white_text->get_text_width("FPS "), 40),
+ white_text->get_text_width("FPS ") - BORDER_X, BORDER_Y + 40),
LEFT_ALLIGN, LAYER_FOREGROUND1);
context.draw_text(gold_text, str,
- Vector(SCREEN_WIDTH-4*16, 40),
+ Vector(SCREEN_WIDTH-4*16 - BORDER_X, BORDER_Y + 40),
LEFT_ALLIGN, LAYER_FOREGROUND1);
}
}
sprintf(str, _("SCORE: %d"), global_stats.get_points(SCORE_STAT));
context.draw_text(gold_text, str, Vector(SCREEN_WIDTH/2, 224), CENTER_ALLIGN, LAYER_FOREGROUND1);
- sprintf(str, _("COINS: %d"), player_status.coins);
+ sprintf(str, _("COINS: %d"), player_status->coins);
context.draw_text(gold_text, str, Vector(SCREEN_WIDTH/2, 256), CENTER_ALLIGN, LAYER_FOREGROUND1);
context.do_drawing();
#include "physic.hpp"
#include "control/controller.hpp"
#include "player_status.hpp"
+#include "scripting/player.hpp"
class BadGuy;
class Portable;
extern TuxBodyParts* fire_tux;
extern TuxBodyParts* ice_tux;
-class Player : public MovingObject
+class Player : public MovingObject, public Scripting::Player
{
public:
enum HurtMode { KILL, SHRINK };
#include "gettext.hpp"
#include "video/drawing_context.hpp"
#include "audio/sound_manager.hpp"
+#include "sprite/sprite_manager.hpp"
+#include "math/vector.hpp"
#include "main.hpp"
static const int START_LIVES = 4;
static const int MAX_LIVES = 99;
-PlayerStatus player_status;
+PlayerStatus* player_status = 0;
PlayerStatus::PlayerStatus()
: coins(0),
score_multiplier(1),
max_score_multiplier(1)
{
+ reset();
+ key_brass = sprite_manager->create("key-brass");
+ key_iron = sprite_manager->create("key-iron");
+ key_bronze = sprite_manager->create("key-bronze");
+ key_silver = sprite_manager->create("key-silver");
+ key_gold = sprite_manager->create("key-gold");
+ key_brass->set_action("outline");
+ key_iron->set_action("outline");
+ key_bronze->set_action("outline");
+ key_silver->set_action("outline");
+ key_gold->set_action("outline");
+}
+
+PlayerStatus::~PlayerStatus()
+{
+ delete key_brass;
+ delete key_iron;
+ delete key_bronze;
+ delete key_silver;
+ delete key_gold;
}
void PlayerStatus::reset()
{
coins = 0;
+ keys = 0;
lives = START_LIVES;
bonus = NO_BONUS;
score_multiplier = 1;
}
void
+PlayerStatus::set_keys(int new_key)
+{
+ keys |= new_key;
+ key_brass->set_action(keys & KEY_BRASS ? "display" : "outline");
+ key_iron->set_action(keys & KEY_IRON ? "display" : "outline");
+ key_bronze->set_action(keys & KEY_BRONZE ? "display" : "outline");
+ key_silver->set_action(keys & KEY_SILVER ? "display" : "outline");
+ key_gold->set_action(keys & KEY_GOLD ? "display" : "outline");
+}
+
+void
PlayerStatus::write(lisp::Writer& writer)
{
switch(bonus) {
std::cerr << "Unknown bonus type.\n";
writer.write_string("bonus", "none");
}
+ writer.write_bool("key-brass", keys & KEY_BRASS);
+ writer.write_bool("key-iron", keys & KEY_IRON);
+ writer.write_bool("key-bronze", keys & KEY_BRONZE);
+ writer.write_bool("key-silver", keys & KEY_SILVER);
+ writer.write_bool("key-gold", keys & KEY_GOLD);
writer.write_int("lives", lives);
writer.write_int("coins", coins);
bonus = NO_BONUS;
}
}
+ bool val;
+ if(lisp.get("key-brass", val) && val == true)
+ set_keys(KEY_BRASS);
+ if(lisp.get("key-iron", val) && val == true)
+ set_keys(KEY_IRON);
+ if(lisp.get("key-bronze", val) && val == true)
+ set_keys(KEY_BRONZE);
+ if(lisp.get("key-silver", val) && val == true)
+ set_keys(KEY_SILVER);
+ if(lisp.get("key-gold", val) && val == true)
+ set_keys(KEY_GOLD);
lisp.get("lives", lives);
lisp.get("coins", coins);
}
void
+PlayerStatus::draw_keys(DrawingContext& context)
+{
+ const float SPACING = 10;
+ float x,y;
+ x = BORDER_X; y = BORDER_Y;
+ key_brass->draw(context, Vector(x, y), LAYER_FOREGROUND1);
+ x += key_brass->get_width() + SPACING;
+ key_iron->draw(context, Vector(x, y), LAYER_FOREGROUND1);
+ x += key_iron->get_width() + SPACING;
+ key_bronze->draw(context, Vector(x, y), LAYER_FOREGROUND1);
+ x += key_bronze->get_width() + SPACING;
+ key_silver->draw(context, Vector(x, y), LAYER_FOREGROUND1);
+ x += key_silver->get_width() + SPACING;
+ key_gold->draw(context, Vector(x, y), LAYER_FOREGROUND1);
+ x += key_gold->get_width() + SPACING;
+}
+
+void
PlayerStatus::draw(DrawingContext& context)
{
context.push_transform();
char str[60];
- sprintf(str, " %d", player_status.coins);
+ sprintf(str, " %d", player_status->coins);
const char* coinstext = _("COINS");
context.draw_text(white_text, coinstext,
Vector(SCREEN_WIDTH - white_text->get_text_width(coinstext)
- - white_text->get_text_width(" 99"), 0),
+ - white_text->get_text_width(" 99") - BORDER_X, BORDER_Y),
LEFT_ALLIGN, LAYER_FOREGROUND1);
context.draw_text(gold_text, str,
- Vector(SCREEN_WIDTH - gold_text->get_text_width(" 99"), 0),
+ Vector(SCREEN_WIDTH - gold_text->get_text_width(" 99") - BORDER_X, BORDER_Y),
LEFT_ALLIGN, LAYER_FOREGROUND1);
- if (player_status.lives >= 5) {
- sprintf(str, "%dx", player_status.lives);
+ if (player_status->lives >= 5) {
+ sprintf(str, "%dx", player_status->lives);
float x = SCREEN_WIDTH - gold_text->get_text_width(str) - tux_life->w;
- context.draw_text(gold_text, str, Vector(x, 20), LEFT_ALLIGN,
+ context.draw_text(gold_text, str, Vector(x - BORDER_X, BORDER_Y + 20), LEFT_ALLIGN,
LAYER_FOREGROUND1);
- context.draw_surface(tux_life, Vector(SCREEN_WIDTH - 16, 20),
+ context.draw_surface(tux_life, Vector(SCREEN_WIDTH - 16 - BORDER_X, BORDER_Y + 20),
LAYER_FOREGROUND1);
} else {
- for(int i= 0; i < player_status.lives; ++i)
+ for(int i= 0; i < player_status->lives; ++i)
context.draw_surface(tux_life,
- Vector(SCREEN_WIDTH - tux_life->w*4 +(tux_life->w*i), 20),
+ Vector(SCREEN_WIDTH - tux_life->w*4 +(tux_life->w*i) - BORDER_X, BORDER_Y + 20),
LAYER_FOREGROUND1);
}
const char* livestext = _("LIVES");
context.draw_text(white_text, livestext,
Vector(SCREEN_WIDTH - white_text->get_text_width(livestext)
- - white_text->get_text_width(" 99"), 20),
+ - white_text->get_text_width(" 99") - BORDER_X, BORDER_Y + 20),
LEFT_ALLIGN, LAYER_FOREGROUND1);
+
+ draw_keys(context);
context.pop_transform();
}
#include "lisp/lisp.hpp"
#include "timer.hpp"
#include "serializable.hpp"
+#include "sprite/sprite.hpp"
+
+static const float BORDER_X = 10;
+static const float BORDER_Y = 10;
enum BonusType {
NO_BONUS, GROWUP_BONUS, FIRE_BONUS, ICE_BONUS
{
public:
PlayerStatus();
+ ~PlayerStatus();
void reset();
void incLives();
void incCoins();
+ void set_keys(int new_key);
void write(lisp::Writer& writer);
void read(const lisp::Lisp& lisp);
void draw(DrawingContext& context);
+ void draw_keys(DrawingContext& context);
int coins;
int lives;
int score_multiplier;
int max_score_multiplier;
+
+ enum {
+ KEY_BRASS = 0x001,
+ KEY_IRON = 0x002,
+ KEY_BRONZE = 0x004,
+ KEY_SILVER = 0x008,
+ KEY_GOLD = 0x010,
+ };
+
+private:
+ int keys;
+ Sprite* key_iron;
+ Sprite* key_brass;
+ Sprite* key_bronze;
+ Sprite* key_silver;
+ Sprite* key_gold;
};
// global player state
-extern PlayerStatus player_status;
+extern PlayerStatus* player_status;
#endif
/* Tux life: */
tux_life = new Surface("images/creatures/tux_small/tux-life.png", true);
-
-#if 0
- /* Sound effects: */
- sound_manager->preload_sound("jump");
- sound_manager->preload_sound("bigjump");
- sound_manager->preload_sound("skid");
- sound_manager->preload_sound("coin");
- sound_manager->preload_sound("invincible");
- sound_manager->preload_sound("brick");
- sound_manager->preload_sound("hurt");
- sound_manager->preload_sound("squish");
- sound_manager->preload_sound("fall");
- sound_manager->preload_sound("ricochet");
- sound_manager->preload_sound("bump-upgrade");
- sound_manager->preload_sound("upgrade");
- sound_manager->preload_sound("grow");
- sound_manager->preload_sound("fire-flower");
- sound_manager->preload_sound("shoot");
- sound_manager->preload_sound("lifeup");
- sound_manager->preload_sound("stomp");
- sound_manager->preload_sound("kick");
- sound_manager->preload_sound("explosion");
- sound_manager->preload_sound("warp");
- sound_manager->preload_sound("fireworks");
-#endif
+
+ player_status = new PlayerStatus();
}
/* Free shared data: */
}
}
+void add_key(int new_key)
+{
+ player_status->set_keys(new_key);
+}
+
}
#ifndef SCRIPTING_API
#define __suspend
+#include "player_status.hpp"
#endif
namespace Scripting
{
+//TODO: Get this from PlayerStatus (update MiniSwig!)
+static const int KEY_BRASS = 0x001;
+static const int KEY_IRON = 0x002;
+static const int KEY_BRONZE = 0x004;
+static const int KEY_SILVER = 0x008;
+static const int KEY_GOLD = 0x010;
+
/** displays a text file and scrolls it over the screen */
void display_text_file(const std::string& filename);
/**
* This is typically used to import functions from external files.
*/
void import(HSQUIRRELVM v, const std::string& filename);
+/** add a key to the inventory
+ */
+void add_key(int new_key);
}
{}
#endif
+#if 0
/**
* Set tux bonus.
* This can be "grow", "fireflow" or "iceflower" at the moment
* Give tux more coins
*/
virtual void add_coins(int count) = 0;
+#endif
};
}
std::auto_ptr<ScriptInterpreter> interpreter(
new ScriptInterpreter(workdir));
interpreter->register_sector(sector);
+
+ // load global default.nut file if it exists
+ //TODO: Load all .nut files from that directory
+ try {
+ std::string filename = "data/script/default.nut";
+ IFileStream in(filename);
+ interpreter->run_script(in, filename, false);
+ } catch(std::exception& e) {
+ // nothing
+ }
- // load default.nut file if it exists
+ // load world-specific default.nut file if it exists
try {
std::string filename = workdir + "/default.nut";
IFileStream in(filename);
std::string filename = "music/";
filename += name;
filename += ".ogg";
- sound_manager->play_music(name);
+ sound_manager->play_music(filename);
}
void
return 0;
}
-static int Player_set_bonus_wrapper(HSQUIRRELVM v)
-{
- Scripting::Player* _this;
- sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
- const char* arg0;
- sq_getstring(v, 2, &arg0);
-
- _this->set_bonus(arg0);
-
- return 0;
-}
-
-static int Player_make_invincible_wrapper(HSQUIRRELVM v)
-{
- Scripting::Player* _this;
- sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
-
- _this->make_invincible();
-
- return 0;
-}
-
-static int Player_add_life_wrapper(HSQUIRRELVM v)
-{
- Scripting::Player* _this;
- sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
-
- _this->add_life();
-
- return 0;
-}
-
-static int Player_add_coins_wrapper(HSQUIRRELVM v)
-{
- Scripting::Player* _this;
- sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
- int arg0;
- sq_getinteger(v, 2, &arg0);
-
- _this->add_coins(arg0);
-
- return 0;
-}
-
static int display_text_file_wrapper(HSQUIRRELVM v)
{
const char* arg0;
return 0;
}
+static int add_key_wrapper(HSQUIRRELVM v)
+{
+ int arg0;
+ sq_getinteger(v, 2, &arg0);
+
+ Scripting::add_key(arg0);
+
+ return 0;
+}
+
} // end of namespace Wrapper
void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
using namespace Wrapper;
sq_pushroottable(v);
+ sq_pushstring(v, "KEY_BRASS", -1);
+ sq_pushinteger(v, 1);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ std::ostringstream msg;
+ msg << "Couldn't register constant'KEY_BRASS'";
+ throw SquirrelError(v, msg.str());
+ }
+
+ sq_pushstring(v, "KEY_IRON", -1);
+ sq_pushinteger(v, 2);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ std::ostringstream msg;
+ msg << "Couldn't register constant'KEY_IRON'";
+ throw SquirrelError(v, msg.str());
+ }
+
+ sq_pushstring(v, "KEY_BRONZE", -1);
+ sq_pushinteger(v, 4);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ std::ostringstream msg;
+ msg << "Couldn't register constant'KEY_BRONZE'";
+ throw SquirrelError(v, msg.str());
+ }
+
+ sq_pushstring(v, "KEY_SILVER", -1);
+ sq_pushinteger(v, 8);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ std::ostringstream msg;
+ msg << "Couldn't register constant'KEY_SILVER'";
+ throw SquirrelError(v, msg.str());
+ }
+
+ sq_pushstring(v, "KEY_GOLD", -1);
+ sq_pushinteger(v, 16);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ std::ostringstream msg;
+ msg << "Couldn't register constant'KEY_GOLD'";
+ throw SquirrelError(v, msg.str());
+ }
+
sq_pushstring(v, "display_text_file", -1);
sq_newclosure(v, &display_text_file_wrapper, 0);
if(SQ_FAILED(sq_createslot(v, -3))) {
throw SquirrelError(v, msg.str());
}
+ sq_pushstring(v, "add_key", -1);
+ sq_newclosure(v, &add_key_wrapper, 0);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ std::ostringstream msg;
+ msg << "Couldn't register function'add_key'";
+ throw SquirrelError(v, msg.str());
+ }
+
// Register class DisplayEffect
sq_pushstring(v, "DisplayEffect", -1);
if(sq_newclass(v, SQFalse) < 0) {
msg << "Couldn't create new class 'Player'";
throw SquirrelError(v, msg.str());
}
- sq_pushstring(v, "set_bonus", -1);
- sq_newclosure(v, &Player_set_bonus_wrapper, 0);
- if(SQ_FAILED(sq_createslot(v, -3))) {
- std::ostringstream msg;
- msg << "Couldn't register function'set_bonus'";
- throw SquirrelError(v, msg.str());
- }
-
- sq_pushstring(v, "make_invincible", -1);
- sq_newclosure(v, &Player_make_invincible_wrapper, 0);
- if(SQ_FAILED(sq_createslot(v, -3))) {
- std::ostringstream msg;
- msg << "Couldn't register function'make_invincible'";
- throw SquirrelError(v, msg.str());
- }
-
- sq_pushstring(v, "add_life", -1);
- sq_newclosure(v, &Player_add_life_wrapper, 0);
- if(SQ_FAILED(sq_createslot(v, -3))) {
- std::ostringstream msg;
- msg << "Couldn't register function'add_life'";
- throw SquirrelError(v, msg.str());
- }
-
- sq_pushstring(v, "add_coins", -1);
- sq_newclosure(v, &Player_add_coins_wrapper, 0);
- if(SQ_FAILED(sq_createslot(v, -3))) {
- std::ostringstream msg;
- msg << "Couldn't register function'add_coins'";
- throw SquirrelError(v, msg.str());
- }
-
if(SQ_FAILED(sq_createslot(v, -3))) {
std::ostringstream msg;
msg << "Couldn't register class'Player'";
currentmusic(LEVEL_MUSIC)
{
song_title = "chipdisko.ogg";
- player = new Player(&player_status);
+ player = new Player(player_status);
add_object(player);
#ifdef USE_GRID
static const size_t MAX_ICE_BULLETS = 1;
Bullet* new_bullet = 0;
- if(player_status.bonus == FIRE_BONUS) {
+ if(player_status->bonus == FIRE_BONUS) {
if(bullets.size() > MAX_FIRE_BULLETS-1)
return false;
new_bullet = new Bullet(pos, xm, dir, FIRE_BULLET);
- } else if(player_status.bonus == ICE_BONUS) {
+ } else if(player_status->bonus == ICE_BONUS) {
if(bullets.size() > MAX_ICE_BULLETS-1)
return false;
new_bullet = new Bullet(pos, xm, dir, ICE_BULLET);
*/
void resume_demo()
{
- player_status.reset();
+ player_status->reset();
titlesession->get_current_sector()->activate("main");
titlesession->set_current();
GameSession session(
current_contrib_subset->get_level_filename(index), ST_GL_PLAY);
session.run();
- player_status.reset();
+ player_status->reset();
Menu::set_current(main_menu);
resume_demo();
}
void
Tux::draw(DrawingContext& context)
{
- switch (player_status.bonus) {
+ switch (player_status->bonus) {
case GROWUP_BONUS:
tux_sprite->set_action("large");
break;
if (level->pos == tux->get_tile_pos())
{
sound_manager->stop_music();
- PlayerStatus old_player_status = player_status;
+ PlayerStatus old_player_status = *player_status;
// do a shriking fade to the level
shrink_fade(Vector((level->pos.x*32 + 16 + offset.x),
level_finished = false;
/* In case the player's abort the level, keep it using the old
status. But the minimum lives and no bonus. */
- player_status.coins = old_player_status.coins;
- player_status.lives = std::min(old_player_status.lives, player_status.lives);
- player_status.bonus = NO_BONUS;
+ player_status->coins = old_player_status.coins;
+ player_status->lives = std::min(old_player_status.lives, player_status->lives);
+ player_status->bonus = NO_BONUS;
break;
case GameSession::ES_GAME_OVER:
context.draw_text(blue_text, _("GAMEOVER"),
Vector(SCREEN_WIDTH/2, 200), CENTER_ALLIGN, LAYER_FOREGROUND1);
- sprintf(str, _("COINS: %d"), player_status.coins);
+ sprintf(str, _("COINS: %d"), player_status->coins);
context.draw_text(gold_text, str,
Vector(SCREEN_WIDTH/2, SCREEN_WIDTH - 32), CENTER_ALLIGN,
LAYER_FOREGROUND1);
wait_for_event(2.0, 6.0);
quit = true;
- player_status.reset();
+ player_status->reset();
break;
}
case GameSession::ES_NONE:
context.push_transform();
context.set_translation(Vector(0, 0));
- player_status.draw(context);
+ player_status->draw(context);
if (!tux->is_moving())
{
writer.write_float("x", tux->get_tile_pos().x);
writer.write_float("y", tux->get_tile_pos().y);
writer.write_string("back", direction_to_string(tux->back_direction));
- player_status.write(writer);
+ player_status->write(writer);
writer.write_string("back", direction_to_string(tux->back_direction));
writer.end_list("tux");
load_map();
savegame->get("intro-displayed", intro_displayed);
- savegame->get("lives", player_status.lives);
- savegame->get("coins", player_status.coins);
- savegame->get("max-score-multiplier", player_status.max_score_multiplier);
- if (player_status.lives < 0)
- player_status.reset();
+ savegame->get("lives", player_status->lives);
+ savegame->get("coins", player_status->coins);
+ savegame->get("max-score-multiplier", player_status->max_score_multiplier);
+ if (player_status->lives < 0)
+ player_status->reset();
const lisp::Lisp* tux_lisp = savegame->get_lisp("tux");
if(tux)
tux_lisp->get("x", p.x);
tux_lisp->get("y", p.y);
tux_lisp->get("back", back_str);
- player_status.read(*tux_lisp);
+ player_status->read(*tux_lisp);
tux->back_direction = string_to_direction(back_str);
tux->set_tile_pos(p);
std::cerr << "Problem loading game '" << filename << "': " << e.what()
<< "\n";
load_map();
- player_status.reset();
+ player_status->reset();
}
calculate_total_stats();