Menu Music

MidNightGamer1125MidNightGamer1125 Member Posts: 50
ok so I applied a play sound on the main menu. So when the main menu is displayed the theme music plays. In my main menu there is a HOW TO PLAY button. when u click on it the music just continues without fail which is perfect. BUT when I press the home button and return to the main menu the music just starts over. I want my theme music to play constantly untill i enter the play area. Does anyone know how I would go about accomplishing this
Thanx
Jon

Comments

  • GamersRejoiceGamersRejoice Member Posts: 817
    You'll need to make a trigger attribute that tells the game to either resume music or play the song. So start by making a boolean attribute and call it "Song Start" And change check it to start it as true.

    Then in your first scene make a rule:
    If game.Song Start is True
    Play music (loop)

    Otherwise:
    Resume music (loop)

    Last thing just make a rule:
    if Song Start is True, Timer after .2 seconds
    Change game.Song Start to false.

    Then just put the rule at the top in all of your menu scenes and it should work out for you.

    I hope this makes sense, good luck.
  • MidNightGamer1125MidNightGamer1125 Member Posts: 50
    I got you for the most part. One thing I am confused on i s which rule to put at my menu scenes.
    Another thing to keep in mind is this when u press the how to play button it shows u how to play blah blah blah but there is a home button on the screen shot and that takes u back to the initial start page or (MAIN MENU) that's were my music starts over so do I just need to put that rule in the home button or do i have to put it in my scenes
  • quantumsheepquantumsheep Member Posts: 8,188
    Here's a best practice rule (I think so anyway!):

    Make a splash screen that's the first scene in your game.

    This is just a screen with your logo on it, for example, or the word 'loading' or whatever.

    Now, having this extra screen at the start is useful for a couple of reasons:

    1. It lets you put in an actor that loads in any saved data (such as hi-scores) at the start of your game.

    2. If you start your music playing with a loop on your splash screen, it'll continue onto your main menu screen. But you should never link back to this splash screen.

    Therefore, in your case, the music starts playing on the splash screen. It continues on the main menu screen. Then, if you go to your 'how to play' screen it'll carry on playing.

    And if you go back to your main menu screen, it'll *still* be playing.

    Hope that helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • MidNightGamer1125MidNightGamer1125 Member Posts: 50
    lol good point never thought of it that way. i think i can manage that and it makes perfect sence to do it that way thanx to the both of you I can make t work wit the info that both of yall have provided
    thanx alot
    Jon
  • quantumsheepquantumsheep Member Posts: 8,188
    /hi5

    Glad to help :D

    QS :D

    EDIT: Oh, I almost forgot:

    GO MAKE A GREAT GAME!

    :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.