QB64 Project Site

Unseen Machine's QB64 Project Site

SLR (Super Low Res) Games

This section is dedicated to my work on SLR games. The main priciple of which is to make games using just a grid of colored circles.  Currently i have only posted A 3 level demo of QB Jump  a v .01 edition of Brick Smash and my best SLR Game yet QB PONG! v.01.

I have made a programme with which you can create a Mario style platform jumping game, complete with transporters and bridges. I am still ironing out a few bugs but will post a game made with it in the next day or two. Here's a screen shot of my QB64 version of the Level Creator (This one generates scrolling levels rather than static levels, but is far from complete).

 

SLR Game - QB Pong v.01

You play at the bottom of the screen, serving for the time being is random, though direction of serve and standard shot is to what ever direction your using, LEFT or Right do diagonals ,pressing nothing = straight up. you can bounce the ball against the side walls.

The CPU is basic  but works well, if you want it to be harder change the Bnow2!-Bnow! >= .04 to .07  it might not sound like much but you will see the differance, might be how i do difficulty in the future.

This version has been cantains enhancements from Pete and Galleon.

'SLR Game - Pong v.01 - By Unseen Machine  - Thanks To Galleon And Pete for the enhancements

DIM SHARED scrn AS LONG, KeyDown(127) AS LONG
DIM SHARED px AS INTEGER, cx AS INTEGER, py AS INTEGER, cy AS INTEGER, pflag AS INTEGER
DIM SHARED bx AS INTEGER, by AS INTEGER, bdirect AS INTEGER, cdirect AS INTEGER
DIM SHARED lwall AS INTEGER, rwall AS INTEGER, pscore AS INTEGER, cscore AS INTEGER
DIM SHARED oldpx AS INTEGER, cflag AS INTEGER, pdirect AS INTEGER, sflag AS INTEGER
DIM SHARED oldcx AS INTEGER
RANDOMIZE TIMER

_TITLE "SLR Pong v.01"
scrn = _NEWIMAGE(1200, 900, 12)

SCREEN scrn, , 3, 1 'place a blank grid on this screen

CALL drawgrid

_PUTIMAGE , 3, 1

lwall = 100: rwall = 1080

cx = 560: cy = 70
px = 560: py = 810
pflag = 1: cflag = 1

bdirect = 2: cdirect = 2

bnow! = TIMER
now! = TIMER

SCREEN scrn, , 1, 1

DO

        IF by = 50 OR by = 850 THEN sflag = 0

        LOCATE 25, 140: PRINT cscore
        LOCATE 31, 140: PRINT pscore

        IF sflag = 0 THEN

                cx = 560: cy = 70
                px = 560: py = 810
                pflag = 2: cflag = 2

                sflag = INT(RND * 2) + 1

                _DELAY 1

                IF sflag = 1 THEN

                        bx = px + 20
                        by = py - 40

                ELSEIF sflag = 2 THEN

                        bx = cx + 20
                        by = cy + 40
                        bd = INT(RND * 2) + 1
                        IF bd = 1 THEN bdirect = 2 ELSE bdirect = 4

                END IF

        END IF
        colcnt = (bx - 100) / 20
        rowcnt = (by - 50) / 20

        GOSUB pclrpaddle
        GOSUB cclrpaddle

        bnow2! = TIMER
        newnow! = TIMER

        IF bnow2! - bnow! >= .04 THEN 'i found anything over .06 is almost impossible to beat

                IF by = 70 THEN pscore = pscore + 1
                IF by = 830 THEN cscore = cscore + 1

                IF by > 70 AND by < 830 THEN

                        CALL ball

                ELSE

                        sflag = 0
                        PAINT (bx, by), 0, 7

                END IF

                bnow! = TIMER

        END IF

        CALL control
        CALL ccontrol
        now! = TIMER

        _DISPLAY 'manually refresh data to screen

        _LIMIT 60 'limit of 30 frames per second to lower CPU usage, and allow input thread more processing time

LOOP

pclrpaddle:
FOR i = 1 TO 3

        PAINT (oldpx, py), 0, 7
        oldpx = oldpx + 20

NEXT

pdrawpaddle:
oldpx = px
FOR i = 1 TO 3

        PAINT (px, py), 15, 7
        px = px + 20

NEXT
px = oldpx
pflag = 0

RETURN


