Advertisement
jargon

Sparked x86

Sep 2nd, 2020 (edited)
5,645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #LANG "deprecated"
  2.  
  3. '#define __play__
  4.  
  5. '#lang "fb"
  6.  
  7. 'option gosub
  8.  
  9. #ifndef __play__
  10.     defint a-z
  11. #endif
  12.  
  13. #ifdef __play__
  14.     #include once "fbPlay.bas"
  15. #endif
  16.  
  17. DIM As Integer GR(10,10)
  18. DIM As Integer SP(10,10)
  19. DIM As Integer SW(10,10)
  20. DIM As Integer SJ(10,10)
  21. DIM As Integer CL(20,20)
  22. DIM As Integer BX(10,10)
  23. DIM As Integer SH(20,20)
  24. DIM As Integer BB(10,10)
  25. DIM As Integer QW(30,30)
  26. DIM As Integer BM(20,20)
  27. DIM As Integer EN(10,10)
  28.  
  29. redim shared key_map(0 to 255) as string
  30. dim shared as long key_ct=0,LF=0,D=0,A=0,R=0,A1=0,D1=0,A2=0,D2=0,DD=0,AA=0,DT=0,AT=0,A3=0,D3=0,D6=0,DR=0,A6=0,AR=0,A7=0,D7=0,IV=0,A4=0,D4=0,CT=0
  31. const key_quit=1
  32. const key_up=2
  33. const key_left=3
  34. const key_down=4
  35. const key_right=5
  36. const key_items=6
  37. const key_warp=7
  38. dim as long t=0
  39. dim as string C=""
  40.  
  41. type screentype
  42.     X as long
  43.     Y as long
  44.     Depth as long
  45.     Pages as long
  46. end type
  47.  
  48. dim Resolution as screentype
  49.  
  50. Resolution.X=640
  51. Resolution.Y=480
  52. Resolution.Depth=4
  53. Resolution.Pages=8
  54.  
  55. restore keys
  56. read key_ct
  57.  
  58. for t=1 to key_ct
  59. read key_map(t)
  60. key_map(t)=ucase(key_map(t))
  61. next t
  62.  
  63. keys:
  64.  
  65. data 6
  66. data "Q"
  67. data "W"
  68. data "A"
  69. data "S"
  70. data "D"
  71. data "I"
  72. data "W"
  73.  
  74. '0
  75. REM "SPARKED! BY TIM KEAL(13)"
  76. 'defint a-z
  77. 'SCREEN 0'
  78. ScreenRes Resolution.X,Resolution.Y,Resolution.Depth,Resolution.Pages
  79. '
  80. ':
  81. 'KEY OFF
  82. ':
  83.  
  84. WIDTH 80
  85. ':
  86. COLOR 15,1
  87. ',1
  88. ':
  89.  
  90. CLS
  91. ':
  92. RANDOMIZE TIMER
  93. LOCATE 5,34
  94. ':
  95. PRINT"S P A R K E D !"
  96. LOCATE 7,28
  97. ':
  98. PRINT"LEVEL 04: SPACE PAD"
  99. LOCATE 9,28
  100. ':
  101. PRINT"RATING: AS HARD AS ICE"
  102. LOCATE 15,1
  103. ':
  104. PRINT"PUSH THE <ENTER> KEY TO START"
  105. '1080
  106. ':
  107.  
  108.     do while INKEY<>CHR(13)
  109. ':
  110. loop
  111.  
  112. '   THEN
  113.  'GOTO 1095
  114. 'GOTO 1080
  115. CLS
  116. 'DIM GR(10,10)
  117. ':
  118. 'DIM SP(10,10)
  119. 'DIM SW(10,10)
  120. ':
  121. 'DIM SJ(10,10)
  122. 'DIM CL(20,20)
  123. ':
  124. 'DIM BX(10,10)
  125. 'DIM SH(20,20)
  126. ':
  127. 'DIM BB(10,10)
  128. 'DIM QW(30,30)
  129. ':
  130. 'DIM BM(20,20)
  131. 'DIM EN(30,30)
  132. ':
  133. 'DIM WP(20,20)
  134. LF=10
  135. FOR D=1 TO 10
  136. FOR A=1 TO 10
  137. READ R
  138. GR(A,D)=R
  139. NEXT A
  140. NEXT D
  141. SCREEN 1
  142. ':
  143. CLS
  144. FOR D=1 TO 10
  145. FOR A=1 TO 10
  146. PSET(A,D),GR(A,D)
  147. NEXT A
  148. NEXT D
  149. A1=1
  150. ':
  151. D1=1
  152. ':
  153. A2=10
  154. ':
  155. D2=10
  156. GET(A1,D1)-(A2,D2),SP
  157. ':
  158. CLS
  159. FOR DD=1 TO 10
  160. FOR AA=1 TO 10
  161. READ R
  162. SJ(AA,DD)=R
  163. NEXT AA
  164. NEXT DD
  165. DT=20
  166. ':
  167. AT=20
  168. FOR DD=1 TO 10
  169. FOR AA=1 TO 10
  170. PSET(AA,DD),SJ(AA,DD)
  171. NEXT AA
  172. NEXT DD
  173. GET(A1,D1)-(A2,D2),SW
  174. ':
  175. CLS
  176. A1=1
  177. ':
  178. D1=1
  179. ':
  180. A2=10
  181. ':
  182. D2=10
  183. CIRCLE(11,11),10,2
  184. D1=1
  185. ':
  186. A1=1
  187. ':
  188. A2=21
  189. ':
  190. D2=20
  191. GET(A1,D1)-(A2,D2),CL
  192. ':
  193. CLS
  194. FOR DD=1 TO 10
  195. FOR AA=1 TO 10
  196. READ R
  197. BX(AA,DD)=R
  198. NEXT AA
  199. NEXT DD
  200. A1=1
  201. ':
  202. D1=1
  203. ':
  204. A2=10
  205. ':
  206. D2=10
  207. FOR DD=1 TO 10
  208. FOR AA=1 TO 10
  209. READ R
  210. BX(AA,DD)=R
  211. PSET(AA,DD),BX(AA,DD)
  212. NEXT AA
  213. NEXT DD
  214. GET(A1,D1)-(A2,D2),BX
  215. ':
  216. CLS
  217. A1=1
  218. ':
  219. D1=1
  220. ':
  221. A2=10
  222. ':
  223. D2=10
  224. FOR DD=1 TO 10
  225. FOR AA=1 TO 10
  226. READ R
  227. SH(AA,DD)=R
  228. PSET(AA,DD),SH(AA,DD)
  229. NEXT AA
  230. NEXT DD
  231. GET(A1,D1)-(A2,D2),SH
  232. ':
  233. CLS
  234. A1=1
  235. ':
  236. D1=1
  237. ':
  238. A2=10
  239. ':
  240. D2=10
  241. FOR DD=1 TO 10
  242. FOR AA=1 TO 10
  243. READ R
  244. BB(AA,DD)=R
  245. PSET(AA,DD),BB(AA,DD)
  246. NEXT AA
  247. NEXT DD
  248. GET(A1,D1)-(A2,D2),BB
  249. ':
  250. CLS
  251. A1=1
  252. ':
  253. D1=1
  254. ':
  255. A2=21
  256. ':
  257. D2=20
  258. CIRCLE(11,11),10,1
  259. PAINT(11,11),1
  260. GET(A1,D1)-(A2,D2),BM
  261. ':
  262. CLS
  263. A1=1
  264. ':
  265. D1=1
  266. ':
  267. A2=10
  268. ':
  269. D2=10
  270. FOR DD=1 TO 10
  271. FOR AA=1 TO 10
  272. READ R
  273. EN(AA,DD)=R
  274. PSET(AA,DD),EN(AA,DD)
  275. NEXT AA
  276. NEXT DD
  277. GET(A1,D1)-(A2,D2),EN
  278. ':
  279. CLS
  280. GOTO 14800
  281. DATA 0,0,3,3,3,3,3,3,0,0
  282. DATA 0,3,0,0,1,1,0,0,3,0
  283. DATA 0,3,0,1,1,1,1,0,3,0
  284. DATA 0,3,0,1,1,1,1,0,3,0
  285. DATA 0,0,3,3,3,3,3,3,0,0
  286. DATA 0,0,0,0,1,1,0,0,0,0
  287. DATA 0,0,0,1,0,0,1,0,0,0
  288. DATA 0,0,0,1,0,0,1,0,0,0
  289. DATA 0,0,2,2,0,0,2,2,0,0
  290. DATA 0,0,0,0,0,0,0,0,0,0
  291. DATA 0,0,3,3,3,3,3,3,0,0
  292. DATA 0,3,0,0,1,1,0,0,3,0
  293. DATA 0,3,0,1,1,1,1,0,3,0
  294. DATA 0,3,0,1,1,1,1,0,3,0
  295. DATA 0,0,3,3,3,3,3,3,0,0
  296. DATA 0,0,0,1,1,1,1,0,0,0
  297. DATA 0,0,1,0,0,0,0,1,0,0
  298. DATA 0,0,1,0,0,0,0,1,0,0
  299. DATA 0,2,2,0,0,0,0,2,2,0
  300. DATA 0,0,0,0,0,0,0,0,0,0
  301. DATA 0,1,1,1,1,1,1,1,1,0
  302. DATA 1,0,0,0,0,0,0,0,0,1
  303. DATA 1,0,0,1,1,1,1,0,0,1
  304. DATA 1,0,1,0,1,1,0,1,0,1
  305. DATA 1,0,1,1,0,0,1,1,0,1
  306. DATA 1,0,1,1,0,0,1,1,0,1
  307. DATA 1,0,1,0,1,1,0,1,0,1
  308. DATA 1,0,0,1,1,1,1,0,0,1
  309. DATA 1,0,0,0,0,0,0,0,0,1
  310. DATA 0,1,1,1,1,1,1,1,1,0
  311. DATA 0,0,0,0,0,0,0,0,0,0
  312. DATA 0,0,2,2,2,2,2,2,0,0
  313. DATA 0,2,2,2,2,2,0,1,2,0
  314. DATA 0,2,2,0,0,0,0,1,2,0
  315. DATA 0,2,0,0,0,0,1,0,2,0
  316. DATA 0,2,0,1,0,0,0,0,2,0
  317. DATA 0,2,1,0,0,0,0,2,2,0
  318. DATA 0,2,1,0,2,2,2,2,2,0
  319. DATA 0,0,2,2,2,2,2,2,0,0
  320. DATA 0,0,0,0,0,0,0,0,0,0
  321. DATA 0,0,0,0,0,0,0,0,0,0
  322. DATA 0,3,3,0,3,3,0,3,3,0
  323. DATA 0,3,0,0,0,0,0,0,3,0
  324. DATA 0,0,0,0,2,2,0,0,0,0
  325. DATA 0,3,0,2,0,0,2,0,3,0
  326. DATA 0,3,0,2,0,0,2,0,3,0
  327. DATA 0,0,0,0,2,2,0,0,0,0
  328. DATA 0,3,0,0,0,0,0,0,3,0
  329. DATA 0,3,3,0,3,3,0,3,3,0
  330. DATA 0,0,0,0,0,0,0,0,0,0
  331. DATA 0,0,0,0,0,0,0,0,0,0
  332. DATA 0,0,0,3,3,3,3,0,0,0
  333. DATA 0,0,3,3,0,0,3,3,0,0
  334. DATA 0,3,3,0,0,0,0,3,3,0
  335. DATA 0,3,0,0,1,1,0,0,3,0
  336. DATA 0,3,0,0,1,1,0,0,3,0
  337. DATA 0,3,3,0,0,0,0,3,3,0
  338. DATA 0,0,3,3,0,0,3,3,0,0
  339. DATA 0,0,0,3,3,3,3,0,0,0
  340. DATA 0,0,0,0,0,0,0,0,0,0
  341. DATA 0,0,0,0,0,0,0,0,0,0
  342. DATA 0,0,3,3,3,3,3,3,0,0
  343. DATA 0,3,3,3,3,3,3,3,3,0
  344. DATA 0,0,1,0,1,0,1,0,0,0
  345. DATA 0,0,0,1,0,1,0,1,0,0
  346. DATA 0,0,1,0,1,0,1,0,0,0
  347. DATA 0,0,0,1,0,1,0,1,0,0
  348. DATA 0,3,3,3,3,3,3,3,3,0
  349. DATA 0,0,3,3,3,3,3,3,0,0
  350. DATA 0,0,0,0,0,0,0,0,0,0
  351. DATA 1,1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0,0,0,0,1,1,2,1,0,0,0,0,0,0,1,6,8,0,1
  367. DATA 1,4,4,4,8,6,9,7,9,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,6,4,6,1,1
  368. DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
  369. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  370. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  371. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  372. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  373. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  374. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  375. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  376. DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  377. 14800:
  378. A1=1
  379. ':
  380. D1=1
  381. ':
  382. A2=10
  383. ':
  384. D2=10
  385. ':
  386. A3=A1-5
  387. ':
  388. D3=D1-5
  389. ':
  390. CLS
  391.  
  392. 'GOSUB 17200
  393.  
  394. CLS
  395. ':
  396. D6=0
  397. ':
  398. A6=0
  399. FOR DR=1 TO 18
  400. FOR AR=1 TO 30
  401. READ R
  402. QW(AR,DR)=R
  403. IF R=1 THEN
  404.     PUT(A6,D6),BX
  405. END IF
  406. IF R=2 THEN
  407.     PUT(A6,D6),BX
  408. END IF
  409. IF R=3 THEN
  410.     PUT(A6,D6),SH
  411. END IF
  412. IF R=4 THEN
  413.     PUT(A6,D6),BB
  414. END IF
  415. IF R=5 THEN
  416.     PUT(A6,D6),BX
  417. END IF
  418. IF R=8 THEN
  419.     PUT(A6,D6),BX
  420. END IF
  421. IF R=7 THEN
  422.     PUT(A6,D6),EN
  423. END IF
  424. A6=A6+10
  425. ':
  426. NEXT AR
  427. ':
  428. A6=0
  429. D6=D6+10
  430. ':
  431. NEXT DR
  432.  
  433. 'RETURN
  434.  
  435. 15000 D7=D1*10
  436. ':
  437. A7=A1*10
  438. PUT(D7,A7),SP
  439. A3=A7-5
  440. ':
  441. D3=D7-5
  442. IF IV=3 THEN
  443.     PUT(D3,A3),CL
  444. END IF
  445. 'FOR T=1 TO 100
  446. ':
  447. 'NEXT T
  448. ':
  449. PUT(D7,A7),SP,XOR
  450. ':
  451. IF IV=3 THEN
  452.     PUT(D3,A3),CL,XOR
  453. END IF
  454.  
  455. D4=INT(18*RND)
  456. ':
  457. A4=INT(30*RND)
  458. D4=(D4*10)
  459. ':
  460. A4=(A4*10)
  461. CT=CT+1
  462. ':
  463. IF CT>=200 THEN
  464.     CT=20
  465. END IF
  466. IF IV=0 THEN
  467.     LOCATE 1,30
  468. ':
  469.     PRINT"---------"
  470. END IF
  471. IF IV=2 THEN
  472.     LOCATE 1,30
  473. ':
  474.     PRINT"SHIELD   "
  475. END IF
  476. IF IV=3 THEN
  477.     LOCATE 1,30
  478. ':
  479.     PRINT"SHIELD ON"
  480. END IF
  481. IF IV=4 THEN
  482.     LOCATE 1,30
  483. ':
  484.     PRINT"BOMBS    "
  485. END IF
  486. IF IV=5 THEN
  487.     LOCATE 1,30
  488. ':
  489.     PRINT"BOMBS ON "
  490. END IF
  491. LOCATE 1,3
  492. ':
  493.     PRINT"LIFE:";LF
  494. 'END IF
  495. IF QW(D1+1,A1+1)=5 THEN
  496.     LOCATE 1,3
  497. ':
  498.     PRINT"(W)ARP TO NEXT LEVEL"
  499. END IF
  500. IF LF<0 THEN
  501.     LOCATE 1,3
  502. ':
  503.     PRINT"YOU LOSE!"
  504. END IF
  505. 15943
  506. C=INKEY
  507. IF QW(D1+1,A1+1)=5 AND ucase(C)=ucase(key_map(key_warp)) THEN
  508.     RUN"SPARKY05"
  509. END IF
  510. IF LF<0 AND C=ucase(key_map(key_quit)) THEN
  511.     WIDTH 80
  512. ':
  513. END
  514. END IF
  515. IF LF<0 AND ucase(C)<>ucase(key_map(key_quit)) THEN
  516.     GOTO 15943
  517. END IF
  518. IF QW(D1+1,A1+1)=5 AND ucase(C)<>ucase(key_map(key_warp)) THEN
  519.     GOTO 15943
  520. END IF
  521. IF QW(D1+1,A1+1)=3 THEN
  522.     IV=3
  523.     ':
  524.     QW(D1+1,A1+1)=0
  525.     #ifdef __play__
  526.         PLAY"O1 C32"
  527.     #endif
  528.     PUT(D7,A7),SH,XOR
  529. END IF
  530. 'END IF
  531. IF QW(D1+1,A1+1)=8 THEN
  532.     IV=0
  533.     #ifdef __play__
  534.         PLAY"O3 C32"
  535.     #endif
  536. END IF
  537. IF QW(D1+1,A1+1)=4 THEN
  538.     IV=5
  539. ':
  540.     QW(D1+1,A1+1)=0
  541.     #ifdef __play__
  542.         PLAY"O1 C32"
  543.     #endif
  544.     PUT(D7,A7),BB,XOR
  545. END IF
  546. IF QW(D1+1,A1+1)=5 AND IV=5 THEN
  547.     PUT(D3,A3),BM
  548.     #ifdef __play__
  549.         PLAY"O5 A32"
  550.     #endif
  551.     PUT(D3,A3),BM,XOR
  552. END IF
  553. IF QW(D1+1,A1+1)=7 THEN
  554.  
  555.     LF=LF+10
  556.     #ifdef __play__
  557.         PLAY"O4 A32"
  558.     #endif
  559.     PUT(D7,A7),EN,XOR
  560.     QW(D1+1,A1+1)=0
  561. END IF
  562. IF QW(D1+1,A1+1)=6 AND IV=5 THEN
  563.  
  564.     PUT(D3,A3),BM
  565.     #ifdef __play__
  566.         PLAY"O5 A32"
  567.     #endif
  568.     PUT(D3,A3),BM,XOR
  569.     QW(D1+1,A1+1)=0
  570. END IF
  571. IF QW(D1+1,A1+1)=6 AND IV<>5 AND IV<>3 THEN
  572.     #ifdef __play__
  573.         PLAY"O5 A32"
  574.     #endif
  575.     LF=LF-1
  576. END IF
  577. IF UCASE(C)=key_map(key_quit) THEN
  578.     WIDTH 80
  579.     CLS
  580.     LOCATE 1,1
  581.     END
  582. END IF
  583. IF UCASE(C)=key_map(key_up) AND A1>1 AND QW(D1+1,A1)<>1 AND QW(D1+1,A1)<>9 THEN
  584.     A1=A1-1
  585.     GOTO 16900
  586. END IF
  587. IF UCASE(C)=key_map(key_down) AND A1<16 AND QW(D1+1,A1+2)<>1 AND QW(D1+1,A1+2)<>9 THEN
  588.     A1=A1+1
  589.     GOTO 16900
  590. END IF
  591. IF UCASE(C)=key_map(key_right) AND D1<28 AND QW(D1+2,A1+1)<>1 AND QW(D1+2,A1+1)<>9 THEN
  592.     D1=D1+1
  593.     GOTO 16900
  594. END IF
  595. IF UCASE(C)=key_map(key_left) AND D1>1 AND QW(D1,A1+1)<>1 AND QW(D1,A1+1)<>9 THEN
  596.     D1=D1-1
  597.     GOTO 16900
  598. END IF
  599. IF UCASE(C)=key_map(key_items) AND IV=2 THEN
  600.     IV=3
  601.     GOTO 16900
  602. END IF
  603. IF UCASE(C)=key_map(key_items) AND IV=4 THEN
  604.     IV=5
  605.     GOTO 16900
  606. END IF
  607. IF UCASE(C)=key_map(key_items) AND IV=3 THEN
  608.     IV=2
  609.     GOTO 16900
  610. END IF
  611. IF UCASE(C)=key_map(key_items) AND IV=5 THEN
  612.     IV=4
  613.     GOTO 16900
  614. END IF
  615. GOTO 15000
  616. 16900:
  617. ':
  618.  
  619. PUT(D7,A7),SW
  620. 'FOR T=1 TO 100
  621. ':
  622. 'NEXT T
  623. ':
  624. sleep 100
  625. PUT(D7,A7),SW,XOR
  626. GOTO 15000
  627.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement