10 ' Fantasy map designer - PUBLIC DOMAIN
20 ' By Richard Coton
30 ' Amstrad Action Christmas 88
40 ' Look at DMP 2000 or DMP 2160 printer
50 ' manual for printing an maps
70 GOSUB 630
80 SYMBOL AFTER 32
90 PEN #1,1:PAPER #1,0:DIM map(39,18):GOSUB 770
100 MODE 1
110 GOSUB 1090
120 ' SCREEN LAYOUT
130 WINDOW 1,40,20,25:WINDOW #1,1,40,1,18
140 ' MAIN PROGRAM
150 xp=20:yp=10
160 CLS #1:CLS
170 WHILE INKEY$<>"":WEND:PRINT"[Sve [Lad [G]raphics [T]yping [Wpe [Print]":PRINT:PRINT"Make your choice";
180 i$=UPPER$(INKEY$):IF i$="" THEN 180
190 IF i$="S" THEN 250
200 IF i$="L" THEN 290
210 IF i$="G" THEN 350
220 IF i$="T" THEN 420
230 IF i$="W" THEN 490
235 IF i$="P" THEN GOSUB 1100
240 GOTO 180
250 ' [Sve map
260 n$="":CLS:PRINT"Enter filename":PRINT:INPUT n$
270 OPENOUT n$+".MAP":FOR x=1 TO 39:FOR y=1 TO 18:WRITE #9,map(x,y):NEXT:NEXT:CLOSEOUT
280 CLS:GOTO 170
290 ' [Lad map
300 CLS:PRINT"Enter filename":PRINT:INPUT n$
310 OPENIN n$+".MAP":FOR x=1 TO 39:FOR y=1 TO 18:INPUT #9,map(x,y):NEXT:NEXT
320 CLOSEIN
330 FOR x=1 TO 39:FOR y=1 TO 18:LOCATE #1,x,y:PRINT #1,CHR$(map(x,y)):NEXT:NEXT
340 CLS:GOTO 170
350 ' [G]raphics position
360 CLS:PRINT"Use CURSOR keys then press SPACE":GOSUB 560
370 CLS:FOR i=1 TO 45:a$=STR$(i)+CHR$(i+144):PRINT a$;:NEXT
380 WHILE INKEY$<>"":WEND:INPUT g
390 IF g=128 THEN LOCATE #1,xp,yp:PRINT #1," ":map(xp,yp)=128:CLS:GOTO 170
400 IF g<1 OR g>45 THEN CLS:GOTO 170
410 LOCATE #1,xp,yp:PRINT #1,CHR$(g+144):map(xp,yp)=g+144:CLS:GOTO 170
420 ' [T]yping position
430 CLS:PRINT"Use CURSOR keys then press SPACE":GOSUB 560
440 CLS:PRINT"Enter one word of text only":PRINT:INPUT text$:PRINT:PRINT"Please wait":xp1=39-xp
450 IF LEN(text$)>xp1 THEN PRINT"Too long":FOR i=1 TO 2000:NEXT:CLS:GOTO 170
460 xp1=xp:a=33:FOR i=1 TO LEN(text$)
470 IF MID$(text$,i,1)=CHR$(a) THEN map(xp1,yp)=a:a=33:xp1+xp1+1:NEXT ELSE a=a+1:GOTO 470
480 xp1=xp:FOR i=xp1 TO xp1+LEN(text$):LOCATE #1,i,yp:PRINT #1,CHR$(map(i,yp)):NEXT:CLS:GOTO 170
490 ' [Wpe
500 CLS:PRINT"Are you sure (Y/N) ?"
510 i$=UPPER$(INKEY$):IF i$="" THEN 510
520 IF i$="Y" THEN CLS #1:GOSUB 1090:CLS:GOTO 170
530 IF i$="N" THEN CLS:GOTO 170
540 GOTO 510
550 ' Cursor movement
560 LOCATE #1,xp,yp:PEN #1,0:PAPER #1,1:PRINT #1,CHR$(map(xp,yp))
570 IF INKEY(0)=0 AND yp>1 THEN LOCATE xp,yp:PEN #1,1:PAPER #1,0:PRINT #1,CHR$(map(xp,yp)):yp=yp-1:GOTO 560
580 IF INKEY(2)=0 AND yp<18 THEN LOCATE xp,yp:PEN #1,1:PAPER #1,0:PRINT #1,CHR$(map(xp,yp)):yp=yp+1:GOTO 560
590 IF INKEY(8)=0 AND xp>1 THEN LOCATE xp,yp:PEN #1,1:PAPER #1,0:PRINT #1,CHR$(map(xp,yp)):xp=xp-1:GOTO 560
600 IF INKEY(1)=0 AND xp<39 THEN LOCATE xp,yp:PEN #1,1:PAPER #1,0:PRINT #1,CHR$(map(xp,yp)):xp=xp+1:GOTO 560
610 IF INKEY(47)=0 THEN PEN #1,1:PAPER #1,0:LOCATE #1,xp,yp:PEN #1,1:PAPER #1,0:PRINT CHR$(map(xp,yp)):WHILE INKEY$<>"":WEND:RETURN
620 GOTO 560
630 ' OPENING SCREEN
640 PEN 3:MODE 1:LOCATE 10,1:PRINT"FANTASY MAP DESIGNER":LOCATE 10,2:PRINT STRING$(20,200):PEN 1
650 PRINT:PRINT" The screen is split into two areas, themap window and the option window. You   make your choce of action and follow anyinstructions."
660 PEN 3:PRINT:PRINT"SAVE":PEN 1:PRINT:PRINT" This option allows you to save the map which is currently on screen."
670 PEN 3:PRINT:PRINT"LOAD":PEN 1:PRINT:PRINT" This option allows you to load a map   previously saved on tape.":PEN 2:LOCATE 15,24:PRINT"PRESS SPACE":CALL &BB18:PEN 3:CLS
680 PRINT"GRAPHICS":PEN 1:PRINT:PRINT" This option allows you TO MOVE a cursoraround the screen TO the desired place. You press space AND you are given a     selection of GRAPHICS TO choose from."
690 PRINT" Enter the number which is next to the  graphic you want."
700 PRINT:PRINT" The first 15 graphics are used for     routes available to the adventurer. The next 7 are used as rooms, then there is a tree, a pit, a hut, 2 lots of steps."
710 PRINT" The next ones are 2 graphics used for  rivers, bridges, marsh or swamp,        mountains, hills, an arch, a porttculis,4 graphics used for rivers and 4        graphics used for dead ends."
720 PRINT" If you type the number 128 then a spaceis placed at the current cursor position.":PEN 2:LOCATE 15,24:PRINT"PRESS SPACE":CALL &BB18:PEN 3:CLS
730 PRINT"TYPING":PEN 1:PRINT:PRINT" This option allows you to place the    cursor anywhere on the screen and then  asks you to type in one word only. It   then puts the word on the map.":PEN 3:PRINT:PRINT
740 PRINT"WIPE":PEN 1:PRINT:PRINT" This option allows you to clear the    whole map from memory and the screen.":PEN 3:PRINT:PRINT
750 PRINT"PRINT":PEN 1:PRINT:PRINT" This option allows you to dump the map currently on screen, to a printer. This is done by pressing CTRL and COPY at thesame time.   [[[THIS SHOULD ONLY BE DONEWHEN THE OPTION WINDOW IS CLEAR]]]":PEN 2
760 LOCATE 15,24:PRINT"PRESS SPACE":CALL &BB18:PEN 1:RETURN
770 ' GRAPHICS SET UP
780 SYMBOL 160,255,129,129,129,129,129,129,255
790 SYMBOL 161,255,165,189,129,129,189,165,255
800 SYMBOL 162,255,129,231,165,165,231,129,255
810 SYMBOL 163,255,165,189,129,129,129,129,255
820 SYMBOL 164,255,129,135,133,133,135,129,255
830 SYMBOL 165,255,129,129,129,129,189,165,255
840 SYMBOL 166,255,129,225,161,161,225,129,255
850 SYMBOL 167,24,60,24,126,24,255,24,24
860 SYMBOL 168,24,36,102,129,102,36,24,0
870 SYMBOL 169,24,60,102,66,153,165,165,231
880 SYMBOL 170,36,60,36,60,36,60,36,60
890 SYMBOL 171,0,0,255,85,85,255,0,0
900 SYMBOL 172,0,0,231,24,0,195,60,0
910 SYMBOL 173,36,36,34,18,18,34,36,36
920 SYMBOL 174,0,24,60,60,60,52,60,60
930 SYMBOL 175,66,36,36,36,36,36,36,66
940 SYMBOL 176,0,129,126,0,0,126,129,0
950 SYMBOL 177,0,0,0,0,165,165,90,60
960 SYMBOL 178,0,0,8,20,20,34,99,129
970 SYMBOL 179,0,0,0,0,0,24,102,195
980 SYMBOL 180,56,108,254,170,254,170,254,170
990 SYMBOL 181,36,100,196,8,16,224,0,0
1000 SYMBOL 182,0,0,224,16,8,196,100,36
1010 SYMBOL 183,0,0,7,8,16,35,38,36
1020 SYMBOL 184,36,38,35,16,8,7,0,0
1030 SYMBOL 185,60,66,129,129,129,129,129,129
1040 SYMBOL 186,0,0,32,224,224,32,0,0
1050 SYMBOL 187,0,0,0,0,0,60,24,24
1060 SYMBOL 188,0,0,4,7,7,4,0,0
1070 SYMBOL 189,24,24,60,0,0,0,0,0
1080 RETURN
1090 FOR x=1 TO 39:FOR y=1 TO 18:map(x,y)=128:NEXT:NEXT:RETURN