[Solved] How do I play background music continuously

Get help using Construct 2

Post » Wed Mar 30, 2016 8:23 am

how could I play background music continuously
i added sound then add action in event play "sound"
but when i click "restart game" or go to another layout
it plays from beginning
Last edited by luckyrawatlucky on Tue Nov 22, 2016 7:21 am, edited 1 time in total.
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Wed Mar 30, 2016 8:48 am

If you load it once like
"on loader layout complete" then it stays between layouts

edit: or doesn't reload (where I think is your problem)

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Wed Mar 30, 2016 10:36 am

No, it's simple. When you call the Play event, give it a tag ("bgmusic" or something).

On Start of Layout
Tag "bgmusic" is not playing ----------> Play with tag "bgmusic"

This way, it will only start if it is not already playing.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Mon Nov 21, 2016 5:21 pm

@C-7

How do I go about modifying the logic of my Event Sheet to include the music in the background, but make it where the music doesn't stop between layout reload / advancing?

Additionally, is there a way to make it where the bgmusic stops once the user returns to the main menu?

Here's a snippet from my Main_Sheet event sheet:

https://www.dropbox.com/s/rdino5iw4xu9qsf/BR.PNG?dl=0
B
3
Posts: 1
Reputation: 177


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 45 guests