Playing music then changing rooms [SOLVED]

Started by Kurdt, Mon 08/10/2007 04:05:11

Previous topic - Next topic

Kurdt

Here's the deal:

I've got a screen on which I'm showing my title card. When the game loads, it flashes a static "Kurdt's Awesome Game Production Company" (or whatever I name my brand) and plays a little piece of fanfare over it. When the music ends (aka it's not looped) I want to call the ChangeRoom function to move on. Is there a specific code I could use for this, a "Change room when the music stops" function I haven't found?

I've got a few theories that I haven't put into practice yet (I'm at work at the moment), but I'm just checking to see if there's a simpler way than how I'm thinking to do it.

This is how I've got it figured:

Code: ags
SetMusicRepeat(0);
PlayMusic(2);
Wait(360); //a 9 second piece of music
cEgo.ChangeRoom(1);


Is there some unknown way to do it simpler than that, without using the Wait function perhaps?
"The reason why so few good books are written is that so few people who can write know anything."

Khris

There's no simpler way I can think of.
That's the way to do things like that :)

Kurdt

Oh my God. Does that mean I might actually understand something in AGS? I don't think I can do this anymore. ;D
"The reason why so few good books are written is that so few people who can write know anything."

Khris

Of course it'd be a whole different story if you wanted the code to be non-blocking. In this case you'd have to use a timer.

SMF spam blocked by CleanTalk