Fixed a tiny spelling mistake that made W1L7 harder to solve.
[supertux.git] / data / levels / test / default.nut
1 /* Default functions for the whole levelset */
2 print("default.nut loaded\n");
3
4 function intro()
5 {  
6   //initialize
7   SUPERTUX.set_action("stand-right");
8   RADIO.set_action("quiet");  
9   PENNY.set_action("stand-left");
10   NOLOK.set_visible(false);
11   logo <- FloatingImage("images/objects/logo/logo.sprite");
12   Tux.deactivate();
13   Tux.set_visible(false);
14   Effect.sixteen_to_nine(0);
15   
16   //begin scrolling sequence
17   Effect.fade_in(2);
18   Camera.scroll_to(0, 945, 15);
19   Sound.play("music/intro.ogg");
20   wait(3);
21   Text.set_text("Somewhere at the shores\nof Antarctica...");
22   Text.fade_in(2);
23   wait(3);
24   Text.fade_out(2);
25   wait(10);
26   SUPERTUX.set_velocity(50,0);
27   Camera.scroll_to(3100, 945, 18);
28   wait(10);
29   logo.set_anchor_point(ANCHOR_TOP);
30   logo.set_pos(0, 50);
31   logo.set_visible(true);
32   wait(5);
33   logo.set_visible(false);
34   wait(6);
35   
36   //begin conversation and Tux rap
37   SUPERTUX.set_velocity(0,0);
38   Sound.play("speech/tux_hello.ogg");
39   wait(3);
40   Sound.play("speech/penny_runt_01.ogg");
41   wait(1);
42   Sound.play("speech/tux_murp_01.ogg");
43   wait(1);
44   RADIO.set_action("loud");
45   Sound.play("speech/tux_rap.ogg");
46   wait(15);
47   shake_bush();
48   wait(2);
49   shake_bush();
50   wait(2);
51   shake_bush();
52   wait(1.3);
53   
54   //enter Nolok
55   NOLOK.set_velocity(-220, 600);
56   NOLOK.set_visible(true);
57   Effect.fade_out(1.3);
58   wait(3);
59
60   //darkness
61   NOLOK.set_visible(false);
62   PENNY.set_visible(false);
63   RADIO.set_action("quiet");
64   SUPERTUX.set_pos(3550, SUPERTUX.get_pos_y());
65
66   //wake up, Tux...
67   Effect.fade_in(4);
68   wait(4);
69   Sound.play("speech/tux_upset.ogg");
70   wait(3);
71   tux_upset();
72   wait(1);
73   tux_upset();
74   wait(4);
75   SUPERTUX.set_action("stand-right");
76   SUPERTUX.set_velocity(300,0);
77   wait(2);
78   
79   //end intro sequence
80   Effect.fade_out(2);
81   wait(3);
82   Level.finish(true);
83 }
84
85 function shake_bush()
86 {
87   //Sound.play("sounds/rustle.wav");
88   local bushx = BUSH.get_pos_x();
89   local bushy = BUSH.get_pos_y();
90   for(local i = 0; i < 20; ++i) {
91     BUSH.set_pos(bushx + rand() % 6 - 3, bushy);
92     wait(0.05);
93   }
94 }
95
96 function tux_upset()
97 {
98   SUPERTUX.set_action("stand-right");
99   SUPERTUX.set_velocity(200,0);
100   wait(0.3);
101   SUPERTUX.set_velocity(0,0);
102   wait(0.4);
103   SUPERTUX.set_action("stand-left");
104   SUPERTUX.set_velocity(-200,0);
105   wait(0.3);
106 }
107
108 function intro_scene2()
109 {
110   //initialize
111   Camera.scroll_to(0, 945, 0);
112   SUPERTUX.set_action("stand-right");
113   SUPERTUX.set_visible(false);
114   NOLOK.set_visible(false);
115   Tux.deactivate();
116   Tux.set_visible(false);
117   Effect.sixteen_to_nine(0);
118   Sound.play("music/nolok.ogg");
119   Effect.fade_in(5);
120   wait(5);
121   Camera.scroll_to(3100, 945, 8);
122   NOLOK.set_visible(true);  
123   NOLOK.set_velocity(500,0);
124   wait(8);
125   SUPERTUX.set_visible(true);
126   SUPERTUX.set_velocity(300,0);
127   wait(24);
128   Level.finish(true);
129 }
130