Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sprite animate function
const { state } = this.state;
const { framesPerStep, states } = this.props;
if (this.tick === framesPerStep) {
this.tick = 0;
this.setState({
state: (state + 1) % states
});
}
this.tick += 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.