This was another large chapter with many improvements to our game engine. Along the way we also learned some key concepts and design patterns that can be used in any .NET and C# project. Learning in the context of building a game is always more fun for me, so I hope you're all enjoying the … Continue reading Lesson 4.15: The Wrap
Tag: unit tests
Lesson 4.12: Read Monster Data File
We are going to continue our move to data files by working on the monster data. We will follow the same design that we described in the last lesson. We will create a new JSON data file, create a couple of Data Transfer Objects to use in serialization, and update the MonsterFactory to load and … Continue reading Lesson 4.12: Read Monster Data File
Lesson 4.11: Load Item Data From JSON File
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
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