I like this tutorial a lot. It’s exactly what I was looking for. I’ve already finished through 13.1. I can’t wait for your future lessons as I’m trying to learn C#, while also building a simple text based game (although it doesn’t feel that simple yet). I think you’re doing a great job and I’ll keep checking back for the rest of your lessons. I bookmarked this website. Cheers.

I just published Lesson 13.2 – Creating functions to handle user input. I’m working on Lesson 14, and it’s a big one. It covers the almost all of the game logic – moving around, completing quests, fighting monsters, etc. So, it will probably be split into 3 or 4 smaller lessons.

Lessons 14.1, 14.2, and 14.3 cover variables, “if” statements, and “foreach” loops.
Lesson 15.1 adds a class to let you create random numbers.
Lessons 16.1, 16.2, and 16.3 add code to move the player around, let them get quests, fight monsters, and complete quests. These lessons are a bit long, since they cover a lot of code.

At the end of lesson 16.3, you’ll be able to play the complete game, running it from within Visual Studio. The next lesson will be on how to run the game on other computers, without Visual Studio installed.

I just finished this series, and I have learned so much! This series was amazing, and it was very well done. Thank you so much for making this series! It really gave me a huge boost in the right direction.

If you want to see how the game would look with some more advanced techniques (such as, LINQ and raising events to communicate from the Engine project to the UI), I’m currently working on it here: https://github.com/ScottLilly/ShinyRockHunter. I don’t have any lessons for LINQ or event-handling (at least, not yet). But I may write some when the app is closer to being completed, if people are interested.

Thanks Scott. Your WinForm RPG tutorial was great. I have taken your exampled and converted it to a WPF. I am still trying to wrap my head around how to set things up on the back end. I have been playing around with the code and got a very basic attribute system (strength, endurance, et cetera) and a class/role system (knight, wizard, et cetera). But I think I may have not set it up very well, because it is clunky and difficult to use/reference. My question is how can such a system be designed to be versatile enough to allow for the application of bonuses (from for example equipped equipment stacked on top a base build) but simple enough not to require too much coding. Forgive the newbie question, but this is probably just me not being fully versed in how C# class and objects propagate and get passed through loops of code.

There are a few different ways you can implement applying bonuses. My first questions are 1) What things do you want to receive bonuses (attributes like strength and endurance, things like “to hit” percentage, etc.) and 2) What items do you want to affect the attributes (just wearable/usable items, or do you also want to be able to add gems to wearable/usable items – for customized bonuses)?

Either way, I think the basics would be for you to have a list of the current items the player is using/wearing, within the Player class. You could do this with some class-level variables or properties for the Player class (e.g., CurrentWeapon, CurrentHelmet, CurrentNecklace), or add an “InUse” property to the Item class, and manage setting the player’s currently active items through the Player class, when they want to wear/use a different item. You could also add some new properties to the Item class for ToHitPercentBonus, ProtectionFromMagicBonus, etc. Set those values to zero, except for the properties you want that item to give a bonus for. Then, in your “AttackMonster” method (for example), you would check the player’s inventory for items that have bonuses that affect the battle.

Let me know if that makes sense. If it isn’t clear, or you think your code still looks clunky, maybe you can put the relevant classes in a GitHub Gist for me to take a look at. Although, I may not be able to check it out until this weekend. I’ve got a lot of work and meetings this week.

Hey, I was going to put a comment earlier about how none of the code you gave worked. I have a little bit of knowledge in other programming languages such as C++ so i was able to understand the code to a certain extent. I found nothing that was wrong with the programs that I had made but there were still errors in a lot of the coding. I just could not figure it out. Since i am new to C# and visual studio, I am not too familiar with the default settings and some of the other things that go along with these two things. I saw how in one of the early lessons that you said that visual studio would automatically put some code into a new class. When i created a new class, that coding didn’t even show up so i just took the code from the source code you gave and tried it out. it still didn’t work. Well, after doing all of that trying to figure out what was wrong with it I just gave up and went on to try to find a different tutorial for C# thinking that these tutorials might have been out of date or something like that. After a few minutes of searching for something else about programming in visual studio, I found out that visual studio has more than just C#. At first that was all i thought it had but after I figured out that it also had C++ and visual basic, i thought that maybe I was not using the right language when i made a new project. So, I went into the project that i was working on with these tutorials and it turns out that it was the problem. By default, visual studio set the language to visual basic and that was what it was trying to compile in but I was trying to write in C++. So, anyway, just wanted to say that these are great tutorials and i really like them. I just have one question though. Is there a way tp change the language the project is set to after it has been created?

Yes, Visual Studio supports several languages: C#, VB.Net, C++, and F#. I’ve heard there are ways to use it for some other languages, like Ruby and Python – although I’ve never used it for that. So, when you create a project, you need to be sure to select the correct language for the classes you’ll create in the project.

Unfortuntely, there isn’t really a way to change the language of a project after it’s been created. It’s best to delete the project with the incorrect language and create it again with the correct one.

I wrote an e-mail about 2 hours ago (about 2015.02.02 19:20). Before this tut i could do nothing in windows form, just console. Now i won’t say i’m good at it, but i could add picture for every location, add new location, items, monsters, and stuff. My next goal will be talking with ,,npcs” (meaning more quest and shop). Thanks for everything.

Great tutorial. I am having a few issues in running the program. Hope you can help. I got through all the lessons and ran the program. The program starts successfully. However, when I move around, I noticed that the combo boxes did not appear when there was something to do in a room such as an Item to pick up. It didn’t pick up the sword at the fountain and when I get to the rats, there is nothing to use against them. Any idea where I should look to make the combo boxes visible at the appropriate time? Not sure if you have enough info to answer this question.

You can double-check the Player and World classes here: SuperAdventure on GitHub. Let me know if that doesn’t help you. I’m going to be offline until next Tuesday, but can help you after then, if there is still a problem.