Skip to content

Instantly share code, notes, and snippets.

@fmendozaro
Last active November 26, 2019 18:16
Show Gist options
  • Save fmendozaro/110c8ddb55d2a4e0aa96c5ce3e976c9e to your computer and use it in GitHub Desktop.
Save fmendozaro/110c8ddb55d2a4e0aa96c5ce3e976c9e to your computer and use it in GitHub Desktop.
### Bonus Improve your Adventure Game
- Create a new branch called `OOP` in your Adventure Game repo.
- Start to improve the code using OOP best practices, start with small steps.
- A couple of suggestions are:
- Create a Player class for the actual user and it's fields and actions.
- Both Players and Enemies could be defined in the same class since they share a lot of fields in common like: `Health`, `Attack`, `Defense`, etc. And just have a boolean property that difference each other i.e. `isHero = true`
- Try to identify what's the best datatype for each field, talk to your partner about this.
Remember this exercise is all about experimentation, you will noticed you might change your mind the more you know and practice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment