From 3681cbb21ea860e39a4c678696da16f2630524aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Ho=C5=A1ek?= Date: Tue, 9 May 2006 18:41:48 +0000 Subject: [PATCH] Small script fixes SVN-Revision: 3504 --- data/levels/world2/default.nut | 22 ++++++++++++++++++---- data/scripts/default.nut | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/data/levels/world2/default.nut b/data/levels/world2/default.nut index f271897fa..5d43ea58f 100644 --- a/data/levels/world2/default.nut +++ b/data/levels/world2/default.nut @@ -1,15 +1,29 @@ - +function add_key(key) +{ + local keys = state.world2_keys; + if (key == "brass") + keys.brass = true; + else if (key == "iron") + keys.iron = true; + else if (key == "bronze") + keys.bronze = true; + else if (key == "silver") + keys.silver = true; + else if (key == "gold") + keys.gold = true; + update_keys(); +} function get_gold_key() { - add_key(KEY_GOLD); + add_key("gold"); end_level(); } function level2_init() { - add_key(KEY_BRASS); - add_key(KEY_IRON); + add_key("brass"); + add_key("iron"); Tux.deactivate(); Effect.sixteen_to_nine(2); Text.set_text(translate("---Insert Cutscene Here---")); diff --git a/data/scripts/default.nut b/data/scripts/default.nut index 981913a69..106e7ba82 100644 --- a/data/scripts/default.nut +++ b/data/scripts/default.nut @@ -7,7 +7,7 @@ // TODO: move this to world2 function end_level() { - Sound.play_music("music/leveldone.ogg"); + play_music("music/leveldone.ogg"); Tux.deactivate(); wait(6); Effect.fade_out(2); -- 2.11.0