/** Construcs a new scoreboard */ public Scoreboard() { // set size calling the constructor of superclass super(60, 35); setBorderWidth(0); setTransparentBackground(true); painter = new Turtle(); painter.setVisible(false); painter.setDirection(90); painter.setPenColor(Color.white); painter.setFont(new Font("Lucida Sans", Font.BOLD, 20)); add(painter); painter.center(); resetScore(); }
/** Repaints the displayed score. */ private void repaintScore() { clear(); painter.printCenter(Integer.toString(score)); }