How to detect collision with JS
and this causes small but still annoying lag. I was researching this here and on google but nobody seems to bother with that since we have different engines for this. Does anybody know how do solve this problem without nested for loops?
Thanks for answer!
One Solution collect form web for “How to detect collision with JS”
You could either use a multidimensional array of “tiles” or a hash table where the key is the x and y position. On a “collision” in the data structure, you trigger your event for your collision.