Time for action – dealing with map squares
Add methods to the TileMap class that deal with map squares and translate pixel coordinates into map square references:
#region Information about Map Squares static public int GetSquareByPixelX(int pixelX) { return pixelX / TileWidth; } static public int GetSquareByPixelY(int pixelY) { return pixelY / TileHeight; } static public Vector2 GetSquareAtPixel(Vector2 pixelLocation) { return new Vector2( GetSquareByPixelX((int)pixelLocation.X), GetSquareByPixelY((int)pixelLocation.Y)); } static public Vector2 GetSquareCenter(int squareX, int squareY) { return new Vector2( (squareX * TileWidth) + (TileWidth / 2), (squareY * TileHeight) + (TileHeight / 2)); } static public Vector2 GetSquareCenter(Vector2 square) { return GetSquareCenter( (int)square.X, (int)square.Y); } static public Rectangle SquareWorldRectangle(int x, int y) { return new Rectangle( x * TileWidth, ...