Spacman

Type: Program
Platform(s): TS 2068

Pacman type game. Originally published inย Sinclair Programsย – type-in from issueย #4 – 1982/Nov.

Appears on

One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained programs 20121 to 20163. These tapes were compiled by Tony Willing.

Source Code

    1 REM spacman
    2 GO SUB 9000
    3 LET r=.01: LET s=0: LET gx=10: LET gx1=2: LET gy1=2: LET gy=10: LET x=19: LET y=2: LET d$="\r": BORDER 1: PAPER 1: INK 1: CLS : PAPER 7
    9 DIM a$(20,20)
   10 LET a$(1)="\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
   20 LET a$(2)="\::......\::\::\::\::\::\::......\::"
   30 LET a$(3)="\::.\::\::\::\::.\::\::\::\::\::\::.\::\::\::\::.\::"
   40 LET a$(4)="\::..\::\::...\::\::\::\::...\::\::..\::"
   50 LET a$(5)="\::\::....\::..\::\::..\::....\::\::"
   60 LET a$(6)="\::..\::\::.\::\::....\::\::\::\::\::..\::"
   70 LET a$(7)="\::.\::\::\::.\::\::\::.\::.......\::\::"
   80 LET a$(8)="\::......\::\::...\::\::\::\::\::.\::\::"
   90 LET a$(9)="\::\::\::\::\::\::..\::.\::...\::\::\::..\::"
  100 LET a$(10)="\::......\::\::.\::\::\::...\::\::.\::"
  110 LET a$(11)="\::\::\::.\::\::\::\::...\::\::\::.\::\::..\::"
  120 LET a$(12)="\::.....\::\::.......\::\::.\::\::"
  130 LET a$(13)="\::.\::\::\::\::\::.....\::\::.....\::"
  140 LET a$(14)="\::...\::\::\::\::\::.\::..\::.\::.\::\::\::"
  150 LET a$(15)="\::\::.\::\::.....\::\::......\::\::"
  160 LET a$(16)="\::.....\::\::\::.\::\::.\::.\::\::..\::"
  170 LET a$(17)="\::\::.\::\::\::\::\::\::.\::\::....\::\::.\::"
  180 LET a$(18)="\::\::.\::\::.............\::\::"
  190 LET a$(19)="\::.....\::\::.....\::\::\::\::..\::"
  200 LET a$(20)="\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
  210 PRINT ': FOR f=1 TO 20: PRINT "\::";a$(f): NEXT f
 1000 LET a$(x,y)=" "
 1001 IF s=180 OR s=460 OR s=740 THEN LET s=s+100: PAPER 1: CLS : GO SUB 7000: PAPER 1: CLS : PAPER 7: GO TO 10
 1010 IF INKEY$="" THEN GO TO 1055
 1020 IF INKEY$="5" THEN LET d$="\l"
 1030 IF INKEY$="6" THEN LET d$="\d"
 1040 IF INKEY$="7" THEN LET d$="\u"
 1050 IF INKEY$="8" THEN LET d$="\r"
 1055 PRINT AT x,y;" "
 1060 IF d$="\u" AND a$(x-1,y)<>"\::" THEN LET x=x-1
 1061 IF d$="\r" AND a$(x,y+1)<>"\::" THEN LET y=y+1
 1062 IF d$="\d" AND a$(x+1,y)<>"\::" THEN LET x=x+1
 1063 IF d$="\l" AND a$(x,y-1)<>"\::" THEN LET y=y-1
 1064 PRINT AT x,y; INK 0;D$
 1070 IF a$(x,y)="." THEN LET s=s+1: PRINT AT 0,0;s: BEEP .1,-10
 1080 PRINT AT gx,gy;a$(gx,gy): IF INT (RND*2)+(gx>x) AND a$(gx-1,gy)<>"\::" THEN LET gx=gx-1
 1090 IF INT (RND*2)+(gx<x) AND a$(gx+1,gy)<>"\::" THEN LET gx=gx+1
 2000 IF INT (RND*2)+(gy>y) AND a$(gx,gy-1)<>"\::" THEN LET gy=gy-1
 2010 IF INT (RND*2)+(gy<y) AND a$(gx,gy+1)<>"\::" THEN LET gy=gy+1
 2015 PRINT AT gx,gy; INK 3;"\a"
 2020 IF (gx=x AND gy=y) OR (gx1=x AND gy1=y) THEN PRINT AT x,y; FLASH 1;d$: STOP 
 3080 PRINT AT gx1,gy1;a$(gx1,gy1): IF INT (RND*2)+(gx1>x) AND a$(gx1-1,gy1)<>"\::" THEN LET gx1=gx1-1
 3090 IF INT (RND*2)+(gx1<x) AND a$(gx1+1,gy1)<>"\::" THEN LET gx1=gx1+1
 3100 IF INT (RND*2)+(gy1>y) AND a$(gx1,gy1-1)<>"\::" THEN LET gy1=gy1-1
 3110 IF INT (RND*2)+(gy1<y) AND a$(gx1,gy1+1)<>"\::" THEN LET gy1=gy1+1
 3120 PRINT AT gx1,gy1; INK 4;"\a"
 3130 GO TO 1000
 7000 FOR f=0 TO 25
 7001 PRINT AT 10,29; INK 7;"O"
 7010 PRINT AT 10,f; INK 3;" \a  "; INK 6;"\r"
 7020 BEEP .1,-15
 7030 NEXT f
 7035 BEEP .2,-20
 7040 FOR f=25 TO 0 STEP -1
 7050 PRINT AT 10,f; INK 5;"\a  "; INK 6;"\l "
 7055 BEEP 0.1,0
 7060 NEXT f: CLS : RETURN 
 8999 STOP 
 9000 DATA 0,BIN 1000010,BIN 11100111,255,255,BIN 1111110,BIN 111100,BIN 11000
 9010 DATA BIN 000011100,BIN 111110,BIN 1111100,BIN 1111000,BIN 1111000,BIN 1111100,BIN 111110,BIN 11100
 9020 DATA 0,BIN 00011000,BIN 00111100,BIN 01111110,255,255,BIN 11100111,BIN 01000010,0
 9030 DATA BIN 001110000,BIN 011111000,BIN 001111100,BIN 000111110,BIN 000111110,BIN 001111100,BIN 011111000,BIN 001110000
 9035 DATA 24,60,126,219,219,255,219,145
 9040 RESTORE 9000
 9045 FOR f=0 TO 7: READ a: POKE USR "\u"+f,a: NEXT f
 9050 FOR f=0 TO 7: READ a: POKE USR "\r"+f,a: NEXT f
 9060 FOR f=0 TO 7: READ a: POKE USR "\d"+f,a: NEXT f
 9070 FOR f=0 TO 7: READ a: POKE USR "\l"+f,a: NEXT f
 9075 FOR f=0 TO 7: READ a: POKE USR "\a"+f,a: NEXT f
 9080 RETURN 
 9999 SAVE "spacman" LINE 1: BEEP 1,33

People

No people associated with this content.

Scroll to Top