Blog Feed

Lesson 4.14: Move Remaining Data to JSON

We've made progress moving our data files thus far. In this lesson we are going to convert the last three factories to load their data from JSON files. We will follow the patterns that have been used in the last 3 lessons: Data Transfer Objects, our JsonSerializationHelper, and modifying the factories to retrieve instances of … Continue reading Lesson 4.14: Move Remaining Data to JSON

Lesson 4.13: Read World Data from File

As we continue moving our data from code to files, the world locations are the big source of data to convert. We will follow the same design principles as the last two lessons: JSON file with data, Data Transfer Objects for reading data and creating game objects, and refactoring corresponding game classes to be more … Continue reading Lesson 4.13: Read World Data from File

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.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.9: Enhanced Combat with Battle Class

In this lesson, we are going to focus on refactoring our combat functionality out of the GameSession view model. There are various methods that deal with combat and handle either player or monster deaths, so it would be helpful to encapsulate all of the combat related code into its own Battle class. We are also … Continue reading Lesson 4.9: Enhanced Combat with Battle Class

Lesson 4.8: Create Centralized Message Broker

As we plan to refactor and expand the combat system, we notice that there are a lot of messages returned from combat methods that need to be displayed. Our plan is to refactor the combat code out of the GameSession class and into its own class that manages the intricacies of combat. To make it … Continue reading Lesson 4.8: Create Centralized Message Broker

Lesson 4.7: Ability to Display Quest and Recipe Data

Currently we have the quest and recipe data concisely shown in the Quests and Recipes tables that only display their names and status. Once we get past the original receiving of the quest, it can be difficult to remember that is needed to complete a quest or recipe. So we are going to enable the … Continue reading Lesson 4.7: Ability to Display Quest and Recipe Data

Lesson 4.6: Add Keyboard Shortcuts for Game Operations

Part of a good game is being able to take multiple forms of input. To this point, we have focused on touch and mouse input. In this lesson, we will add keyboard input to the game and handle keyboard keys and shortcuts to perform specific game actions, like moving or fighting or using a consumable … Continue reading Lesson 4.6: Add Keyboard Shortcuts for Game Operations