Original Post
public void run() {
while (Thread.currentThread() == animator) {
// Display the next frame of animation.
enemymove();
you.move();
// Delay for a while
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
break;
}
// Advance the frame
frame++;
repaint();
}
}
public void paint(Graphics g) {
g.setColor(Color.WHITE);
g.drawOval(you.x - 16, you.y - 8, 32, 16);
g.setColor(Color.WHITE);
g.drawString(notes, 20, 20);
g.setColor(Color.WHITE);
g.drawString("Health: " + you.health + "/" + you.maxhealth, 50, 50);
} I am fairly new to Java and trying to build an applet game. The game runs but the screen refresh is rather slow and there is a noticeable flickers as it clears and regenerates the screen. I just want it to redraw everything, not to clear first. I tried changing repaint() to paint() and it is giving me errors. I somehow need to include 'g' in the calling I think, but Im not sure how I do this? I have tried just about everything, including google, and have been stuck for a couple days so help is very appreciated.