How do I play roll sound when rolling, and bounce sound when

Get help using Construct 2

Post » Mon Mar 10, 2014 11:49 pm

When the ball bounces (collides with a platform), it makes a bounce sound. But when the ball is rolling, I want it to play a continuous rolling sound that speeds up when the ball's speed increases and slows down when the ball's speed slows down.

How can I do this in Construct?
B
6
S
1
Posts: 12
Reputation: 444

Post » Thu Mar 13, 2014 3:01 am

BALL > on collision with FLOOR> play sound BOUNCE
trigger on while true(Additional condition)

set bounce sound for not looping
sound plays on every bounce once

Of course you need to provide a lot more Info when posting a question of this type.
Are you using bullet behaviors, physics, animation when rolling? Is it on a flat surface or angle?

Give details.
Be descriptive.
Your post sounds like you didn't try anything yet.

http://www.neoprofessor.com

http://www.nakedgametalk.com
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sat Mar 15, 2014 12:03 am

TheDom wrote:BALL > on collision with FLOOR> play sound BOUNCE
trigger on while true(Additional condition)

set bounce sound for not looping
sound plays on every bounce once

Of course you need to provide a lot more Info when posting a question of this type.
Are you using bullet behaviors, physics, animation when rolling? Is it on a flat surface or angle?

Give details.
Be descriptive.
Your post sounds like you didn't try anything yet.

http://www.neoprofessor.com

http://www.nakedgametalk.com


Boy I am glad I kept looking threw these topics :D. Spending so much time on this problem myself and forced myself to ask for help.
I tried all kind of strange events. By the way, if I set collide with, I cant seem to add trigger once(true?) from system.

Here is a rough sketch what the problem is:

Image

Surface behavior: physics
Ball Behavior: physics
Sound file is 0.5 sec long
B
8
S
2
G
2
Posts: 44
Reputation: 1,429

Post » Sat Mar 15, 2014 1:37 am

Ok. Try this

https://dl.dropboxusercontent.com/u/42168787/Rolling_Sound.capx

It's simple solution. I used global variable. I use 1 for true AND 0 for false.

if you object bounces a lot, give the system wait more time (0.5, 0.6, etc..)

If your going to use multiple Cogs (rolling balls), you'll need to use an Instance Variable within the cog and use Boolean operator instead.

If you think about it you can expand on this pretty easy.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sat Mar 15, 2014 10:55 am

TheDom wrote:Ok. Try this

https://dl.dropboxusercontent.com/u/42168787/Rolling_Sound.capx

It's simple solution. I used global variable. I use 1 for true AND 0 for false.

if you object bounces a lot, give the system wait more time (0.5, 0.6, etc..)

If your going to use multiple Cogs (rolling balls), you'll need to use an Instance Variable within the cog and use Boolean operator instead.

If you think about it you can expand on this pretty easy.



I just discovered what the invert on right klick selection on condition is. That is condition False.

Thank you very much, it kind of helped! Also, I hope I am not that blind in the future not seeing some things are laid out almost right in front of me.

There are problems with your capx tough, first thing I did, I set the blue rectangle parallel with x axis and the cog will stay on the platform and your rolling sound is looping indefenetly. I added a speed smaller or equal mute condition to it, so It wouldnt loop on one place.

I will tinker around with your capx and see how I can implemenent it as nicely as possible. My new problem is my rolling character is moving lot faster on objects than on this capx and it it requires a lot more testing to get it right.

Thanks for making that capx!
B
8
S
2
G
2
Posts: 44
Reputation: 1,429

Post » Sat Mar 15, 2014 1:35 pm

No problem. Actually, I can see the dilemma you were in. I'm sure there's a better solution that the one I presented,
it just hasn't come to me yet. I knew the use of the variables would help expand your thought process. I've found there is always a solution, you just need something to hit you on the head. Just something to remember; you can create variables that are strings, and use those to define states like falling, bouncing, rolling, etc. And write

SYSTEM>COG_VARIABLE = FALLING > PLAY FALLING_SOUND and so on.....

also you can use "trigger once while true" with collisions, you just have to make the "trigger once while true" a sub event of the "on collision" condition.

I think I might expand on that capx a little and post tutorial about it.

Anyway, good luck!


http://www.neoprofessor.com
http://www.nakedgametalk.com
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sat Mar 15, 2014 2:06 pm

TheDom wrote:No problem. Actually, I can see the dilemma you were in. I'm sure there's a better solution that the one I presented,
it just hasn't come to me yet. I knew the use of the variables would help expand your thought process. I've found there is always a solution, you just need something to hit you on the head. Just something to remember; you can create variables that are strings, and use those to define states like falling, bouncing, rolling, etc. And write

SYSTEM>COG_VARIABLE = FALLING > PLAY FALLING_SOUND and so on.....

also you can use "trigger once while true" with collisions, you just have to make the "trigger once while true" a sub event of the "on collision" condition.

I think I might expand on that capx a little and post tutorial about it.

Anyway, good luck!


http://www.neoprofessor.com
http://www.nakedgametalk.com


I tried some variations, and I figured I will try to make it work like my sketch says (v=db). It will feel natural for faster rolling physical objects (tried it and failed right now). But it is more complex and I have some simplier matters to learn/attend to, like graphical resources for scenery, creating a custom fitting soundtrack for the game. There sheer amount of stuff you cand do, is overwhelming for a single project, but it is all managble, if you get what can-be-made-atm out of the way and then take your time to go threw the manual, examples and tutorials and nail those harder parts and learn them.

If you were to made a tutorial out of this, that would be awsome, but consider your own time first, because I think you have done more than enough right now!
B
8
S
2
G
2
Posts: 44
Reputation: 1,429

Post » Sat Mar 15, 2014 8:08 pm

Thanks. I appreciate the sentiment. I may just post this capx with a short write up on the use of variables. Sounds like your on the right track and while some things get easier and faster as you go, you'll always being doing tedious things too. Good Luck and stay motivated...
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 46 guests