With a working game engine, it's time for some changes to make it more flexible and able to support an ever-growing list of features and functions. One large refactoring that we will make is to replace the weapon and monster attack behavior with an Attack command instead. We will learn and use the Command design … Continue reading Lesson 4.2: Refactoring to Use Attack Command
Tag: xUnit
Lesson 4.1: Adding Hit Point, Gold, and Level Management
We left the Player and LivingEntity classes very open ended and allow our code to just set properties for things like hit points and experience. However, there is actually logic that needs to be run when some of these properties change. So we are going to add methods with additional logic to handle these behaviors. … Continue reading Lesson 4.1: Adding Hit Point, Gold, and Level Management
Lesson 3.5: Creating Monsters
Our game now has a player with inventory, game items, and the ability to move between locations. But, no game is complete without some antagonists for our hero to fight. We are going to introduce monsters into the game world for the player to battle. Creating the Monster Class Let's start with a new Monster … Continue reading Lesson 3.5: Creating Monsters
Lesson 1.7: Adding Unit Test Project
Before we get too far along in coding the Simple RPG game, we need to enable building and running unit tests for our project. I've followed various forms of TDD (test-driven development) over the years. And I'm not a purest about writing tests prior to writing code. But I do firmly believe in creating tests … Continue reading Lesson 1.7: Adding Unit Test Project