Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 rem The Wall
- 3 rem Written by: Menedek Programozo Klub
- 4 rem Programmer: TBC
- 5 rem 2018.
- 10 rem ****************
- 11 rem * Declarations *
- 12 rem ****************
- 15 let kk% = 7680 : rem Screen mem. start
- 20 let kv% = 8185 : rem Screen mem. end
- 25 let sk = 38400 : rem Colour mem. start
- 30 let sv = 38905 : rem Colour mem. end
- 35 let x = 11 : rem Player X coordinate
- 40 let y = 11 : rem Player Y coordinate
- 45 let xe = x : rem Previous X coord.
- 50 let ye = y : rem Previous Y coord.
- 55 let p = 0 : rem Score
- 60 let jv = 0 : rem Game over
- 100 rem ***************
- 101 rem * Main pogram *
- 102 rem ***************
- 110 gosub 3000 : rem New chars
- 120 gosub 2000 : rem Intro screen
- 130 gosub 11000 : rem Clear screen
- 140 gosub 20000 : rem Read
- 150 gosub 22000 : rem Evaluate
- 160 gosub 21000 : rem Move
- 170 if jv=0 then goto 140
- 180 gosub 25000 : rem Game over
- 200 clr
- 210 kk% = 7680 : kv% = 8185
- 220 sk = 38400 : sv = 38905
- 230 x = 11 : y = 11 : xe = x : ye = y
- 240 p = 0 : jv = 0
- 300 print "new game (y/n)? ";
- 310 get f$
- 320 if f$="y" then goto 130
- 330 if f$="n" then goto 999
- 340 goto 310
- 999 end
- 1000 rem ***************
- 1001 rem * Subprograms *
- 1002 rem ***************
- 2000 rem
- 2001 rem *** Intro screen ***
- 2002 rem
- 2010 PRINT ""
- 2020 PRINT ""
- 2030 PRINT ""
- 2040 PRINT ""
- 2050 PRINT " {green}the"
- 2060 PRINT ""
- 2070 PRINT " {red}< < < < < <"
- 2080 PRINT " < < < < < < <"
- 2090 PRINT " < < < < < < <"
- 2100 PRINT " < < < < < < <"
- 2110 PRINT " < < < < < < <"
- 2120 PRINT " < < < <<< < <"
- 2130 PRINT " < < < < < < <"
- 2140 PRINT " < < < < <<< <<<"
- 2150 PRINT ""
- 2160 PRINT ""
- 2170 PRINT ""
- 2180 PRINT ""
- 2190 PRINT " {blue}, ,"
- 2200 PRINT " menedek programozo"
- 2210 PRINT ""
- 2220 PRINT " klub"
- 2230 PRINT ""
- 2240 for i=1 to 1000 : next : rem Wait
- 2250 print "{black}press space to start"
- 2255 print " controls: i,j,k,l"
- 2260 get k$
- 2270 if k$<>" " then goto 2260
- 2999 return
- 3000 rem
- 3001 rem *** New characters ***
- 3002 rem
- 3010 rem BASIC decrease BASIC memory
- 3020 poke 52,20 : poke 56,20
- 3030 rem clr
- 3040 rem RAM-charset copy
- 3050 for i=0 to 2047
- 3060 poke 5120+i,peek(32768+i)
- 3070 next i
- 3080 rem Modify chars
- 3090 for i=60 to 64
- 3100 for j=0 to 7
- 3110 read a
- 3120 poke 5120+i*8+j,a
- 3130 next j
- 3140 next i
- 3150 rem Enable RAM-charset
- 3160 poke 36869,253
- 3200 rem Set colour
- 3210 for i=sk to sv
- 3220 poke i,6
- 3230 next i
- 3999 return
- 10000 rem ***************
- 10001 rem * Subroutines *
- 10002 rem ***************
- 11000 rem
- 11001 rem *** Clear screen ***
- 11002 rem
- 11010 print chr$(147)
- 11020 for i=sk to sv
- 11030 poke i,0
- 11040 next i
- 11999 return
- 20000 rem
- 20001 rem *** Read ***
- 20002 rem
- 20010 get b$
- 20020 IF b$="i" THEN ir=8
- 20030 IF b$="j" THEN ir=4
- 20040 IF b$="k" THEN ir=2
- 20050 IF b$="l" THEN ir=6
- 20060 IF b$="q" THEN jv=1
- 20999 return
- 21000 rem
- 21001 rem *** Move ***
- 21002 rem
- 21010 poke kk%+22*ye+xe,60
- 21020 if ir=2 then poke kk%+22*y+x,64
- 21030 if ir=4 then poke kk%+22*y+x,61
- 21040 if ir=6 then poke kk%+22*y+x,62
- 21050 if ir=8 then poke kk%+22*y+x,63
- 21999 return
- 22000 rem
- 22001 rem *** Evaluate ***
- 22002 rem
- 22010 if ir=2 then goto 22200
- 22020 if ir=4 then goto 22400
- 22030 if ir=6 then goto 22600
- 22040 if ir=8 then goto 22800
- 22099 return
- 22200 rem ir=2 down
- 22210 if y=22 then goto 22900
- 22220 if peek(kk%+22*(y+1)+x)<>32 then goto 22900
- 22230 let xe = x
- 22240 let ye = y
- 22250 let y = y + 1
- 22260 let p = p + 1
- 22299 return
- 22400 rem ir=4 left
- 22410 if x=0 then goto 22900
- 22420 if peek(kk%+22*y+(x-1))<>32 then goto 22900
- 22430 let xe = x
- 22440 let ye = y
- 22450 let x = x - 1
- 22460 let p = p + 1
- 22499 return
- 22600 rem ir=6 right
- 22610 if x=21 then goto 22900
- 22620 if peek(kk%+22*y+(x+1))<>32 then goto 22900
- 22630 let xe = x
- 22640 let ye = y
- 22650 let x = x + 1
- 22660 let p = p + 1
- 22699 return
- 22800 rem ir=8 up
- 22810 if y=0 then goto 22900
- 22820 if peek(kk%+22*(y-1)+x)<>32 then goto 22900
- 22830 let xe = x
- 22840 let ye = y
- 22850 let y = y - 1
- 22860 let p = p + 1
- 22899 return
- 22900 rem End
- 22910 let jv=1
- 22920 for i=1 to 200 : next : rem Wait
- 22930 gosub 11000 : rem Clear screen
- 22935 print chr$(147) : rem Because of a bug...
- 22940 print "game over."
- 22950 print "score: ";
- 22960 print p
- 22999 return
- 25000 rem
- 25001 rem *** Game over ***
- 25002 rem
- 25999 return
- 60000 rem ********
- 60001 rem * Data *
- 60002 rem ********
- 61000 rem
- 61001 rem *** New characters ***
- 61002 rem
- 61010 DATA 255,016,016,016,255,001,001,001
- 61020 DATA 007,031,127,255,255,127,031,007
- 61030 DATA 224,248,254,255,255,254,248,224
- 61040 DATA 024,060,060,126,126,255,255,255
- 61050 DATA 255,255,255,126,126,060,060,024
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement