With the new one-parameter constructor that takes the size of the turtle, we can modify the instantiation of the turtles. In the Gui class in the edu.westga.cs1301.project1.view package. Do the following: In the Gui constructor, for the instantiation of the first turtle replace the call to the DoodleTurtle default constructor with a call to the one-parameter constructor and pass in a size of 30. Do the same for the second turtle but give it a size of 15.
- With the new one-parameter constructor that takes the size of the turtle, we can modify the instantiation of the turtles. In the Gui class in the edu.westga.cs1301.project1.view package. Do the following:
- In the Gui constructor, for the instantiation of the first turtle replace the call to the DoodleTurtle default constructor with a call to the one-parameter constructor and pass in a size of 30.
Do the same for the second turtle but give it a size of 15.
public class Gui extends GraphicsProgram {
public static final int APPLICATION_WIDTH = 900;
public static final int APPLICATION_HEIGHT = 900;
private static final long serialVersionUID = 1L;
private DoodleController sketchPad;
private StatisticsController statsController;
private DoodleTurtle turtle1;
private DoodleTurtle turtle2;
/**
* Constructs and initializes the GUI.
*
* @precondition none
* @postcondition none
*/
public Gui() {
this.turtle1 = new DoodleTurtle();
this.turtle2 = new DoodleTurtle();
this.sketchPad = new DoodleController(this.turtle1, this.turtle2);
this.statsController = new StatisticsController(this.turtle1, this.turtle2);
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
I have tried this however, I am getting an error. What do I do?