public class Animation
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
curSpriteIndex
The index of the current sprite being shown within an animation
|
int |
intervalDelayCounter
Counts the delay between each sprite
|
GameObject |
owner
The object the animation belong to
|
boolean |
pause
Used to pause the animation
|
Sprite |
sprite
Stores all of the sprites to create an animation
|
| Constructor and Description |
|---|
Animation()
The default constructor of the class
|
Animation(GameObject owner,
Sprite sprite)
The general constructor of the class used to create a new animation with the given parameters
|
| Modifier and Type | Method and Description |
|---|---|
void |
paint(java.awt.Graphics g)
Draws the sprites, rotated or flipped if necessary, of the animation
|
void |
reset()
Used to reset the animation back to the initial state
|
void |
update()
Updates the animation by changing the index of the animation using the interval delay
|
public GameObject owner
public int curSpriteIndex
public boolean pause
public int intervalDelayCounter
public Sprite sprite
public Animation()
public Animation(GameObject owner, Sprite sprite)
owner - The owner the animation belongs tosprite - The sprites of the animationspublic void paint(java.awt.Graphics g)
g - An instance of the Graphics objectpublic void update()
public void reset()