Class Robot
java.lang.Object
|
+----Robot
- public class Robot
- extends Object
- implements Runnable
A Robot is a self-animating object that
moves (or tries to move) when you switch it on.
-
myStepper
-
-
on
-
-
Robot(Stepper, Color)
-
-
act()
- This method is called periodically by run() if the robot is on.
-
run()
- run() has a while(true) whose body calls act() if the robot
is on, and does nothing otherwise.
-
switchOff()
- switchOff() turns the robot off
-
switchOn()
- switchOn() turns the robot on
myStepper
protected Stepper myStepper
on
protected boolean on
Robot
public Robot(Stepper s,
Color c)
switchOn
public void switchOn()
- switchOn() turns the robot on
switchOff
public void switchOff()
- switchOff() turns the robot off
run
public void run()
- run() has a while(true) whose body calls act() if the robot
is on, and does nothing otherwise.
act
public void act()
- This method is called periodically by run() if the robot is on.