Reputation: 2719
==> I am developing game like carom board Where i am facing few issue due to continuous collision detection.
As shown in the image due to collision detection striker hanging around with gray puck and game can not get continue after that and playing sound continuously over there
and i want play sound only first time when striker or puck hit each other or frame (wall ) but in my case if i put striker near wall sound is playing continuously
Thank you very much in advance
Help is greatly appreciated
Upvotes: 2
Views: 515
Reputation: 2460
In my view best way would be to maintain some minimum distance between both the sprites after collision detection this should be done in update function. This will resolve your first problem. For second problem just check frame of both the sprites and try to decrease the frame size.
Upvotes: 5