Introduction to MonoGame

Introduction to MonoGame

So you want to make games with MonoGame. You're in the right place! Stick with me, my young aspiring MonoGame developer! Before long, you'll be up and running, and building games that baffle the mind with their awesomeness.

What is MonoGame?

Before we get going too quickly, let's set the stage. If you're here, you've probably already heard at least a little about MonoGame and XNA. You probably know they can be used to make games.

In 2006, Microsoft released XNA, which is a set of tools and code libraries that made it easy to make games that could be run on Windows desktop and laptop computers, plus their Xbox 360 console. Soon after, they updated it to be able to also run on their Windows smart phones. For many programmers, this was the thing we had been waiting for. A system where you could create games that ran all over the place, and without an insane amount of trouble or work.

For years, Microsoft did a great job of supporting and growing XNA, and it became an exciting approach to game development.

One of the limitations of XNA, however, was that it was limited in what platforms it could run on. Don't get me wrong; between PCs, the Xbox 360, and the Windows smart phones, you cover absolutely massive audiences. And for many people, getting your game on a console like the 360 was several heaping teaspoons full of pure awesome. There's no way you could not be excited about that.

But still, there were more platforms that people wanted to be able to target: iPhones, Android phones, other consoles, and Macs and Linux machines as well.

Here's where MonoGame comes in. MonoGame is an open-source port of XNA. It's not run by Microsoft, but rather a group of independent software developers (including you, if you wanted to join) who wanted to build a version of XNA that allows people to use the exact same code, but run everywhere. (On these other platforms, instead of running on Microsoft's .NET Framework, the games run on Mono.NET, which is an open-source port of the .NET Framework itself.)

I bring up this history to make a couple of important points:

  • MonoGame is very similar to XNA. For nearly everything, if you find a MonoGame tutorial somewhere, it will work in XNA as well. (Unless it applies specifically to one of these non-Microsoft platforms.) And if you find an XNA tutorial somewhere (like all of the ones I have) they'll apply to MonoGame as well. At least in most cases.
  • MonoGame is not XNA, and as such, doesn't have quite the same level of integration and support, nor does it have all of the features that XNA has. (Though being able to target those additional platforms is a pretty big plus.) So there will be a few things that we'll have to take the long road to do in MonoGame, and I'll be sure to point those out when we get to them. The good news is, they're working hard to address these issues, and some day, they'll fill in these holes.

Some Examples

Just so you can see what MonoGame can do, take a look at these examples of games made with XNA:

What You Need to Know

People have asked me what they need to know before getting started on these tutorials. I've seen people in-game development forums say "I want to make a game, but I don't know where to get started." The truth is, it will be hard to learn how to program a game if you don't know how to program at all. I would recommend spending some time learning how to program if you don't already know. If you want to use MonoGame, then the ideal language to learn is C#. However, C++ is kind of a standard that is used a lot in game development, and Java is a good language as well. If you know any of those, you'll be in good shape.

In my tutorials, I will try to explain some of the programming concepts that come up, but I won't be able to explain everything, so it would be best if you already have a grasp of programming concepts. Like I pointed out in my link a second ago, I've got a TON of C# tutorials. Even a book.

Also, understanding math, particularly linear algebra and geometry, could be helpful, but is not necessary. Anything with computer graphics will heavily involve linear algebra, and most games hit the geometry pretty heavily. The good news is that MonoGame takes care of a lot of the math for us, and the stuff that it doesn't do, we will cover in various tutorials.

I don't expect you to have had any previous experience with graphics programming or game programming. After all, if you knew how to do that, you probably wouldn't be here! We will be starting from the very basics, so you don't have to worry about anything.

A Few Final Words….

I really hope these tutorials help you get started. Since I started making games, I've have a whole lot of fun. I hope these tutorials can help you! If there is anything that I can do to help you along, let me know. In particular, feel free to post questions in the forum (and answer other people's questions if you have any good advice!), leave comments on the tutorial pages, and make suggestions for new tutorials, or improving existing ones.

Good Luck!