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

Refactor 6 #24

Open
wants to merge 1 commit into
base: refactor-5
Choose a base branch
from
Open

Refactor 6 #24

wants to merge 1 commit into from

Conversation

michaeltintiuc
Copy link
Member

This is the sixths step of refactoring:

  • Cleanup Player component
  • Improve collision
  • Improve movement

We've further cleaned up the Player component by removing DOM access function and simplified the collision logic by creating Rect and Collider helper classes. Each collidable component now uses a new useColliders custom hook that pushes it's collision info such as position, size, type and what happens on collision to the global context's colliders array that is then being looped within the Player component and react to collisions differently based on their type. This setup is much easier to follow, manage and update, we can easily make our coins do damage or fire yeild bonus points.

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.

1 participant