You finished with the lessons, and have a working game!
Plus, you’ve learned many of the most common things you need to write more C# programs.
There is still plenty more to learn, if you decide to get serious about programming. I’ve been programming for over 30 years, and learn something new every week.
Expanding the game
The easiest thing for you to do is to make a bigger world, with more locations, quests, monsters, and items.
Draw a map of your larger world, and modify the World class to include these new locations. Create more monsters and quests. Add more powerful weapons, so the player can defeat the giant spider.
Ideas for new features
This is a very simple RPG, and there is a lot you can do to expand it.
Here are a few ideas:
- Save the player’s current game to disk, and re-load it later
- As the player gains experience, increase their level
- Increase MaximumHitPoints with each new level
- Add a minimum level requirement for some items
- Add a minimum level requirement for some locations
- Add randomization to battles
- Determine if the player hits the monster
- Determine if the monster hits the player
- Add player attributes (strength, dexterity, etc.)
- Use attributes in battle: who attacks first, amount of damage, etc.
- Add armor and jewelry
- Makes it more difficult for the monster to hit the player
- Has special benefits: increased chance to hit, increased damage, etc.
- Add crafting skills the player can acquire
- Add crafting recipes the player use
- Require the appropriate skill
- Requires components (inventory items)
- Make some quests repeatable
- Make quest chains (player must complete “Quest A” before they can receive “Quest B”)
- Add magic scrolls
- Add spells
- Level requirements for the spells
- Spells require components to cast (maybe?)
- Add more potions
- More powerful healing potions
- Potions to improve player’s “to hit” chances, or damage
- Add poisons to use in battle
- Add pets
- Help the player in battle by attacking opponents
- Help the player in battle by healing the player
- Add stores/vendors
- Player can sell useless items and buy new equipment, scrolls, potions, poisons, and crafting/spell components
There are also more programming techniques you can learn to make the program a little cleaner.
- LINQ, when searching lists
- Events/delegates, to handle communication between the “logic” project and the UI project – which will let you move more logic code out of the UI project
- BindingList, so you don’t have to repeatedly repopulate the DataGridViews and ComboBox in the UI
If you’re going to make more changes, or write more programs, you really should learn how to use a version control tool.
You can create a backup copy of your program by copying the solution folder to a new location before making your change. But version control software is a better solution.
It will let you keep track of all the changes you ever make to your program. This is extremely helpful when you make some changes that don’t work, and want to go back to the old, working version.
Version control tools usually take a little while to set up, and to figure out how to use. But once you have one in place, and you learn the basics, using it will become a habit that doesn’t require any time or thought. And the first time you need to go back to a previous version, you’ll thank yourself that you used version control.
Now that you have the basic game, you can expand it.
Hopefully you enjoyed these lessons, and learned some new things.
Please let me know if you have any questions about anything that wasn’t clear in the lessons, if you want to see some other features in the game, or if you want to learn some other aspects of programming in C#.
Previous lesson: Lesson 17.1 – Running the game on another computer
All lessons: Learn C# by Building a Simple RPG Index