widthInTiles = trans[0].length; heightInTiles = trans.length;
bounds.width = trans[0].length; bounds.height = trans.length;
    public void rotate(int angle) {        Tile[][] trans;        int xtrans = 0, ytrans = 0;        switch (angle) {            case ROTATE_90:                trans = new Tile[widthInTiles][heightInTiles];                xtrans = heightInTiles - 1;                break;            case ROTATE_180:                trans = new Tile[heightInTiles][widthInTiles];                xtrans = widthInTiles - 1;                ytrans = heightInTiles - 1;                break;            case ROTATE_270:                trans = new Tile[widthInTiles][heightInTiles];                ytrans = widthInTiles - 1;                break;            default:                System.out.println("Unsupported rotation (" + angle + ")");                return;        }        double ra = Math.toRadians(angle);        int cos_angle = (int)Math.round(Math.cos(ra));        int sin_angle = (int)Math.round(Math.sin(ra));        for (int y = 0; y < heightInTiles; y++) {            for (int x = 0; x < widthInTiles; x++) {                int xrot = x * cos_angle - y * sin_angle;                int yrot = x * sin_angle + y * cos_angle;                trans[yrot + ytrans][xrot + xtrans] = getTileAt(x, y);            }        }        widthInTiles = trans[0].length;        heightInTiles = trans.length;        map = trans;    }