public class Turtle extends Actor
Constructor and Description |
---|
Turtle()
Creates a turtle using the sprite image 'turtle'.
|
Modifier and Type | Method and Description |
---|---|
void |
back(int distance)
Moves the turtle backward (opposite to its current heading direction).
|
void |
clear()
Clears the turtle's playground by painting it black.
|
void |
forward(int distance)
Moves the turtle forward (in its current heading direction).
|
void |
left(double angle)
Turns the turtle to the left.
|
void |
penDown()
Puts down the turtle's pen so it will draw a trace when moving.
|
void |
penUp()
Lifts the turtle's pen so it will not draw a trace when moving.
|
void |
reset()
Calls home().
|
void |
right(double angle)
Turns the turtle to the right.
|
act, addActorCollisionListener, addActorTouchListener, addActorTouchListener, addBorderListener, addCollisionActor, addCollisionActors, addCollisionTile, addCollisionTiles, addTileCollisionListener, collide, collide, delay, displace, getBackground, getCollisionActors, getCollisionActorsInRange, getCollisionTiles, getCurrentImage, getDirection, getDirectionStart, getDisplacePosition, getHeight, getIdVisible, getImage, getImage, getIntDirection, getLocation, getLocationOffset, getLocationStart, getNbCycles, getNbHorzCells, getNbSprites, getNbVertCells, getNeighbours, getNeighbours, getNextMoveLocation, getPixelColor, getPixelLocation, getRotatedImage, getRotatedPosition, getRotationIndex, getScaledImage, getScaledImage, getScaledImage, getSlowDown, getWidth, getX, getXStart, getY, getYStart, getZoomedImage, hide, isActEnabled, isActorCollisionEnabled, isHorzMirror, isInGrid, isMoveValid, isNearBorder, isRemoved, isRotatable, isVertMirror, isVisible, move, move, nearBorder, removeSelf, rotate, rotate, setActEnabled, setActorCollisionEnabled, setActorTouchCircle, setActorTouchCircle, setActorTouchEnabled, setActorTouchImage, setActorTouchImage, setActorTouchRectangle, setActorTouchRectangle, setCollisionCircle, setCollisionCircle, setCollisionImage, setCollisionImage, setCollisionLine, setCollisionLine, setCollisionRectangle, setCollisionRectangle, setCollisionSpot, setCollisionSpot, setDirection, setDirection, setDisplacePosition, setHorzMirror, setLocation, setLocationOffset, setOnBottom, setOnTop, setPixelLocation, setSlowDown, setVertMirror, setX, setY, show, show, showNextSprite, showPreviousSprite, turn
public Turtle()
public void penDown()
public void penUp()
public void clear()
public void reset()
public void forward(int distance)
distance
- the distance in pixels to move forwardpublic void back(int distance)
distance
- the distance in pixels to move backwardpublic void left(double angle)
angle
- the turning angle (in degrees)public void right(double angle)
angle
- the turning angle (in degrees)