|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.collegeboard.gridworld.actor.Actor
com.collegeboard.gridworld.actor.Critter
public class Critter
| Constructor Summary | |
|---|---|
Critter()
Constructs a green critter that drops flowers as it moves. |
|
Critter(Color color)
Constructs a critter of a given color that drops flowers as it moves. |
|
| Method Summary | |
|---|---|
void |
act()
Override this method with the action that your actor carries out.actor needs to |
boolean |
canMove()
Checks whether this critter can move in the current direction. |
void |
move()
Moves in the current direction. |
void |
setTracing(boolean b)
|
void |
turn()
Turns 45 degrees to the right. |
| 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 |
|---|
public Critter()
public Critter(Color color)
color - the color for this critter| Method Detail |
|---|
public void act()
Actor
act in class Actorpublic void turn()
public void move()
public boolean canMove()
public void setTracing(boolean b)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||