How do I keep playing music ?

Get help using Construct 2

Post » Tue Oct 14, 2014 4:47 pm

Hello,

I'ld like to keep playing music of my layout (my level) even if I die.
I just know how to play music by starting the layout but it always plays it again from the beginning every time I die....

How could I do please ?
B
3
Posts: 3
Reputation: 181

Post » Tue Oct 14, 2014 5:03 pm

If you restart the layout when you die, the on start of layout will happen, verify that your music is not currently playing before playing it.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Tue Oct 14, 2014 5:53 pm

The "on start of layout" have to happen (school exercise...) and I can't touch this part of the code...
The music begins on a special layout, layout which include the main one (I did this just to add a speacial music for the boss, keeping the main mandatoried features)
B
3
Posts: 3
Reputation: 181

Post » Wed Oct 15, 2014 12:42 am

@Fyrost You have to play music play on start of layout?
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

Post » Wed Oct 15, 2014 1:05 am

@Aphrodite didn't tell you not to play your music on start of layout... just to add a condition to make sure it wasn't already playing.
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Wed Oct 15, 2014 6:43 pm

Okay, thanks guys, I found a solution. I wanted the music to keep playing the same song even if I die, so I started the music not with a On start of Layout, but with a simple (but tricky) "Compare time" to 0.0 seconds, then it start the music... Not really clean but it works ! :p
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 24 guests