Created
December 31, 2018 14:09
-
-
Save angstsmurf/780ba80d91f9e13ec81c4de5c239d131 to your computer and use it in GitHub Desktop.
Inform 7 sound notification example code
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
"Sounds after each other" by Phosphate | |
Include version 10/160919 of Glulx Entry Points by Emily Short. | |
Use direct event handling. | |
The Sound Stage is a room. "You can hear two songs alternating in the background." | |
Sound 1 is the file "song1.ogg". | |
Sound 2 is the file "song2.ogg". | |
When play begins: | |
unless glk sound notification is supported: | |
say "This interpreter does not support sound notifications! Song alternation won't work!"; | |
play Sound 1 with notification. | |
To play (SFX - sound name) with notification: | |
(- glk_schannel_play_ext(gg_foregroundchan, ResourceIDsOfSounds-->{SFX},1,1); -). | |
Glulx input handling rule for a sound-notify-event: | |
let sound id be glk event value 1; | |
if sound id is the Glulx resource ID of Sound 1: | |
play Sound 2 with notification; | |
otherwise: | |
play Sound 1 with notification. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment