Tux::Tux(WorldMap* worldmap_)
: worldmap(worldmap_)
{
- tux_sprite = sprite_manager->create("worldmaptux");
+ tux_sprite = sprite_manager->create("images/worldmap/common/tux.sprite");
offset = 0;
moving = false;
{
switch (player_status->bonus) {
case GROWUP_BONUS:
- tux_sprite->set_action("large");
+ tux_sprite->set_action(moving ? "large-walking" : "large-stop");
break;
case FIRE_BONUS:
- tux_sprite->set_action("fire");
+ tux_sprite->set_action(moving ? "fire-walking" : "fire-stop");
break;
case NO_BONUS:
- tux_sprite->set_action("small");
+ tux_sprite->set_action(moving ? "small-walking" : "small-stop");
break;
default:
#ifdef DEBUG
std::cerr << "Bonus type not handled in worldmap.\n";
#endif
- tux_sprite->set_action("large");
+ tux_sprite->set_action("large-stop");
break;
}
teleporterdot = new Surface("images/worldmap/common/teleporterdot.png");
name = "<no title>";
- music = "salcon.ogg";
+ music = "music/salcon.ogg";
intro_displayed = false;
total_stats.reset();
level_lisp->get("quit-worldmap", level.quit_worldmap);
level_lisp->get("name", level.name);
+
+ if (!PHYSFS_exists((levels_path + level.name).c_str()))
+ {
+ // Do we want to bail out instead...? We might get messages from modders
+ // who can't make their levels run because they're too dumb to watch
+ // their terminals...
+ std::cerr << "Error: level file '" << level.name
+ << "' does not exist and will not be added to the worldmap." << std::endl;
+ return;
+ }
+
level_lisp->get("x", level.pos.x);
level_lisp->get("y", level.pos.y);
break;
}
- sound_manager->play_music(std::string("music/") + music);
+ sound_manager->play_music(music);
Menu::set_current(0);
if (!savegame_file.empty())
savegame(savegame_file);
quit = false;
- sound_manager->play_music(std::string("music/") + music);
+ sound_manager->play_music(music);
if(!intro_displayed && intro_script != "") {
try {
return;
std::string dir = FileSystem::dirname(filename);
- if(PHYSFS_exists(dir.c_str()) == 0 && PHYSFS_mkdir(dir.c_str()) == 0) {
+ if(PHYSFS_exists(dir.c_str()) == 0 && PHYSFS_mkdir(dir.c_str()) != 0) {
std::ostringstream msg;
msg << "Couldn't create directory '" << dir << "' for savegame:"
<< PHYSFS_getLastError();