Sprite Sheet


 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.

the only thin that is flickering is the drawStrings that make up my GUI. thats the only thing that is flickering. The gui doesn’t work in the paint method, but it works in the updated method. I’ll keep playing with it, and I’ll post if I get it.

Actually I was more worried about these:


gui.drawGUI(g,gui1,gui2); 
  gui.drawStats(g,25,20,1025,5); 
  gui.drawMenu(g); 

Since they take the normal graphics context as their first parameter instead of the buffered one.

Kev

you can see my flickering problem here…
http://rct3nerds.eblah.com/soc/game/SecretsofCelebrindal.htm