Max Lyn
Posts: 11
Nickname: techrolla
Registered: Feb, 2003
|
|
Re: Trouble with Java Game
|
Posted: Mar 10, 2003 9:02 PM
|
|
You just need to make the gae double buffered. Just make a Graphics object then an off screen Image and just update and repaint the screen, heres an example
class whatever { Graphics offG; Image offImage;
public whatever() {
offImage = createImage(size().width, size().height); offG = offImage.getGraphics(); }
public void update(Graphics g) { offG.setColor(getBackground()); offG.fillRect(0, 0, size().width, size().height); offG.setColor(getForeground()); offG.drawRect(10, 40, 30, 30); paint(offG); g.drawImage(offImage, 0, 0, null); }
Thats How you can make it double buffered. By the way, tight ass game, you should make the guy spin and shit.
|
|