Question about sound

Get help using Construct 2

Post » Sun Jul 26, 2015 9:39 pm

Hello

I have a sound issue with my android app. A little bit hard to explain in english... Hope somebody will understand anyway :

A soundtrack ("theme") starts when the menu layout starts.
In this menu layout, there is several buttons going to other layouts. Of course, when the user want to go back to the menu, the music should not start twice. So I did this :

Image

But in fact it's only working when the game is offline. I mean, if the system opens a new window or connect with google play leaderboards, once coming back to the menu layout, the system starts the sound a second time. I have no idea what to do... Does somebody know a better expression for that ?

Thanks !
Image
B
9
S
1
Posts: 22
Reputation: 586

Post » Sun Jul 26, 2015 11:36 pm

You can solve it with a Variable

Variable "MusicTheme" = 0

At Start of Layout ->

Subevent 1 -> Variable "MusicTheme" = 0 -> another Subevent-> System: Trigger once while True (only when you can´t add "Trigger once while True" at the "Subevent 1" as another condition)-> Play "Theme" + Set Variable "MusicTheme" to 1

Subevent 2 -> Variable "MusicTheme" = 1 -> leave empty (it means: do nothing - The "Theme" from first Variable will play without a new "Theme" Music)
B
8
S
2
Posts: 53
Reputation: 687

Post » Mon Jul 27, 2015 2:49 pm

It's working, thank you !
Image
B
9
S
1
Posts: 22
Reputation: 586


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests