void drawBricks(Graphics g) g.setColor(0x00FF00); for (int row = 0; row < 6; row++) for (int col = 0; col < 8; col++) if (bricks[col][row]) g.fillRect(col * 16, row * 8 + 20, 14, 6);
class Ball int x, y; // position int dx, dy; // velocity int radius = 3; void update() x + radius >= 128) dx = -dx; if (y - radius <= 0) dy = -dy; bounce java game 128x160
boolean[][] bricks = new boolean[8][6]; // 16px per brick approx void initBricks() for (int row = 0; row < 6; row++) for (int col = 0; col < 8; col++) bricks[col][row] = true; void drawBricks(Graphics g) g