//begin scrolling sequence
Effect.fade_in(2);
Camera.scroll_to(0, 945, 15);
- play_sound("music/intro.ogg");
wait(3);
Text.set_text("Somewhere at the shores\nof Antarctica...");
Text.fade_in(2);
")
(sector
(name "main")
- (music "")
+ (music "music/intro.ogg")
(init-script "
import(\"levels/world1/intro.nut\");
intro();
(worldmap-spawnpoint
(name "main")
(x 22)
- (y 5)
+ (y 4)
)
(worldmap-spawnpoint
(name "world2")
(x 22)
(y 4)
(sprite "images/objects/invisible/invisible.sprite")
+ (auto-play #t)
)
(special-tile
(teleport-to-x 0)
(y 34)
(sprite "images/worldmap/common/shroom.sprite")
)
- (special-tile
- (invisible-tile #t)
- (script "fadeout_screen( 2 );")
+ (teleporter
+ (worldmap "levels/world1/worldmap.stwm")
+ (spawnpoint "world2")
+ (automatic #t)
(x 2)
(y 54)
)
{
LevelTile::LevelTile(const std::string& basedir, const lisp::Lisp* lisp)
- : solved(false), auto_path(true), basedir(basedir), picture_cached(false),
+ : solved(false), auto_play(false), auto_path(true), basedir(basedir), picture_cached(false),
picture(0)
{
lisp->get("name", name);
lisp->get("x", pos.x);
lisp->get("y", pos.y);
+ lisp->get("auto-play", auto_play);
std::string spritefile = "images/worldmap/common/leveldot.sprite";
lisp->get("sprite", spritefile);
Vector pos;
std::string title;
bool solved;
+ bool auto_play; /**< true if Tux should automatically enter this level if it's unfinished */
std::auto_ptr<Sprite> sprite;
}
}
+ // check for auto-play levels
+ LevelTile* level = at_level();
+ if (level && (level->auto_play) && (!level->solved) && (!tux->is_moving())) {
+ enter_level = true;
+ level->solved = true;
+ }
+
if (enter_level && !tux->is_moving())
{
/* Check level action */