Skip to content

Instantly share code, notes, and snippets.

@AlabasterAxe
Created November 10, 2020 00:08
Show Gist options
  • Select an option

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

Select an option

Save AlabasterAxe/3908270e629cf698f749e835617216ae to your computer and use it in GitHub Desktop.
Drawing of all the GameObjects to the screen
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