Hello. I got the sound code working. But, I couldn't get the sound to continue until the song fades into the start of "Story Mode". Also, is there another code that plays a different song when the function enters story mode? Thanks.
Here is the code.
[[GAME MENU]]:
@title Game
{GAMESOUND01}
Beta Version
[[Click to Start]](MAIN MENU)
[[MAIN MENU]]:
@clear
Arcade Mode:
[[Story Mode]](Story Mode)
Challenge Mode:
Characters:
Gallery:
Options
[[Story Mode]]:
@clear
@title clear_timeout
[[Beginning]](New Story)
[[New Story]]:
@clear
The Story begins
[[GAMESOUND01]]:
[[start]]:
squiffy.ui.write('<audio id="ogg-audio" src="http://media.textadventures.co.uk/games/1RurGHLuLUqrWdMJh53LTQ/bushcave-explicit-r9/sounds/bushcave.ogg" autoplay />');
squiffy.ui.write("Welcome to the game!");
squiffy.story.go("loop audio");
[[stop audio]]
[[stop audio]]:
document.getElementById("ogg-audio").pause();
document.getElementById("ogg-audio").currentTime=0;
[[play audio]]
[[play audio]]:
document.getElementById("ogg-audio").play();
[[stop audio]]
[[loop audio]]:
document.getElementById("ogg-audio").loop = true;
[[stop audio]]
To change the audio's source:
[[start]]:
squiffy.ui.write('<audio id="ogg-audio" src="http://media.textadventures.co.uk/games/1RurGHLuLUqrWdMJh53LTQ/bushcave-explicit-r9/sounds/bushcave.ogg" autoplay />');
squiffy.ui.write("Welcome to the game!");
squiffy.story.go("loop audio");
[[stop audio]]:
document.getElementById("ogg-audio").pause();
document.getElementById("ogg-audio").currentTime=0;
[[play audio]]
[[change src]]
[[play audio]]:
document.getElementById("ogg-audio").play();
[[stop audio]]
[[change src]]
[[change src]]:
document.getElementById("ogg-audio").loop = false;
document.getElementById("ogg-audio").src = "http://media.textadventures.co.uk/games/6qJLyNxxokqakBDCUdwE2Q/snd_effect.ogg";
[[loop audio]]:
document.getElementById("ogg-audio").loop = true;
[[stop audio]]
[[change src]]