currentFrame = world.level.getAnimation(ship.getSpriteName()).getKeyFrame(ship.getTime(), true);
currentFrame.flip(false, false);
}
TextureRegion image = new TextureRegion(currentFrame);
Image object = new Image(image);
object.setPosition(ship.getPosition().x + ship.getWidth() / 3 - currentFrame.getRegionWidth() / 2,
ship.getPosition().y + ship.getHeight() / 3 - currentFrame.getRegionHeight() / 2);
object.setOrigin(currentFrame.getRegionWidth() / 2, currentFrame.getRegionHeight() / 2);
object.setWidth(currentFrame.getRegionWidth());
object.setHeight(currentFrame.getRegionHeight());
object.setScale(ship.getRenderScaleX(), ship.getRenderScaleY());
object.setRotation(ship.getRotation());
if (ship.isDead()) {
object.setColor(1, 1, 1, ship.getAlpha());
}
stage.addActor(object);
if (ship.isSLOW()) {
TextureRegion slowSprite = new TextureRegion(world.level.getTexture("shipSlow"));
Image slow = new Image(slowSprite);
slow.setPosition(ship.getPosition().x + ship.getWidth() / 2 - slowSprite.getRegionWidth() / 2,
ship.getPosition().y + ship.getHeight() / 2 - slowSprite.getRegionHeight() / 2);
slow.setOrigin(slowSprite.getRegionWidth() / 2, slowSprite.getRegionHeight() / 2);
slow.setWidth(slowSprite.getRegionWidth());
slow.setHeight(slowSprite.getRegionHeight());
slow.setScale(ship.getRenderScaleX(), ship.getRenderScaleY());
slow.setRotation(ship.getSlowEffectRotation());
stage.addActor(slow);
}
}