Skip to content

Instantly share code, notes, and snippets.

@vlat456
Created August 30, 2016 14:41
Show Gist options
  • Save vlat456/a118b586d0db4f883d2e699771c58b26 to your computer and use it in GitHub Desktop.
Save vlat456/a118b586d0db4f883d2e699771c58b26 to your computer and use it in GitHub Desktop.
public void update() {
prevX = getX();
cleanup();
wrap(playScreen.getViewport());
this.setPosition(b2body.getPosition().x - getWidth()/2f,
b2body.getPosition().y - getHeight()/2f);
this.setRotation((float)Math.toDegrees(b2body.getAngle()));
light.setPosition(b2body.getPosition().x,b2body.getPosition().y);
deltaX = prevX - getX();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment