private void createMinimap() {
        Graphics2D mapGraphics = null;
        int mapWidth = (map.getWidth() * map.getTileWidth());
        int mapHeight = (map.getHeight() * map.getTileHeight());

        minimap = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB);
        mapGraphics = (Graphics2D) minimap.getGraphics();

        for (int x = 0; x < map.getWidth(); x++) {
            for (int y = 0; y < map.getHeight(); y++) {
                for (int z = 0; z < map.getLayerCount(); z++) {
                    Tile t = ((TileLayer) map.getLayer(z)).getTileAt(x, y);
                    if (t != null) {
                        mapGraphics.drawImage(t.getImage(), x << 5, y << 5, null);
                    }
                }
            }
        }
        minimap = minimap.getScaledInstance((int) (Main.app.getWidth() * .25f),
                (int) (Main.app.getHeight() * .25f), Image.SCALE_SMOOTH);
        minimapCreated = true;
    }