DungeonAssetManager.java
public class DungeonAssetManager {
public AssetManager manager;
public Animation<TextureRegion> playerAnimation;
public Animation<TextureRegion> enemyAnimation;
public DungeonAssetManager(){
manager = new AssetManager();
}
public void queueAddDefaultAnimations(){
manager.load(playerImage, Texture.class);
manager.load(enemyImage, Texture.class);
playerAnimation = GifDecoder.loadGIFAnimation(Animation.PlayMode.LOOP, Gdx.files.internal("Textures/Sprites/knight_run.gif").read());
enemyAnimation = GifDecoder.loadGIFAnimation(Animation.PlayMode.LOOP, Gdx.files.internal("Textures/Sprites/demon_run.gif").read());
}
...
loadingScreen.java
...
queueAddDefaultAnimations();
queueAddDefaultImages();
queueAddDefaultMusic();
queueAddDefaultSounds();
queueAddDefaultTextures();
parent.assMan.manager.finishLoading();
...
game.java
...
// sb = SpriteBatch
sb.draw(animation.getKeyFrame(elapsed), body.getPosition().x - ((.5f) * width), body.getPosition().y - ((.5f) * height), width, height);
...