)
(powerup (x 8000) (y 352)
(sprite "key-gold")
- (script "add_key(KEY_GOLD);
- Sound.play_music(\"leveldone\");
- wait(6);
- DisplayEffect.fade_out(2);
- wait(2);
- Level.finish();")
+ (script "get_gold_key();")
)
(infoblock (x 2560) (y 320)
(message (_ "-Oh no!
--- /dev/null
+
+function get_gold_key()
+{
+ add_key(KEY_GOLD);
+ end_level();
+}
+
+function end_level()
+{
+ Sound.play_music("leveldone");
+ wait(6);
+ DisplayEffect.fade_out(2);
+ wait(2);
+ Level.finish();
+}
// load global default.nut file if it exists
//TODO: Load all .nut files from that directory
try {
- std::string filename = "data/script/default.nut";
+ std::string filename = "script/default.nut";
IFileStream in(filename);
interpreter->run_script(in, filename, false);
} catch(std::exception& e) {