I am making a game with html, css and javascript. I am searching that is there any way to make an event with javascript when two images touches, enters, passes over etc each other.
Asked
Active
Viewed 203 times
-2
-
Hope this helps: https://stackoverflow.com/questions/37704978/how-to-trigger-an-event-when-elements-divs-images-touch-each-other – Aasim Hussain Khan Sep 20 '17 at 11:34
-
Thanks a lot. The problem is the images have animation to move, so we can not calculate the position. Do you have any solution to this? – Mina Sep 23 '17 at 12:30
1 Answers
0
You could do it on your own: https://developer.mozilla.org/kab/docs/Games/Techniques/2D_collision_detection
Most likely if you arn't using any kind of engine you will have to.

Xanlantos
- 887
- 9
- 18