From: Christoph Sommer Date: Fri, 18 Aug 2006 00:03:58 +0000 (+0000) Subject: Icyisland intro is now an ordinary level set to "auto-play". / X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9fa95a3f4318f71b151a57035a6a8d5732b5ed95;p=supertux.git Icyisland intro is now an ordinary level set to "auto-play". / Intro now plays music as music, not as sound. / Added teleporter from world2 back to world1 SVN-Revision: 4197 --- diff --git a/data/levels/world1/intro.nut b/data/levels/world1/intro.nut index 04ac9201c..b38be37be 100644 --- a/data/levels/world1/intro.nut +++ b/data/levels/world1/intro.nut @@ -13,7 +13,6 @@ function intro() //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); diff --git a/data/levels/world1/intro.stl b/data/levels/world1/intro.stl index ecc4b79d0..1fd632616 100644 --- a/data/levels/world1/intro.stl +++ b/data/levels/world1/intro.stl @@ -8,7 +8,7 @@ Level.finish(true); ") (sector (name "main") - (music "") + (music "music/intro.ogg") (init-script " import(\"levels/world1/intro.nut\"); intro(); diff --git a/data/levels/world1/worldmap.stwm b/data/levels/world1/worldmap.stwm index 1fccca240..4742c6390 100644 --- a/data/levels/world1/worldmap.stwm +++ b/data/levels/world1/worldmap.stwm @@ -8,7 +8,7 @@ (worldmap-spawnpoint (name "main") (x 22) - (y 5) + (y 4) ) (worldmap-spawnpoint (name "world2") @@ -172,6 +172,7 @@ (x 22) (y 4) (sprite "images/objects/invisible/invisible.sprite") + (auto-play #t) ) (special-tile (teleport-to-x 0) diff --git a/data/levels/world2/worldmap.stwm b/data/levels/world2/worldmap.stwm index 626799b22..60acfd374 100644 --- a/data/levels/world2/worldmap.stwm +++ b/data/levels/world2/worldmap.stwm @@ -216,9 +216,10 @@ (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) ) diff --git a/src/worldmap/level.cpp b/src/worldmap/level.cpp index 129f493a4..aafa66035 100644 --- a/src/worldmap/level.cpp +++ b/src/worldmap/level.cpp @@ -32,12 +32,13 @@ namespace WorldMapNS { 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); diff --git a/src/worldmap/level.hpp b/src/worldmap/level.hpp index dabd4d740..eb577f226 100644 --- a/src/worldmap/level.hpp +++ b/src/worldmap/level.hpp @@ -44,6 +44,7 @@ public: 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; diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 23c99d8b3..920cf8cca 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -539,6 +539,13 @@ WorldMap::update(float delta) } } + // 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 */