Monogame projects


Context

During my first year on my journey to becoming a game developer, students were introduced to the Monogame framework and C#. In time of a whole semester, multiple assignments and exams were provided with this framework and programming language. I’ve acquired most of my game programming knowledge during this time, and am still implementing lots of concepts learned during this specific semester. Most notable topics from this period are inheritance, classes and objects, constructors and overall C#.

Monogame and C# has been essential for my individual growth, proving to be my biggest obstacle so far as game developer. In this post I will be expanding on the individual topics and lessons learned during my time with Monogame. I will not be including code snippets since my understanding during my time on these projects was very very minimal, and I am not sure what my personal implementations were for the individual projects themselves.



Monogame and C#

Coming from Processing and Java, the switch to Monogame and C# was a big step. I was still relatively new to programming, and was still learning the basics. Suddenly having to work with such a big language and complicated framework was hard from the beginning. I found it hard to get to work, often encountering simple syntax errors and having trouble understanding what was supposed to happen. Therefore, it took quite some time to get accustomed to the framework and language, slowly being able to complete steps from different assignments. Many of the given assignments were retro games, which was actually a lot of fun to be working on. A few examples are: Frogger, SpaceInvaders, Asteroids, MissileCommand and FlappyBird.

Looking back on this time, I can say I’d definitely do things different. Instead of diving into a book and reading about the theory behind C#, I’d jump straight into the code and work on one of the many assignments to practce. I’d delve deeper into the concept of debugging and other errors I encounter, and would try to start quick and dirty and see where this leads me before optimizing my code. I think this approach would be more beneficial for me, seeing as this is my approach a few years later. Like many others have said, you don’t learn programming by reading about it, you got to get your hands dirty!



Classes and objects

A very relevant topic regarding Monogame and C#, are classes and objects. Before working with C#, I worked with Java to learn the basics about programming. The topic of classes was mentioned and used, but not up to it’s full potential. That is, until we got Monogame and C# handed to us. C# is notorious for being an object oriented programming language, so using classes and objects was taught in lots of detail. Furthermore, the concept of the Monogame framework was expanded on and introduced with lots of assignments and demos. These assignments were structured in a way that students had to make the individual classes with all it’s logic and behavior, then create multiple instances of the classes in the PlayingState. While proving to be a big challenge in the beginning, I must say I got the hand of it and got very used and accustomed to the principle. Nowadays, I like to put object specific logic and behavior into it’s own methods in the class, so that I can call these methods from outside to keep my code structured and clear. This way of working has become mostly automatic for me, but I can confidently say that it is all thanks to the Monogame framework.



Inheritance

One of the most notable topics I’ve learned during my time with Monogame, is the topic of Inheritance. This took a while to sink in and even more time to be able to work with, but somewhere along the line it clicked and is now used in almost every project I start with. Nowadays I’m a big fan of Inheritance, strangely finding a lot of joy in finding ways to apply the concept to optimize my code. Although I find myself sometimes confused while implementing the concept, it usually clicks rather quickly which leads me to implementing it in various ways. A few examples of my implementations are: enemies, class managers, obstacles, objects, weaponry and many more. C#



C# Overall

The topic I learned most about during this semester, is C#. I made a lot of progress from when I first started with the language, now being able to implement lots of it’s features and concepts. I’d say that C# really sparked my knowledge and interests for programming, being the prime factor of why I enjoy programming so much and like to experiment with lots of things and approaches. Working with the language gave me a real understanding of the individual topics regarding programming, making all of these concepts blend together to a point that I can be able to apply it myself. Additionally, working with C# gave me many ideas for all kind of things, which I was able to implement rather easily by searching for the topic online. Nowadays, I mainly use Unity as engine, applying everything I have learned about C# and much more.



Conclusion

Looking back on my old code makes me realize how much I’ve learned already, and really makes me excited for all the things that are still awaiting me. These Monogame projects are a portal to the past, and motivate me to keep working hard on the projects I am currently working on or still have to face. Furthermore, they are a source of inspiration. Because, if I have managed to work through all those struggles with Monogame, I am confident that I can do it with other obstacles as well. I am happy to have left Monogame in the past, but I will definitely come back to this framework in a couple of years to see how much I have improved overall, and see if I can still manage to make flappy bird look in the correct direction. 😉