Skip to content

Conversation

michaeltintiuc
Copy link
Member

This is the first step of refactoring:

  • Create a global context
  • Create appropriate constants

By creating a global context we can now switch the state of the game from any of our components and add logic that depends on certain states. For instance change how certain objects are rendered or react to input, instead of checking player health. We can also move the player health state from the App component to the Player component. All of these things will be implemented in the future PRs, we're just laying the groundwork here.

By creating constants (both global and local) we have in a way created an API layer for our components allowing to easily switch tilesets, their size, etc. Even though this is only the first step it's already much cleaner.

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