Fangames > Programming Questions

Can I delay the 'Game Over' music?

(1/1)

Seirei:
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!

infern0man1:
In a press R event, put sound_stop(sndOnDeath);

Seirei:
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!

lawatson:
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.

Seirei:
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.

Navigation

[0] Message Index

Go to full version