This commit is contained in:
2026-04-20 01:35:46 -05:00
parent 0606be1d06
commit 3b7869be34
7 changed files with 36 additions and 9 deletions

View File

@@ -355,6 +355,17 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
this.setBackground(SKY);
}
if (currentLevel == 8) {
// draw black overlay over entire world
g.setColor(new Color(0, 0, 0, 255));
g.fillRect(cameraX, cameraY, boardWidth, boardHeight);
// cut out a circle around the player
Graphics2D g2 = (Graphics2D) g;
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR));
g2.fillOval(player.x - 60, player.y - 60, 120, 120);
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
}
g.translate(-cameraX, -cameraY);
player.draw(g);