From: Ondřej Hošek Date: Tue, 9 May 2006 18:41:48 +0000 (+0000) Subject: Small script fixes X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3681cbb21ea860e39a4c678696da16f2630524aa;p=supertux.git Small script fixes SVN-Revision: 3504 --- 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);