0
\$\begingroup\$

I'm trying to make a runner game for the blind, and I need help making a sound every time it is time to jump. I am using Game Maker, and I have no idea how to do it.

How do I play a sound when my player gets to the edge of a platform in Game Maker?

\$\endgroup\$
  • \$\begingroup\$ Can you be more specific? Maybe adding an example image? I may have an answer for you, but I'd like to get your question straight \$\endgroup\$ – liggiorgio Jan 28 '17 at 18:44
1
\$\begingroup\$

A few methods you can use for this:

  • Add an invisible block in front of the edge (where you want the sound to go off) and when the player hits this invisible block, delete the block and play the sound.
  • Make the ground around the edge into a trigger so that when the player "steps onto" (interacts or collides with) that ground, you can know when to play the sound.
  • Add an invisible block to your player that goes in front of him and detects collisions with other objects. Add invisible objects that only interact with this invisible block at the edges or on traps etc., and play a sound when they interact.

They're all valid methods and there may be many more that I can't think of right now, pick one that seems like you can implement and work on that, or make one up using these as general ideas of how to implement this mechanic.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Probably the cleanest way in the to implement this is to use a raycast slightly in front and under the player that detects when the floor is going to miss. By using this approach you can make the sound happening always at the same moment before a jump. You can also use the same trick to eventually detect obstacles.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.