Advertisement

RTS CD

Started by May 22, 2020 08:02 AM
20 comments, last by JoeJ 4 years, 8 months ago

Looks correct.

Another idea would be simply to round the point to the grid and compare:

bool CheckPointInTile (vec2 point, int tileX, int tileY)
{
	return ( 	(int)floor(point.x) == tileX) &&
				(int)floor(point.y) == tileY) );
}

Requires grid and points share the same coordinate system ofc.

This topic is closed to new replies.

Advertisement