An example of how to embed and use custom sounds with dustscripting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string EMBED_sound1 = "test1.ogg"; | |
class script { | |
scene@ g; | |
script() { | |
@g = get_scene(); | |
} | |
void build_sounds(message@ msg) { | |
msg.set_string("test1", "sound1"); | |
msg.set_int("test1|loop", 44100 * 2); // 2 seconds in | |
} | |
void on_level_start() { | |
g.play_script_stream("test1", 1, 0, 0, true, 1.0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment