Hello there.
I've got this problem with hitTestPoint. When I test with the 'shape flag' set to false it detects hits out to the bounding box of the symbol (as you'd expect), but when I set the shape flag to true I get no hit detections at all.
Here's the (very simple!) code I'm using...
Is there any reason why I'm not getting ANY hit detections with the flag set to true? I'm testing the same x and y coords. Pretty much stumped.Code:for (i=0;i<Math.floor(width);i++) { j = -100; do { j++; } while (!this.hitTestPoint(x+i, y+j, true) && j < 100); pixelYs.push(j); };
In case you're wondering I'm trying to get the best performance out of a scroller game. Any land shapes with rises or falls are loaded with an array (pixelYs[]) of y heights that the game loop can 'get', instead of having to do a lot of looping hitTestPoints to determine how high the player should be positioned over the piece of ground they're standing on.
Any help, well appreciated!
Cheers.




Reply With Quote