I am working on a game written in javaScript / jQuery. Part of my code draws a random polygon (island) on a tile grid. I need to check if the point is inside the polygon.
I am using point intersection in a polygon script, which I found in several places on Qaru (the original is here ). This works fine in Firefox. In Chrome, there are dots inside the polygon, which the script says is not inside it.
In Firefox: 
In Chrome (the island is different in that they are randomly generated): 
Please see the source here, especially the pointPolygonIntersect function: Point in polygon collision test
Can anyone understand why this is happening? The original script is in C and I am using a version of JavaScript - could this be the cause of the problem?
source share