public void paint(Graphics g){
if (bgraphics == null) {
System.out.println("Buffer not enabled yet");
return;
}
//re-draw map + character
for(y = 0; y < 480; y = y + 32){
bgraphics.drawString("Cirdan",player_x-5,player_y - 15);
//He means don't do this:
// makeRow(0,y,g);
// but instead do this:
// makeRow(0,y,bgraphics);
}
//Finally do this:
g.drawImage(buffer, 0, 0, null);
}
That’s how you use your buffer to remove flickering. We call that “double buffering”. Maybe I’ve misunderstood the context of the code, but the idea is the only time you ever call any draw methods on “g” is the last one I put there. That should be the only time anything gets thrown to the screen.