Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hoffenlarft on Fri 27/01/2006 04:08:06

Title: Music End
Post by: Hoffenlarft on Fri 27/01/2006 04:08:06
Hello, I was trying to attemp a little thing for my game. What I want is that when the music that it's currently runing in a room stops, the game quit. Any answers?
Title: Re: Music End
Post by: Gilbert on Fri 27/01/2006 04:23:29
Put in repeatedly_execute() of the room:
if(IsMusicPlaying()==0) QuitGame(0);

However, if the player had set up the game to play without sound, the game would be quitted immediately upon entering the room (unless you want to force people to play your game with music, which is what I think you're going to). Alternate way is to time your music yourself, remember how long it will play, start a timer when the player enters the room. and then check if it expires in rep_ex() and quit if expired.