first very unfinished and unpolished version of the intro
[supertux.git] / data / levels / world1 / default.nut
1 function intro()
2 {
3   SUPERTUX.set_action("stand-right");
4   Tux.deactivate();
5   Tux.set_visible(false);
6   DisplayEffect.sixteen_to_nine(0);
7   DisplayEffect.fade_in(2);
8   wait(2);
9
10   Text.set_text(translate("Tux and Penny were out having a\n nice picnic on the\nice fields of Antarctica."));
11   Text.fade_in(1);
12 // TODO play some tux sounds...
13   wait(1);
14
15   Sound.play("speech/tux_rap.ogg");
16   wait(5);
17   Text.fade_out(1);
18   wait(15);
19
20   Text.set_text(translate("Then suddenly..."));
21   Text.fade_in(1);
22
23 // let's shake the bush...
24   // Sound.play("sounds/rustle.wav");
25   local bushx = BUSH.get_pos_x();
26   local bushy = BUSH.get_pos_y();
27   for(local i = 0; i < 20; ++i) {
28     BUSH.set_pos(bushx + rand() % 6 - 3, bushy);
29     wait(0.1);
30   }
31   Text.fade_out(1);
32
33 // NOLOK jumps out of the bush
34   wait(0.5);
35   print("jump");
36   NOLOK.set_velocity(70, 600);
37
38   wait(1)
39   NOLOK.set_velocity(-120, 700);
40   wait(2);
41
42 // nolok casts his spell...
43   NOLOK.set_action("throw");
44   // TODO we really need fade to white here and some thunder sound...
45   DisplayEffect.fade_out(0.3);
46   wait(0.3);
47   DisplayEffect.fade_in(0);
48   wait(0.3);
49   DisplayEffect.fade_out(0.5);
50   wait(0.5);
51   DisplayEffect.fade_in(0);
52   wait(0.4);
53   DisplayEffect.fade_out(0.2);
54   wait(2.5);
55   NOLOK.set_visible(false);
56   PENNY.set_visible(false);
57   DisplayEffect.fade_in(1);
58   wait(1);
59
60   Text.set_text("Oh No!\nPenny has been captured");
61   Text.fade_in(1);
62   wait(3);
63   Text.fade_out(1);
64   
65   Text.set_text("Tux has to rescue her");
66   Text.fade_in(1);
67   wait(5);
68
69 // fade out
70   DisplayEffect.fade_out(2);
71   wait(2);
72   Level.finish();
73 }