cclrpaddle:
FOR i = 1 TO 3

        PAINT (oldcx, cy), 0, 7
        oldcx = oldcx + 20

NEXT

cdrawpaddle:
oldcx = cx
FOR i = 1 TO 3

        PAINT (cx, cy), 15, 7
        cx = cx + 20

NEXT
cx = oldcx
RETURN


SUB ball

PAINT (bx, by), 0, 7

'cpu paddle contact
IF by < 450 THEN

        IF POINT(bx + 20, by - 20) = 15 AND bdirect <> 5 THEN

                IF cdirect = 1 THEN bdirect = 4
                IF cdirect = 2 THEN

                        bd = INT(RND * 3) + 1
                        IF bd = 1 THEN bdirect = 2
                        IF bd = 2 THEN bdirect = 4
                        IF bd = 3 THEN bdirect = 6

                END IF
                IF cdirect = 3 THEN bdirect = 2

        ELSEIF POINT(bx, by - 20) = 15 THEN

                IF cdirect = 1 THEN bdirect = 4
                IF cdirect = 2 THEN

                        bd = INT(RND * 3) + 1
                        IF bd = 1 THEN bdirect = 2
                        IF bd = 2 THEN bdirect = 4
                        IF bd = 3 THEN bdirect = 6

                END IF

                IF cdirect = 3 THEN bdirect = 2

        ELSEIF POINT(bx - 20, by - 20) = 15 AND bdirect <> 5 THEN

                IF cdirect = 1 THEN bdirect = 4
                IF cdirect = 2 THEN

                        bd = INT(RND * 3) + 1
                        IF bd = 1 THEN bdirect = 2
                        IF bd = 2 THEN bdirect = 4
                        IF bd = 3 THEN bdirect = 6

                END IF
                IF cdirect = 3 THEN bdirect = 2

        END IF

ELSEIF by > 450 THEN

        'player paddle contact

        IF POINT(bx + 20, by + 20) = 15 AND bdirect <> 6 THEN

                IF pdirect = 1 THEN bdirect = 1
                IF pdirect = 2 THEN bdirect = 5
                IF pdirect = 3 THEN bdirect = 3

        ELSEIF POINT(bx, by + 20) = 15 THEN

                IF pdirect = 1 THEN bdirect = 1
                IF pdirect = 2 THEN bdirect = 5
                IF pdirect = 3 THEN bdirect = 3


        ELSEIF POINT(bx - 20, by + 20) = 15 AND bdirect <> 6 THEN

                IF pdirect = 1 THEN bdirect = 1
                IF pdirect = 2 THEN bdirect = 5
                IF pdirect = 3 THEN bdirect = 3

        END IF
END IF

'Edges of Grid
IF bdirect = 3 AND bx = rwall THEN bdirect = 1
IF bdirect = 4 AND bx = lwall THEN bdirect = 2
IF bdirect = 1 AND bx = lwall THEN bdirect = 3
IF bdirect = 2 AND bx = rwall THEN bdirect = 4

IF bdirect = 1 THEN 'up left

        by = by - 20
        IF bx > 100 THEN bx = bx - 20

ELSEIF bdirect = 2 THEN 'down right

        by = by + 20
        IF bx < 1080 THEN bx = bx + 20

ELSEIF bdirect = 3 THEN 'up right

        by = by - 20
        IF bx < 1080 THEN bx = bx + 20

ELSEIF bdirect = 4 THEN ' down left

        by = by + 20
        IF bx > 100 THEN bx = bx - 20

ELSEIF bdirect = 5 THEN ' up

        by = by - 20

ELSEIF bdirect = 6 THEN ' down

        by = by + 20

END IF

PAINT (bx, by), 2, 7

END SUB


SUB ccontrol

IF cx < bx THEN

        cdirect = 3

ELSEIF cx > bx THEN

        cdirect = 1

ELSE

        cdirect = 2

END IF

oldcx = cx

IF cdirect = 3 THEN

        IF cx < rwall - 40 THEN cx = cx + 20
        cflag = 2

ELSEIF cdirect = 1 THEN

        IF cx > lwall THEN cx = cx - 20
        cflag = 2

ELSE

        cflag = 0

END IF

END SUB

 


SUB control

'Galleons INP(&H60) routine for keyboard input - logs multiple keys
'update keydown states
FOR z& = 1 TO 100
        i& = INP(&H60)
        IF (i& AND 128) THEN KeyDown(i& XOR 128) = 0
        IF (i& AND 128) = 0 THEN KeyDown(i&) = -1
