These lessons will teach you the basics of C#, by building a very simple role-playing game (RPG).
What will be in the game?
The game will let you create a player, set up locations for them to travel to, discover quests to complete, and fight monsters.
When I say that it’s, “very simple”, that’s what I mean. There are no graphics, there are only nine locations, three different types of monsters, two different weapons, and two quests. The battles are very simple, and there is no armor, magic, or crafting.
However, at the end, you will know the basics of C# programming. That’s the goal of these lessons – not to build the next Skyrim or World of Warcraft.
What will the game look like?
Like this:
And here is how the game will play:
What will I learn?
The focus of these lessons is to show you the most common things you’ll need to do to create a C# program – such as creating classes, handling user inputs, and doing common calculations.
Think of the Pareto Principle. You’ll learn the 20% of the things that you’ll need to do 80% of the time, when writing a program in C#.
Will I learn the ‘best’ way to write a C# program?
There’s always a better way.
In fact, there will be some things that I know could be done better, but are more complex than I want to introduce to you right now.
This will get you started, with the ability to create a program that works. But if you want to do more advanced things in your programs, you’ll need to learn, and practice, more.
Can I add more to the game?
Yes!
If you want to add more locations, creatures, quests, weapons, potions, etc., you’ll be able to easily do that.
If you want to expand the game with more features (armor, crafting, buying/selling, poisons, spells, repeatable quests, etc.), let me know. I may be able to find some time to expand the game.
Next lesson: Lesson 00.2 – General information about programming in C#
All lessons: Learn C# by Building a Simple RPG Index
is this possible to add a graphic latter? Because i have a project in my school where i need to create a game with any graphics. Although i haven’t read yet, but i’m sure that is course in the one in the whole internet, thank you.
You can add a graphical map in lesson 26.1. You can use the same techniques from that lesson to display graphics for the location and monster, if you want. These are static images – no animation.
hey scott. really looking forward to the lessons . You mention that we will be working with static images later , do you know of any good places where I can learn animation?
Regards,
Griffinhand
I don’t do any animation, but if you want to learn animation to create games (especially in Unity), you might look at Brackeys or Quill18Creates channels on YouTube.
Pluralsight generally has high-quality courses, if you are willing to pay for them (search for a coupon code, if you do). But, I haven’t tried any of their graphics courses.
If anyone sees this comment, and knows of good courses, please leave a comment.
This looks awesome, Scott! I’ve been following Tim Corey for building Windows Forms Applications, but I’m having trouble following him. I don’t think he explains enough about some things. Not sure why, but I’m not grasping things. Very much looking forward to following your tutorial here, so that I can learn the C# fundamentals.
Thanks! Doing both courses might be helpful. If there is something I skip over, or don’t explain well, Tim might have a lesson that helps you understand – and vice versa. Let me know if you have any questions while following the lessons.
I will give it a try. I had two programming classes at my college, Visual Basic which I know is a bit outdated and Java which I hear is almost the same as C # so I will look forward to doing your tutorials. Thanks for your time to teach us! I hope to make some kids games with this knowledge.
You’re welcome! Good luck! Let me know if you have any questions.
well done.
Hey, im trying to learn c# i found this course when tryed to find ideas for projects to lean by codeing them, thank you in advance for it
You’re welcome!
Hi, I want to suggest this course to some of my students who are struggling with coding, and was wondering how much time they would approximately need to run through the whole course?
Hello Karlien,
Most lessons probably take 20-30 minutes, although I suggest students take as much time as needed to understand the code in the lesson. So, it would take around 25-30 hours if they follow all lessons. They might not want to do all of them. Some of the final lessons are for things like adding SQL database – which might be more than they want to learn.
If your students follow the lessons, please ensure they create the projects with “.NET Framework”. Any version from 4.6 through 4.8. The most common problem I’ve seen is that people build the projects with the newer versions of .NET (.NET Core, .NET 5, or .NET Standard)
Let me know if you have any other questions.
Is there a particular reason against using .NET 5/6 assuming you can figure out how to fix small differences yourself?
Hi Luke,
I wrote these in 2014, before .NET Core or .NET 5/6. I created a version in WPF that starts with .NET Framework 4.7.2 and is eventually converted to .NET 5 at https://soscsrpg.com/. The only problem with starting in .NET 5/6 with that project is that the images don’t display until lesson 14.3 – when we switch how the images are read and bound to the UI.
Hey, I was wondering what kind of modifications I have to make to the code and/or software choice for this tutorial to work on MacOS? I plan to use a Windows machine for these at first, but I do most of my computer work on the go and the only laptop I own is a MacBook.
Hi Josh,
Unfortunately, this won’t work on a Mac – unless you’re using VM (virtual machine) software to run Windows on the Mac. .NET Framework (what this program is built in) only woks on Windows computer. Microsoft created new version of .NET (.NET Core and .NET 5 and 6) that run on Windows, Linux, and Macs. However, the new cross-compatible versions don’t have a good solution for writing to the UI yet. They are working on MAUI (https://docs.microsoft.com/en-us/dotnet/maui/what-is-maui), but that isn’t expected to be officially released until the end of 2022.