Skip to content

Instantly share code, notes, and snippets.

@philipshen
Created June 16, 2018 14:47
Show Gist options
  • Save philipshen/2f0863609b353adc42fdccd5006d960e to your computer and use it in GitHub Desktop.
Save philipshen/2f0863609b353adc42fdccd5006d960e to your computer and use it in GitHub Desktop.
update(dt) {
const { angleSpeed } = this;
if (angleSpeed !== 0) {
const angle = this.angle = MathUtilities.clamp(this.angle + angleSpeed * dt,
this.leftMaxAngle * -1,
this.rightMaxAngle);
this.barrel.rotation = angle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment