Adjust intro to new image location.
[supertux.git] / data / levels / world1 / intro.nut
1 function intro()
2 {  
3   //initialize
4   SUPERTUX.set_action("big-walk-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(translate ("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(6);
25   logo.set_anchor_point(ANCHOR_TOP);
26   logo.set_pos(0, -120);
27   logo.set_visible(true);
28   logo.fade_in(2);
29   logo_in();
30   wait(6);
31   logo.fade_out(2);
32   wait(2);
33   logo.set_visible(false);
34   wait(5.3);
35   
36   //begin conversation and Tux rap
37   SUPERTUX.set_velocity(0,0);
38   SUPERTUX.set_action("big-stand-right");
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   SUPERTUX.set_pos(3550, SUPERTUX.get_pos_y());
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   SUPERTUX.set_action("big-walk-right");
77   SUPERTUX.set_velocity(300,0);
78   wait(2);
79   
80   //end intro sequence
81   Effect.fade_out(2);
82   wait(3);
83   Level.finish(true);
84 }
85
86 function shake_bush()
87 {
88   //play_sound("sounds/rustle.wav");
89   local bushx = BUSH.get_pos_x();
90   local bushy = BUSH.get_pos_y();
91   for(local i = 0; i < 20; ++i) {
92     BUSH.set_pos(bushx + ( rand() % 6 ) - 3, bushy);
93     wait(0.05);
94   }
95 }
96
97 function tux_upset()
98 {
99   SUPERTUX.set_action("big-walk-right");
100   SUPERTUX.set_velocity(200,0);
101   wait(0.3);
102   SUPERTUX.set_action("big-stand-right");
103   SUPERTUX.set_velocity(0,0);
104   wait(0.4);
105   SUPERTUX.set_action("big-walk-left");
106   SUPERTUX.set_velocity(-200,0);
107   wait(0.3);
108   SUPERTUX.set_action("big-stand-left");
109 }
110
111 function logo_in()
112 {
113   local i;
114   for(local i = -120; i <= 90; i+=2) {
115     logo.set_pos(0, i);
116     wait(0.01);
117   }
118 }