Skip to content

Instantly share code, notes, and snippets.

@msg555
Created Oct 20, 2017
Embed
What would you like to do?
An example of how to embed and use custom sounds with dustscripting.
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