SLIDE 10 http://www.uni-klu.ac.at
10
Worm Panel Class III
// paint the game objects – painting order is important!!! paintScreen () { // get the graphics-handle to paint into panel Graphics g = this.getGraphics(); // clear the background (white) and seth the font. g.setColor(Color.white); g.fillRect(0, 0, PWIDTH, PHEIGHT); g.setColor(Color.blue); g.setFont(font); // draw message and red worm head at initial position g.drawString(message, 20, 25); g.setColor(Color.red); g.fillOval(xCoords, yCoords, WORM_DOTSIZE, WORM_DOTSIZE); } } // end of class WormPanel