I put this is advanced but Im not sure how easy/hard this really is.
Ive got a script that checks if the player is inside a certain boundary, but its rectangular in shape:
Code: ags
Since Id like to check if a player is inside a diamond-shape boundary (isometric) without using hotspots or regions, what is the math I need to make sure the extra "triangles" get cut off of the rectangle so that the area is for a diamond (blue lozenge below) (Do I have to multiply the y coordinates by sin(30°), ~ 0.454 ?)
**EDIT**
(And would that same formula work for non-diamond rhombuses too, like the green zones in the above picture?)
Ive got a script that checks if the player is inside a certain boundary, but its rectangular in shape:
function playerInsideBounds(int iMinX, int iMaxX, int iMinY, int iMaxY)
{
//Display("**function playerInsideBounds...");
return ((player.x >= iMinX && player.x <= iMaxX) && (player.y >= iMinY && player.y <= iMaxY));
}
Since Id like to check if a player is inside a diamond-shape boundary (isometric) without using hotspots or regions, what is the math I need to make sure the extra "triangles" get cut off of the rectangle so that the area is for a diamond (blue lozenge below) (Do I have to multiply the y coordinates by sin(30°), ~ 0.454 ?)
**EDIT**
(And would that same formula work for non-diamond rhombuses too, like the green zones in the above picture?)
