Class BallTurtle
java.lang.Object
SpritePixels
BallTurtle
public class BallTurtle
- extends SpritePixels
This class provides the turtle's appearance, the array of pixels
that make up its image. In this case, the image is a circle.
Constructor Summary |
BallTurtle(java.awt.Color color,
double heading)
|
BallTurtle(int diameter,
java.awt.Color color,
double heading)
|
Method Summary |
protected void |
initSpritePixels(int turtleSideSize)
Initialize the pixels composing the Sprite's image, a ball. |
boolean |
setSpriteHeading(double newHeading)
Rotate the turtle to a specified heading (radians). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BallTurtle
public BallTurtle(java.awt.Color color,
double heading)
BallTurtle
public BallTurtle(int diameter,
java.awt.Color color,
double heading)
initSpritePixels
protected void initSpritePixels(int turtleSideSize)
- Initialize the pixels composing the Sprite's image, a ball.
- Overrides:
initSpritePixels
in class SpritePixels
setSpriteHeading
public boolean setSpriteHeading(double newHeading)
- Rotate the turtle to a specified heading (radians).
Return true if the Sprite's image changed, false if not.
Override SpritePixels.setSpriteHeading() and do nothing.
Rotating a ball does not change its image...
- Overrides:
setSpriteHeading
in class SpritePixels