[Solved] How do I Stop audio repeating on collisions

Just started using Construct 2? Post your questions here

Post » Sat Sep 27, 2014 8:42 am

Hi

I have the 'player' and some 'baddies'. The baddies have the sine behavior so they move left and right along a floating platform, and the solid behavior.

The player has the platform and boundToLayout behaviors.

When the player collides with a baddie, I play a sound. Now the baddie will push the player which is what I want, but as it's pushing it the collision sound will repeat.

What I'd like is for the collision sound to only play once, or for it to play say every 0.5 seconds (for example).

I've tried with a system-wait for 1 second, but that doesn't work.

I'm sure I'm making a fundamental error, so any help would be appreciated.

The .capx should be below, it's made with construct R182.

Thanks
Nick .
You do not have the required permissions to view the files attached to this post.
Last edited by nickl on Sun Sep 28, 2014 11:55 am, edited 1 time in total.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Sat Sep 27, 2014 10:22 am

You can more effectively control what happens in your game by using variables. In your case, a variable that checks if the player has been hit or not can solve your problem. I've updated your capx, check it out.

Also, as a side note, try to use the Tilled Background object for repeated textures, I've also changed the platforms and the ground in your capx.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sat Sep 27, 2014 11:23 am

Try this
You do not have the required permissions to view the files attached to this post.
B
245
S
39
G
15
Posts: 1,941
Reputation: 40,246

Post » Sun Sep 28, 2014 8:41 am

@eli0s

that's a great solution, thanks for putting the effort in explaining it all.
Adding the extra flash and 'bounce' features look fab too, thank you.

Also, I've never really understood Tiled Backgrounds, so thanks for replacing my platforms with them, that has helped me get my head around them!

Nick .
Last edited by nickl on Sun Sep 28, 2014 8:55 am, edited 2 times in total.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Sun Sep 28, 2014 8:45 am

@Lordshiva1948

Ah, that is working better than my method too, thank you for the help.

Nick .
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Sun Sep 28, 2014 11:10 am

Nick Most welcome dear friend. Any time you need help plz pm if you wish
B
245
S
39
G
15
Posts: 1,941
Reputation: 40,246

Post » Sun Sep 28, 2014 3:58 pm

@nickl ,

You are welcome, I am glad I helped!
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests