Quick, Stop the Bomber before It Destroys You


A fun little ZX81 shooter game to whittle away a few, er minutes, of your life.

Blaster, ZX81 screen shot, by Steven Reid, 1985Wait what? Another month? Another game? You betcha! April is upon us, and pretty much over. So, to pass the time I introduce Blaster, a shooter with a twist. Use Z to move left, . to move right, and M to fire. Not the most exciting game ever, but you’ll find it hard enough to spend a few minutes with it.

How’s it play?
Blaster may not look like much, but it packs a decent punch. Move your ship, the asterisk at the bottom, to intercept the bomber making a run at your world. Careful. The bomber has a shield and your shot won’t always hit. Good luck!

The game play is pretty good. You actually can avoid the moving part altogether and wait for the bomber to move to you. But, if you miss, you only have a few tries before the ship moves past you. Sounds easy, but at the higher levels it isn’t too hard to miss every time.

Given your ship is a smaller, you move a little faster than the bomber. This gives you a few more attempts should you need them. But, you lose momentum if you miss. Timing is everything. But, you get do earn more points the longer you wait. Up to you how much risk you are willing to take.

It’s a fun little game, and I was able to rack up some good points with it. The speed and aesthetics are good. Not a bad attempt for a game at the tail end of my ZX81 programing days.

What about the code?
Although the game looks like a 1K program, given it only uses four display lines, in reality it is bigger. The original game, available in the archive, takes up almost 2K of memory. It might run on an unexpanded 2K ZX81 or TS1000. But, don’t try it on something smaller. It won’t work as is. The version presented here won’t run at all on an unexpanded system.

That said, the code is still short. The initialize and setup is 13 lines of code. That may not seem like a lot, but when you note that the program is less than 40, that’s a third of the program.

Eight lines of code make up the game itself. Blaster uses a simple loop to move the ship. One of the things I like is that I added random stars behind it as the ship moved. I used Sinclair BASIC’s string splicing to make that work. Check out line 160 to see how that works.

It works pretty well and, to my surprise, I didn’t even notice it until I reviewed the listing. I was smarter than I thought. Although, taking a look at the listing again, it looks like I tried a different method on line 150. Yet, as written, it does nothing. Bingo. I could have saved a few more bytes!

The rest of the code checks if you hit the bomber, or it accomplishes its mission. Oh, and that shield is a random check if you hit or miss. Nothing exciting. But, quite effective. I do like the way I transitioned a few lines of text at the end of each wave. It is a simple, but nice touch.

Tweaking a few things, I see.
Besides adding a save routine, I had to fix a few things. First off, I had to fix the way the game ended. Although you can use a few different methods, such as STOP or running out of code to run. I used another trick in the original version. I added an undefined variable called END to a PRINT statement. Not a bad trick, but one I needed to remove before posting.

Besides removing the breaking variable, I added a new line telling the player to press a key. Pretty standard way to restart. Then, I included a CLS to clear the screen on restart. Something that wasn’t needed before.

The other big change was how you move. That shield is a bit of a problem. It isn’t very forgiving. At some point, you’ll get unlucky and miss 3 times in a row, ending the game. Not very fair. Time for a fix.

Looking over the code, the answer seemed obvious. Use a smaller step routine. This moves the bomber a little slower, but allows you more moves. To my surprise, it didn’t slow the game down much. Even better, the player has a fighting chance to beat the bomber to the end. Maybe!

To add a little fun to the game, the delay whittles away each wave. It never reaches 1, like the original game, but it enough to keep things interesting. Funny enough, I didn’t realize I needed to make this change at first. Once I realized you could move your ship, it dawned on me that it didn’t matter the way the game was written. You couldn’t catch the bomber. The change above fixes that, making the game mechanic more useful.

And there you have it. Simple, sweet and effective. Blaster is a fun little game. Just don’t die.



Comments on this article:

No comments so far.

Write a comment:

Type The Letters You See.
[captcha image][captcha image][captcha image][captcha image][captcha image][captcha image]
not case sensitive