info.gridworld.actor
Class Flower
java.lang.Object
info.gridworld.actor.Actor
info.gridworld.actor.Flower
public class Flower
- extends Actor
A Flower
is an actor that darkens over time. Some actors drop
flowers as they move.
The API of this class is testable on the AP CS A and AB exams.
Constructor Summary |
Flower()
Constructs a pink flower. |
Flower(Color initialColor)
Constructs a flower of a given color. |
Method Summary |
void |
act()
Causes the color of this flower to darken. |
Flower
public Flower()
- Constructs a pink flower.
Flower
public Flower(Color initialColor)
- Constructs a flower of a given color.
- Parameters:
initialColor
- the initial color of this flower
act
public void act()
- Causes the color of this flower to darken.
- Overrides:
act
in class Actor