Jump to content

help with sound and collisions


daniel0514
 Share

Recommended Posts

Hi, I'm currently working on a vertical scroller and I'm having some issues when playing a sound on collision.

I have a ball and i want to play a bounce sound when it collides with the platforms, the problem is, when the ball stays on the platforms (not moving), the sound just keeps playing over and over until I left that platform and jump to another.

 

How can i play the sound just once? 

Link to comment
Share on other sites

what phisics are You using?

 

You can allways do something like that:

//after creating ballball.last_platform = null;// inside colide functionif(ball.last_platform != this_platform)    sound.play();ball.last_platform = this_platform
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...