public class Sprite
extends java.lang.Object
Constructor and Description |
---|
Sprite(java.lang.String imageLoc,
int width,
int height,
int cycleSize)
Constructor: an instance with image at imageLoc, of size (width, height),
and number of frames in the animation cycleSize.
|
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
getSprite(int dRow,
int dCol)
Return offset (dRow, dCol) into the spritesheet.
|
void |
tick()
Update the spritesheet's animation by a single frame.
|
public Sprite(java.lang.String imageLoc, int width, int height, int cycleSize)
public void tick()
public java.awt.image.BufferedImage getSprite(int dRow, int dCol)
dRow
- the number of rows to offset into the spritesheet for the first animationdCol
- the number of columns to offset into the spritesheet for the first animation