We currently define all of our game data in code. We did this for simplicity and to learn the coding concepts without worrying about data management. If we want to add a new GameItem, we need to code that into the ItemFactory. But as we grow our game, we really need to move all of … Continue reading Lesson 4.11: Load Item Data From JSON File
Tag: unit tests
Lesson 4.10: Attack Initiative and Hit Logic
Now that we have the Battle class, we're going to make the combat more interesting. Currently combat is very static... the player attacks and monster and then the monsters respond with their own attack. Attacks always hit the opponent and cause a random amount of damage. But that's really all the variance in the combat … Continue reading Lesson 4.10: Attack Initiative and Hit Logic
Lesson 4.3 Monsters Attack with Weapons
Since we moved the player's weapon to use the Attack command/action, it makes sense to do the same with the monsters too. The monsters are technically fighting with their natural weapons, be it a bite or claw attack. But if we want our hero to eventually fight other humanoids, then those would also fight with … Continue reading Lesson 4.3 Monsters Attack with Weapons