NEXT

IF KeyDown(75) THEN

        oldpx = px
        IF px > 100 THEN
                px = px - 20
                pflag = 2
        END IF
        pdirect = 1

ELSEIF KeyDown(77) THEN

        oldpx = px
        IF px < rwall - 40 THEN
                px = px + 20
                pflag = 2
        END IF
        pdirect = 3
ELSE

        pdirect = 2

END IF

END SUB


SUB drawgrid

cx = 100: cy = 50

FOR i = 1 TO 2000

        CIRCLE (cx, cy), 10, 7

        IF i >= 951 AND i <= 1050 THEN PAINT STEP(0, 0), 7, 7

        cx = cx + 20

        IF i MOD 50 = 0 THEN

                cx = 100
                cy = cy + 20

        END IF

NEXT

END SUB

SLR GAME - QB Jump - 3 Level Playable demo.

 You play Blob, a blue thing that jumps. Use the arrow keys to control movement ( I have left a level skip function in so you can see all level's without winning - Press enter to skip level's). 

This code was generated by my QB Jump Map Creator and Code generator v.01.3 - When I iron out all the bugs, I will post that too... 

DECLARE SUB loose ()
DECLARE SUB loadplayer ()
DECLARE SUB startgame ()

DIM SHARED level AS INTEGER
DIM SHARED grav AS SINGLE
DIM SHARED px(1 TO 10) AS INTEGER, py(1 TO 10) AS INTEGER
DIM SHARED t1x(1 TO 10) AS INTEGER, t1y(1 TO 10) AS INTEGER
DIM SHARED t2x(1 TO 10) AS INTEGER, t2y(1 TO 10) AS INTEGER
DIM SHARED bx1(1 TO 10) AS INTEGER, by1(1 TO 10) AS INTEGER
DIM SHARED bdirect(1 TO 10) AS INTEGER, bcnt(1 TO 10) AS INTEGER
DIM SHARED bflag(1 TO 10) AS INTEGER, mcnt AS INTEGER

grav = .08

DO
        level = level + 1
        CALL startgame
        CALL loadplayer

 

LOOP UNTIL level = 3
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  15, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2
DATA  2, 6, 6, 0, 0, 0, 2, 2, 2,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0


SUB loadplayer

px(1) = 40: py(1) = 245
px(2) = 25: py(2) = 95
px(3) = 40: py(3) = 200

t1x(1) = 610
t1y(1) = 305
t2x(1) = 25
t2y(1) = 155
t1x(2) = 595
t1y(2) = 260
t2x(2) = 580
t2y(2) = 125
t1x(3) = 0
t1y(3) = 0
t2x(3) = 0
t2y(3) = 0
bflag(1) = 1
bx1(1) = 430
by1(1) = 155
bcnt(1) = 7
bdirect(1) = 2
bflag(2) = 1
bx1(2) = 25
by1(2) = 305
bcnt(2) = 36
bdirect(2) = 2
bflag(3) = 0
bx1(3) = 0
by1(3) = 0
bcnt(3) = 0
bdirect(3) = 0

GOSUB drawplyr

IF bflag(level) = 1 THEN GOSUB drawbridge
mcnt = 0


now! = TIMER
now2! = TIMER

