Have a nice extended vacation? Time to get our noses back to the grindstone and add some things to our game to make it more of a “game” and less of a “slideshow”. I think it’s as good a time as any to introduce a control scheme, and something we can directly interact with – a ship! A player! For now we’ll focus on the keyboard as our prime method of control.
Hey all you Allegro guys! You may or may not have a problem in your project where it seems to flicker – this is casue by it attempting to clear and redraw the screen a hojillion times per second. We can solve this using a technique known as double buffering. Remember how we were drawing directly to the magical “screen” bitmap before? We set up another bitmap, the same SIZE as the screen, and draw onto that instead – and then once every frame we copy that bitmap to the screen. That way we don’t redraw the screen more times than necessary. Ready? Let’s begin!
I think it’s time we finalize our Space Invaders design document. This will probably look a bit overblown at first, but the more detail we have, the less we have to guess when we’re putting together our code. As with the entire series of tutorials here, feel free to deviate as much as you wish – but make sure you HAVE a solid design, and don’t deviate too much from yours. I also cannot say that this is completely immutable – it’s subject to change as we go along, or discover things that don’t work (or possibly work better).
So what exactly makes Space Invaders? (Or, in my case, Star Attackers?)
Writing games is a lot of fun. At least, it can be. It also carries a few significant hurdles, if you’re just starting for the first time. Programming can be scary, especially if you have no experience. The options are limitless, which can make it overwhelming for a newcomer to the field. Fear not, however! I am going to do what I can to teach you, very simply, how to take a zillion hours of hair-pulling effort and make it into something you’re almost-satisfied-with-but-not-quite.
