Releases
Version: 0.1
Initial release
Date: 17 july 2009
Version: 0.2
Code Clean-up
Date: 28 aug. 2009
Keywords
.NET, WF, GDI, GDI+, Game Clock, Multi Threading, Sprites, Tiles, Game Loop, Bonus Managers, Custom Character Sets, Desktop, Game Development
Introduction
Back in the day, say 10 years ago, I had a Playstation 1. On this little device I came a cross a
puzzle game that I liked. A few years later that game, called SWING was ported to PC. I gave that
game to my mother and guess what, she got hooked, just as me.
That version of SWING
was written with the use of DirectX 6/7, and doesn’t work on versions of Windows other than Windows 98/ME.
The company, Software 2000
that made the game went bankrupt back in 2002.
A few ago months I found the original version of this little game for the PC.
I just had to smile and thought, would it be nice to have that game again on XP/Vista/Windows7?
The Project
As I started this project, I wanted this project to follow the formal software development way.
So I wrote a
Software Requirement Specification also known as SRS based
on the IEEE 830-1998 standard, which can be acquired on request.
The game itself had the intention of learning purpose to it. The intention was
to give the SRS to junior/medior programmers, so they could come up with a solution.
This implementation is my first draft, first run, my proof of pudding implementation,
meaning, the code used isn’t production code, but basically to see if
things are possible. Not to mention that I haven't programmed for a while....
The game itself had the intention of learning purpose to it. The intention was to give
the SRS to junior/medior programmers, so they could come up with a solution.
This implementation is my first draft, first run, my proof of pudding implementation,
meaning that the code produced isn’t production code, but basically to see if things are possible.
I used the following for creating this game:
- .NET 3.5 sp1
- Windows Forms (GDI).
- Visual Studio 2008
- Paint.NET
I used Windows GDI because I have plans to port the game to .NET Compact framework as well. Those projects are on hold for now, but the will be here soon enough.
The Game Play

The game itself is basically a “Three-On-A-Row-Kinda-Game”, the twist is that the balls are dropped on pillars, that changes height according to the weight they carry, as each ball has a certain weight to it.
Although it was the intention to follow the original game, I changed the game some what to
make the project smaller. Given 6 weeks of time, the project should be finished as a
shippable product. Later on new or alter feature
would be integrated to the current version of the game.
So I changed the Three-In-A-Row, to 4-In-A-Row
and removed most of the animations of the original game.
I left most of the explosions in the game to give the player
the idea of actually playing a action/puzzle game.
The player is still dead when the ball hit the ball dropper on top of the screen.
The Game Technical
I started the game from scratch. Although I have written games before in different languages, I never could find the time to do it in C#. So I started with all basic elements of a game, by creating the game engine, containing the game loop, sprites, sprite tile sets and sprite managers. As the project went on, I added Bonus Manager, Score Manager and the presenter for the game clock.
By using inheritence and design patterns like strategy object the following scheme can be produced:
The Game Graphics
I got most of the game graphics by ripping them from screen shots and changing them using Paint.NET. The pixel size do matter when acquiring graphics, so remember the DPI setting. I had some trouble of fitting the graphics nicely. The solutions for this is to set the DPI to the right size.
Resolution Size / DPI settings
The pixel size do matter when acquiring graphics, so remember the DPI setting. I had some trouble of fitting the graphics nicely. The solutions for this is to set the DPI to the right size.
Show DPI code
// break it down, be sure that the images have the right DPI settings // Bitmap pImg = new Bitmap( FiWidth, FiHeight );
// some tilesets can have different DPI settings // so force them to the standard used by this game // pImg.SetResolution( 72, 72 );
|
If you forget the call to SetResolution(), the DrawImageUnscaled() method on a graphics device will not always work as expected, due to the resolution settings of the image.
Double Buffering
Because this game has all the aspects of an high action/puzzle game it needed a fast draw method
without any flickering to the screen. By using the pretty common method of double buffering the game is more fluent.
<CODE EXAMPLE HERE DOUBLE BUFFERING>
The Things To Do
Although this game is playable and quite fun with it's explosions and stuff, like all software, it is never finished.
Shippable okay, but far from finished.
I had some more idea's like network play and an uploadable highscore list, move away from GDI and do Managed DirectX,
port to Windows Mobile by using the compact framework. Darn, I can think
of more options and feature that I can program by myself.... Goosh... I wish I had a development team :D.
If I can find the time, I will start working on these things for future versions.
The Conclusion
It is pretty easy to build your own game with the .NET framework. I made this proof of pudding example with in a few weeks. Although my time and commitment to this project was pretty fragmented, the code works, but leaves a lot of room for optimalization.
I hope you have as much fun building your own game, as I did while crafting this game.
* * *
Legal Note
Although the company that made the original game and graphics, they no longer exists. The graphics
and the game itself is probably legally protected. I tried to contact the original developers, but was unsuccessful there.
This project is meant as a learning process and I regret that the game isn’t available on XP or higher.
For that purpose only I made this game and lent their graphics to have some nostalgic feelings.
I hope they will resurrect from the dead and develop more games like this.
No animals nor humans were harmed during the production of the game & this website.