public class Animal extends Interactable implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private Direction |
curDir
Current Direction of the Animal
|
private int |
health
Health of the Animal
|
private static int |
imageHeight
Height of the Animal
|
private static int |
imageWidth
Width of the Animal
|
private int |
speed
Speed of the Animal
|
height, width, xLocation, yLocation
Constructor and Description |
---|
Animal()
Constructor for the animal object.
|
Modifier and Type | Method and Description |
---|---|
Direction |
getDirection()
Simple getter method that retrieves the current direction of the animal.
|
int |
getHealth()
Simple getter method that retrieves the current health of the animal.
|
void |
loseHealth()
"Decreases the health of the animal by 30.
|
void |
setDirection(Direction direction)
"Sets the direction of the animal.
|
addXLocation, addYLocation, getCollidesWith, getCollisionRect, getHeight, getWidth, getXLocation, getYLocation, setRelativeCollisionRect, setXLocation, setYLocation
private Direction curDir
private int speed
private static int imageHeight
private static int imageWidth
private int health
public Animal()
None.
- public Direction getDirection()
empty
- public void setDirection(Direction direction)
direction
- The direction that the user wants the crab to gopublic int getHealth()
empty
- public void loseHealth()
empty
-