DO

        'collisions and empty space(gravity)

        newnow! = TIMER

        IF POINT(px(level), py(level) + 45) = 0 AND newnow! - now! >= grav AND py(level) < 330 THEN

                GOSUB clrplyr
                py(level) = py(level) + 15

                GOSUB drawplyr

                grav = grav / 1.12 'acceleration factor

                now! = TIMER

        ELSEIF POINT(px(level), py(level) + 45) > 0 THEN

                grav = .08

        END IF


        'transporters

        IF POINT(px(level), py(level) + 45) = 15 THEN

                IF px(level) = t1x(level) AND py(level) + 45 = t1y(level) THEN

                        GOSUB clrplyr
                        px(level) = t2x(level)
                        py(level) = t2y(level) - 45
                        GOSUB drawplyr

                END IF

        END IF

        'bottom of screen

        IF py(level) >= 330 THEN CALL loose

        'red x win collison

        IF POINT(px(level) + 15, py(level)) = 4 OR POINT(px(level) + 15, py(level) + 15) = 4 OR POINT(px(level) + 15, py(level) + 30) = 4 THEN EXIT DO

        IF POINT(px(level) - 15, py(level)) = 4 OR POINT(px(level) - 15, py(level) + 15) = 4 OR POINT(px(level) - 15, py(level) + 30) = 4 THEN EXIT DO


        'bridge movement

        IF newnow! - now2! >= .7 AND bflag(level) = 1 THEN

                'bridge collision

                IF POINT(px(level), py(level) + 45) = 14 THEN

                        GOSUB clrplyr
                        IF bdirect(level) = 1 AND POINT(px(level) - 15, py(level)) = 0 AND POINT(px(level) - 15, py(level) + 15) = 0 AND POINT(px(level) - 15, py(level) + 30) = 0 THEN

                                px(level) = px(level) - 15

                        ELSEIF bdirect(level) = 2 AND POINT(px(level) + 15, py(level)) = 0 AND POINT(px(level) + 15, py(level) + 15) = 0 AND POINT(px(level) + 15, py(level) + 15) = 0 THEN

                                px(level) = px(level) + 15

                        END IF
                        GOSUB drawplyr
                END IF

                GOSUB clrbridge


                IF bdirect(level) = 1 AND mcnt > 0 AND mcnt <= bcnt(level) THEN

                        bx1(level) = bx1(level) - 15

                        mcnt = mcnt - 1

                ELSEIF bdirect(level) = 2 AND mcnt >= 0 AND mcnt < bcnt(level) THEN

                        bx1(level) = bx1(level) + 15
                        mcnt = mcnt + 1

                END IF
                now2! = TIMER
                GOSUB drawbridge

                IF bdirect(level) = 1 AND mcnt = 0 THEN bdirect(level) = 2
                IF bdirect(level) = 2 AND mcnt = bcnt(level) THEN bdirect(level) = 1

        END IF

        ' user input

        kb$ = INKEY$

        SELECT CASE kb$

                CASE CHR$(27)

                        SYSTEM

                CASE CHR$(0) + CHR$(72) 'jump button

                        IF POINT(px(level), py(level) - 15) = 0 AND POINT(px(level), py(level) + 45) > 0 THEN

                                FOR i = 1 TO 5 STEP 1

                                        GOSUB clrplyr
                                        IF POINT(px(level), py(level) - 15) = 0 AND py(level) > 80 THEN py(level) = py(level) - 15
                                        GOSUB drawplyr
                                        now! = TIMER

                                        DO

                                                newnow! = TIMER

                                        LOOP UNTIL newnow! - now! >= .05

                                NEXT

                        END IF

                CASE CHR$(13)

                        EXIT DO

                CASE CHR$(0) + CHR$(77)

                        IF POINT(px(level) + 15, py(level)) = 0 AND POINT(px(level) + 15, py(level) + 15) = 0 AND POINT(px(level) + 15, py(level) + 30) = 0 THEN

                                GOSUB clrplyr
                                IF px(level) < 610 THEN px(level) = px(level) + 15
                                GOSUB drawplyr

                        END IF

                CASE CHR$(0) + CHR$(75)

                        IF POINT(px(level) - 15, py(level)) = 0 AND POINT(px(level) - 15, py(level) + 15) = 0 AND POINT(px(level) - 15, py(level) + 30) = 0 THEN

                                GOSUB clrplyr
                                IF px(level) > 25 THEN px(level) = px(level) - 15
                                GOSUB drawplyr

                        END IF


        END SELECT

LOOP

GOTO btm

drawplyr:

CIRCLE (px(level), py(level)), 7, 1
PAINT (px(level), py(level)), 1, 1
CIRCLE STEP(0, 15), 7, 1
PAINT STEP(0, 0), 1, 1
CIRCLE STEP(0, 15), 7, 1
PAINT STEP(0, 0), 1, 1
RETURN

clrplyr:

CIRCLE (px(level), py(level)), 7, 9
PAINT (px(level), py(level)), 0, 9
CIRCLE STEP(0, 15), 7, 9
PAINT STEP(0, 0), 0, 9
CIRCLE STEP(0, 15), 7, 9
PAINT STEP(0, 0), 0, 9
RETURN

drawbridge:
CIRCLE (bx1(level), by1(level)), 7, 14
PAINT STEP(0, 0), 14, 14
CIRCLE STEP(15, 0), 7, 14
PAINT STEP(0, 0), 14, 14
CIRCLE STEP(15, 0), 7, 14
PAINT STEP(0, 0), 14, 14
CIRCLE STEP(15, 0), 7, 14
PAINT STEP(0, 0), 14, 14
RETURN

clrbridge:
CIRCLE (bx1(level), by1(level)), 7, 9
PAINT STEP(0, 0), 0, 9
CIRCLE STEP(15, 0), 7, 9
PAINT STEP(0, 0), 0, 9
CIRCLE STEP(15, 0), 7, 9
PAINT STEP(0, 0), 0, 9
CIRCLE STEP(15, 0), 7, 9
PAINT STEP(0, 0), 0, 9
RETURN

btm:

END SUB

SUB loose
CLS
LOCATE 15, 30: PRINT " YOU DIED FOOL!"
SLEEP
'SYSTEM
RUN


END SUB

SUB startgame
SCREEN 12

DIM cx AS INTEGER, cy AS INTEGER, cnt AS INTEGER

cx = 25: cy = 80

OUT &H3C8, 9: OUT &H3C9, 19: OUT &H3C9, 19: OUT &H3C9, 49

FOR i = 1 TO 800 STEP 1

        READ n

        IF n = 0 THEN

                CIRCLE (cx, cy), 7, 9
                PAINT STEP(0, 0), 0, 9

        ELSE

                CIRCLE (cx, cy), 7, n
                PAINT (cx, cy), n, n

        END IF
        cx = cx + 15

        cnt = cnt + 1

        IF cnt MOD 40 = 0 THEN

                cy = cy + 15
                cx = 25

        END IF

NEXT

END SUB

SLR Game - Brick Smash v.01 (Break out clone)

So this uses a new input routine Galleon (he made QB64) taught me. This is my final version of the .01 edition.

 

'SLR Games - Brick Smash v.01 - By Unseen Machine

DIM SHARED scrn AS LONG, cx AS INTEGER, cy AS INTEGER, pflag AS INTEGER, bcnt AS INTEGER
DIM SHARED fnt AS LONG, px AS INTEGER, py AS INTEGER, oldpx AS INTEGER, oldpy AS INTEGER
DIM SHARED KeyDown(127) AS LONG, bx AS INTEGER, by AS INTEGER, bdirect AS INTEGER
DIM SHARED colcnt AS INTEGER, rowcnt AS INTEGER, brick(1 TO 7, 1 TO 5) AS INTEGER
DIM SHARED lives AS INTEGER

RANDOMIZE TIMER

_TITLE " Brick Smash v.01"

scrn = _NEWIMAGE(1200, 900, 12)

SCREEN scrn, , 1, 1

CALL drawgrid

CALL Drawbricks

px = 540: py = 610: pflag = 1

rndm = INT(RND * 5) + 1

bx = 560: by = 390

FOR c = 1 TO rndm

        by = by - 20

NEXT

bdinitial = INT(RND * 2)

IF bdinitial = 1 THEN bdirect = 4 ELSE bdirect = 2

lives = 3

GOSUB drawpaddle
_DELAY 1

now! = TIMER
bnow! = TIMER

DO

        LOCATE 2, 30: PRINT "Lives : ", lives
        IF bcnt = 35 THEN GOSUB win
        newnow! = TIMER
        bnow2! = TIMER

        colcnt = (bx - 100) / 20
        rowcnt = (by - 50) / 20

        IF pflag = 2 THEN GOSUB clrpaddle
        IF pflag = 1 THEN GOSUB drawpaddle

        IF newnow! - now! >= .1 THEN

                CALL control
                CALL collision
                now! = TIMER

        END IF

        IF bnow2! - bnow! >= .15 THEN

                CALL Ball
                bnow! = TIMER

        END IF

LOOP

drawpaddle:
oldpx = px
FOR i = 1 TO 4

        PAINT (px, py), 15, 7
        px = px + 20

NEXT
px = oldpx
pflag = 0
RETURN


clrpaddle:
FOR i = 1 TO 4

        PAINT (oldpx, py), 0, 7
        oldpx = oldpx + 20

NEXT
pflag = 1
RETURN

win:
CLS
LOCATE 5, 30: PRINT "Well Done = You have completed the game."
_DELAY 5
SYSTEM


