Hi, I've got a problem with the Breakout game I'm making.
The game uses a ball, a paddle, and lots of bricks. I have drawn all
the bricks into a JFrame, and then saved the picture as a BufferedImage.
This gives me 2 advantages:
1. When the ball and/or paddle are moving, the bricks do not all have to
be redrawn each time.
2. I can scan around the ball using the getRGB(int x,int y) method of
the BufferedImage class, to see if a point has the same colour as a
brick, and hence perform the correct actions.
But my current problem is that when the ball contacts a brick. I am
redrawing all the bricks minus the one that has just been hit, and then
saving the picture as a BufferedImage again...
This works fine, except for the fact the screen flashes white each
time a brick is contacted by the ball.
I'm not sure exactly whats causing this. I have considered just drawing
everything to the frame, but then I can't use the getRGB method to
test the colour of points around the ball.
Any ideas how to overcome this are appreciated. Thanks