public class Sprite
extends java.lang.Object
Constructor and Description |
---|
Sprite(java.lang.String imageLoc,
int tileWidth,
int tileHeight,
int cycleSize)
Create a new sprite.
|
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
getSprite(int dRow,
int dCol)
Gets the sprite at a given offset into the spritesheet.
|
void |
tick()
Updates the spritesheet's animation by a single frame.
|
public Sprite(java.lang.String imageLoc, int tileWidth, int tileHeight, int cycleSize)
imageLoc
- the location of the spritesheet imagetileWidth
- the width of an individual image on the spritesheettileHeight
- the height of an individual image on the spritesheetcycleSize
- the number of frames in a sprite's animationpublic 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