info.gridworld.actor
Class Rock
java.lang.Object
info.gridworld.actor.Actor
info.gridworld.actor.Rock
public class Rock
- extends Actor
A Rock is an actor that does nothing. It is commonly used to
block other actors from moving.
The API of this class is testable on the AP CS A and AB exams.
|
Constructor Summary |
Rock()
Constructs a black rock. |
Rock(Color rockColor)
Constructs a rock of a given color. |
|
Method Summary |
void |
act()
Overrides the act method in the Actor class
to do nothing. |
Rock
public Rock()
- Constructs a black rock.
Rock
public Rock(Color rockColor)
- Constructs a rock of a given color.
- Parameters:
rockColor - the color of this rock
act
public void act()
- Overrides the
act method in the Actor class
to do nothing.
- Overrides:
act in class Actor