public Tile getTile(int x, int y) {

        if (x < 0 || y < 0 || x >= width || y >= height) {
            return Tile.emptyTile;
        }

        int spot = tiles[x + y * width];

        Tile t = Tile.getTileFromNumber(spot);

        if (t != null) {
            return t;
        } else {
            return Tile.voidTile;
        }
    }