Skip to content

Instantly share code, notes, and snippets.

@AlabasterAxe
Created November 9, 2020 23:54
Show Gist options
  • Select an option

  • Save AlabasterAxe/b4da367387a34063a0148dc0d000a609 to your computer and use it in GitHub Desktop.

Select an option

Save AlabasterAxe/b4da367387a34063a0148dc0d000a609 to your computer and use it in GitHub Desktop.
registering our update call as a listener to our worldController
Duration lastUpdateCall = Duration();
@override
void initState() {
super.initState();
worldController =
AnimationController(vsync: this, duration: Duration(days: 99));
worldController.addListener(_update);
}
void _update() {
dino.update(lastUpdateCall, worldController.lastElapsedDuration)
lastUpdateCall = worldController.lastElapsedDuration
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment