Potholes (C64) by Peter Caspari
A downloadable game
POTHOLES
=======
Written by Peter Caspari for the BASIC 10Liner Contest 2023.
Language: Commodore 64 Basic v2
Category: PUR-80
The game
----
Race the 60 second timer to see how far you can get. Hitting potholes or the side of the track will slow you down.
With the compiled version I got 4.64KM
The Compiled version uses the same BASIC Code with the following exception.
line 7: D=D+0.75 rather than D=D+1.3
This adjusts the distance covered to accommodate the faster execution of the compiled version
Controls and play
--------
Use left and right on the joystick in port 2 to drive the car. Fire to accelerate
Expanded and commented version. Can be cut and pasted directly into CBM prg Studio
----------------
0 A$="{space*10}":R$(1)="{reverse on}{cm k} {reverse off}{cm k}"+A$+"{reverse on}{cm k} {reverse off}{cm k}"
1 R$(0)="{reverse on}{space*2}{reverse off}"+A$+" {reverse on}{space*2}{reverse off}":REM SETUP TRACK PETSCII
2 N=54272:PRINT"{clear}{white}";:REM SETUP SID START ADDRESS AND CLEAR SCREEN
10 S=TI:V=53248:W=255:T=120:X=50:REM INITIALIZE VARIABLES
11 POKEV+1,220:POKE2040,13::REM SETUP SPRITES
12 SYS59749:REM INITIALIZE KERNEL SCROLL-DOWN ROUTINE
13 POKE210,208:REM PRINT TO MEMORY HACK - CHANGE SCREEN BASE ADDRESS
14 POKEN+24,15:REM SID VOLUME
20 U=1:POKEN+5,9:POKEN+6,63:REM SID SUSTAINE AND RELEASE
21 PRINTTAB(21)"1{right}0{right*3}0{right}1{right}000":REM PRINT TO MEMORY HACK
22 POKEV+39,14:REM SPRITE COLOUR BLUE
23 FORT=832TO892STEP3:POKET,0:REM LOOP TO SETUP SPRITE FROM STRING
30 POKET+1,ASC(MID$("<<<{sh +}{pi}{pi}{sh +}<<<<<<{sh +}{pi}{pi}{sh +}<{pi}{pi}{pi}",(T-832)/3+1,1)):PRINTR$(0):POKET+2,0:NEXT
31 POKEN+4,33:REM SETUP SID WAVEFORM
40 REM HEADER
41 PRINT"{home}{yellow}{reverse off}speed"305-W"{left}{space*2}{cyan}timer"L"{left}{space*2}{pink}distance"INT(D)/100"{left} km{space*2}":PRINT"{home}{down*2}";
42 IFW<0THENW=0:REM LIMIT DELAY
50 PRINTLEFT$("{white}{red}",C+1)LEFT$(A$+A$,R/2)R$((R/2-INT(R/2))*2):REM RENDER TRACK
51 C=1-C:IFR<1THENR=1:REM TOGGLE COLOUR AND LIMIT TRACK POSITION
60 POKEV,X:REM MOVE SPRITE
61 REM RANDOMIZE TRACK AND POT HOLES
62 IFRND(.)>.8THENP=1108+R/2+RND(.)*7:POKEP,87:POKEP+N,12:U=INT(RND(.)*3)-1
70 J=PEEK(56320):X=X+4*(SGN(JAND4)-SGN(JAND8)):REM READ LEFT AND RIGHT FROM JOYSTICK
71 D=D+1.3:R=R+U:IFR>36THENR=36:REM INCREMENT DISTANCE AND TRACK POSITION
80 W=W+10+20*PEEK(V+31)-(16-(JAND16)):REM ADJUST DELAY/SPEED OF CAR
81 POKEN+1,25-W/15:IFW>255THENW=255:REM ADJUST CAR SOUND PITCH AND LIMIT DELAY
90 FORZ=1TOW:NEXT:REM DELAY
91 SYS59777:REM CALL KERNEL ROUTINE TO SCROLL
92 L=60-INT((TI-S)/100):IFL>0THEN40:REM TIMER | Status | Released |
| Author | BASIC 10Liner |
| Genre | Racing |
| Tags | 8-Bit, basic, basic10liner, commodore, Commodore 64 |
Install instructions
Loading
-------
You can use any Commodore 64 emulator that works with *.d64 files, commonly used is VICE.
- In VICE:
- Click: File -> Attach disk image -> Unit #8
- Select: potholes.d64
- Click: Open
LOAD"PH-BASIC",8 - for the BASIC version
LOAD"PH-COMPILED",8 - for the COMPILED version
RUN
RUN Again to restart the game
On the real hardware, just load with:
LOAD"PH-BASIC",8 - for the BASIC version
LOAD"PH-COMPILED",8 - for the COMPILED version
RUN
RUN Again to restart the game


Comments
Log in with itch.io to leave a comment.
very good