public class Character extends DirectionAnimatedSprite
|Modifier and Type||Field and Description|
The speed the character moves with.
Position where the character should move to.
currentDirection, movementAnimations, noMovementAnimations
|Constructor and Description|
Create a new sprite.
|Modifier and Type||Method and Description|
Move the sprite according to the defined speed.
Sets the target position of the character.
draw, setAllMovementAnimations, setAllNoMovementAnimations, setMovementAnimation, setNoMovementAnimation
absoluteBorder, draw, ensureBoundaryPolicy, getDimension, getHeight, getPosition, getVelocity, getWidth, intersects, intersects, intersects, intersects, intersects, isActive, isVisible, keyPressed, keyReleased, keyTyped, loadPolygonFromFile, mouseClicked, mouseClicked, mouseEntered, mouseExited, mousePressed, mousePressed, mouseReleased, move, setActive, setBorder, setBounds, setPosition, setVelocity, setVisible, stop
protected int speed
protected java.awt.Point target
public Character(Board board, java.awt.Point startPoint, int speed, Sprite.BoundaryPolicy policy, AnimatedImage noDirection, AnimatedImage west, AnimatedImage east, AnimatedImage north, AnimatedImage south, AnimatedImage noMovementWest, AnimatedImage noMovementEast, AnimatedImage noMovementNorth, AnimatedImage noMovementSouth)
board- our board
startPoint- start position
speed- the speed of the object
policy- policy used when sprite reaches
noDirection- animation for no direction
west- animation for movement to the west
east- animation for movement to the east
north- animation for movement north
south- animation for movement south
noMovementWest- animation for non-moving sprite, facing to the west
noMovementEast- animation for non-moving sprite, facing to the east
noMovementNorth- animation for non-moving sprite, facing to the north
noMovementSouth- animation for non-moving sprite, facing to the south