How do I control 3 different sounds on 3 levels

  • 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

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

    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"

  • 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?

  • 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

  • ok thank you very much for help

  • 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"

  • 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

  • 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.

  • You could try and post a capx or link with the problem

  • 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.

  • It is definitely not a bug, it has to do with how you set up your events.

    The thing is ... your current scenario is unclear ... creating a capx for you with some examples would be like shooting in the dark.

    The simplest solution might be, to add an action "audio stop all ", then "wait 1" second, before you start a new stage sound.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • no if i get capx example i can set my sounds correctely. the scenario is clear. i have 3 sounds and 3 stages ( 3 layouts). i want to control each sound for every stage. play the sound, stop it, pause it ect... . im beginner, i dont know all about construct 2 so where i add these actions?? about the weird sound i dont know why i get it ( as i said is not a big problem for me).

  • i still need help my friends, i hope someone can give me a capx example to this scenario ( as i explain in my last post) and thank you in advanced

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)