To get you warmed up, first write a minimal program that leverages the essential concepts needed for Breakout. Write a MouseReporter that creates a GLabel on the left side of the screen. When the mouse is moved the label is updated to display the current x, y location of the mouse. If the mouse is touching the label it should turn red, otherwise, it should be blue. You should take advantage of the setLabel method that can be called on a GLabel. If you look in the documentation at the methods that are defined at the GraphicsProgram level, you will discover that there is a method
public GObject getElementAt(double x, double y)
that takes a position in the window and returns the graphical object at that location, if any. If there are no graphical objects that cover that position, getElementAt() returns the special constant null. If there is more than one, getElementAt() always chooses the one closest to the top of the stack, which is the one that appears to be in front on the display. The starter code for MouseReporter stores the label as an instance variable and adds it to the screen.
It will also be helpful to use:
public void mousePressed(MouseEvent e) {
}
public void mouseMoved(MouseEvent e) {
}
Make sure to watch the video below to see a tutorial on how to use these methods. Your program should look like this: