Classic Computer Magazine Archive COMPUTE! ISSUE 42 / NOVEMBER 1983 / PAGE 304

U-boat

Mark Vittek

"U-boat," for VIC and 64, starts out quietly enough, but don't be lulled into a false sense of security. Without warning, you'll be called upon to use all your wits to save yourself.

"U-boat" is a nice change of pace from fast action, run-and-shoot games — for a while.

As you calmly patrol the ocean floor, the serenity is soon broken by the sudden explosion of a depth charge. Above you, on the ocean surface, are destroyers on a search-and-destroy mission. And if that isn't bad enough, there is a constant supply of mines to keep you busy.

The object of the game is to sink as many ships as possible before their depth charges reach you. On the surface of the sea, destroyers and aircraft carriers pass to and fro dropping their destructive cargo. Some drop randomly, but others zero in on your U-boat.

You can destroy bothersome mines with your torpedoes, but new ones always replace them after five ships have been sunk. So in order to keep your patrol area tidy, you have to take time out every now and then to remove mines. Also, it's important to remember that when the charges and mines explode, they take the surrounding eight cursor spaces with them. If your U-boat is in this area, it is permanently retired.

VIC Version

For those of you who do not have a joystick, Program 3 shows the necessary replacement lines for Program 2 so that you can use the keyboard. I used the cursor keys to move the sub, but if you find that they are too difficult, you may assign new keys in lines 70-76.

If you do have a joystick, you may want to try the keyboard later on. You'll find it more of a challenge because the game plays faster. It may be a bit difficult at first, but if you master the game using the keyboard, you can become the scourge of the seven seas.

U-boat was designed to provide a large variety of objects on the screen without slowing the game down. As most game programmers know, too many POKEs and PRINTs can spoil the game's fast action quality. For example, the usual two POKEs to location 37154 have been omitted from the joystick reading routine.

Using MID$ is a good technique for achieving fast movement of many objects on screen. In Program 2, MID$ was used to move the ships across the screen because it was faster than POKEing. Also, when I first wrote the game with POKEs, the ship's bow plunged into the sea as the ship wrapped around the screen. This could be remedied with IF statements, but using MID$ turned out to be faster and easier. Since the number of characters displayed by MID$ is set at 22 (VIC's screen width), the ship disappears as if it just sailed out of view.

LEFTS, RIGHTS, and MIDS often provide for faster and more clever effects in game programming.

Type in and SAVE Program 1 first. This program will print instructions and redefine the necessary game characters. Reset the computer, then type in and SAVE Program 2 immediately following Program 1 on the same tape. When you RUN Program 1, it will automatically LOAD and RUN Program 2.

The 64 version plays the same as the VIC version but requires a joystick.