How do I...? Doppler Effect

  • Hello all,

    My game is about racing a spaceship and avoiding mines that come in from off screen by judging their distance using the doppler effect.

    How would I go about implementing this in-engine?

    I am pretty sure my mines will not be moving, so I think that will help if a formula is needed.

    If Construct does not have a natural feature for this, then any tips on using/implementing this mechanic are highly appreciated.

    Thank you for your attention,

    Van Halen

  • Construct supports advanced audio feature such as the doppler effect, but not all browsers might.

    It doesn't matter if your mines don't move, as your ship does, and the effect is calculated by the change in distance between the objects.

    See the manual page for more information. https://www.scirra.com/manual/109/audio

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it might be worth noting that Doppler Effect can’t possibly tell you anything about the distance to an object, only the speed at which it is getting closer or farther. What you might want instead is something much simpler, the loudness of the sound, which is related to distance, and is very easy to adjust programmatically.

    Sorry, the physics teacher in me couldn’t resist.

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