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

Implement sprite pooling #4

Closed
spmurrayzzz opened this issue Mar 10, 2014 · 1 comment
Closed

Implement sprite pooling #4

spmurrayzzz opened this issue Mar 10, 2014 · 1 comment

Comments

@spmurrayzzz
Copy link
Owner

Presently, all the asteroid sprites are created on-demand in perpetuity. This is problematic for frame rates in the long run.

Alternative here would be to create a finite amount of sprites up front and recycle them as needed.

@spmurrayzzz
Copy link
Owner Author

Added this functionality for laser and starfield sprites, but still need a game plan for asteroids (and future enemy entities).

For the time being, asteroids are removed from the display group on out of bounds events (which helps keep GC ticks small), but we're still creating them in a timed loop which is not performant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant