981913a692356328773fa19898b7ceda7f311a46
[supertux.git] / data / scripts / default.nut
1 /**
2  * This script gets loaded into the squirrel root vm in supertux. So functions
3  * and variables you define here can be used in all threads
4  */
5
6
7 // TODO: move this to world2
8 function end_level()
9 {
10   Sound.play_music("music/leveldone.ogg");
11   Tux.deactivate();
12   wait(6);
13   Effect.fade_out(2);
14   wait(2);
15   Level.finish(true);
16 }
17
18 function levelflip()
19 {
20   Effect.fade_out(1);
21   wait(1);
22   Level.flip_vertically();
23   Effect.fade_in(1);
24 }
25
26 function println(val)
27 {
28         print(val);
29         print("\n");
30 }
31
32 if(! ("state" in this))
33   state <- {};
34