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
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.
HitDetection module:Year 2009 (I think): Battle Tanks v0
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
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")
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
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:
Tank class:Year 2013: Battle City
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:http://i42.tinypic.com/30uzb14.jpg
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.