Created
November 10, 2020 00:08
-
-
Save AlabasterAxe/3908270e629cf698f749e835617216ae to your computer and use it in GitHub Desktop.
Drawing of all the GameObjects to the screen
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
| for (GameObject object in [...obstacles, dino]) { | |
| children.add( | |
| AnimatedBuilder( | |
| animation: worldController, | |
| builder: (context, child) { | |
| Rect objectRect = object.getRect(screenSize, runDistance); | |
| return Positioned( | |
| top: objectRect.top, | |
| left: objectRect.left, | |
| width: objectRect.width, | |
| height: objectRect.height, | |
| child: object.render()); | |
| }), | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment