proximity based volume [SOLVED] :)

0 favourites
From the Asset Store
Hand-animated Sprite Base for isometric game/animation development
  • Ah I figured it out almost!

    every tick

    for each "emitter"

    distance < threshold

    trigger once

    / play

    every tick

    for each "emitter"

    distance > threshold

    trigger once

    / stop

    But when I copy different instances of the emitter, it only plays one instance of the audio, it's not emitting the same sound multiple times at the different sources.

  • Hmm, not too sure. If you post a simple, stripped down capx I'll take a look at it.

  • sqiddster

    I figured it out :)

    Here I made this little build for you to hear the proximity based area sounds. I took all the gameplay out all you can do is run around the level. Use arrow keys to move. Press space in the beginning to remove the platform.

    https://dl.dropbox.com/u/3317708/ORBIT%20AUDIO/index.html

  • Wow, that's really nice ! And the graphics are awesome! Glad the sounds worked for you, they really helped the atmosphere.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 :(

  • Haha, good luck with that!

  • 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

  • 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)

  • Cool thanks, I've not learnt lerp.

    object.speed isn't anything that C2 can understand

  • 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,

  • ah my game is all physics driven

  • 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. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)