How do I do different sounds for different layouts?
I have a background music that I want to add to different layouts.
Also, will it automatically loop back to the beginning when the song finishes?
Import your music into Construct 2 Sound or Music folders in your project tree.(right click 'import')
Use an event....for each layout...
"On layout start....Audio-> Play ->(select your track and looping conditions)
Repeat for each layout...
This is all in the Manual
Develop games in your browser. Powerful, performant & highly capable.
Yeah, but that's the thing, I have 5 different layouts using the same eventsheet.
How do you define the layout using "On layout start"?
I'm looking for something like "On X layout start".
You need to use...TADA!!!! GLOBAL VARIABLES!!!!
Seriously, though, you do! Try this. Make a global variable called something like "currentlayout". On the start of each layout set "currentlayout" to the number of your current layout (e.g. for "Layout 5" the global variable would be "5"). Then for your sounds event sheet, do "At start of Layout" and add a condition using "Compare Variable" with a value of the corresponding layout for each sound.
You could also just check the name of the current layout at Start, and if Layout Name = X, play Y, if = to Z, play A etc. etc. Right?
You could also make separate event sheets for each layout with their own 'start of layout' events, then 'include' the common event sheet.