How do I make a walking sound loop for a platformer?

Get help using Construct 2

Post » Sun Aug 03, 2014 6:48 pm

Hey guys,

I want to play the sound "steps" for my character, it's a small audio that loops

I used this conditions

If:
Player1 is moving and Player 1 is on floor > play sound "steps" looping

When i do that it starts to loop endlessly and becomes unbearable.

Also i tried the

Player1 is NOT moving and Player 1 is NOT on floor > Stop playing "steps".


but so far, it doesn't work
B
7
S
2
Posts: 57
Reputation: 591

Post » Sun Aug 03, 2014 7:29 pm

The only thing that came on my mind right now is: control sound loop with a variable.

Define Global Variable "Step" = 0
Player1 is moving and Player 1 is on floor and Step = 0 > set Animation "Walking", play sound (NO LOOP), set Step = 1

Player1 On finished Animation "Walking" > set Step = 0

---
Of course you'll need the "Walking" animation for your sprite.

I think, this is not the best solution, but, could work.

Best Regards.
B
8
Posts: 20
Reputation: 302

Post » Sun Aug 03, 2014 8:09 pm

leomachado666 wrote:Hey guys,

I want to play the sound "steps" for my character, it's a small audio that loops

I used this conditions

If:
Player1 is moving and Player 1 is on floor > play sound "steps" looping

When i do that it starts to loop endlessly and becomes unbearable.

Also i tried the

Player1 is NOT moving and Player 1 is NOT on floor > Stop playing "steps".


but so far, it doesn't work

Put the "trigger once while true" condition with the others.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Mon Aug 04, 2014 4:26 pm

Thanks pal!

now it works, and i post a screenshot for everyone having trouble.
You do not have the required permissions to view the files attached to this post.
B
7
S
2
Posts: 57
Reputation: 591

Post » Mon Aug 04, 2014 11:50 pm

leomachado666 wrote:Thanks pal!

now it works, and i post a screenshot for everyone having trouble.


You're welcome :)
One more thing: your first event is ok, but I think you don't need the other two.
Instead, just create an "else = stop steppy".
Cheers
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Tue Aug 05, 2014 1:29 am

I still don't fully understand how to use while and else, i'm getting the hang of else, but i have been doing that kind of coding since the beginning haha i should start using Else
Thanks People! :)
B
7
S
2
Posts: 57
Reputation: 591


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, RobertMKD, Syazanie Amirin and 10 guests