SHARE
TWEET

pwnd3 editor

a guest Feb 9th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 100 'basic controls
  2. 110 'Editor Mode
  3. 120 'r = restore field (only works if field has been previously saved in memory by going into play/test mode)
  4. 130 'c = clear field
  5. 140 'p = play/test field
  6. 150 'esc = return to basic
  7. 160 ' , = chose tile -1
  8. 170 ' . = chose tile +1
  9. 172 'l=save from saved file (field.bin set filename)
  10. 173 ' red walls as passable (invisible in final version)
  11. 174 ' blue walls are non passable (green in final version)
  12. 180 '
  13. 190 'Play Mode
  14. 200 'push cursor key to start moving the direction the cursor key is pushed (also works with joystick)
  15. 210 'esc = return to editor mode
  16. 220 '
  17. 230 SCREEN1,0,0:WIDTH32:KEYOFF
  18. 240 DEFINT A-Z
  19. 250 RESTORE 260
  20. 260 DATA CD,72,00,21,F,04,22,E9,F3,AF,32,EB
  21. 270 DATA F3,CD,62,00,CD,41,0,3E,01,32,B0,FC
  22. 280 DATA 32,AF,FC,21,0,0,CD,77,C0,CD,62,C0
  23. 290 DATA 21,0,8,CD,77,C0,CD,62,C0,21,00,10
  24. 300 DATA CD,77,C0,CD,62,C0,AF,CD,C3,0,CD,69
  25. 310 DATA 00,CD,44,00,3E,F0,01,00,8,21,00,20
  26. 320 DATA CD,56,00,3E,F0,01,00,8,21,00,28,CD
  27. 330 DATA 56,00,3E,F0,01,00,08,21,00,30,CD,56
  28. 340 DATA 00,C9,2A,20,F9,01,98,00,16,8,7E,5F
  29. 350 DATA F,B3,ED,79,23,10,F7,15,20,F4,C9,AF
  30. 360 DATA CB,04,17,CB,04,17,CB,3C,CB,3C,D3,99
  31. 370 DATA 3E,8E,D3,99,7D,D3,99,7C,F6,40,D3,99
  32. 380 DATA C9,#
  33. 390 FOR I=&HC000 TO &HC090:READA$:POKEI,VAL("&H"+A$):NEXTI
  34. 400 DEFUSR=&HC000:U=USR(0)
  35. 410 'a
  36. 420 REM a
  37. 430 DATA &b01111110,&h40
  38. 440 DATA &b11111111,&h50
  39. 450 DATA &b11011101,&he0
  40. 460 DATA &b11111111,&hf0
  41. 470 DATA &b11011101,&hf0
  42. 480 DATA &b11100011,&hf0
  43. 490 DATA &b11111111,&h50
  44. 500 DATA &b01111110,&h40
  45. 510 REM b
  46. 520 DATA &b01111110,&hc0
  47. 530 DATA &b11111111,&h20
  48. 540 DATA &b11011111,&h3e
  49. 550 DATA &b11011111,&h3f
  50. 560 DATA &b11011111,&h3f
  51. 570 DATA &b11111111,&h3e
  52. 580 DATA &b11111111,&h2e
  53. 590 DATA &b01111110,&h80
  54. 600 REM c
  55. 610 DATA &b11111011,&hB0
  56. 620 DATA &b11111011,&h20
  57. 630 DATA &b11111011,&h30
  58. 640 DATA &b00000000,&h00
  59. 650 DATA &b11011111,&hB0
  60. 660 DATA &b11011111,&h20
  61. 670 DATA &b11011111,&h30
  62. 680 DATA &b00000000,&h00
  63. 690 REM d
  64. 700 DATA &b00100100,&h00
  65. 710 DATA &b01011010,&ha0
  66. 720 DATA &b01100110,&hb0
  67. 730 DATA &b00111100,&hb0
  68. 740 DATA &b10111101,&h90
  69. 750 DATA &b11011011,&h80
  70. 760 DATA &b01100110,&h60
  71. 770 DATA &b00111100,&h20
  72. 780 REM e
  73. 790 DATA &b01111110,&hc0
  74. 800 DATA &b11111111,&h23
  75. 810 DATA &b11100011,&h3e
  76. 820 DATA &b11011111,&h3f
  77. 830 DATA &b11111111,&h32
  78. 840 DATA &b11111111,&h32
  79. 850 DATA &b11111111,&h2e
  80. 860 DATA &b01111110,&hc0
  81. 870 REM f
  82. 880 DATA &b01111110,&he0
  83. 890 DATA &b11100111,&he6
  84. 900 DATA &b11100111,&hf8
  85. 910 DATA &b11100111,&hf9
  86. 920 DATA &b10000001,&hf9
  87. 930 DATA &b11000011,&hf8
  88. 940 DATA &b11100111,&he6
  89. 950 DATA &b01111110,&he0
  90. 960 REM g
  91. 970 DATA &b01111110,&he0
  92. 980 DATA &b11100111,&he6
  93. 990 DATA &b11000011,&hf8
  94. 1000 DATA &b10000001,&hf9
  95. 1010 DATA &b11100111,&hf9
  96. 1020 DATA &b11100111,&hf8
  97. 1030 DATA &b11100111,&he6
  98. 1040 DATA &b01111110,&he0
  99. 1050 REM h
  100. 1060 DATA &b01111110,&he0
  101. 1070 DATA &b11110111,&he6
  102. 1080 DATA &b11110011,&hf8
  103. 1090 DATA &b10000001,&hf9
  104. 1100 DATA &b10000001,&hf9
  105. 1110 DATA &b11110011,&hf8
  106. 1120 DATA &b11110111,&he6
  107. 1130 DATA &b01111110,&he0
  108. 1140 REM I
  109. 1150 DATA &b01111110,&he0
  110. 1160 DATA &b11101111,&he6
  111. 1170 DATA &b11001111,&hf8
  112. 1180 DATA &b10000001,&hf9
  113. 1190 DATA &b10000001,&hf9
  114. 1200 DATA &b11001111,&hf8
  115. 1210 DATA &b11101111,&he6
  116. 1220 DATA &b01111110,&he0
  117. 1230 REM j
  118. 1240 DATA &b11111011,&h70
  119. 1250 DATA &b11111011,&h40
  120. 1260 DATA &b11111011,&h50
  121. 1270 DATA &b00000000,&h00
  122. 1280 DATA &b11011111,&h70
  123. 1290 DATA &b11011111,&h40
  124. 1300 DATA &b11011111,&h50
  125. 1310 DATA &b00000000,&h00
  126. 1320 REM k
  127. 1330 DATA &b11111011,&h60
  128. 1340 DATA &b11111011,&h80
  129. 1350 DATA &b11111011,&h90
  130. 1360 DATA &b00000000,&h00
  131. 1370 DATA &b11011111,&h60
  132. 1380 DATA &b11011111,&h80
  133. 1390 DATA &b11011111,&h90
  134. 1400 DATA &b00000000,&h00
  135. 1410 REM l
  136. 1420 DATA &b00111100,&ha0
  137. 1430 DATA &b01100110,&hb0
  138. 1440 DATA &b01100110,&ha0
  139. 1450 DATA &b01100110,&hb0
  140. 1460 DATA &b01100110,&ha0
  141. 1470 DATA &b01111110,&hb0
  142. 1480 DATA &b01100110,&ha0
  143. 1490 DATA &b00111100,&ha0
  144. 1500 '
  145. 1510 RESTORE 410
  146. 1520 FORI=0TO95:READA,B:FORK=0TO2:VPOKE776+I+2048*K,A:VPOKE776+8192+I+2048*K,B:NEXTK,I
  147. 1530 FOR I=0 TO 31:LOCATE I,0:PRINT"c":LOCATE I,21: PRINT"c":NEXTI
  148. 1540 FOR I=0 TO 21:LOCATE 0,I:PRINT"c":LOCATE31,I: PRINT"c":NEXTI
  149. 1550 LOCATE0,22:PRINT"abcdefghijkl"
  150. 1560 DATA &b01010101
  151. 1570 DATA &b10000000
  152. 1580 DATA &b00000001
  153. 1590 DATA &b10000000
  154. 1600 DATA &b00000001
  155. 1610 DATA &b10000000
  156. 1620 DATA &b00000001
  157. 1630 DATA &b10101010
  158. 1640 RESTORE 1560
  159. 1650 A$="":FOR I=0TO7:READA:A$=A$+CHR$(A):NEXT:SPRITE$(0)=A$
  160. 1660 X=1:Y=1:C=0:S=10
  161. 1670 PUT SPRITE0,(X*8,Y*8-1),S,0
  162. 1680 PUT SPRITE1,(C*8,22*8-1),S,0
  163. 1690 A$=INKEY$
  164. 1700 IF A$=CHR$(27) THEN SCREEN0:END
  165. 1710 IF A$=CHR$(30) THEN Y=Y-1
  166. 1720 IF A$=CHR$(31) THEN Y=Y+1
  167. 1730 IF A$=CHR$(29) THEN X=X-1
  168. 1740 IF A$=CHR$(28) THEN X=X+1
  169. 1750 IF A$=CHR$(32) THEN LOCATE X,Y:PRINTCHR$(ASC("a")+C):'put tile
  170. 1760 IF A$=CHR$(44) THEN C=C-1
  171. 1770 IF A$=CHR$(46) THEN C=C+1
  172. 1780 IF A$="r" THEN GOSUB 2370:X=1:Y=1:' restore field
  173. 1781 IF A$="s" THEN GOSUB 1920:GOSUB 9000:X=1:Y=1:' save field
  174. 1782 IF A$="l" THEN GOSUB 9100:GOSUB 2350:' load field
  175. 1790 IF A$="c" THEN CLS:GOTO 1530:'clear field
  176. 1800 IF A$="p" OR A$="P"THEN GOSUB 1920:GOSUB 1990:'test play
  177. 1810 IF A$=CHR$(127) THEN LOCATE X,Y:PRINT" ":'delete tile
  178. 1820 IF X=0 THEN X=30
  179. 1830 IF X=31THEN X=1
  180. 1840 IF Y=0THEN Y=20
  181. 1850 IF Y=21THEN Y=1
  182. 1860 IF C=12THEN C=0
  183. 1870 IF C=-1THEN C=11
  184. 1880 IFS=10THENS=8ELSES=10
  185. 1890 IFA$<>""THEN LOCATE15,22:PRINT"X:";:PRINTX;:PRINT"   Y:";:PRINTY
  186. 1900 GOTO 1670
  187. 1910 'Store field in memory
  188. 1920 FORX=0TO31:FORY=0TO21
  189. 1930 A=VPEEK (&H1800+X+Y*32)
  190. 1940 POKE (&HA000+X+Y*32),A
  191. 1950 LOCATE 15,22:PRINT X;:PRINT " ";:PRINT Y;:PRINT" ";:PRINT A
  192. 1960 IF A=97 THEN PX=X:PY=Y
  193. 1970 NEXT:NEXT
  194. 1980 X=PX:Y=PY:T=150:RETURN
  195. 1990 'basic game engine
  196. 2000 E=D
  197. 2010 FORI=0TOT
  198. 2020 M=STICK(0)ORSTICK(1):IF (M=1 OR M=3 OR M=5 OR M=7) THEN D=M
  199. 2030 NEXT
  200. 2040 IFE=0 THEN 2000
  201. 2050 VPOKE (&H1800+X+Y*32),ASC("e")
  202. 2060 IF D=0 THEN D=E:VPOKE (&H1800+X+Y*32),ASC("2")
  203. 2070 'prevent player from reversing into "itself"
  204. 2080 IF D=1 AND E=5 THEN D=5
  205. 2090 IF D=5 AND E=1 THEN D=1
  206. 2100 IF D=3 AND E=7 THEN D=7
  207. 2110 IF D=7 AND E=3 THEN D=3
  208. 2120 'stick controls
  209. 2130 IFD=1 THEN Y=Y-1
  210. 2140 IFD=3 THEN X=X+1
  211. 2150 IFD=5 THEN Y=Y+1
  212. 2160 IFD=7 THEN X=X-1
  213. 2170 A= VPEEK(&H1800+X+Y*32)
  214. 2180 IF A=ASC("d") THEN F=F+1:PLAY"l64o4co6c":W=W+100:'OTO1290
  215. 2190 IF A=ASC("c") THEN GOSUB 2430
  216. 2200 IF A=ASC("b") THEN GOSUB 2430
  217. 2210 IF A=ASC("e") THEN GOSUB 2430
  218. 2220 IF A=ASC("f")AND D=1 THEN GOSUB 2430
  219. 2230 IF A=ASC("g")AND D=5 THEN GOSUB 2430
  220. 2240 IF A=ASC("h")AND D=7 THEN GOSUB 2430
  221. 2250 IF A=ASC("i")AND D=3 THEN GOSUB 2430
  222. 2260 IF A=ASC("j") THEN GOSUB 2430
  223. 2270 IF A=ASC("l") THEN GOSUB 2480
  224. 2280 VPOKE &H1800+X+Y*32,ASC("a")
  225. 2290 W=W+1
  226. 2300 'IF C=F THEN GOTO 3360
  227. 2310 A$=INKEY$
  228. 2320 IF A$=CHR$(27)THEN GOSUB 2370:GOTO 1660
  229. 2330 'LOCATE 0,0:PRINT USING "SCORE:######";W
  230. 2340 GOTO 2000
  231. 2350 'restore field from memory
  232. 2360 E=0:D=0
  233. 2370 LOCATE10,10:PRINT"REBUILDING"
  234. 2380 FORX=0TO31:FORY=0TO21
  235. 2390 A=PEEK (&HA000+X+Y*32)
  236. 2400 VPOKE (&H1800+X+Y*32),A
  237. 2410 NEXT:NEXT
  238. 2420 RETURN
  239. 2430 LOCATE 10,10:PRINT "DEAD"
  240. 2440 IF INKEY$<>CHR$(32)THEN2440
  241. 2450 GOSUB 2350
  242. 2460 X=PX:Y=PY:E=0:RETURN
  243. 2470 'switch tiles
  244. 2480 FORA=1TO30:FORB=1TO20
  245. 2490 Q=&H1800+A+B*32
  246. 2500 F=VPEEK(Q)
  247. 2510 IF F=ASC("j") THENVPOKE Q,ASC("k")
  248. 2520 IF F=ASC("k") THENVPOKE Q,ASC("j")
  249. 2530 NEXT:NEXT
  250. 2540 RETURN
  251. 9000 BSAVE"field.bin",&HA000,&HA740
  252. 9001 RETURN
  253. 9100 BLOAD"field.bin",&HA000
  254. 9101 RETURN
  255. 
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top