Author Topic: Can I delay the 'Game Over' music?  (Read 2245 times)

Seirei

  • Wannabe
  • Posts: 3
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 47.0.2526.106 Chrome 47.0.2526.106
    • View Profile
  • Playstyle: Keyboard
Can I delay the 'Game Over' music?
« 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!

infern0man1

  • ~(=^・ω・^)ψ
  • Global Moderator
  • Oatmeal Killer
  • Posts: 1.021
  • Dear sir stroke madam, fire exclamation point
  • OS:
  • Android 4.4.2 Android 4.4.2
  • Browser:
  • Chrome 47.0.2526.83 Chrome 47.0.2526.83
    • View Profile
    • Twitter
  • Playstyle: Keyboard
Re: Can I delay the 'Game Over' music?
« Reply #1 on: December 20, 2015, 08:34:53 PM »
In a press R event, put sound_stop(sndOnDeath);

Seirei

  • Wannabe
  • Posts: 3
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 47.0.2526.106 Chrome 47.0.2526.106
    • View Profile
  • Playstyle: Keyboard
Re: Can I delay the 'Game Over' music?
« Reply #2 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!

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 47.0.2526.80 Chrome 47.0.2526.80
    • View Profile
  • Playstyle: Keyboard
Re: Can I delay the 'Game Over' music?
« Reply #3 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.
(click to show/hide)

smoke weed everyday

Seirei

  • Wannabe
  • Posts: 3
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 47.0.2526.106 Chrome 47.0.2526.106
    • View Profile
  • Playstyle: Keyboard
Re: Can I delay the 'Game Over' music?
« Reply #4 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.