To play a different music for each layout

  • I need to play a different music for each layout.

    If I use the audio command "stop" the music doesn't stop to play.

    When the player goes to the next layout the game play togheter the previous music and the current music.

    I tried to move the music file from the music folder to the audio folder, but the game play only the music without the sound effects.

    How I can manage it?

    Thanks <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try experimenting: Perhaps stopping the music before going to the next layout or using a tag to identify which sound to stop may have better results.

  • You can create a text called "music1"(text object), other called "music2" (text object)etc, then place "music1" in layout1 "music2" where you want.(make them invisible)

    layout1

    "music1"(text) is on screen-play music A

    trigger once

    layout2

    "music2"(text) is on screen-play music B

    trigger once

    that way you can switch musics by switching textobjects between layouts.

  • Check my tutorial Asteroid clone in less than 100 events, the "audio system" is doing just what you want to do.

    Keep your music files in the music folder, and be sure to tag it when you play it (tag it "BackgroundMusic").

    At the end of your layout, Audio: Stop "BackgroundMusic" and on start of the next layout, Play file tag "BackgroundMusic".

    Check the tutorial for a more detailed explanation and working example.

  • Thanks guys I have fixed the problem adding the tag on the audio play command.

    I thought the tag was only a comment to describe the sound played.

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