java.lang.Objectgreenfoot.Actor
UrRobot
StairSweeper
public class StairSweeper
A StairSweeper knows how to climb one stair and pick a beeper from it. This is a sample illustration of one way to use this system. Note that the Greenfoot Run command/button is not useful with this class. Use the Act command/button.
| Constructor Summary | |
|---|---|
StairSweeper()
|
|
| Method Summary | |
|---|---|
void |
act()
Act - Climb exactly three stairs, picking a beeper from each. |
void |
climbStair()
Climb one stair |
static void |
getStairs()
Convenience method to get an appropriate world for the StairSweeper. |
| Methods inherited from class UrRobot |
|---|
addedToWorld, learnLocation, move, pickBeeper, putBeeper, setLocation, sleep, turnLeft, turnOff |
| Methods inherited from class greenfoot.Actor |
|---|
getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, setImage, setImage, setRotation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StairSweeper()
| Method Detail |
|---|
public void act()
act in class UrRobotpublic void climbStair()
public static void getStairs()