Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make number of dummy elements grow as needed #5

Merged
merged 1 commit into from
Sep 8, 2020

Conversation

thepaperpilot
Copy link
Contributor

Instead of being hard-coded to 16, the number of dummy elements will now be calculated based on the width of the page, and grow as necessary when the page is resized.

Note that elements are not destroyed, since even a very large monitor won't have too many elements and creating/destroying elements on every resize may introduce a (very minor) performance concern. This way its still fast, since at most it'll only ever create ~6 elements on most monitors, but it can still handle infinitely large monitors.

Instead of being hard-coded to 16, the number of dummy elements will now be calculated based on the width of the page, and grow as necessary when the page is resized.

Note that elements are not destroyed, since even a very large monitor won't have too many elements and creating/destroying elements on every resize may introduce a (very minor) performance concern. This way its still fast, since at most it'll only ever create ~6 elements on most monitors, but it can still handle infinitely large monitors.
@asteriskman7
Copy link
Member

I like the idea of adding elements as necessary but not bothering to delete them.

@asteriskman7 asteriskman7 merged commit eda2e1c into r-incremental-games:master Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants