Skip to content

Instantly share code, notes, and snippets.

@AlexJWayne
Created October 14, 2009 17:00
Show Gist options
  • Select an option

  • Save AlexJWayne/210225 to your computer and use it in GitHub Desktop.

Select an option

Save AlexJWayne/210225 to your computer and use it in GitHub Desktop.
function update() {
timer += deltaTime;
if (state == holstered && timer >= holsterTime) {
timer = 0;
state = aiming;
} else if (state == aiming && timer >= aimTime) {
timer = 0;
state = firing;
} else if (state == firing && timer >= fireTime) {
timer = 0;
state = holstered;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment