Created
November 9, 2020 23:54
-
-
Save AlabasterAxe/b4da367387a34063a0148dc0d000a609 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