Icyisland intro is now an ordinary level set to "auto-play". /
[supertux.git] / data / levels / world1 / intro.nut
1 function intro()
2 {  
3   //initialize
4   SUPERTUX.set_action("stand-right");
5   RADIO.set_action("quiet");  
6   PENNY.set_action("stand-left");
7   NOLOK.set_visible(false);
8   logo <- FloatingImage("images/objects/logo/logo.sprite");
9   Tux.deactivate();
10   Tux.set_visible(false);
11   Effect.sixteen_to_nine(0);
12   
13   //begin scrolling sequence
14   Effect.fade_in(2);
15   Camera.scroll_to(0, 945, 15);
16   wait(3);
17   Text.set_text("Somewhere at the shores\nof Antarctica...");
18   Text.fade_in(2);
19   wait(3);
20   Text.fade_out(2);
21   wait(10);
22   SUPERTUX.set_velocity(50,0);
23   Camera.scroll_to(3100, 945, 18);
24   wait(10);
25   logo.set_anchor_point(ANCHOR_TOP);
26   logo.set_pos(0, 90);
27   logo.set_visible(true);
28   wait(5);
29   logo.set_visible(false);
30   wait(6);
31   
32   //begin conversation and Tux rap
33   SUPERTUX.set_velocity(0,0);
34   play_sound("speech/tux_hello.ogg");
35   wait(3);
36   play_sound("speech/penny_runt_01.ogg");
37   wait(1);
38   play_sound("speech/tux_murp_01.ogg");
39   wait(1);
40   RADIO.set_action("loud");
41   play_sound("speech/tux_rap.ogg");
42   wait(15);
43   shake_bush();
44   wait(2);
45   shake_bush();
46   wait(2);
47   shake_bush();
48   wait(1.3);
49   
50   //enter Nolok
51   NOLOK.set_velocity(-220, 600);
52   NOLOK.set_visible(true);
53   Effect.fade_out(1.3);
54   wait(3);
55
56   //darkness
57   NOLOK.set_visible(false);
58   PENNY.set_visible(false);
59   RADIO.set_action("quiet");
60   SUPERTUX.set_pos(3550, SUPERTUX.get_pos_y());
61
62   //wake up, Tux...
63   Effect.fade_in(4);
64   wait(4);
65   play_sound("speech/tux_upset.ogg");
66   wait(3);
67   tux_upset();
68   wait(1);
69   tux_upset();
70   wait(4);
71   SUPERTUX.set_action("stand-right");
72   SUPERTUX.set_velocity(300,0);
73   wait(2);
74   
75   //end intro sequence
76   Effect.fade_out(2);
77   wait(3);
78   Level.finish(true);
79 }
80
81 function shake_bush()
82 {
83   //play_sound("sounds/rustle.wav");
84   local bushx = BUSH.get_pos_x();
85   local bushy = BUSH.get_pos_y();
86   for(local i = 0; i < 20; ++i) {
87     BUSH.set_pos(bushx + ( rand() % 6 ) - 3, bushy);
88     wait(0.05);
89   }
90 }
91
92 function tux_upset()
93 {
94   SUPERTUX.set_action("stand-right");
95   SUPERTUX.set_velocity(200,0);
96   wait(0.3);
97   SUPERTUX.set_velocity(0,0);
98   wait(0.4);
99   SUPERTUX.set_action("stand-left");
100   SUPERTUX.set_velocity(-200,0);
101   wait(0.3);
102 }
103