News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Mr. DVG

A crossroads adventure completely in BASIC, is it possible?

Started by Mr. DVG, 19:10, 17 January 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mr. DVG

Fabrizio Radica (a very dear friend of mine who is an Amstrad CPC enthusiast like me) has developed a small, easily modifiable BASIC engine to create a very simple forklift adventure.

If you are interested in developing these types of projects, I will put you the test demo (in Italian, sorry) and the listing in BASIC to make it work!
The idea is to create .TXT files with the story and the choices to be made.

To work, the .TXT files must be compiled like the test one I have attached for example.

However, there are limits to all of this, you cannot put more than 64 files on a disk! :laugh:

BASIC listing:
5 mode 0:border 26:ink 0,26:ink 1,0:DIM choose$(5)
8 locate 5,10:print "CPC Brother's":locate 8,12:print "Presents"
9 on error goto 2000
10 SYMBOL AFTER 32: FOR a=HIMEM TO HIMEM+767 STEP 8
20 FOR b=1 TO 4: a$=BIN$(PEEK(a+b),8)
30 POKE a+b,VAL("&x"+a$) AND VAL ("&x"+a$)/2: NEXT b,a
40 load"wolf.scr":CALL &C7D0

50 memory &3fff:p=&4000:file$="1":memory p:mode 2:border 0:ink 0,0:ink 1,26
52 WINDOW #1,1,80,1,20
55 WINDOW #2,1,80,21,22
62 gosub 1000
65 gosub 2000
70 goto 62

90 'Load text to memory
1000 load file$+".txt",p:i=p:cls

1001 'Parsing HEADER with chooise
1005 j=0:k=0:a=0:vc=0:id=0:n=0:res$=""
1010 while hex$(peek(id))<>"D"
1012 n=n+1:id=i+n
1015 j=j+1:res$=res$+chr$(peek(id-1))
1020 if j=3 then j=0 : k=k+1 : choose$(k)=res$ : res$=""
1030 wend
1050 'for vc=1 to k:print choose$(vc),k:next

1100 locate #1,1,1:riga=0:while peek(i)
1110 i=i+1:add=peek(n+i-1):dat$=chr$(add)
1120 if dat$="@" then print #1,chr$(24);:dat$=" ":dat$=dat$+chr$(8 ):
1200 h=i mod 80:if h=1 then riga=riga+1
1250 print #1,dat$;
1300 if riga>10 then gosub 3000
1350 wend
1400 return

2000 input #2,"Scegli il tuo destino: > ",file$
2010 if len(file$)=1 then file$="00"+file$
2015 if len(file$)=2 then file$="0"+file$
2050 for vc=1 to k
2060 if file$=choose$(vc) then goto 2100
2080 next

2090 print #2,"Scelta non valida. Riprova":goto 2000
2100 cls #1:cls #2:locate #1,1,1:locate #2,1,1:print #1,"Caricamento...":for c=p to i:poke c,0:next
2200 return

3000 locate #2,1,1:print #2,"Premi A per proseguire..."
3010 a$=inkey$
3050 if a$="a" or a$="A" then riga=0: cls #2 : return
3060 goto 3000


Powered by SMFPacks Menu Editor Mod