Friday, December 07, 2012

Windows 8 Game Development using C#, XNA and MonoGame 3.0: Building a Shooter Game Walkthrough – Part 1: Overview, Installation, MonoGame 3.0 Project Creation

Inline image 1


Casual game developers have been using XNA since 2004 for ease of create games for Windows, XBOX and most recently Windows Phone. XNA is a .NET framework for game development providing a content pipeline and load functionality for game asset, animation, math, sound and user input tracking via gamepad, mouse, keyboard and touch with game logic organized in a straightforward game loop architecture.

Game development is not trivial undertaking and XNA was a great framework to start down the path for a great number of novice game developers and/or students and developers who wanted to learn how to create quality game applications. XNA along with Visual Studio made it as easy as File –> New –> XNA Game Studio Project and you were off and running.

MonoGame is an open source cross platform implementation of the XNA namespace and class model. The goal of MonoGame is to provide XNA developers with a framework to build applications that will run on Xbox 360, Windows, Windows 8, and Windows Phone while providing the ability to port the game using the same C #codebase to run natively on the iOS, Android, Mac OS X, and Linux platform with minimal effort. With these goals in mind, the MonoGame motto therefore is to "Write Once, Play Everywhere". The technologies that make the MonoGame API cross-platform power possible are:

  • OpenTK - a low-level C# library that wraps OpenGL, OpenCL and OpenAL for 3D graphics.
  • SharpDX - an open-source implementation of the full DirectX API for .NET which allows for development of high performance games, 2D and 3D graphics rendering, and real-time sound
  • Lidgren.Network - a networking library for .NET framework which uses an UDP socket to provide an API for connecting a client to a server, as well as, reading and sending messages

The game you will be making in this walkthrough is using the MSDN Shooter tutorial. Shooter is a particular type of game with a set of well-defined limits around what it does when the user interacts with it. This tutorial is a good starting point for learning game development with XNA and publishing a game running on Windows 8 platform using XNA leveraging MonoGame. In addition to leveraging this technology for Windows 8, you can use the MonoGame technology for native cross-platform development with other mobile platforms.


Setting Up Your Development Environment

Before you can write games for Windows 8 using MonoGame, you mush setup your enviroment and your IDE to do so. I have outlined the steps below for getting your environment created. Please follow and perform the following steps in the order stated to successfully prepare your computer for XNA Development with MonoGame:

  • Install Microsoft Windows 8.
  • Install Games for Windows
  • Install Windows Phone 8 SDK or Visual Studio 2010 Express for Windows Phone
  • Why do I need Visual Studio 2010? There is a feature of XNA called the Content Pipeline, a pre-compiler step in the preparation of graphic and audio assets for use at runtime in XNA. This feature is not implemented in MonoGame. You can leverage VS 2010 or VS 2012 with the Windows Phone SDK installed to leverege the XNA Framework template to compile the graphics into the .xnb files to include in your Windows 8 project.


    • Visual Studio 2012 Pro/Premium/Ultimate: Use DreamSpark, MSDN or your licensed copy
    • Install MonoGame 3.0 binaries, templates, and dependencies with Windows Installer:
    Leverage the new MonoGame 3.0 Windows Installer to install the MonoGame and SharpDX libraries needed to create an XNA 4.0 project for Windows 8. This will also install two MonoGame templates for use within Visual Studio to start an XNA/MonoGame project.

    Optional: Install GitHub
    If you want to review the MonoGame Source Code or contribute code to the MonoGame project.

    Create a Git Account:
    Install the GitHub Windows Client:

    Read more: T E W 

    Posted via email from Jasper-Net