Skip to content

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