com.collegeboard.gridworld.actor
Class Flower

java.lang.Object
  extended by com.collegeboard.gridworld.actor.Actor
      extended by com.collegeboard.gridworld.actor.Flower

public class Flower
extends Actor

Some actors drop flowers as they move. Flowers wilt by turning black over time.

copyright© 2005 Cay S. Horstmann (http://horstmann.com)

Author:
Cay Horstmann

Constructor Summary
Flower()
          Constructs a pink flower.
Flower(Color color)
          Constructs a flower of a given color.
 
Method Summary
 void act()
          When a flower acts, it "wilts", gradually losing its color.
 
Methods inherited from class com.collegeboard.gridworld.actor.Actor
getColor, getDirection, getGrid, getLocation, getValidNeighborLocations, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, toString, turn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Flower

public Flower()
Constructs a pink flower.


Flower

public Flower(Color color)
Constructs a flower of a given color.

Parameters:
color - the initial color of this flower
Method Detail

act

public void act()
When a flower acts, it "wilts", gradually losing its color.

Specified by:
act in class Actor