Lesson 4.2: Refactoring to Use Attack Command

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

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