import java.awt.Color; public class Asteroid { private Color color; private double x; private double y; private double radius; private double xVelocity; private double yVelocity; public Asteroid( double x, double y, double radius, double xVelocity, double yVelocity ) { //TODO: Initialize all the private members //Set the color to StdDraw.GRAY } public double getX() { //TODO: Complete accessor for x } public double getY() { //TODO: Complete accessor for y } public double getRadius() { //TODO: Complete accessor for radius } public void update( double time ) { //TODO: Update the location of the asteroid //Update the x and y locations assuming that each has moved by the component velocity times the time //If x is less than 0, set it to 1 //If x is greater than 1, set it to 0 //If y is less than 0, set it to 1 //If y is greater than 1, set it to 0 //This corresponds to "wrap around" physics, not bouncing } public void draw() { StdDraw.setPenColor( color ); StdDraw.filledCircle( x, y, radius ); } }