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
Month: July 2020
Lesson 3.4: Random Dice Roller
Many game systems have a way of producing randomized results. Be it selecting a random number in some range (min-max), flipping coins, or rolling dice. For RPGs, rolling dice is a seminal concept -- you've seen it in all the RPGs that you've likely played. It is burned into the genre by the popularity of … Continue reading Lesson 3.4: Random Dice Roller
Lesson 3.3: Build Inventory System
Starting with a simple inventory item list was a good way to being thinking about this problem and building the user experience to show a player's inventory. However, exposing the list directly and allowing all callers to edit the list can lead to a lot of duplicate code editing that list, and builds more interdependencies … Continue reading Lesson 3.3: Build Inventory System
Lesson 3.2: Initial Player Inventory
Our first attempt at providing player inventory will be a simple one -- and we will expand upon it as we build out the game engine. For this initial system, we are going to use a simple list in the Player class that holds the player's items. using System.Collections.Generic; namespace SimpleRPG.Game.Engine.Models { public class Player … Continue reading Lesson 3.2: Initial Player Inventory
Lesson 3.1: Game Items and Factory
We are going to build the start of an inventory system. To encapsulate the concept of items in our game, we are going to define a GameItem model class. This class will have the base properties of all GameItems. Then, we will define a derived class for Weapon. Weapon is a specialized item that also … Continue reading Lesson 3.1: Game Items and Factory
Lesson 2.11: The Wrap
We have created our initial game engine which supports a player, location, game world, and moving around within it. Then we created the UI elements/components to display those in our game screen. We now have a game that we can move around in and investigate the images and descriptions of each location in our limited … Continue reading Lesson 2.11: The Wrap
Lesson 2.10: Moving in the Game World
Showing the player's location is the first step, but we also need to provide the ability to move around our game world. We're going to build some controls and event handlers that move the player between adjacent locations in the world. To begin we're going to create a new view model class to assist with … Continue reading Lesson 2.10: Moving in the Game World
Lesson 2.9: Creating The Game World
The location was a single spot in a larger game world. We want to represent the game world as a grid of places that the player can move to. We will manage that by creating a new World model class that encapsulates the structure of the world and exposes some methods for retrieving location data. … Continue reading Lesson 2.9: Creating The Game World
Lesson 2.8: Game Location
Now that we have our core design components in place (MVVM, Dependency Injection, Blazor components, and unit test coverage), we are going to focus on building out more game functionality. We will start with the game location. This lesson will add a Model class, update the view model, create a Blazor component to show the … Continue reading Lesson 2.8: Game Location
Lesson 2.7: Adding a Test Mocking Framework
With our current test project, we have several classes that we created to "mock" some simple behavior for our tests: MockGameSession, MockJSRuntime, and MockIconProvider. As we build out our game, we will need to mock more classes to help simplify our testing. Creating mock objects manually is repetitive and time consuming, so to increase our … Continue reading Lesson 2.7: Adding a Test Mocking Framework