Search (Article Or Program)

19 December 2013

Shoot'em Up .NET


Before Introduction

If you only want to download the code and see what's happening, then the important things are:
  • There's a solution for Silverlight 5 and one for WPF, but most units are simply used by both;
  • The game uses the directional keys to move, Space to shot and either EscP or Enter to pause;
  • The game has three levels. Between the levels you may acquire upgrades to your ships, so if you think the initial ships are too weak, well, that's on purpose.
You can play the Silverlight game by opening this link:http://paulozemek.azurewebsites.net/ShootEmUpTestPage.2013_10_10.html
Or you can download the WPF version by clicking on the next image:

Introduction

I know that many programmers would love to write games. I myself started to program computers because I wanted to create games and, even if I already wrote some games, I've spent most of my time dealing with systems and solving problems related to database connectivity and better caching mechanisms.
One of the problems I see to write games is the lack of material. In my particular case, I usually look for graphics and sounds, as those are the things that I am not able to do. Yet, I think there's missing material for games in general. It is hard to find game tutorials and, when I find something, I only see material to write games using XNA or Unity. There is almost no material on how to write games using WPF or Silverlight or other similar technologies.
And, considering that I usually write games using those technologies, I though it will be a good idea to present a solution on how to write games using non-game specific technologies.

Why not use XNA or Unity?

My idea on writing games without using XNA or Unity is to show that you can use normal UI technologies to write games, which in many cases simplify the job as you don't need to care about how to render things to the screen or to recreate layout controls. Also, by doing this you will be able to create games without having to install such libraries/engines and you will be able to write games even for Windows 8, as using C# + XAML(which is what I am going to use in this article) is a trait of SilverlightWPF and of Windows 8 applications.