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 chunk-like system for space #1

Open
KennethGomez opened this issue Apr 7, 2021 · 0 comments
Open

Implement chunk-like system for space #1

KennethGomez opened this issue Apr 7, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@KennethGomez
Copy link
Owner

What this system aims is to provide a performant way to iterate through stars for hovering animations;

The idea is the following:

  • Create a grid of chunks of 64 x 64 pixels.
  • Assign stars to a chunk depending on its position grid[(star.x / 64) | 0][(star.y / 64) | 0] .
  • For star finding algorithm look on the chunk on which the pointer is on grid[(p.x / 64) | 0][(p.y / 64) | 0] and look on nearby chunks depending on if the look-up distance is outside of the main chunk bounds.
@KennethGomez KennethGomez added the enhancement New feature or request label Apr 7, 2021
@KennethGomez KennethGomez self-assigned this Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant