Threat Level 2.0

Back in the summer of 2011 I decided it was time I learned C++. I already knew some C# and C so I figured C++ would meet somewhere in the middle (whether it actually does or not is a matter of opinion - I'm known for my strange notions). I'm probably not alone in believing that, at heart, all coders really want to do is make computer games - so I set out to create my first, rather ambitious, C++ project; Threat Level. The basic premise was a side scrolling shoot 'em up which gradually sped up over time and all the player had to do was survive - the longer you survived the more points you gained. The entry point for this was Andre LaMothe's Tricks of the Game Programming Gurus available for free on Dave Perry's wiki (which has since disappeared, unfortunately). The book is, in fact, C centric and talks about the 'new' features of DirectX 8 - a little out of date - but contains a wealth of useful information nonetheless. It put me on course to download the DirectX 9  SDK and start hammering out some code. The end result as a game was, well, rather lack lustre to say the least, but it was a valuable experience in learning to code and certainly didn't put me off. Four months of research, late nights and trial and error culminated in an encyclopaedia of things I now know not to do, and this:

The most significant things I took away from the experience where probably the use of shaders (in this case the displacement effects in the background), 2D math and trigonometry and an insight into just how accelerated graphics hardware works.
    After a short break from coding, around the beginning of 2012, someone pointed me in the direction of SFML - a C++ library designed with hardware accelerated 2D graphics in mind. The current release at the time was (and still is I believe) 1.6, so I downloaded it and started to experiment. I quickly saw how useful this library is - particularly how it takes advantage of C++ object oriented design (where similar other libraries such as SDL are written in C) and offers a suitable layer of abstraction for OpenGL calls which falls exactly in line with my way of thinking, while still providing access to the lower level underlying API. Tinkering with a few small projects gave me the confidence I needed to go back to Threat Level and rewrite it in a cleaner and more elegant way, as well as tidy up a few of the game play issues. When the release candidate for version 2.0 of SFML became available I immediately downloaded it and set to work.
    Despite having a much clearer goal in my mind as to what I wanted to achieve, version 2 of Threat Level took much longer to write. I assume this is because I suddenly saw a lot more potential and wanted to add many more features now that I knew what SFML offered. I initially worked on the game from April '12 to around July, where I managed to get the gameplay to a similar state to that of its predecessor, only with much revamped graphics including fancy particle effects provided by a library called Thor. I was pleased with this but wanted more for it too, so I put the project on hold for a few months and worked on other things. One of the other projects was something I mentioned in an earlier post, which included the development of Fizz. This was a good example of a learning exercise which I was able to channel back into Threat Level 2.0 when I picked up development again around 6 weeks ago. Now refreshed and recharged I added what I felt the original really lacked which was a Boss fight at the end of each round in which, if you play it, you'll see the rope simulation of Fizz powering the animation of the wires hanging from the Boss's robotic head. Thanks to another SFML based library TGUI I was also able to add a much nicer menuing system to the game allowing players to input and save their high scores as well as make the options screen more convenient to use. Finally I felt I had a more 'complete' game - although I'm sure there could be many new features added and game play variables tweaked. It is, however, complete enough in my opinion for me to write this long and rambling entry, and to share Threat Level 2.0 with anyone who wants to play it. You can see a video of it in action below:

and download an installer here or, if your prefer, download a straight zip file here. System requirements are pretty small, other than OpenGL accelerated graphics hardware and a soundcard it doesn't need much. It runs on my laptop happily enough - although I do need to disable the post processing shader effects (available in the options). I do have designs on a score board server at some point in the future, so players can submit their scores online and compare themselves with others around the world - although whether that feature makes it into Threat Level or another (unannounced) project I haven't yet decided. Oh and for anyone interested: my personal best is level 7. F5 will take a screenshot if you want to take a stab at beating it ^_^


Popular Posts