Tuesday, 14 June 2011

Space Invaders - Progress Report

Shooting and...

Destroyed!
I've made progress in my space invaders clone. I now have invaders. They don't move, they don't regenerate, they don't shoot, and they can't add to your score, but they can die. They can be destroyed, with a satisfying explosion. There is some light at the end of the tunnel.

The Codebase itself is an absolute mess and is probably best described as an example of how not to force old-style procedural programming upon classes, which in themselves are poorly split, highly interdependent and full of data and gameplay - not always related.

But, I'm still learning C++, and that is the goal. I need to learn more patterns, and be stricter with how I apply it. I'm finding that one of the hardest things to grasp in C++ has been the STL, but really, its a fantastic resource - particularly having object oriented lists, arrays and (as I'm loving) maps directly available. Whilst this is simultaneously over-engineered and under-engineered, I'm beginning to get a better idea of the types, classes and features available to me - as opposed to simply programming in ObjectPascal with C++ syntax. Whatever comes next may have to be more planned then this was, but I've got a better idea of the language now for when I do the planning. However, this code may be properly considered a casualty in my lessons. If I want to expand the feature set, there is a genuine chance I'll need to refactor the code considerably. I'll make a playable game (rather then a shooting gallery, without a score and stationary targets), and then see how much I care about extending its rather pitiful life. But a useful learning exercise nonetheless.

No comments:

Post a Comment