Problem with sounds!

  • Hi there!

    I have a jump-sound playing whenever the player jumps, which is constantly. The problem is that when the player jump several times within a second, it sounds terrible. So, I was wondering if it's possible to not play the jump-sound if the jump-sound has just been played?

    For example: Don't play jump-sound if it was played 0,1 seconds ago.

    Or: Don't play jump-sound if the jump-sound is already playing.

    Thanks in advance,

    Tomolo Games

  • Should you be able to jump several times within a second?

  • I recorded a video so you can see/hear the problem. Problem 8 seconds in the video

  • The player automatically jumps as soon at it hits the "floor" and if there, for example, is something above the player and the "floor" the player is bouncing up and down very quickly and that's when the sound problem starts. Do you understand what I mean? I'm not the best at explaining things and my English sucks :p

  • Yeah it's a weird one because it shouldn't really be possible to 'jump' that fast, but at the same time if you lock the sound out which is easy to do you're going to have the player jumping with no sound playing. You could try playing the jump sound with a trigger once condition on hitting the floor, (on landed?)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Every time you play a sound you can assign a tag to it. So play your jumping sound with tag="jump".

    Before playing check if "jump" sound is already playing and either stop it or don't play new sound.

    Something like this:

        Audio -> Is tag "jump" NOT playing
               Audio -> Play "your jumping sound" (tag "jump")
    [/code:2w96fp6l]
  • Audio -> Is tag "jump" NOT playing

    Audio -> Play "your jumping sound" (tag "jump")

    I'm not sure if I understand what you mean because this just makes it play the jump-sound repeatedly?

  • I meant replace your existing action (Audio->Play jumping sound) with those 2 lines.

    This is what you wanted, isn't it?

    [quote:94xz1gbr]Don't play jump-sound if the jump-sound is already playing.

    I didn't see your code and don't know where you play your sound. I'm guessing it's inside some event, maybe On collision with a floor, or On key "Up" pressed. So insert my 2 lines inside that event.

  • But then it plays the jump-sound when the player is not jumping instead of playing the jump-sound when the player is jumping?

  • No, it doesn't check if the player is jumping or not, it checks if the sound is playing.

    Again, I don't know how and when you check if the jump is made and decide to play the sound.

    Could you share the screenshot of your entire event where you play you jumping sound?

  • Sorry for being stupid but I don't quite understand :p

    Would you mind if I send you the capx-file so you can fix it for me? I would be extremely grateful if you could do so

  • Sure, if it's not too big

    my email: <censored>

  • I've just sent you an e-mail. You are amazing for doing this

  • Here you go:

    I noticed you never use sub-events in your game. This is a sub-event, it's only executed if the parent event is executed (if Player is on the Floor)

  • It works great! Thanks again, you are an angel

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