A downloadable game

-= PrgTaxi                    =-
-=                            =-
-= Written by Doczens         =-
-= 2024 Basic 10Liner Contest =-
-= C64 (PUR-80)               =-

This year I was thinking to bring a game which is connected also to programming, so I figured out a concept to give a path description with some very simple commands and iteration possibility, to traverse through a map. 

To give it some purpose I turned it to a Taxi game. So the map is a city map and the goal is to drive our cab to the passenger to pick him up with a sequence of commands. To implement a program editor and interpreter in the PUR-80 category for pure Basic V2, turned out to be quite a challenge, and I had to cut some of my ideas, both visual and gameplay related, I originally had for the game. But I decided to not let those ideas lost, so I now apply with the advanced version in the EXTREME-256 category. 

The PUR-80 version is a simple game which also can be seen as a trainer for the 2 player EXTREME-256 variant.

If you start the game you are presented with the program editor table on the left and the map at the middle of the screen. On the top of the program editor you see the number of level you are at. It is incremented every time you successfuly pick up a passenger. The passenger is represented with the heart symbol on the map. The map and also the position of the passenger is randomized. It can happen, that more then one passenger is appearing, in that case reaching any one of them means winning the level. Your taxi will allways start from the upper left corner of the map, heading to the right. 

You start in program editor mode in every new screen. You can use keys "q" and "a" to navigate up and down on the program table. the actual position of the editor is marked with a reversed "E" at the end of the actual row. You can use "s" key to change the command. It will cycle through the available commands:

 - "^": drive one character to the direction of current orientation of the vehicle

 - "<": turn orientation of the vehicle to the left in place

 - ">": turn orientation of the vehicle to the right in place

 - "-": NOP do nothing

With keys "1".."9" you can select the number of iterations the given command will be executed. After you are happy with the program you have "written" you can press " " (space) to start the interpreter. 

The program execution is now shown on the program editor by the edit mark and also decreasing the iteration count to 0. Meanwhile your Taxi is moving on the map based on the commands executing. If you leave the road or reach the end of the program before picking up the passenger the game ends. If you reach the character of the passenger staying on the road then you won the level, and a new map is generated.

The game was developed with CBM prg studio and tested on the VICE and HOXS64 emulator.


Program code with comments and (number of characters):

!- (79) Initialization if first run, set background color 
0p=p+1:ifd=0tHfOi=0to3:rEc(i),d(i):nE:rEy,x,q,f,z,d,w,m:n=48:g=f-3:h=f-1:pOd,11
!- (79) Print program editor
1o=0:s=0:v=0:?"{clear}{yellow}{down}{down}{cm a}"p"{cm s}":fOi=0to8:p(i)=0:q(i)=1:?"B^ 1B":?"{cm q}CCC{cm w}":nE:?"{up}{cm z}CCC{cm x}"
!- (79,80) Generate randomized map
2e=0:fOi=0to5:r=(r+int(rN(0)*3)-1)*(i>0)*(i<5):fOj=0to15:pOy,3+j:?:pOx,12+i*3+r
3b=z:?"{light gray}{reverse on}{sh +}":pOy,3+i*3-r:?:pOx,12+j:t=-(j=(r+4)*3)*-(i>4+r):?"{reverse on}"cH(123-t*8):nE:nE
!- (79,79) Keyboard input, edit program
4l=e:gEa$:e=e-(a$="q")*(e>0)+(a$="a")*(e<8):pOf+e*m,133:p(e)=(p(e)-(a$=" "))aN3
5t=-(a$>"0"aNa$<":"):q(e)=t*(aS(a$+"!")-n)+(1-t)*q(e):s=-(a$="s"ors=1):ifs=0tH8
!- (79,79) Run program, check succes
6k=b:b=b+(p(v)=0)*((o=0)+((o=1)-(o=3))*40)+(o=2):o=(o+(p(v)=1)-(p(v)=2))aN3:e=v
7t=pE(b):pOk,w:pOb,d(o):on(t<>w)*(p(v)=0)-(t=211)gO9,0:q(v)=q(v)-1:v=v-(q(v)=0)
!- (75) Draw moving screen elements
8pOg+e*m,c(p(e)):pOf+l*m,-66*(l<>e)-133*(l=e):pOh+e*m,n+q(e):on(v<9)+2gO4,9
!- (80)Game over,c(i) d(i)                   y   x   q    f    z    d     w   m
9?"game over!":dA30,107,60,114,62,115,67,113,214,211,1141,1148,1196,53281,219,80

!- Variable            Comment

!- ------------------------------------------------

!- a$                  keyboard input

!- a                   road or passenger to print

!- b                   screen memory address of taxi

!- e                   pointer to the actually edited row in program

!- i                   general cycle variable

!- j                   general cycle variable

!- k                   old value of b

!- l                   old value of e

!- o                   orientation of taxi (32)

!- p                   level counter

!- r                   random number for map drawing

!- s                   program started flag

!- t                   general temporary variable

!- v                   program counter (32)

!- Array               Comment

!- ------------------------------------------------

!- p()                 program commands, (used 0-8 size 11 auto dim)

!-                      0=forward, 1=left, 2=right, 3=stop

!- q()                 program repeat counts, (used 0-8 size 11 auto dim)

!- Constant            Comment

!- ------------------------------------------------

!- d = 53281           memory address of background

!- f = 1148            screen memory address of edit sign column

!- g = f-3             screen memory address of command sign column

!- h = f-1             screen memory address of command count column

!- m = 80              numberof chars in 2 rows

!- n = 48              character code of 0 

!- q = 1141            screen memory address of NOP column

!- w = 219             road screen code

!- x = 211             cursor column setting address

!- y = 214             cursor line setting address

!- z = 1196            screen memory address of taxi start point 

!- Constant array      Comment

!- ------------------------------------------------

!- c()                 screen code of program command symbols

!-                       30 (^),60(<),62(>),67(-)

!- d()                 screen code of taxi based on orientation

!-                       107(right),114(down),115(left),113(up)

StatusReleased
Rating
Rated 4.0 out of 5 stars
(1 total ratings)
AuthorBASIC 10Liner
GenreSimulation
Tags10liner, 8-Bit, basic, Commodore 64

Download

Download
prgtaxi.bas 3 kB
Download
prgtaxi.d64 170 kB
Download
prgtaxi.txt 6 kB

Install instructions

The game is delivered on a D64 disk image.

In VICE first attach the disk image from the menu:

 - File -> Attach disk image-> Drive #8

 - Load the program with LOAD”PRGTAXI”,8 and RUN.

Leave a comment

Log in with itch.io to leave a comment.