if (terrain[x][y].getTileType() == "WATER") {
/* left tile */
if (x > 1 && x < WIDTH - 1 && y > 1 && y < HEIGHT - 1) {
/* left tile */
if (terrain[x - 1][y] != null && (terrain[x - 1][y].getTileType() == "GRASS" || terrain[x - 1][y].getTileType() == "TREE"))
overlaps_left[x - 1][y] = new GrassOverlapTile(x * TILE_SIZE, y * TILE_SIZE, 3);
/* right tile */
if (terrain[x + 1][y] != null && (terrain[x + 1][y].getTileType() == "GRASS" || terrain[x + 1][y].getTileType() == "TREE"))
overlaps_right[x - 1][y] = new GrassOverlapTile(x * TILE_SIZE, y * TILE_SIZE, 1);
/* top tile */
if (terrain[x][y - 1] != null && (terrain[x][y - 1].getTileType() == "GRASS" || terrain[x][y - 1].getTileType() == "TREE"))
overlaps_top[x - 1][y] = new GrassOverlapTile(x * TILE_SIZE, y * TILE_SIZE, 0);
/* bottom tile ( didn't do trees for obvious reasons ) */
if (terrain[x][y + 1] != null && (terrain[x][y + 1].getTileType() == "GRASS"))
overlaps_bottom[x - 1][y] = new GrassOverlapTile(x * TILE_SIZE, y * TILE_SIZE, 2);
}
}
}
}
}