GridWorld Case Study Flashcards
What does a Flower do when it acts?
Becomes darker
What does a Rock do when it acts?
Nothing
What does a Bug do when it acts?
When facing an empty spot or Flower, moves onto that spot and leaves a Flower behind. When facing another type of Actor or a Grid edge, turns 45 degrees right and doesn’t move.
What does a BoxBug do when it acts?
Moves like a Bug, but traces out a square if there are no obstacles. If blocked, it turns 90 degrees right and starts over.
What does a Critter do when it acts?
Eats (removes from the Grid) all neighboring actors (except Rocks and other Critters), then randomly picks a neighboring location and moves there (without changing direction).
What does a ChameleonCritter do when it acts?
Picks a random neighbor and matches its color (doesn’t change color if there are no neighboring Actors), then moves randomly like a Critter after turning to face the direction it moves.
What does an Actor do when it acts?
Reverses direction (subclasses of Actor generally override this method).
Flower’s parent is…
Actor
Rock’s parent is…
Actor
Bug’s parent is…
Actor
Critter’s parent is…
Actor
BoxBug’s parent is…
Bug
ChameleonCritter’s parent is…
Critter