|
|||||||||
| 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.Alien
public class Alien
An alien is an actor that can move and turn. It drops flowers as it moves. Override an alien to draw shapes in the actor world.
copyright© 2005 Cay S. Horstmann (http://horstmann.com)
| Constructor Summary | |
|---|---|
Alien()
Constructs a green alien. |
|
Alien(Color color)
Constructs an alien of a given color. |
|
| Method Summary | |
|---|---|
void |
act()
Override this method to define the action of this actor. |
boolean |
canMove()
Tests whether this alien can move forward. |
void |
move()
|
void |
turn()
Makes this alien turn by 45 degrees to the right. |
| Methods inherited from class com.collegeboard.gridworld.actor.Actor |
|---|
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, toString, turnBy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Alien()
public Alien(Color color)
color - the color for this alien| Method Detail |
|---|
public void act()
Actor
act in class Actorpublic void turn()
public void move()
public boolean canMove()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||