public class TurtleRobot extends LegoRobot
| Constructor and Description |
|---|
TurtleRobot()
Creates a TurtleLegoRobot instance.
|
TurtleRobot(boolean waitStart)
Creates TurtleLegoRobot instance and delays execution until the user
presses the ENTER button.
|
| Modifier and Type | Method and Description |
|---|---|
TurtleRobot |
backward(int steps)
Moves the turtle backward the given number of steps.
|
TurtleRobot |
forward(int steps)
Moves the turtle forward the given number of steps.
|
Gear |
getGear()
Returns the gear used as component of the turtle.
|
int |
getTurtleSpeed()
Returns the current turtle speed.
|
TurtleRobot |
left(int angle)
Turns the turtle to the left for the given angle.
|
TurtleRobot |
right(int angle)
Turns the turtle to the right for the given angle.
|
TurtleRobot |
setTurtleSpeed(int speed)
Sets the turtle speed to the given value.
|
addButtonListener, addPart, clearDisplay, drawString, drawStringAt, exit, getBatteryLevel, getHitButtonID, getRobotProperties, getVersion, isButtonHit, isDownHit, isEnterHit, isEscapeHit, isLeftHit, isRightHit, isUpHit, playTone, setLED, setVolumepublic TurtleRobot(boolean waitStart)
waitStart - if true, the execution is stopped until the ENTER button is hit.public TurtleRobot()
public Gear getGear()
public TurtleRobot setTurtleSpeed(int speed)
speed - 0..100public int getTurtleSpeed()
public TurtleRobot forward(int steps)
steps - the number of steps to go.public TurtleRobot backward(int steps)
steps - the number of steps to go.public TurtleRobot left(int angle)
angle - the angle in degree to rotate.public TurtleRobot right(int angle)
angle - the angle in degree to rotate.