Tile drawing logic.