Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by SimonWollerton

Hello everyone. I'm struggling to work out how to play a sound when the puck collides with a paddle and a collision layer area. Any help would be appreciated.

I'm also trying to work a scoring function for both the CPU and player.

Thanks

Si

1 decade ago by Joncom

http://impactjs.com/documentation/class-reference/sound

var sound = new ig.Sound( 'shoot.ogg' );
sound.play();

The above shows how to play a sound.

The next part, "when the puck collides with a paddle", just means to make sure the sound.play() occurs when you're changing puck velocity due to collision, and not some place else.

1 decade ago by SimonWollerton

Thanks very much for the reply
Page 1 of 1
« first « previous next › last »