CAR10LINE (Commodore VIC 20) by Simon Forsyth
A downloadable game
CAR10LINE
Last modified: 2026-02-11
Platform: Commodore VIC 20
Author: Simon Forsyth
Language: Commodore BASIC V2
Category: PUR-80
CONTROLS
O Left
P Right
Alternate controls also work:
A Left
D Right
DESCRIPTION
You are a formula one driver who has severe budget limitations and can only afford a VIC-20.
This is the software you are using to hone your driving skills.
Clearly your path to victory is assured.
The simulated track is infinitely long, probably.
The track shifts left and right, and varies in width.
Speed? No - only single speed, budget limitations you understand.
Potholes will appear on the road, best to avoid them.
Potholes will appear more frequently the longer you drive.
How long can you stay on the road?
Can you get to the end? (no : see "infinitely long" above)
Will you crash and burn? (most certainly)
Will you succumb to the hypnotic engine noise?
For every car length travelled you accumulate a score point.
How many points can you score?
CODE
0 s$="###########":n=36874:v=n+4:g=n-5:pokeg,255:pokev,1:b=8142:t=198
1 fori=0to7:readq,p:poke7168+i,q:poke7448+i,255:poke7176+i,p:poke7424+i,0:next
2 c=9:r=5:w=7:fori=1to22:printspc(r)left$(s$,w):next
3 s=s+1:ifrnd(1)<.05orw>10thenq=w:w=w+int(rnd(1)*3)-1:ifw<5orw>9thenw=q
4 ifrnd(1)<.1ord=0thend=int(rnd(1)*3)-1:ifrnd(1)<(s/1000)thenpokeb+r+rnd(1)*w,1
5 q=r:r=r+d:ifr<0orr+w>20thenr=q:d=d*-1:ifrnd(1)<(s/1000)thenpokeb+r+w/2,1
6 k=peek(197):q=c:c=c+(k=52)-(k=13)+(k=17)-(k=18):poken,128-(q<>c)*32
7 p=peek(7702+c):printspc(r)left$(s$,w):poke7680+c,0
8 ifp=35andc>=0then3:data36,255,0,231,36,195,231,129,231,129,36,195,0,231,36,255
9 fori=1tot:poken,rnd(1)*t+56:next:pokev,0:poket,0:pokeg,240:print"{up}{up}score"s"{up}"
VARIABLES
s$ : string containing road characters
n : noise voice poke location
v : volume poke location
g : graphics mode poke location
b : screen poke location, left edge of second last line of screen
t : (1) a vector to the keyboard buffer, (2) a value for the crash loop sound duration, (3) the crash loop random range
c : car x coord
r : left edge of road x coord
w : width of road
s : score
i,q,p : temporary values
CODE DESCRIPTION
0 initialise some values, turn on the volume, set graphics mode
1 setup the user defined characters: car(0), pothole(1), road(35), space(32)
2 a couple values initialised that didn't fit on line 0, print the initial road
3 increment score, randomly change road size
4 randomly change road direction, maybe add a pothole (yes, on road direction changes)
5 don't let road direction go off screen, maybe add a pothole (yes, as road bounces off screen edge)
6 check key, adjust car position if O or P or A or D pressed, different noise if A/D. This could be optimised to remove duplicate controls, A/D is standard convention but O/P was part of the rules, SOUND!
7 check the car character for a crash, print the new road segment, place car character
8 loop if not crashed, character data
9 crash sound! clean things up, print the score, we're done!
You have to type RUN and tap enter to play again
FEATURES:
Custom graphics! Looks just like a formula one car.
Sound! Feel like you're in the cockpit, and the inevitable crash noise as bits of your car tinkle away.
OPTIONS:
[1] You can set the screen foreground and background and text colour yourself: this game will play with whatever you have set before you RUN the game.
Try this, press any of the following, before you type run.
Ctrl+1 Black
Ctrl+2 White
Ctrl+3 Red
Ctrl+4 Cyan
Ctrl+5 Purple
Ctrl+6 Green
Ctrl+7 Blue
Ctrl+8 Yellow
Maybe not white on white background - but hey, you do you, I'm not your mum.
You could try messing with POKE36879,xxx where xxx is a byte that should always have OR 8, 8 is reverse(0) or normal(1), first three bits is border colour, and the last 4 bits are the screen colour. Just make sure you can see your cursor and text.
For example:
POKE 36879,8
Ctrl+6
RUN
But none of this is necessary, you can just use the colours that Jack Tramiel deemed fit for start up of the computer.
[2] Before hitting enter on your RUN command, load up
and turn up the volume a little.
Can you last the whole song without crashing?
[3] Update line 7 to change the keys to only "A" and "D" if you want:
6 k=peek(197):q=c:c=c+(k=17)-(k=18):poken,128-(q<>c)*32
^^ ^^
This may speed things up very slightly.
Install instructions
START UP
Load the program with VICE using the VIC-20 emulator.
Preferences > Settings > Machine > Model > "No expansion memory"
File > Attach Disk Image > Drive #8 > "car10line.d64"
In the VICE VIC20 environment type:
LOAD "CAR10L",8
Common mistake: you typed shift+L ... don't do that.
Then once the program is loaded, you type:
RUN
and tap enter.
Note that each play requires you to type RUN + enter.

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