SUB collision

colstart = 2
rowstart = 2

FOR b = 1 TO 5

        IF rowcnt = rowstart THEN

                FOR a = 1 TO 7

                        IF colcnt >= colstart AND colcnt <= colstart + 4 THEN

                                IF brick(a, b) = 0 THEN

                                        bcnt = bcnt + 1
                                        brick(a, b) = 1
                                        CALL Drawbricks
                                        IF bdirect = 1 THEN bdirect = 4
                                        IF bdirect = 3 THEN bdirect = 2

                                END IF

                        END IF

                        colstart = colstart + 7

                NEXT a
        END IF

        rowstart = rowstart + 3

NEXT

END SUB


SUB Ball

PAINT (bx, by), 0, 7

IF by >= 610 AND lives = 0 THEN

        RUN

ELSEIF by >= 610 THEN

        lives = lives - 1
        bx = 560: by = 390

        _DELAY 1

        FOR c = 1 TO rndm

                by = by - 20

        NEXT

        bdinitial = INT(RND * 2)

        IF bdinitial = 1 THEN bdirect = 4 ELSE bdirect = 2
        px = 540: py = 610: pflag = 2

END IF

IF POINT(bx + 20, by + 20) = 15 AND bdirect = 2 THEN bdirect = 3
IF POINT(bx, by + 20) = 15 AND bdirect = 2 THEN bdirect = 3
IF POINT(bx - 20, by + 20) = 15 AND bdirect = 4 THEN bdirect = 1
IF POINT(bx, by + 20) = 15 AND bdirect = 2 THEN bdirect = 3

IF bdirect = 3 AND bx = 1080 THEN bdirect = 1
IF bdirect = 1 AND by = 50 THEN bdirect = 4
IF bdirect = 4 AND bx = 100 THEN bdirect = 2
IF bdirect = 1 AND bx = 100 THEN bdirect = 3
IF bdirect = 3 AND by = 50 THEN bdirect = 2
IF bdirect = 2 AND bx = 1080 THEN bdirect = 4

IF bdirect = 1 THEN 'up left

        IF by > 50 THEN by = by - 20
        IF bx > 100 THEN bx = bx - 20

ELSEIF bdirect = 2 THEN 'down right

        IF by < 620 THEN by = by + 20
        IF bx < 1080 THEN bx = bx + 20

ELSEIF bdirect = 3 THEN 'up right

        IF by > 50 THEN by = by - 20
        IF bx < 1080 THEN bx = bx + 20

ELSEIF bdirect = 4 THEN ' down left

        IF by < 620 THEN by = by + 20
        IF bx > 100 THEN bx = bx - 20

END IF

PAINT (bx, by), 1, 7

END SUB

SUB drawgrid

cx = 100: cy = 50

FOR i = 1 TO 1500

        CIRCLE (cx, cy), 10, 7
        cx = cx + 20

        IF i MOD 50 = 0 THEN cx = 100: cy = cy + 20

NEXT i

END SUB


SUB Drawbricks

cx = 140: cy = 90

FOR k = 1 TO 5

        FOR j = 1 TO 7

                FOR i = 1 TO 4

                        IF POINT(cx, cy) = 0 AND brick(j, k) = 0 THEN

                                PAINT (cx, cy), 6, 7

                        ELSEIF brick(j, k) = 1 THEN

                                PAINT (cx, cy), 0, 7

                        END IF
                        cx = cx + 20

                NEXT i

                cx = cx + 60

        NEXT j

        cx = 140
        cy = cy + 60

NEXT

END SUB


SUB control

'Galleons INP(&H60) routine for keyboard input - logs multiple keys
'update keydown states

i& = INP(&H60)
DO
        IF (i& AND 128) THEN KeyDown(i& XOR 128) = 0
        IF (i& AND 128) = 0 THEN KeyDown(i&) = -1
        i2& = i&
        i& = INP(&H60)
LOOP UNTIL i& = i2&
DO: LOOP UNTIL INKEY$ = "" 'flush INKEY$ buffer

IF KeyDown(75) THEN

        oldpx = px
        IF px > 100 THEN
                px = px - 20
                pflag = 2
        END IF

ELSEIF KeyDown(77) THEN

        oldpx = px
        IF px < 1020 THEN
                px = px + 20
                pflag = 2
        END IF

END IF

END SUB