proximity based volume [SOLVED] :)

Get help using Construct 2

Post » Tue Nov 27, 2012 11:34 pm

Cheers yeah, the audio is pretty essential in this game and working within the construct 2 audio limitations can be...tough. All I need now is panning, just simple panning :(
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Wed Nov 28, 2012 12:04 am

Haha, good luck with that!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Nov 28, 2012 4:30 pm

I've got another challenge for you, volume based on speed.

GameObject speed = 0 : stop "sound"

GameObject speed > 0 : start "sound"

set "sound" volume to GameObject speed : min -20db / max 0db + rate

I'm sure it could be very similar to the proximity volume, I've been messing with it for an hour and had no luck so far
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Wed Jan 23, 2013 4:38 pm

Something like this should work. Also, you can lerp the playback rate for a pretty interesting speed-up/slow-down effect.

Object is Moving
-->Trigger Once-->Start "sound" looping
-->Set "sound" volume: lerp(-50, 0, Object.Speed/'yourObjectsMaxspeed)
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Wed Jan 23, 2013 9:02 pm

Cool thanks, I've not learnt lerp.

object.speed isn't anything that C2 can understand
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Wed Jan 23, 2013 11:16 pm

Lerp is pretty awesome, but I still don't totally understand it either! Sorry, I assumed you were using custom movement or one of the behaviours to move your sprite. If you have Custom Movement, you can say Sprite.CustomMovement.Speed,the_chosen_byte2013-01-23 23:16:25
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Thu Jan 24, 2013 3:11 pm

ah my game is all physics driven
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Fri Mar 15, 2013 8:02 pm

Did you solve this ?

You can calculate a rough speed by taking the hypotenuse of the vectorx/vectory for the physics object.

SQRT((Thing.Physics.VectorX^2)+(Thing.Physics.VectorY^2))

or distance(0,0,Thing.Physics.VectorX,Thing.Physics.VectorY)

It's the only thing that's missing from the physics object is a general 'speed' variable that can be accessed, rather than having to calculate it each time. :)JohnnySix2013-03-15 20:03:10
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Previous

Return to How do I....?

Who is online

Users browsing this forum: Televangelist and 21 guests