Thunderbolt (Sinclair QL) by Stephen Poole
A downloadable game
PUR80 – Thunderbolt_bas game by Stephen Poole, (QL Forum).
Code written and tested on SINCLAIR QL, (Preferably use QPC2 emulator).
___________________
1 CLEAR:PAPER 0:MODE 8:WINDOW 512,256,0,0:g=DATE:CSIZE 0,0:k=0:q=75:h=40:i=-1:f=4 2 REPeat r:CLS:n=q+h*i:s RND(30 TO 120),98:IF KEYROW(1)=8:STOP:ELSE IF k>9:STOP 3 DEFine PROCedure s(x,y) 4 LOCal L,c,a,b,j:GO SUB 9:IF k>9:RETurn :END IF :p=0:FOR L=1 TO 7 5 c=RND(-25 TO 25):a=x-c:b=y-14:IF b<0 OR p=1:p=0:RETurn :END IF :p=KEYROW(1)=64 6 j=8-y/14:INK j:IF b<14:SELect a:=n-7 TO n+7:k=k+1:BEEP 9999,k:GO SUB 9:PAUSE 1 7 LINE x,y TO a,b:IF p:INK 0:GO SUB 9:i=-i:n=q+h*i:INK j:GO SUB 9:p=0:END IF 8 x=a:y=b:PAUSE f:IF RND(2)=0:s a,b:END IF :END FOR L: END DEFine 9 GO SUB 10:FOR z=1 TO 3:CURSOR n,8,-3,0:PRINT k:END FOR z: RETurn 10 ARC n-4,11 TO n+4,11,PI:FILL 1:CIRCLE n,6,3:FILL 0:AT 1,1:PRINT DATE-g :RETurn
___________________
Program description :
1 Clear out memory : MODE 8 colours : WINDOW format : g start_timer : character size small : k lifecounter : q screen_center : h center_offset :i left_or_right :f pause_speed
2 Main_loop : blank_screen : n viking_position : s bolt(start_position) :
IF ESCape key hit or life=10 ? then STOP
3 DEFine thunderbolt animation (current_position)
4 non-global variables L loop, c next_position, a x_offset, b y_down, j bolt_ink
GOSUB viking_head : k if dead go to main loop : p space_bar
L loop to flash_downwards
5 c flash_offset : a lower x_position : b lower y_position :
if b<0 ground_level or p=1 spacebar_hit then next thunderbolt_section :
p see if spacebar_hit
6 j calculate ink_colour : if b=ground_level, compare, a bolt, to n viking positions : if viking_hit, k increment_lives, beep_deeper and redraw_viking on line 9 : wait 1/50th second
7 draw_bolt : if p=1 spacebar hit : erase viking(black ink) : jump sideways :
p=0 reset spacebar
8 new bolt_position : f wait : 1/3 chance to start a lateral_bolt : end_loop
9 draw the lives_number (in the viking) : return to the calling statement.
10 draw_horns, head and timer. Return to the calling statement.
________________________
This program was rapidly written at short notice, using a few of the QL’s built in features. It has been tested on a Sinclair QL original machine too, via a floppy disc interface, which can read the program as it stands : Hit the (ESC)ape key, then type, in the lower black window, SAVE flp1_ThunderBolt_bas and hit (ENTER).
___________________________
Any time the program halts, just type in RUN and hit ENTER.
____________________________
| Status | Released |
| Author | BASIC 10Liner |
| Genre | Action |
| Tags | 10liner, basic, ql, sinclair |
| Content | No generative AI was used |
Download
Install instructions
The original QL possessed two microdrive tape readers. These are now hard to find. Floppy disc readers could be installed, but are now rare. MSDOS and QDOS discs are formatted differently, but both types can be accessed by the ‘QPC2’ QL emulator. With this readme file, comes a program file which QPC2 will run.
But the simplest way to access the files is to UNZIP and copy them to a USB key, (which will be referred to by QPC2 as dos2_ ).
_________________
On PCs : Download QPC2 from its website onto your PC. Unzip, then click on the QPC2 appfile. Set ‘resolution’ to 512x256 and hit ok.
__________________
Type LRUN flp1_ThunderBolt_bas(Enter) on the bottom black window.
At top left see the timer. The viking head shows the current life (0/9).
Hit the space bar to jump left or right to avoid lightning bolts.
Stay alive as long as possible until the game halts. Try, try, again.
Never use the QL BREAK keys, as this game uses recursion. Just hit (ESC)ape.

Comments
Log in with itch.io to leave a comment.
Always great to new games for the QL. I was playing mine today