Hello, I am making a pong game and want the ball to make sounds when it bounces off of the walls. But i cannot figure out how to, any help is appreciated. Thanks!
Here is a snippet of my code:
ball = this.physics.add.image(this.physics.world.bounds.width/2,this.physics.world.bounds.height/2,'ball').setCollideWorldBounds(true).setBounce(1,1);
if( /* is colliding with bounds */ ){
sfx_wallBounce.play();
}