public ManView(AbstractCharacter model) { this.model = model; textureLeft = TextureLibrary.getTextures(model.getTeam())[0]; textureRight = TextureLibrary.getTextures(model.getTeam())[1]; textureDead = TextureLibrary.getTextures(model.getTeam())[2]; currentTexture = textureLeft; }
@Override public void draw(SpriteBatch batch, float parentAlpha) { super.draw(batch, parentAlpha); float x1 = model.getX() + size; float y1 = model.getY() + size; if (model.getCurrentHealth() <= 0) currentTexture = textureDead; else { if (model.getxSpeed() < 0) currentTexture = textureLeft; if (model.getxSpeed() > 0) currentTexture = textureRight; } batch.draw(currentTexture, x1, y1, size, size); }