Jump to content

April 2017 »

23 24 2526272829

Recent Entries

Recent Comments

- - - - -

Back to the (my) past.

4: Adsense

I've been working a little on my old laptop. After digging through My Documents in search for some old documents, I've noticed VS2010 folder in it. With my curiosity suddenly awakened, I suddenly found myself staring at the content of the Projects folder.

Reason: some of my old projects were there. Most of them were games. A collection of 1s and 0s, silently waiting for their creator to come back for them. And he came.

After copying all the projects to the PC I work on, I loaded each solution and, after performing some maintenance like retargeting compiler to compile using .NET 3.0, ran debugger for each of them.
And felt like I was back there, looking at younger me sitting in front of PC I had at that time and trying to cope up with a solution to the problem.

So, here there are, the "games" I made before. Please join me in the travel to the past.
Note: I'll post code of each project. Because it's going to be huge, I'll put it in spoilers so that you can skip it if you're not interested.

Year 2006: Duck Shooting

Posted Image

First game I ever made, using Visual Basic (.NET Framework 2.0) with XNA 3.1. I have no idea how long it took me to make it. Gameplay is simple: shoot ducks and dog using the mouse to score points. Blue ducks are the slowest and give least amount of points; green are in the middle and brown are fastest. Dog jumps at random times and gives the most points.

Maybe you, dear reader, recognize the ducks and dog. Yeah, they're from Duck Hunt. And yeah, I hated that dog so much I created a way to get my revenge on him for mocking me each time I missed those damned duck(s). However, game is satisfying to play for maximum 60 seconds.

As for the code... when I look it now, it is atrocious. However, when I calmed myself I realized that... I didn't know better at that time. That was my best. For those who love statistics and code analysis, here's the data Code Metrics gave:
  • Maintanability Index: 59
  • Cyclomatic Complexity: 52
  • Depth of Inheritance: 2
  • Class Coupling: 32
  • Lines of Code: 243
Code for itself is rather easy to follow. However, I violated so many principles that it might be a bit painful to read.

XNAGame class:

DuckGame module:

DefineTextures module:

AnimatedTexture module:

HitDetection module:

Year 2009 (I think): Battle Tanks v0

Posted Image

Wrote with C# (.NET 3.5) and XNA 3.1. This was my first try of making "player" move the objects using keyboard.
This was also the project I learned why many of the modern games (League of Legends, for example) avoid using slick rotations of models unless needed.

Project isn't particulary impressive. Just a box with a barrel moving around and rotating. With one interesting bug I didn't fix: pressing Space during rotation makes bullet stuck at that angle.

Code is actually quite simple:

I could say that the project is abandoned, but I won't; I used this project as a base for the one later.

Year 2010: Nine Men's Morris

Posted Image

Back to the mouse based games. This one is once again written with C# (.NET 3.5) with XNA 3.1. I believe you can recognize the game, but in case you don't know, I'll explain:

Two players, each has 9 pieces. Game is split into 2 phases.
In phase 1, players alternately place their tokens on the board, trying to fill a row or column - make a "mill". After all 18 tokens are placed, each player can take away one of the opponents tokens from the board for each mill that player made. Tokens from mills cannot be taken out.
In phase 2, each turn players can move one token to the adjacent cell. Goal is to take out all opponent tokens by making mills. Once player remains with only 3 tokens, he isn't restricted to the adjacent cells of each token and can "jump" over the whole board.

Sadly, I never wrote a game beyond Phase 1. I might finish it one day... *looks at code* Screw it, if I ever decide to finish it I'll rather remake it from scratch:

I wasn't that young anymore. I just finished high school and entered faculty (college, if you like). I learned QBasic, (Turbo) Pascal, Visual Basic and C# until that point and I was comfortable with Trigger Editor in WarCraft 3 World Editor. So, I have full right to ask this: "WHAT THE HELL WAS I THINKING!!!"

Year 2011: Arkanoid (more like "Half Pong")

Posted Image

