One of the recognizable features of the original Rogue game was the long list of key commands that the player used for all actions, including eating, searching and using objects. Now we’ll see how we can implement those in our own roguelike.
At this point, our game can generate a random map and there are classes to control the game itself and define a player. Now I want to spread some gold around the rooms for the player to collect. In the process, we’ll be making some improvements to how the program handles Random values.
Programs often use multiple classes that work together to provide structure to the program. In this chapter, we’ll expand our roguelike with the new Game and Player classes.
What do you do when no algorithm seems to work without problems? In this chapter, we’ll see how not every problem is solved in a straight line and how some can be solved in phases.
Completing the hallways on a roguelike map is one of the most challenging parts of the game and it goes back to the importance of the right algorithm that will teach the computer to do what you take for granted.
String manipulation is a common task in programming and C# has a couple of different methods for performing large numbers of edits to a selection of text. In this chapter, we’ll compare them and see how efficient the StringBuilder class actually is.
We need just a little bit of supporting code to actually plot the rooms on the map. In this chapter, you’ll see examples of enumerations and dictionaries in C#. You’ll also see a way to check a char value against many others at once.
Roguelike maps are made up of a network of rooms and the algorithm for creating the individual rooms is important. In this chapter, we’ll look at the use of loops and arrays in maintaining our network of dungeon rooms.
Properties and constructors are basic elements of C# classes and this chapter shows examples of how they’ll be used to describe and create maps in the program.
Constants enable us to store values that will be used in the program and give them context within the code. Constants will be used heavily in our roguelike game and this chapter shows how they can be used to construct the map.