"Space Invader Test" BASIC Program


This program was written with the aim of making a Space Invader 'like' game.
The idea came as an expansion to the work I done on my Graphics Demo Program.
The thought was I could turn the idea into a game. Though with 'limited' at
the time programming experience and the limitations of programming in BASIC
I soon realised that the only way to do such a game would be to use assembler.


So, this program below is just a skeleton of an idea and it taught me a few things.
It is crude and hardly works, but at the time the rest of the kids in my computer
studies class thought I was a true hacker in managing to get this far with the concept.

Here is the 1986 listing for INVADER in BBC BASIC


10 REM GRAPHICS DEMO
20 REM
30 REM GUESS THE NUMBER
40 REM
50 REM By RICHARD HALL
60 REM
70 REM Written on the:
80 REM
90 REM BBC Model-B
100 REM
110 REM Language:BBC BASIC
120 REM
130 MODE 2
140 COLOUR 132:COLOUR 2
150 CLS
160 PRINT:PRINTSPC(3);"SPACE INVADERS"
170 PRINTSPC(3);"~~~~~ ~~~~~~~~"
180 PRINT:PRINT
190 PRINT:COLOUR 3:PRINTSPC(2);"THIS PROGRAM IS A VERY SIMPLE SPACE"'"INVADERS GAME. IT"'"USES THE SAME BASIC CONTROLS AS THE"'"REAL THING"
200 PRINT:PRINT"Z-LEFT"'"X-RIGHT"'"SPACE-FIRE"
210 PRINT:PRINTSPC(1);"<SPACE> TO START":REPEAT UNTIL GET=32
220 MODE 1
230 SCORE%=0
240 HI%=0
250 PRINTSPC(3);"SCORE:";SCORE%;SPC(5);"HIGH:";HI%
260 HEIGHT=800
270 along=500
280 height=80
290 VDU 23,150,0,12,12,15,23,46,94,231
300 VDU 23,151,0,48,48,240,232,116,122,231
310 VDU 23,152,194,194,195,195,195,3,3,3
320 VDU 23,153,67,67,195,195,195,192,192,192
330 VDU 23,170,0,1,1,1,1,3,4,7
340 VDU 23,171,0,128,128,128,128,192,64,224
350 VDU 23,172,15,31,62,123,241,224,192,192
360 VDU 23,173,240,248,124,190,143,7,3,3
370 VDU 23,174,0,0,0,0,0,0,0,0
380 VDU 5
390 GCOL 0,2
400 FOR invader=1 TO 10
410 LET step=10
420 IF invader=2 THEN LET step=step+4
430 FOR move=0 TO 1100 STEP step
440 MOVE move,HEIGHT
450 VDU 152;153:VDU 11,8,8,150,151
460 MOVE move,HEIGHT:GCOL 0,0:VDU 152;153:VDU 11,8,8,150,151:GCOL 0,2
470 PROCbase
480 NEXT move
490 NEXT invader
500 DEFPROCbase
510 MOVE along,height
520 VDU 170:VDU 8,10,172:VDU 11,171:VDU 8,10,173:MOVE along,height:GCOL 0,0:VDU 170:VDU 8,10,172:VDU 11,171:VDU 8,10,173
530 IF INKEY(-67) THEN along=along+20:MOVE along,height:GCOL 0,0:VDU 170:VDU 8,10,172:VDU 11,171:VDU 8,10,173:GCOL 0,3
540 IF INKEY(-98) THEN along=along-20:MOVE along,height:GCOL 0,0:VDU 170:VDU 8,10,172:VDU 11,171:VDU 8,10,173:GCOL 0,3
550 IF INKEY(-99) THEN PROCfire
560 ENDPROC
570 DEFPROCfire
580 IF along=move THEN GOTO 590 ELSE ENDPROC
590 DRAW along,HEIGHT:GCOL 0,0:DRAW along,height
600 MOVE move,HEIGHT
610 GCOL 0,0
620 VDU 152;153:VDU 11,8,8,150,151:GCOL 0,2
630 SCORE%=SCORE%+10
640 IF SCORE%>HI% THEN LET SCORE%=HI%
650 ENDPROC

Back to School Programs Page


If you have arrived here from a Search Engine
Click the link below to go to the Classic Acorn Home Page
Everyone else use the Navigation Section on the Left
<---------------------------------------------------

Home