I have tiles generated on the screen and I have a square bitmap that represents the player, which is the size of the tile(or slightly bigger) so it can register whether it is hitting the tile completely. I’m having a problem where it is registering hit test from tiles that aren’t even next to the player. The link below, My mouse is over the tile that is highlighted, and I have a trace that checks the hitTest between the player and the current Tile that it’s on. It’s registering “Next To” even though it isn’t directly next to the player
http://postimg.org/image/6so3npm19/
Here is the code for the bitmap. I’ve been playing around with the x and y position and the size of it.
visionArea.graphics.beginFill(0x00FF00, 1.0);
visionArea.graphics.drawRect(0, 0, 85, 85);
visionArea.graphics.endFill();
var matrix:Matrix = new Matrix();
matrix.rotate(Math.PI / 4);
matrix.scale(1, 0.5);
visionArea.transform.matrix = matrix;
addChild(visionArea);
visionArea.mouseEnabled = false;
visionArea.visible = false;
visionArea.x = 4;
visionArea.y = -21;