How do I control 3 different sounds on 3 levels

Get help using Construct 2

Post » Sun Mar 22, 2015 9:32 am

hi everyone :) , i try to make a game with 3 levels. i make every level in different layout, and i import 3 audio files. now i want to add 1 audio per level. for ex i want when stage finish . the current sound stop and the second sound play, when level 2 finish , the current sound stop and the third sound start ( every level with a single sound), but the problem is i dont know how to control these sounds to start and stop in every layout.
can someone help me please ? thanks
B
21
S
8
Posts: 85
Reputation: 1,669

Post » Sun Mar 22, 2015 9:38 am

Funny thing .... your description actually pretty much describes what you need :P

import all 3 tunes ....

In each layouts event sheets

Event
on start of layout,
sub event audio tag "level1" not playing (inverted)
Action
audio play tune 1 tag "level1"


Event
Level finished (some event determining that the level is finished)
sub event
audio tag "level1" is playing
action
audio stop tag "level1"
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Sun Mar 22, 2015 9:42 am

thank you for your fast answer much appreciated . ok i will try that and post my feedback :)
edit : but i make all 3 layouts with same event sheet. its not problem?
B
21
S
8
Posts: 85
Reputation: 1,669

Post » Sun Mar 22, 2015 10:40 am

androidpro wrote:thank you for your fast answer much appreciated . ok i will try that and post my feedback :)
edit : but i make all 3 layouts with same event sheet. its not problem?




You could make it recognize the layout name


compare two values

LayoutName = "level1"

etc etc etc
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Sun Mar 22, 2015 10:47 am

ok thank you very much for help
B
21
S
8
Posts: 85
Reputation: 1,669

Post » Mon Mar 23, 2015 1:18 am

I'd just give them all the same tag, and tell it to stop playing a sound with tag "LevelMusic" at the start of layout, then read a variable of what level you are on and then Play Sound&"LevelThatYouAreOnVarible" with the tag "LevelMusic"
Using R243 for all examples
B
68
S
20
G
6
Posts: 378
Reputation: 9,672

Post » Mon Mar 23, 2015 11:07 am

thanks emoaeden for reply, i dont understand very well what you said. can you please give me a capx example? so i can understand all the steps. thank you in advanced
B
21
S
8
Posts: 85
Reputation: 1,669

Post » Wed Mar 25, 2015 9:30 am

now i figure out how to control the 3 sounds, a little problem is when for example stage 1 startn, all work fine except a weird sound (from another stage, start for 0.01 second and stop) and make the game lagging. that sound appear sometimes not always. i dont know why.

and also i hope someone can explain to me the emoaeden reply by capx examples thank you.
B
21
S
8
Posts: 85
Reputation: 1,669

Post » Wed Mar 25, 2015 11:28 am

You could try and post a capx or link with the problem
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Wed Mar 25, 2015 12:23 pm

its not a big problem lennaert sometimes appear sometimes not, its like a bug. i start stage and a sound from another stage start for 0.01 second and stop, that make the game lag for this 0.01 second. anyway thank very much lennaert for your help. i would like to someone post a capx explain how to control 3 sounds in 3 stages ( play first audio in the first stage, stop the first audio in the second stage and play the second audio etc....) ( the correct way) because i figure out how but with a strange way.
B
21
S
8
Posts: 85
Reputation: 1,669

Next

Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, ColombageEnPLS and 9 guests