Now that we have some requirements for the monsters, it’s time to build the class and add a few new guests to the dungeon. As always, building the class requires some serious attention to detail.
Rogue C# – “Here there be monsters.”
It’s a bit lonely in this dungeon game so it’s time to add some monsters and there’s a lot more to it than you’d think. In this chapter, I detail some of what’s involved in adding opponents to our roguelike.
Rogue C# – Inventory Revisited
Before we can introduce monsters and fights to the game, the player needs some items such as weapons in inventory. It’s time to test some of the theory the Inventory class is built on.
Rogue C# – A Little Housekeeping
Fast Play mode let’s the player zip around the map without having to press the direction keys for every space but each space still equals one turn. In this chapter, we code for that and a couple other odds and ends.
Rogue C# – “A mango a day …”
Food is one of the most important items that you look for on the map so it’s appropriate that food be the first inventory item that we implement in our roguelike game. In this chapter, I’ll demonstrate how the player’s level of hunger can be managed and write the function that will allow the player to consume food and keep going.
Rogue C# – Displaying and Selecting Inventory
In addition to collecting inventory, the player needs to be able to view their inventory and manage its contents so they can have the specific items they need. We also need a way to display other screens and come back to the map when needed.
Rogue C# – Building the Inventory
The inventory items have a complete cycle throughout this game, depending on the item, and each step has to be coded so that the inventory exists and is managed just like inventory items would be in real life. Every part of the program will be affected in some way.
“As for me and my codebase …”
A Changing Landscape In 2011, I was interviewed for a programming job at a local company and, as part of the interview, I was asked to provide some samples of my coding. I brought a couple of significant examples I was happy with and let the interviewer look over them. He immediately asked me to…
Rogue C# – The Inventory Class
Now we need inventory collection in the game, starting with food. We need a system in place for collecting and managing not only food but all the other collectibles such as armor, weapons and potions which often have different requirements.
Rogue C# – Turns and Cheatcodes
Role-playing games are often turn-based; your character performs an action and then all the other characters and opponents get their turn. For this reason, managing the turns is essential to the game and that’s what we’re looking at in this chapter.