Class Properties and Constructors
In a previous chapter, we added the MapLevel and MapSpace classes to our game project and, in this chapter, we’ll add some class properties and the code to actually create objects from those classes. Along the way, you’ll see examples of overloaded constructors and auto-properties in C#. Constructors When...
Using Constants in C#
The MapLevel class that we added in the last chapter will contain all the code for actually generating the random map, including the hallways, within the 80 x 25 area assigned to it using specific ASCII characters. There are a lot of specific values used repeatedly during this operation...
Rogue C# – Working with Classes and Objects
In the previous chapters of the series, we setup the main form for our roguelike game; now it’s time to add some code. C# is what’s called an object-oriented language, meaning that it makes constant use of classes to organize and contain (or encapsulate) various functions. The algorithm spelled...
Algorithms
Generating the map is pretty much central to everything else in a roguelike game so we might as well get it out of the way first. It’s also one of the most challenging parts. Before we can do that, we need to come up with the actual steps the...
C# Form Controls and Properties
Visual Studio provides a wealth of controls that you can use in Windows Forms apps from buttons and text boxes for displaying information to combo boxes and menus for providing choices to the user. Each of these controls has its own set of properties and events that you can...
Rogue C# – Creating the Game Project
The original Rogue game was created as a console application that used a C programming library to control the character placement on the screen. At the time before Windows, there was no such thing as keeping multiple apps open and switching between them. In this course, I’ll be creating...
Working with ASCII Graphics in C#
A little history … In 1980, when Rogue was first designed, the world of computers was largely non-graphical. If you went into a computer lab, you would see rows of green (or amber) monochrome, monospaced text displays. Even IBM’s CGA graphics, which would provide a stunning 16 colors for...
Writing the Program Requirements
One of the most important tasks in software development is defining the software requirements – in detail. Architects have blueprints, writers develop outlines and smart programmers get an idea of what the finished program is supposed to look like before they start programming. It might be a basic version...
Choosing a Programming Language
What language should I learn? That’s the first question that I often see from aspiring programmers which is understandable. With all the technologies out there, it’s easy to get lost in all the choices and spend too much time agonizing over the decision and second-guessing yourself. There are two...
New Tutorial Series – Rogue C#
Introduction A few years ago, when I was teaching a college course in database programming, I remember one of the students looking at a sample program and wondering out loud “How does anyone actually put something like this together?”. I knew what he was asking – it’s a long...