Space Warp – A Graphics Space Game

See all articles from SYNC v2 n3
Author(s): Armando Fox
Publication: SYNC
Pub Details: SYNC v2 n3 (Volume 2, Issue 3)
Date: May/June 1982
Pages: 44-45

Since I have always loved video space games, I have been looking for some game that could possibly fit into my limited 1K of RAM. The product of several hours of often exasperating labor is Space Warp, which runs in 1K without any problems if entered as specified.

The objective of Space Warp is to reach your base before running out of fuel. In order to do this, you must think ahead and consider how your speed will affect your fuel consumption. The distance to the base is 1000 miles, and you have 100 fuel units initially. Your speed, measured in warp factors as per Star Trek, has a direct bearing on your fuel consumption. Warp factors range from 1 (slowest) to 15 (fastest). Each turn, you will be asked to enter a warp factor. A read-out of fuel remaining, distance remaining, velocity, and warp factor as of last turn is also displayed. After entering the warp factor, you will be asked “DIRECTION?” Input F to move forward towards the base or R to reverse. The reason for reversing will be discussed below. When this has been done, one of two things will happen.

If you are unlucky, an enemy satellite dispatched from a nearby base will harass your approach. This will appear as a double asterisk (**) at the rightmost edge of the screen. If you do not watch out for these satellites, they “eat” a random number of fuel units. This is often the downfall of many players. However, if you are going at warp 7 or less, you will be asked “RETREAT?” Answer Y or N. If you retreat, you will of course lose distance as well as fuel, but the enemy satellites cannot harm a retreating ship, so retreating does pay off as a strategy technique. If you decide to retreat, the appropriate fuel (and distance) will be added into the next calculation; if you decide not to, the enemy satellite will “eat” a random number of fuel units.

Next (or first, if no satellite came after you) the screen will clear and then redisplay, hopefully with your ship farther over to the right, indicating that you have moved closer to the base. The readout will again be displayed, and the “WARP” and “DIRECTION” prompts will wait for input.

This turn sequence continues until one of three things happens:

1) You reach the base and still have fuel, and the message “HOME FREE” will appear near the center of the screen.

2) You will reach the base without any fuel, drift, and collide with it—your ship will break up into several pieces.

3) You run out of fuel before reaching the base, and the game will stop with error code 9/460. If you want to know how far you actually travelled, subtract the distance on the screen from 1000.

Entering the Program

This program runs in 1K, but it must be entered in two parts. The first part is the “set variables” section shown in Listing 1. Enter this short program and RUN. Enter the following values to be POKEd to the REM statement in line 1: 0, 3, 10, 0, 0, 132, 128, 150, 139, 10, 0, 132, 3, 133, 6. Then hit LIST. Line 1 will look like a jumble of graphics symbols; these draw the ship. Now delete lines 40 through 70 (not 1 through 30) and continue by entering the main program in Listing 2. To run the program, simply type RUN; since the graphics are stored as a REM statement, there is not much that can cause these variables to be cleared, except for NEW.

Listing 1: Setting the Variables.

 1 REM XXXXXXXXXXXXXXX   (15 X's)
10 LET D=1000
20 LET D2=0
30 LET F=100
40 FOR X=16427 TO 16441
50 INPUT P
60 POKE X, P
70 NEXT X

Listing 2: Space Warp.

100 PRINT "WARP?"
110 INPUT W
120 IF W>15 OR W<1 THEN GO TO 110
130 PRINT "DIRECTION?"
140 INPUT D$
150 IF NOT (D$="F" OR D$="R") THEN GO TO 140
200 LET F=F-W*RND(3)
210 LET V=(W/2)*(RND(5)+5)
220 LET D1=V*(W/2)
230 IF D$="R" THEN LET D1=-D1
240 LET D=D-D1
250 LET S=0
260 IF RND(6)=6 THEN LET S=226
270 LET D2=D2+D1
280 IF D<0 THEN LET D=0
290 CLS
300 PRINT "WARP", "FUEL", "VELOC", "DIST", W, F, V, D
320 PRINT
330 FOR X= -4 TO 6
340 FOR J=1 TO D2/40
350 PRINT "#";
360 NEXT J
370 FOR N=X+5 TO X+9
380 PRINT CHR$ (PEEK (16426+N));
390 NEXT X
400 PRINT
410 LET X=X+4
420 NEXT X
425 FOR L=1 TO 25
430 PRINT "#";
435 NEXT L
440 PRINT CHR$ (S)
450 IF S THEN GO SUB 600
460 IF F<1 THEN STOP
470 IF D<1 THEN GO TO 500
480 GO TO 100
500 PRINT , "HOME FREE"
510 STOP
600 IF W>7 THEN GO TO 660
610 PRINT "RETREAT?"
620 INPUT D$
630 IF D$="N" THEN GO TO 660
640 LET D=D+V*(W/2)
645 LET F=F-W
650 GO TO 670
660 LET F=F-(RND(5)*3+W)
670 RETURN

Sample Run

WARP?
6 (NL)
DIRECTION?
F (NL)

(screen cleared)
WARP     FUEL     VELOC     DIST
6        82       27        919

WARP?
10 (NL)
DIRECTION?
F (NL)

(screen cleared)

WARP     FUEL     VELOC     DIST
10       52       40        719

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.