Tiny example of timer queue to play delayed sounds

Hi all,

One of the areas of NVGT that still heavily requires documentation is the timer_queue class. That's a shame, because that class is super useful! In this case, someone in the NVGT discord asked for an example of how they could make an object that plays various sounds with delays between them and without blocking their entire game loop.

I saw this as an opportunity both to answer this person's question as well as to publicly share a small working example of the timer queue.

While this code is not meant to be copypasted into an application - it doesn't contain a pretty API or something like that, it is still a runnable example of how the timer queue can be used to create a sequence of sound effects. Feel free to rework it for your project.

Hope this is helpful to someone!

delayed_player.nvgt (842 Bytes)