Skip to content

Instantly share code, notes, and snippets.

@AlabasterAxe
Created November 10, 2020 00:16
Show Gist options
  • Save AlabasterAxe/7116a6de8d2c71c151722038aa46a9aa to your computer and use it in GitHub Desktop.
Save AlabasterAxe/7116a6de8d2c71c151722038aa46a9aa to your computer and use it in GitHub Desktop.
maintaining the infinite ground
if (groundlet.getRect(screenSize, runDistance).right < 0) {
setState(() {
ground.remove(groundlet);
ground.add(Ground(
worldLocation: Offset(
ground.last.worldLocation.dx +
groundSprite.imageWidth / WORLD_TO_PIXEL_RATIO,
0)));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment