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 1 #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Refactor 1 #19

wants to merge 1 commit into from

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