Monday, July 27, 2009

Java AB: Grid World Case Study: Courage Critter (I need some help making)?

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.


No comments:

Post a Comment