A downloadable game

BASIC 10 Liner Contest

Harry Dotter by Ian King (120 PUR Category)

*******************************************

Character counter, a=10,b=20..l=120

123456789a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789i123456789j123456789k123456789l
0d=0:V=1:W=3:Z=240:K=0:H=-1:V.23,Z,H;H;H;H;:REM0-=(((888((5((((X(((*)9*(H;8H-=(H;8H*)9*((((X(((5(((888((-=(@5EEIIMQQUYaa
1DEFFNt(x,y,c):SO.1,-12*d,200,6*d:=((x>c)+((x<c)*-1))*-(((PO.x-64,y)<4)A.(x>c))OR((PO.x+64,y)<4) A.(x<c)))
2DEFFNu(x,y,c):V.4:P.TAB(0,18);K:V.5:=((y>c)+((y<c)*-1))*-(((PO.x,y-32)<4)A.(y>c))OR((PO.x,y+32)<4) A.(y<c)))
3B=241:V.23,B,60,126,219,147,219,-1,189,152:D=PA.+47:F.y=1TO59:D?y=D?y+40*H:N.:H=0:D?0=Z:D?60=Z:GOS.8:V.5:MOVEj,k:GC.3,5
4V.B:MOVEl,m:GC.3,5:V.B:REP.:MOVEX,Y:GC.0,3:P."H":n=j:o=k:p=l:q=m:IFPO.X+32,Y-26)=V K=K+1:MOVEX,Y:GC.0,0:V.Z:SO.0,-9,2,1
5F=RND(12):e=-(F<V+1):j=j+FNt(j,k,X)*64*e:l=l+FNt(l,m,X)*64*e:k=k+FNu(j,k,Y)*32*e:m=m+FNu(l,m,Y)*32*e:MOVEn,o:GC.3,5:V.B
6IFK=V*99 OR d=1 V=V+1-d:G.3:EL.MOVEp,q:GC.3,5:V.B:MOVEj,k:GC.3,5:V.B:MOVEl,m:GC.3,5:V.B:r=X:s=Y:IFPO.X+32,Y)=5 d=1
7X=X+64*FNt(X,Y,X+INKEY(-98)-INKEY(-67)):Y=Y+32*FNu(X,Y,Y+INKEY(-102)-INKEY(-71)):MOVEr,s:GC.0,0:V.Z:IFW=0 END:EL. U.0
8MO.2:X=452:Y=670:l=388:m=862:j=772:k=m:V.4:C=0:S=0:F.L=1TO15:REP.:A=D?S:S=S+1:F.I=0TOA/16:C.4:V.Z;:C=C+1:N.:K=V*99-99
9F.I=0TOA A.15:C.V:V.46*-(C<16);:C=C+1:N.:U.C=17:P.:C=0:N.:F.E=61TO72:SO.1,-12,D?E,2:N.:W=W-d:P.TAB(7,18);V;W:V.5:d=0:R.



Harry Dotter Game Play

**********************

Guide Harry around the Maze using the following Keys to collect the Jello shot dots.

Z: Left

X: Right

K: Up

M: Down

Beware of the pink jelly monsters, Harry will lose one of his 3 lives if he bumps into either of them.

If Harry gets caught, the level will start again and you he will lose all the Jello shots he has collected in that level.

The aim is to collect 99 jello shots dotted along the corridors after which, Harry will move to the next level.

As the level increases, the monsters will advance towards Harry more quickly to stop him eating their jello.

The game ends when all the 3 lives have been played.

The game must be reloaded to play again.


Line Count

**********

0 = 120 Chars

1 = 106 Chars

2 = 109 Chars

3 = 120 Chars

4 = 120 Chars

5 = 120 Chars

6 = 115 Chars

7 = 118 Chars

8 = 118 Chars

9 = 120 Chars


Line Comments

*************

Line0 Initialise Variables and Constants. Provide Maze and Sound data in REM statement

Line1 The Xfunction(t) calculates the next x position for Harry and the monsters. Make high pitched scream sound if life lost

Line2 The Yfunction(u) calculates the next y position for Harry and the monsters. Print the score

Line3 Initialise and define the Jelly Monster UDG AND GOSUB the Maze Subroutine. This line is the entry point for new level or new life. 

Line4 Print the monsters and H to the screen. Store last x and y positions. Detect if Harry has eaten a jello dot and increment the score and make a sound.

Line5 Create a random number and moves the monsters if number is less than level+1 to make monsters move progressivley faster. Get new monster positions.

Line6 Redraw the Maze if Score=99 or a monster catches Harry. Redraw monsters in new positions. If a monster catches Harry then lose a life.

Line7 Detect key control for Harry and delete dot at current position.If lives=0 then END else repeat back to line 4.

Line8 Initialise positions for new maze. Extract high nibble maze data from byte.Reset score to level*99 if life lost.

Line9 Extract low nibble maze data from byte. Draw Maze which is run length encoded, high nibble blocks, low nibble dots. Sound the intro tune. Return from subroutine.


Constants

*********

Z, 240, VDU Character Solid Block

H, -1, decimal definition of 0xFF and first pass flag so offset only subtracted from REM data once.

B, 241 VDU Character number for the Jelly Monster.


Variables

*********

D, Data Pointer to the REM Statement data, init=PAGE+47

V, Level number which increments when all dots have been eaten, init=1

W, Number of Lives, init=3

K, Score, init=0

y, REM data counter within FOR LOOP during subtraction routine, init=1, end=59

j, Monster1 current x position, init=772

k, Monster1 current y position, init=862

l, Monster2 current x position, init=388

m, Monster2 current y position, init=862

n, Monster1 last x position

o, Monster1 last y position

p, Monster2 last x position

q, Monster2 last y position

X, Harry's current x position, init=452

Y, Harry's current y position, init=670

r, Harry's last x position

s, Harry's last y position

A, Maze data read from the REM statement

L, Line Counter for the Maze data within FOR LOOP, init=1, end=15

C, Line Length Counter for the maze used to not print final dot, init=0

S, Maze data counter, init=0

I, Block and Dot FOR LOOPS to decode run length coding, init=0

E, Intro Tune FOR LOOP to play the sound in sequence, init=61

F, Random number generated to increase chance that the jelly monsters will be moved in each pass based on current level number.


Flags

*****

d, lose a life flag which if set will restart the level and level score, init=0

H, First pass flag set to 0 on line 3 after subtraction routine for Maze data.

e, Allows the monsters to move if TRUE. Based on random number F and Level.


Functions

*********

t(x,y,c), Passed x,y data for Monster1, Monster2 or H and a comparison x position. Returns x value as -1, 0 or +1 depending on c value and relative blue block positions.

u(x,y,c), Passed x,y data for Monster1, Monster2 or H and a comparison y position. Returns y value as -1, 0 or +1 depending on c value and relative blue block position.


"It's not a bug, it's a feature"

********************************

If the monsters move into the same position, the collision detection becomes ineffective. You can clean up the level.

**.EOF IK 02_MARCH_22

Download

Download
HDOTTER.ssd 22 kB
Download
HDOTTER_IK_02Mar22.txt 6.2 kB

Install instructions

How to load the game

********************

Load the disc file "HDOTTER.ssd" into a BBC emulator such as BeebEm

->File

->Load Disc 0

Select "HDOTTER.ssd" to mount the disc image.

CHAIN"HDOTTER" or <SHIFT> <F12> (Shift/Break) to load and run the game.

*EXEC !BOOT will also run the disc. 

The 10 lines of code listed above can also be copied into the following web emulators

https://www.bbcmic.ro/

https://bbc.godbolt.org/

Comments

Log in with itch.io to leave a comment.

Incredible stuff.