* Fix main.cpp again
[supertux.git] / data / levels / world1 / intro.nut
1 function intro()
2 {  
3   //initialize
4   Camera.set_mode("manual");
5   Tux.deactivate();
6 //  Tux.set_position(2291,1280);
7   Tux.add_bonus("grow");
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   Effect.sixteen_to_nine(0);
13   
14   //begin scrolling sequence
15   Effect.fade_in(2);
16   Camera.scroll_to(0, 945, 15);
17   wait(3);
18   Text.set_text(translate ("Somewhere at the shores\nof Antarctica..."));
19   Text.fade_in(2);
20   wait(3);
21   Text.fade_out(2);
22   wait(10);
23   Tux.walk(0);
24   Camera.scroll_to(3100, 945, 18);
25   wait(6);
26   logo.set_anchor_point(ANCHOR_TOP);
27   logo.set_pos(0, -120);
28   logo.set_visible(true);
29   logo.fade_in(2);
30   logo_in();
31   wait(6);
32   logo.fade_out(2);
33   wait(2);
34   logo.set_visible(false);
35   wait(5.3);
36   
37   //begin conversation and Tux rap
38   Tux.walk(0);
39   play_sound("speech/tux_hello.ogg");
40   wait(3);
41   play_sound("speech/penny_runt_01.ogg");
42   wait(1);
43   play_sound("speech/tux_murp_01.ogg");
44   wait(1);
45   RADIO.set_action("loud");
46   play_sound("speech/tux_rap.ogg");
47   wait(15);
48   shake_bush();
49   wait(2);
50   shake_bush();
51   wait(2);
52   shake_bush();
53   wait(1.3);
54   
55   //enter Nolok
56   NOLOK.set_velocity(-220, 600);
57   NOLOK.set_visible(true);
58   Effect.fade_out(1.3);
59   wait(3);
60
61   //darkness
62   NOLOK.set_visible(false);
63   PENNY.set_visible(false);
64   RADIO.set_action("quiet");
65 //  Tux.set_position(3550, 1270);
66
67   //wake up, Tux...
68   Effect.fade_in(4);
69   wait(4);
70   play_sound("speech/tux_upset.ogg");
71   wait(3);
72   tux_upset();
73   wait(1);
74   tux_upset();
75   wait(4);
76   Tux.walk(3000);
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   //play_sound("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   Tux.walk(200);
99   wait(1);
100   Tux.walk(0);
101   wait(1);
102   Tux.walk(-200);
103   wait(1);
104   Tux.walk(0);
105 }
106
107 function logo_in()
108 {
109   local i;
110   for(local i = -120; i <= 90; i+=2) {
111     logo.set_pos(0, i);
112     wait(0.01);
113   }
114 }