Created
November 9, 2020 23:51
-
-
Save AlabasterAxe/9814ccefc8244bf8453b0e470442e408 to your computer and use it in GitHub Desktop.
registering our update call as a listener to our worldController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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