This one is also uncomplete. Written with C# (.NET 4.0) and XNA 4.0, I managed to get the basics (paddle moving and ball bouncing) before giving up for some reason. I think the reason was making the collision detection work the way I imagined it. While many people finished it (most recent example being superman3275), I decided to skip it... for now.

Code is actually quite clean, however I think I made it more complicated than I should:

Year 2012: Battle Tanks

BattleCity Alpha2

This one should actually be familiar if you remember anything from my older journal entries. I won't ramble too much about it; based on "Box with barrel", it's actually the 2nd sensible thing I made after a huge gap and a huge step up. I slowly started to do actual object-oriented programming. I've wrote more about it in my earlier entries.

For anyone interested in code:

Game1 class:

Player class:

Tank class:

Year 2013: Battle City

Posted Image

Upgrade of Battle Tanks. I'm still working on it - on both code and art. I won't ramble much about it here, and just add: powerups are added.

Now, take the picture above and compare it with this:
Posted Image

However, the biggest step is not the art - it's the code. Up to the Battle Tanks, I used strictly arrays and simple structures/classes and used only main class (the one automatically created with project), with a lot of copy/pasting, bad code etc. Now, with Battle City, I finally stepped - at least with one leg - into "true" object oriented programming. Skills I learned here helped me to deal with other tasks faster and easier. For example, laboratory tasks (like writing Finite State Machine) took no longer than 20 minutes of writing and debugging.

Battle City is nowhere near completition, but here are code metrics for current state:
  • Maintanability Index: 78
  • Cyclomatic Complexity: 873
  • Depth of Inheritance: 3
  • Class Coupling: 85
  • Lines of Code: 2025
If you wish to try it, head to my last entry and grab the attachement. That version doesn't have powerups but is still playable; I'd appreciate a feedback. I hope I'll be able to provide better version soon enough.

I hope this little trip to the past was at least a little interesting. If nothing, I'll have this journal preserving my memories and as a reminder how I was before as a programmer.

Thanks for reading and, I hope, see you in next entry.

Jun 30 2013 12:00 AM

Interesting read, makes me wish I still had more of my own early experiments -- alas, most are lost, and those that remain are on a hard disk that I've been meaning to retrieve the data from "sometime soon" for almost a year now.


Battle City is certainly an upgrade from your first Battle Tanks!

Jun 30 2013 10:39 AM

I like the remake of Duck Hunter and Battle Tank. They both take me back in time and drive me to play them. smile.png

Sadly I have lost a lot of old material due to my latest move.

Jun 30 2013 06:10 PM

Surprisingly, most of my early programming projects and experiments have in fact survived despite me being rather unorganized, and are currently sitting on my desk :) but if I knew I was going to be reading them a few years later.. from now on I'll inline little comment blocks in my code saying hello to future me.


That said if you're anything like me, your projects folder contains a large number of unfinished projects and an even larger number of projects where development never actually started (the IDE files set up, and perhaps a text file with a couple sentences jotted down hastily, but no actual code)


yeah.. those were good times.. strong nostalgia for sure ^_^

Jul 05 2013 02:49 PM

Thanks for comments :D


Navyman, I'll upload soon (probably in a week or two) improved version (one with powerups) so you can try it :D It won't be complete product, but at least it would be more playable than the version from my last entry...

Speaking of which, 14 downloads and 0 feedback... maybe I should've specified how to contact me, I expected feedback in comments...


Bacterius, I actually don't start most things until I have something to write, so my Projects is actually kinda empty. 2 unfinished projects (Battle Tanks and one Windows Phone app for Best Code Challenge tournament which was a little too difficult for me), Battle City and college lab assignments. I actually had "Element Fight" in plan (stickman in various colors representing elements fighting; basically Poor Man's Street Fighter) which I started... and never went beyond first Switch for game states XD


Maybe I also remake Boulder Dash over the summer... depending on how far my siblings (specifically my sister whos hobby is drawing) go with an art (I'll work on code and mechanics).

Note: GameDev.net moderates comments.