edu.fcps.karel2
Class Robot
java.lang.Object
edu.fcps.karel2.Item
edu.fcps.karel2.Robot
- Direct Known Subclasses:
- Athlete, Carpeter, Harvester, Shifter, Swimmer
public class Robot
- extends Item
Fields inherited from class edu.fcps.karel2.Item |
x, y |
Constructor Summary |
Robot()
|
Robot(int x,
int y,
int dir,
int beepers)
|
Methods inherited from class edu.fcps.karel2.Item |
getX, getY |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
beepers
private int beepers
direction
private int direction
Robot
public Robot()
Robot
public Robot(int x,
int y,
int dir,
int beepers)
getDirection
public int getDirection()
getBeepers
public int getBeepers()
move
public void move()
turnLeft
public void turnLeft()
putBeeper
public void putBeeper()
pickBeeper
public void pickBeeper()
hasBeepers
public boolean hasBeepers()
frontIsClear
public boolean frontIsClear()
rightIsClear
public boolean rightIsClear()
leftIsClear
public boolean leftIsClear()
nextToABeeper
public boolean nextToABeeper()
nextToARobot
public boolean nextToARobot()
facingNorth
public boolean facingNorth()
facingSouth
public boolean facingSouth()
facingEast
public boolean facingEast()
facingWest
public boolean facingWest()
explode
public void explode()
render
public void render(java.awt.Graphics g,
edu.fcps.karel2.util.Coordinate c)
- Description copied from class:
Item
- Renders the Item.
- Specified by:
render
in class Item