import objectdraw.*; import java.awt.*; // A program to simulate the brightening of the sky at sunrise public class LightenUp extends FrameWindowController { private FilledRect sky; // background rectangle private FilledOval sun; // Circle that represents the sun private int brightness; // brightness of sky's color // Draw a dark grey sky and the sun public void begin() { brightness = 50; sky = new FilledRect(0, 0, canvas.getWidth(), canvas.getHeight(), canvas); sky.setColor(new Color(brightness, brightness, brightness)); sun = new FilledOval(50, 150, 100, 100, canvas); } // Brighten the sky and move the sun with each click public void onMousePress(Location point) { brightness = brightness + 5; sky.setColor(new Color(brightness, brightness, brightness)); sun.move(0, -5); } }