In this final chapter we'll summarize what we've covered in the C# Adventure Game series, offer suggestions on how to improve your game, and look at some options for you to improve your programming skills.
Summary
We've covered a lot of concepts. You should have a good foundation in programming with C#, and hopefully you have ideas on how to create a new program from scratch; how to think critically and problem solve while creating an application.
- Basic syntax of C#: Know how and when to use punctuators like semicolons, parentheses, and curly braces.
- Variables and datatypes: Understand what variables are, and why we use them. You should also understand the most common types of data we store (i.e., integer, string, double, boolean), and the differences between them.
- Functions/Methods: Create and use functions/methods.
- Object-oriented theory basics: Know what a class is, and how to create and use one.
To Do: Practice
Version Your Game
Some suggestions to try:
- Create more content. Can the player find more items? Explore other areas?
- Add more random elements to make the game slightly different each time it is played. (Example code: Random Properties.)
- Practice making more classes. Make at least one more static class, and a non-static class that you will create instances from.
- If you were starting another adventure game with the knowledge you have now, what would you do differently?
- Research Try/Catch (Exceptions), and use it in your project.
Refactor Code
You've read about refactoring, and we've tried it out in this series. Make your code more efficient. If you see statements repeated, it is likely you can streamline the code.
Programming Practice
Suggestions for further practice:
- Learn how to read data from, and write data to, an external file: Reading and Writing External Data (C# Console Application). If you make a game that is longer than a few minutes, you can save player progress to an external text file so that players can restart from a save point. If you have a point system, you can also save high scores.
- Create another version of your guessing game that uses words instead of numbers. Walkthrough: Word Guessing Game: C# Console Application
- We briefly discussed the keyword Private; research it and see what would need to change in your code if you used it.
- Practice passing arguments into your methods. Use return values. When is it helpful to pass in (or return data from) a method?