123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- function initialize()
- {
- Tux.add_bonus("grow");
- RADIO.set_action("quiet");
- PENNY.set_action("stand-left");
- NOLOK.set_visible(false);
- LOGO.set_visible(false);
- LOGO.enable_gravity(false);
- SIGN.set_visible(false);
- }
- function logo_in()
- {
- local x = LOGO.get_pos_x();
- local y = LOGO.get_pos_y();
- local time = 1.5;
- LOGO.set_pos(x,-120);
- LOGO.set_visible(true);
- LOGO.set_velocity(0,(120+y)/time);
- LOGO.enable_gravity(false);
- wait(time);
- LOGO.set_velocity(0,0);
- wait(3);
- LOGO.set_visible(false);
- }
- function intro_text()
- {
- Text.set_text(_("Somewhere at the shores\nof Antarctica..."));
- Text.fade_in(1);
- wait(1);
- Text.fade_out(1);
- }
- function rap_scene()
- {
- Tux.deactivate();
-
- play_sound("speech/tux_hello.ogg");
- Text.set_centered(false);
- Text.set_text(_("Tux: Hello Penny"));
- Text.fade_in(1);
- wait(2.5);
- Text.fade_out(1);
- wait(1);
- play_sound("speech/penny_runt_01.ogg");
- Text.set_text(_("Penny: Hey Tux"));
- Text.fade_in(0.5);
- wait(1);
- Text.fade_out(0.5);
- wait(0.5);
- play_sound("speech/tux_murp_01.ogg");
- Text.set_text(_("Tux: Check out my dance moves."));
- Text.fade_in(0.5);
- wait(1);
- Text.fade_out(0.5);
- wait(0.5);
- RADIO.set_action("loud");
- play_sound("speech/tux_rap.ogg");
- local t = ::newthread(shake_bush_thread);
- t.call(this);
-
-
-
- wait(6);
- Tux.do_duck();
- Tux.set_dir(false);
- wait(0.40625);
- Tux.do_standup();
- Tux.kick();
- wait(0.40625);
- Tux.set_dir(true);
- wait(0.203125);
- Tux.set_dir(false);
- wait(0.203125);
- Tux.set_dir(true);
- wait(0.09375);
- Tux.do_duck();
- wait(0.5);
- Tux.set_dir(false);
- wait(0.203125);
- Tux.set_dir(true);
- wait(0.203125);
- Tux.set_dir(false);
- wait(0.203125);
- Tux.set_dir(true);
- wait(0.203125);
- Tux.set_dir(false);
- wait(0.203125);
- Tux.set_dir(true);
- Tux.do_standup();
- wait(0.203125);
- Tux.set_dir(false);
- wait(0.203125);
- Tux.kick();
- wait(0.40625);
- Tux.set_dir(true);
- Tux.do_jump(-300);
- wait(0.703125);
- Tux.do_duck();
- wait(0.296875);
- Tux.set_dir(false);
- wait(0.59375);
- Tux.set_dir(true);
- wait(0.703125);
- Tux.do_standup();
- Tux.kick();
- wait(0.5);
- Tux.do_duck();
- wait(0.5);
- Tux.do_backflip();
- wait(79.0/64);
- Tux.walk(200);
- wait(38.0/64);
- Tux.walk(0);
- wait(184.0/64);
- Tux.set_dir(false);
- wait(0.3)
- Tux.kick();
- wait(0.40625);
- Tux.do_duck();
- Tux.set_dir(true);
- wait(0.296875);
- Tux.set_dir(false);
- wait(0.5);
- Tux.do_standup();
- Tux.do_jump(-800);
- wait(1.5);
- Tux.kick();
- wait(0.5);
- Tux.do_duck();
- wait(0.5);
- Tux.do_jump(-400);
- wait(1.0);
- Tux.do_standup();
- wait(0.796875);
- Tux.set_dir(true);
- Tux.do_jump(-520);
- wait(151.0/64);
-
- Tux.activate();
- Tux.kill(false);
- Tux.deactivate();
- wait(1.5);
-
-
- NOLOK.set_visible(false);
- NOLOK.set_solid(false);
- PENNY.set_visible(false);
- PENNY.set_solid(false);
- RADIO.set_visible(false);
- RADIO.set_solid(false);
- SIGN.set_visible(true);
-
- Effect.fade_in(3);
- play_sound("speech/tux_upset.ogg");
- Text.set_text(_("Tux: Oww... my head..."));
- Text.fade_in(1);
- wait(1.9);
- Tux.activate();
- Text.fade_out(0.3);
- wait(0.5);
- Text.set_text(_("Tux: Wait!"));
- Text.fade_in(0.5);
- wait(1);
- Text.fade_out(0.5);
- wait(0.5);
- Text.set_text(_("Tux: Penny!"));
- Text.fade_in(0.5);
- wait(1);
- Text.fade_out(0.5);
- wait(0.5);
- Text.set_text(_("Tux: Where are you, Penny?!"));
- Text.fade_in(0.5);
- wait(2);
- Text.fade_out(0.5);
- wait(0.5);
- Text.set_text(_("Tux: Oh no..."));
- Text.fade_in(0.5);
- wait(1);
- Text.fade_out(0.5);
- wait(0.5);
- Text.set_text(_("Tux: Don't worry, Penny, I'll rescue you!"));
- Text.fade_in(0.5);
- wait(2);
- Text.fade_out(0.5);
- wait(0.5);
- }
- function shake_bush()
- {
-
- local bushx = BUSH.get_pos_x();
- local bushy = BUSH.get_pos_y();
- for(local i = 0; i < 21; ++i) {
- BUSH.set_pos(bushx + ( rand() % 6 ) - 3, bushy);
- wait(0.046875);
- }
- wait(0.015625);
- }
- function shake_bush_thread(table)
- {
- table.wait(8);
- table.shake_bush();
- table.wait(5);
- table.shake_bush();
- table.wait(3);
- table.shake_bush();
- table.wait(2);
- table.shake_bush();
- table.shake_bush();
-
- table.NOLOK.set_velocity(-220, 600);
- table.NOLOK.set_visible(true);
- table.Effect.fade_out(1.3);
- }
- function end_level()
- {
-
- Effect.fade_out(2);
- wait(2.1);
- Level.finish(true);
- }
- state_idx <- 0;
- states <- { init=0, start=1, logo_in=2, intro_text=3, rap_scene=4, end_level=5};
- function trigger_state(state) {
- local idx = states[state];
- if(!idx || idx <= state_idx)
- return;
- state_idx = idx;
- switch(state) {
- case "start":
- initialize();
- break;
- case "logo_in":
- logo_in();
- break;
- case "intro_text":
- intro_text();
- break;
- case "rap_scene":
- rap_scene();
- break;
- case "end_level":
- end_level();
- break;
- }
- }
|