ProjectZombie/src/shootergame/util/gl/texture/TextureReferenceAnimation.java

26 lines
482 B
Java

package shootergame.util.gl.texture;
public abstract class TextureReferenceAnimation extends TextureReference
{
private TextureReference[] references;
private int upto = 0;
public TextureReferenceAnimation(TextureReference[] references)
{
this.references = references;
}
@Override
public void texCoord(float x, float y) {
references[upto].texCoord(x, y);
}
public void tick()
{
// Cycle through all the textures
upto += 1;
upto %= references.length;
}
}