public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); rotation = (rotation + 0); sprite.setSize(screenRectangle.width, screenRectangle.height); sprite.setPosition(screenRectangle.x, screenRectangle.y); sprite.setOriginCenter(); if (Gdx.input.isKeyJustPressed(keyRight)) { body.setTransform(body.getPosition().x + 5, body.getPosition().y, body.getAngle()); } elapsedTime += Gdx.graphics.getDeltaTime(); // body.setTransform(body.getPosition(), rotation); batch.end(); batch.begin(); sprite.setRotation(rotation); sprite.draw(batch); // batch.draw(animation.getKeyFrame(elapsedTime, true), screenRectangle.x, screenRectangle.y, // screenRectangle.width, screenRectangle.height ); // animation.setFrameDuration(0.09f); }