Lesson 4.4: Create the First Consumable Item

Most game players are familiar with consumable items - these are single use items that are used to provide the player an effect... like a potion of healing that lets us rejuvenate some of our hit points. This is a common concept in many roleplaying games. So we are going to introduce a Granola bar … Continue reading Lesson 4.4: Create the First Consumable Item

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

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

Lesson 3.11: Adding Quests to Locations

Quests are a core concept of any roleplaying game. Various people send our player off on quests to kill some monsters, return with items for potions, retrieve the secret stone, and so much more. These provide some of the motivations for our heroes to adventure. Then when the player completes the quests, they may get … Continue reading Lesson 3.11: Adding Quests to Locations

Lesson 3.9: Adding Traders to the Game Engine

As we go around the village ridding it of monsters, we are starting to accumulate items (snakeskins, fangs, and rat tails). We need to do something with these before they start to clutter up our inventory... not to mention smelling up our backpack. Let's add traders to the game so that we can sell these … Continue reading Lesson 3.9: Adding Traders to the Game Engine

Lesson 3.8: Simple Monster Combat

Now that we have the pieces in place, we are going to allow our players to fight these terrible monsters that are terrorizing the village. The initial combat simulation will be simple: the player will fight one monster at a time.attacks with weapons will always succeed.damage is rolled randomly based on the selected weapon and … Continue reading Lesson 3.8: Simple Monster Combat