I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Seirei on December 20, 2015, 07:45:34 PM

Title: Can I delay the 'Game Over' music?
Post by: Seirei on December 20, 2015, 07:45:34 PM
Hey guys!

I'm new to the whole fangame thing and I'm currently experimenting with Game Maker Studio and the YoYoYo Engine.

I'm currently trying to delay the music that plays on death. I tried it by adding the music to an alarm in the Game Over object, wich worked perfectly, but it doesn't reset on pressing 'R'.

Then I tried to put it in the script for the Player Kill, but I just can't get it to delay.

So what would be the correct way to do this?

Thanks in advance!
Title: Re: Can I delay the 'Game Over' music?
Post by: infern0man1 on December 20, 2015, 08:34:53 PM
In a press R event, put sound_stop(sndOnDeath);
Title: Re: Can I delay the 'Game Over' music?
Post by: Seirei on December 20, 2015, 08:52:41 PM
Well, that was easy! :D

But now, if someone rebinds his R-Key it wouldn't work, right? I guess that's very unlikeley so I'll just keep it like that anyway.

Thanks a lot!
Title: Re: Can I delay the 'Game Over' music?
Post by: lawatson on December 20, 2015, 09:15:04 PM
you would then use global.resetkey or something, i know that's a variable that exists in some engines (i think yuuutu) you'll have to see how it works in studio engines though.
Title: Re: Can I delay the 'Game Over' music?
Post by: Seirei on December 20, 2015, 10:41:07 PM
Sooo funny thing.

If I put the following code into the Step event:
if(keyboard_check_pressed(global.shotbutton))
    audio_stop_sound(musGameOver);

I can stop the music using the my shoot button.

If I use global.restartbutton, which is the one that's bind to R, the music keeps going.

Guess I'll have to stick to the previous method for now.