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