inicio personajes y partida

This commit is contained in:
2020-02-18 23:21:25 +01:00
parent f72eede716
commit 32b63d42c4
17 changed files with 130 additions and 13 deletions

View File

@@ -11,13 +11,14 @@ public class Gifs {
private float contadorEstado;
public Gifs(String ruta, int n_estados, int inicio_image, int desplazamiento,
int anchura, int x, int y) {
int anchura, int x, int y, boolean flip) {
textura = new Texture(ruta);
this.n_estados = n_estados;
frames = new TextureRegion[n_estados];
for(int i = 0; i<n_estados; i++) {
frames[i] = new TextureRegion(textura, inicio_image+i*desplazamiento
frames[i] = new TextureRegion(textura, inicio_image+(i*desplazamiento)
, anchura, x, y);
frames[i].flip(flip, false);
}
}
@@ -40,5 +41,7 @@ public class Gifs {
public void draw(SpriteBatch batch, float x, float y) {
batch.draw(this.frames[(int)contadorEstado], x, y);
}
public void dispose() {
this.textura.dispose();
}
}