Created
November 10, 2020 00:16
-
-
Save AlabasterAxe/7116a6de8d2c71c151722038aa46a9aa to your computer and use it in GitHub Desktop.
maintaining the infinite ground
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
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