Sounds

Get help using Construct 2

Post » Tue Nov 06, 2012 8:44 pm

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?
B
3
Posts: 9
Reputation: 643

Post » Wed Nov 07, 2012 8:57 am

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
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
29
S
11
G
8
Posts: 307
Reputation: 7,323

Post » Wed Nov 07, 2012 9:47 pm

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".
B
3
Posts: 9
Reputation: 643

Post » Thu Nov 08, 2012 3:16 am

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.



Make sense?ptbcomposer2012-11-08 03:17:56
B
14
S
5
G
4
Posts: 121
Reputation: 3,938

Post » Thu Nov 15, 2012 1:15 am

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?
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Thu Nov 15, 2012 5:34 pm

You could also make separate event sheets for each layout with their own 'start of layout' events, then 'include' the common event sheet.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests