-if(! ("intro_displayed" in state)) {
- load_level("levels/world1/intro.stl");
- wait_for_screenswitch();
- wait_for_screenswitch();
- state.intro_displayed <- true;
+if(! ("world" in state)) {
+ state.world <- "levels/world1/worldmap.stwm";
save_state();
}
-load_worldmap("levels/world1/worldmap.stwm");
+
+// load worldmap and wait till it is displayed
+load_worldmap(state.world);
wait_for_screenswitch();
save_state();
-wait_for_screenswitch();
-save_state();
-print("Goodbye from world1\n");
+
+worldthread <- get_current_thread();
+// wait for worldchanges
+while(true) {
+ ::suspend();
+ exit_screen();
+ load_worldmap(state.world);
+ save_state();
+}
+