public class TurtleRobot extends Robot
collisionCenter, collisionRadius
Constructor and Description |
---|
TurtleRobot()
Creates a turtle robot instance.
|
Modifier and Type | Method and Description |
---|---|
void |
backward()
Starts moving backward and returns immediately.
|
void |
backward(int steps)
Moves the turtle backward the given number of steps.
|
void |
forward()
Starts moving forward and returns immediately.
|
void |
forward(int steps)
Moves the turtle forward the given number of steps.
|
Gear |
getGear()
Returns the gear used for the turtle robot.
|
int |
getTurtleSpeed()
Returns the current turtle speed.
|
void |
left()
Starts turning left and returns immediately.
|
void |
left(double angle)
Turns the left to the right for the given angle.
|
void |
right()
Starts turning right and returns immediately.
|
void |
right(double angle)
Turns the turtle to the right for the given angle.
|
void |
setTurtleSpeed(int speed)
Sets the turtle speed to the given value.
|
addButtonListener, addCollisionListener, addObstacle, addTarget, debug, exit, getGameGrid, getHitButtonID, getRobot, getVersion, isAutonomous, isButtonHit, isConnected, isDownHit, isEnterHit, isEscapeHit, isLeftHit, isRightHit, isUpHit, playTone, playTone, removeObstacle, removeTarget, reset
public void setTurtleSpeed(int speed)
speed
- 0..100public int getTurtleSpeed()
public void forward()
public void forward(int steps)
steps
- the number of steps to go.public void backward(int steps)
steps
- the number of steps to go.public void backward()
public void right(double angle)
angle
- the angle in degree to rotate.public void right()
public void left(double angle)
angle
- the angle in degree to rotate.public void left()
public Gear getGear()