Write a class called CourageCritter that extends Critter.
A CourageCritter looks at all the locations within two steps of its current location. (Note: For a critter not near an edge, this includes 24 locations).
The CourageCritter counts all the Critters within those locations.
If there are fewer than c critters, the CourageCritter's color gets brighter.
If there are c or more critters, the CourageCritter's color gets darker.
The value of c indicates the courage level of the Critter. The courage level is set in the constructor.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment