TeachingKidsProgramming/TeachingKidsProgramming.Source.Java

Provide better way to override default Turtle panel

Closed this issue · 1 comments

Because getPanel will create a new panel if the panel is null, the order of operations matters in some recipes. In particular we have a hint in ManyAnimals indicating that turtles must be added to the MultiTurtlePanel before any other methods are called. The addTurtle method will set the MultiTurtlePanel instance to be the Turtle's panel, and this is how we get more than one turtle on a panel. The hint is basically a workaround the default Turtle behavior, and it would be better to have a solution that did not require overtly hinting the students.

refactored and lazyWindow object introduced