/** The method accepts a string and displays the green text in the center of the screen */ private GLabel createMessage(String message) { GLabel text = new GLabel(message); text.setFont("Arial Black-20"); text.setColor(Color.GREEN); double x = (WIDTH - text.getWidth()) / 2; double y = (HEIGHT - text.getDescent()) / 2; text.setLocation(x, y); add(text); return text; }
/** Displays the amount of points on the screen in text form */ private GLabel createScore(String score) { GLabel text = new GLabel(score); text.setFont("Arial Black-12"); text.setColor(Color.black); double x = (WIDTH - text.getWidth()) / 2; double y = HEIGHT - text.getDescent(); text.setLocation(x, y); add(text); return text; }