Well I've made lots of progress, but am having a hard time getting all the kinks out of splitting the polygon and creating the new points in the right order. I have it working in some circumstances, but there are edge cases which seem to be messing me up. More work to do.
However, since that will take a while, I'll throw int eh question here about accessing the mathUtil functions. I want to use pointInPoly, but it's not being recognised. I've put this line at the head of my code
import "/sys/lib/mathUtil.ms"
I tried several variants of the path including and excluding the directory path and the '.ms' with no difference. This line gives me an error saying pointInPoly isn't a valid reference.
if pointInPoly([enemy.sprite.x, enemy.sprite.y], splitBounds.left) then
Not sure what I'm missing. it seems fairly obvious. Is there something else I need to do to get the import to work?
It does work if I use the internal version of pointInPoly.
Russell.