Advertisement
Guest User

spctank_mod.bas

a guest
Aug 8th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.77 KB | None | 0 0
  1. rem SPACE TANKS for the Atari VCS
  2. rem Geek Basic Computers 2013 www.geekbasic.com
  3. rem programmed by: Gemino Michael Smothers
  4.  
  5. set tv ntsc
  6. set romsize 4k
  7.  
  8. rem data statements go where you
  9. rem put them and the compiler adds jump
  10. rem around them so the code doesn't run
  11. rem into them
  12. rem using the noinlinedata optimization
  13. rem eliminates the jumps but you have to
  14. rem put the data statements out of the way
  15.  
  16. set optimization noinlinedata
  17.  
  18. dim mapx=a
  19. dim mapy=b
  20. dim area=c
  21. dim object=d
  22. dim shield=e
  23. dim ammo=f
  24. dim anim=g
  25. dim dir=h
  26. dim aimx=i
  27. dim aimy=j
  28. dim delay=k
  29. dim shoot=l
  30. dim key=m
  31. dim kills=n
  32. dim temp=o
  33. dim tempx=p
  34. dim tempy=q
  35. dim sfx=r
  36. dim slen=s
  37. dim explode=t
  38. dim flag=u
  39. dim npcshield=v
  40. dim autolock=w
  41. dim bigmissile=x
  42.  
  43. const p0_0 = $63
  44. const p0_1 = p0_0 + 8
  45. const p0_2 = p0_0 + 16
  46. const p1_0 = $13
  47. const p1_1 = p1_0 + 8
  48. const p1_2 = p1_0 + 16
  49. const p1_3 = p1_0 + 24
  50. const p1_4 = p1_0 + 32
  51. const p1_5 = p1_0 + 40
  52. const p1_6 = p1_0 + 48
  53. const p1_7 = p1_0 + 56
  54. const p1_8 = p1_0 + 64
  55. const p1_9 = p1_0 + 72
  56. const p1_A = p1_0 + 80
  57.  
  58.  
  59. rem moved the data statement out
  60. rem of the way of the code
  61.  
  62. rem data areas
  63. rem 3,7,11,11,11,8,7,11,11,8
  64. rem 10,10,7,11,11,9,10,7,8,10
  65. rem 6,5,9,2,11,11,4,10,6,9
  66. rem 7,9,7,4,7,11,8,6,11,8
  67. rem 10,7,9,2,5,8,6,11,11,9
  68. rem 10,6,8,7,5,5,4,7,11,8
  69. rem 6,8,10,10,10,6,4,6,4,10
  70. rem 2,5,5,9,6,8,7,11,11,9
  71. rem 7,5,5,8,7,9,6,11,11,8
  72. rem 6,9,1,1,6,11,11,11,11,9
  73. rem end
  74.  
  75. gosub titlecols
  76.  
  77. rem initialize flag is not critical
  78. rem so you could save a few bytes
  79. rem by leaving it out
  80.  
  81. flag=0
  82.  
  83. titleloop
  84.  
  85. rem flag will roll over at 255
  86. rem so the test are 0 and 128
  87. rem which will make the time about
  88. rem 1 / 3 longer
  89. rem and you leave out the counter reset
  90.  
  91. rem !flag is cheaper and equivalent
  92. rem to if flag = 0
  93.  
  94. rem if flag=100 then playfield:
  95.  
  96. if !flag then playfield:
  97. ......XXX..X...XX...XX...X.....
  98. .....X....X.X.X..X.X....X......
  99. ......XX..XX..XXXX.X....XX.....
  100. ........X.X...X..X.X....X......
  101. .....XXX..X...X..X..XX...X.....
  102. ...............................
  103. .....XXX..XX..X..X.X.X..XXX....
  104. ......X..X..X.XX.X.X.X.X.......
  105. ......X..XXXX.X.XX.XX...XX.....
  106. ......X..X..X.X..X.X.X....X....
  107. ......X..X..X.X..X.X.X.XXX.....
  108. end
  109.  
  110. if flag=128 then playfield:
  111. .........XXX..X..X.X.X.........
  112. ........X....X..X..X.X.........
  113. ........X.XX.XX.XX.XX..........
  114. ........X..X.X..X..X.X.........
  115. .........XX...X..X.X.X.........
  116. ...............................
  117. ......XX...XX...XXX.XXX..XX....
  118. .....X..X.X..X.X.....X..X......
  119. .....X.XX.XXXX..XX...X..X......
  120. .....X..X.X..X....X..X..X......
  121. .....XXX..X..X.XXX..XXX..XX....
  122. end
  123.  
  124. rem leave out the counter reset
  125. rem if flag=200 then flag=0
  126.  
  127. rem reverse the sense of the if predicate
  128. rem saves a goto but have to move the drawscreen
  129.  
  130. drawscreen
  131.  
  132. flag=flag+1
  133.  
  134. if !joy0fire && !joy1fire then goto titleloop
  135. ammo=60:shield=60:player0x=45:player0y=45:missile0x=55:missile0y=45
  136. rem drawscreen
  137.  
  138. rem goto titleloop
  139.  
  140. rem you don't need to rewrite the
  141. rem playfield if you just adjust
  142. rem for the differences between
  143. rem old and the new
  144. rem so moved stuff around so that
  145. rem the playfield statement is
  146. rem outside the loop
  147. rem this is less flexible if
  148. rem doing things by differences
  149. rem is not good enough
  150.  
  151. rem loadroom
  152.  
  153. rem flag=mapx+(mapy*10)
  154. rem area=areas[flag]
  155.  
  156. rem the playfield is only 31 pixels
  157. rem wide instead of the full 32
  158.  
  159. playfield:
  160. .XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
  161. XXXXXX...................XXXXXX
  162. XXX.........................XXX
  163. XX...........................XX
  164. X.............................X
  165. X.............................X
  166. X.............................X
  167. XX...........................XX
  168. XXX.........................XXX
  169. XXXXXX...................XXXXXX
  170. .XXXXXXXXXXXX.....XXXXXXXXXXXX.
  171. end
  172.  
  173. gosub setup_P1
  174.  
  175. rem var4 = player0pointerlo
  176. rem var4 = player1pointerlo
  177.  
  178. area = 4
  179.  
  180. loadroom
  181.  
  182.  
  183. rem rearranging the expression
  184. rem saves stashing mapx on the stack
  185.  
  186. rem saved 35 bytes so far
  187.  
  188.  
  189. rem flag=mapx+(mapy*10)
  190.  
  191. flag=mapy*10 + mapx
  192.  
  193. rem I changed the areas data
  194. rem to represent where the openings
  195. rem are and then rearranged the code to
  196. rem flip openings that are different
  197. rem between the old and the new screen
  198. rem that way you only need one if statement
  199. rem and one call to the the line routines
  200. rem for each possible opening
  201. rem and you don't draw lines if you don't
  202. rem need to
  203. rem area needs initializing and the initial
  204. rem playfield definition is different
  205.  
  206. rem this saves about 240 bytes all by it's self
  207. rem 280 or so total so far
  208.  
  209. rem if area=1 then pfhline 13 0 17 off
  210. rem if area=2 then pfvline 30 3 7 off
  211. rem if area=3 then pfhline 13 10 17 off
  212. rem if area=4 then pfvline 0 3 7 off
  213. rem if area=5 then pfhline 13 0 17 off:pfvline 30 3 7 off:pfhline 13 10 17 off:pfvline 0 3 7 off
  214. rem if area=6 then pfhline 13 0 17 off:pfvline 30 3 7 off
  215. rem if area=7 then pfvline 30 3 7 off:pfhline 13 10 17 off
  216. rem if area=8 then pfhline 13 10 17 off:pfvline 0 3 7 off
  217. rem if area=9 then pfhline 13 0 17 off:pfvline 0 3 7 off
  218. rem if area=10 then pfhline 13 0 17 off:pfhline 13 10 17 off
  219. rem if area=11 then pfvline 30 3 7 off:pfvline 0 3 7 off
  220.  
  221. area = area ^ areas[flag]
  222.  
  223. if area{0} then pfhline 13 0 17 flip
  224. if area{1} then pfvline 30 3 7 flip
  225. if area{2} then pfhline 13 10 17 flip
  226. if area{3} then pfvline 0 3 7 flip
  227.  
  228. area = areas[flag] : flag = 0
  229.  
  230. if mapx=6&&mapy=6 then object=9:goto gameloop else object=(rand&7)+1
  231. if object=4 then object=0
  232. if !mapx&&!mapy then object=0
  233. if switchleftb&&object>6&&rand<40 then object=0
  234.  
  235. npcshield=object*2
  236.  
  237. rem each of these gives you 4 possibilities
  238. rem for a total of 16 possibile positions
  239.  
  240. player1x=(rand&80)+40
  241. player1y=(rand&40)+35
  242.  
  243. gameloop
  244.  
  245. COLUPF=$00
  246. COLUBK=$64
  247. COLUP0=$04
  248.  
  249. if anim=11 then anim=0
  250.  
  251. if anim<6 then player0:
  252. %10101011
  253. %01010101
  254. %11111111
  255. %11111111
  256. %01111110
  257. %00011000
  258. %01111000
  259. %00000000
  260. end
  261.  
  262. if anim>5 then player0:
  263. %11010101
  264. %10101010
  265. %11111111
  266. %11111111
  267. %01111110
  268. %00011000
  269. %01111000
  270. %00000000
  271. end
  272.  
  273. rem if mapy is equivalent to if mapy > 0
  274. rem but is faster and uses fewer bytes
  275.  
  276. rem if player0y<10&&mapy>0 then mapy=mapy-1:player0y=85:goto loadroom
  277.  
  278. if player0y<10&&mapy then mapy=mapy-1:player0y=85:goto loadroom
  279. if player0x>135&&mapx<9 then mapx=mapx+1:player0x=20:goto loadroom
  280. if player0y>85&&mapy<10 then mapy=mapy+1:player0y=20:goto loadroom
  281.  
  282. rem if player0x<15&&mapx>0 then mapx=mapx-1:player0x=130:goto loadroom
  283.  
  284. if player0x<15&&mapx then mapx=mapx-1:player0x=130:goto loadroom
  285.  
  286. rem dir is set from a look up table indexed by
  287. rem the joy0 part of SWCHA and then used to index
  288. rem position increments this reduces the code and makes
  289. rem the timing less variable and saves about 64 bytes
  290. rem tables are arbitrary and more flexible
  291. rem the way the if statements are set up prioritizes
  292. rem directions and doesn't allow for diagonal movement
  293. rem the way the tables are set up mimics that
  294. rem but it would be easy to change
  295.  
  296. rem if collision(player0,playfield)&&dir=1 then player0y=player0y+1:goto skipmove
  297. rem if collision(player0,playfield)&&dir=2 then player0x=player0x-1:goto skipmove
  298. rem if collision(player0,playfield)&&dir=3 then player0y=player0y-1:goto skipmove
  299. rem if collision(player0,playfield)&&dir=4 then player0x=player0x+1:goto skipmove
  300.  
  301. if collision(player0,playfield) && dir then player0x = player0x + dx[dir] : player0y = player0y + dy[dir] : goto skipmove
  302.  
  303. if !explode&&flag{0} then flag{0}=0
  304.  
  305. rem skipmove is close enough that you
  306. rem don't need the goto
  307.  
  308. rem if flag{0} then goto skipmove
  309.  
  310. if flag{0} then skipmove
  311.  
  312. temp1 = (SWCHA ^ $F0) / 16
  313. if temp1 && !collision(player0,playfield) then dir = dirt[temp1] : player0x = player0x - dx[dir] : player0y = player0y - dy[dir] : flag{1} = 1 : anim = anim + 1
  314.  
  315. rem if joy0up&&!collision(player0,playfield) then player0y=player0y-1:dir=1:anim=anim+1:flag{1}=1:goto skipmove
  316. rem if joy0right&&!collision(player0,playfield) then player0x=player0x+1:dir=2:anim=anim+1:flag{1}=1:goto skipmove
  317. rem if joy0down&&!collision(player0,playfield) then player0y=player0y+1:dir=3:anim=anim+1:flag{1}=1:goto skipmove
  318. rem if joy0left&&!collision(player0,playfield) then player0x=player0x-1:dir=4:anim=anim+1:flag{1}=1:goto skipmove
  319. skipmove
  320.  
  321. if joy1up&&missile0y>8 then missile0y=missile0y-1
  322. if joy1right&&missile0x<155 then missile0x=missile0x+1
  323. if joy1down&&missile0y<80 then missile0y=missile0y+1
  324. if joy1left&&missile0x>5 then missile0x=missile0x-1
  325. if !joy1fire&&flag{3} then flag{3}=0
  326.  
  327. if autolock then missile0x=player1x+3:missile0y=player1y-3
  328.  
  329. rem these could save a few bytes but are probably
  330. rem not worth it with more than 8 objects and having
  331. rem to select flag bytes
  332.  
  333. rem temp1 = object / 8 : temp2 = setb[object]
  334. rem if cP1f[temp1] & temp2 then COLUP1 = cP1[object]
  335. rem if NS1f[temp1] & temp2 then NUSIZ1 = NS1[object]
  336. rem if P1f[temp1] & temp2 then P1plo = P1[object]
  337.  
  338. rem using on gosub gets rid of some if statements
  339. rem and uses returns instead of goto's
  340. rem with the miscellaneous tweaks in the subroutines
  341. rem saves about 85 bytes
  342.  
  343. on object gosub o0 o1 o2 o3 o4 o5 o6 o7 o8 o9
  344.  
  345.  
  346. skipo
  347.  
  348.  
  349. if joy0fire then tempx=player1x:tempy=player1y:goto huddisplay
  350.  
  351. dead
  352.  
  353.  
  354. if switchreset then reboot
  355.  
  356. drawscreen
  357.  
  358. AUDV0=0
  359.  
  360. if flag{1} then AUDV0=4:AUDC0=2:AUDF0=3:flag{1}=0
  361. if slen then AUDV0=10:AUDC0=4:AUDF0=sfx:sfx=sfx-1
  362. if slen&&!sfx then sfx=6:slen=slen-1
  363. if sfx>0&&!slen then AUDV0=10:AUDC0=8:AUDF0=5:sfx=sfx-1
  364.  
  365. if shield>250 then goto dead
  366.  
  367. goto gameloop
  368.  
  369. huddisplay
  370.  
  371. gosub shieldsprite
  372.  
  373. player1x=60
  374. player1y=80
  375. missile1x=70
  376. missile1y=80
  377. missile1height=shield
  378.  
  379. drawscreen
  380.  
  381. gosub ammosprite
  382.  
  383. player1x=80
  384. player1y=80
  385. missile1x=90
  386. missile1y=80
  387. missile1height=ammo
  388.  
  389. drawscreen
  390.  
  391. if joy0fire then goto huddisplay
  392.  
  393. player1x=tempx
  394. player1y=tempy
  395.  
  396. gosub hidemissile
  397. goto gameloop
  398.  
  399.  
  400. data areas
  401. 4, 6, 10, 10, 10, 12, 6, 10, 10, 12
  402. 5, 5, 6, 10, 10, 9, 5, 6, 12, 5
  403. 3, 15, 9, 2, 10, 10, 8, 5, 3, 9
  404. 6, 9, 6, 8, 6, 10, 12, 3, 10, 12
  405. 5, 6, 9, 2, 15, 12, 3, 10, 10, 9
  406. 5, 3, 12, 6, 15, 15, 8, 6, 10, 12
  407. 3, 12, 5, 5, 5, 3, 8, 3, 8, 5
  408. 2, 15, 15, 9, 3, 12, 6, 10, 10, 9
  409. 6, 15, 15, 12, 6, 9, 3, 10, 10, 12
  410. 6, 9, 1, 1, 6, 11, 11, 11, 11, 9
  411. end
  412.  
  413. data dirt
  414. 0, 1, 3, 1, 4, 1, 3, 1, 2, 1
  415. end
  416.  
  417. const dx = dy + 1
  418.  
  419. data dy
  420. 0, 1, 0, -1, 0, 1
  421. end
  422.  
  423. rem selection is done with on gosub so the
  424. rem if statement is not needed
  425.  
  426. rem if object>0 then goto o1
  427.  
  428. o0
  429. player1pointerlo = p1_A
  430. rem player1:
  431. rem %00000000
  432. rem %00000000
  433. rem %00000000
  434. rem %00000000
  435. rem %00000000
  436. rem %00000000
  437. rem %00000000
  438. rem %00000000
  439. rem end
  440.  
  441. if explode then explode=explode-1:COLUP1=$48:player1pointerlo = p1_0
  442.  
  443. rem %00000100
  444. rem %01111110
  445. rem %11111100
  446. rem %01111110
  447. rem %00111110
  448. rem %11111110
  449. rem %00111100
  450. rem %01011110
  451. rem end
  452.  
  453. if explode=0&&flag{0} then object=4:flag{0}=0
  454.  
  455. gosub hidemissile
  456.  
  457. rem goto skipo
  458.  
  459. return
  460.  
  461. o1
  462.  
  463. rem done with on gosub
  464.  
  465. rem if object>2 then goto o3
  466.  
  467. if object=1 then COLUP1=$44:NUSIZ1=$00 : player1pointerlo = p1_1
  468.  
  469. rem player1:
  470. rem %01100110
  471. rem %00100100
  472. rem %00011000
  473. rem %00011000
  474. rem %01111110
  475. rem %11011000
  476. rem %00111100
  477. rem %00111100
  478. rem end
  479.  
  480. o2
  481.  
  482. if object=2 then COLUP1=$0E:NUSIZ1=$07 : player1pointerlo = p1_2
  483.  
  484. rem player1:
  485. rem %00101000
  486. rem %01000010
  487. rem %00100101
  488. rem %10011000
  489. rem %00011001
  490. rem %10100100
  491. rem %01000010
  492. rem %00010100
  493. rem end
  494.  
  495. if object=2 then shoot=0:gosub hidemissile
  496.  
  497. shoot=0:gosub hidemissile
  498.  
  499. delay=delay+1
  500.  
  501. rem removed the gotos
  502.  
  503. rem if object=1&&delay<3 then goto skipmove2
  504. rem if shoot then goto skipmove2
  505.  
  506. if object=1&&delay<3 then skipmove2
  507. if shoot then skipmove2
  508.  
  509. delay=0
  510.  
  511. if switchrightb then temp=1 else temp=0
  512. if aimy=0 then player1y=player1y-1:player1y=player1y-temp
  513. if aimx=1 then player1x=player1x+1:player1x=player1x+temp
  514. if aimy=1 then player1y=player1y+1:player1y=player1y+temp
  515. if aimx=0 then player1x=player1x-1:player1x=player1x-temp
  516.  
  517. skipmove2
  518.  
  519. if player1y<20 then aimy=1
  520. if player1x>120 then aimx=0
  521. if player1y>80 then aimy=0
  522. if player1x<20 then aimx=1
  523.  
  524. if joy1fire then gosub checkfire
  525.  
  526. if collision(player0,player1) then shield=shield-1:sfx=2
  527.  
  528. rem goto skipo changed to return
  529.  
  530. rem if object=2 then goto skipo
  531.  
  532. if object=2 then return
  533.  
  534. rem removed goto's
  535.  
  536. rem temp=player1y-1:if player0y<temp then goto skipshoot
  537. rem temp=player1y+1:if player0y>temp then goto skipshoot
  538.  
  539. temp=player1y-1:if player0y<temp then skipshoot
  540. temp=player1y+1:if player0y>temp then skipshoot
  541.  
  542. if player0x<player1x&&shoot=0 then missile1x=player1x+4:missile1y=player1y-3:shoot=1
  543.  
  544. if player0x>player1x&&shoot=0 then missile1x=player1x+4:missile1y=player1y-3:shoot=2
  545.  
  546.  
  547. skipshoot
  548.  
  549. if shoot=1 then missile1x=missile1x-2
  550. if shoot=2 then missile1x=missile1x+2
  551. if missile1x<20||missile1x>135 then shoot=0:gosub hidemissile
  552. if collision(player0,missile1) then shield=shield-15:shoot=0:sfx=7:gosub hidemissile
  553.  
  554. rem goto skipo
  555.  
  556. return
  557.  
  558. o3
  559.  
  560. rem on gosub .. not needed .. yadda, yadda, yadda
  561.  
  562. rem if object>3 then goto o4
  563.  
  564. COLUP1=$12
  565. NUSIZ1=$07
  566. player1pointerlo = p1_3
  567.  
  568. rem player1:
  569. rem %11100111
  570. rem %11100111
  571. rem %01000010
  572. rem %11111111
  573. rem %01111111
  574. rem %00111111
  575. rem %00011111
  576. rem %00000000
  577. rem end
  578.  
  579. delay=delay+1
  580.  
  581. rem you know the drill by now
  582.  
  583. rem if delay<3 then goto skipmove3
  584.  
  585. if delay<3 then skipmove3
  586.  
  587. delay=0
  588.  
  589. if switchrightb then temp=1 else temp=0
  590. if player0y<player1y then player1y=player1y-1:player1y=player1y-temp
  591. if player0x>player1x then player1x=player1x+1:player1x=player1x+temp
  592. if player0y>player1y then player1y=player1y+1:player1y=player1y+temp
  593. if player0x<player1x then player1x=player1x-1:player1x=player1x-temp
  594.  
  595. skipmove3
  596.  
  597. if joy1fire then gosub checkfire
  598.  
  599. if collision(player0,player1) then shield=shield-1:sfx=2
  600.  
  601. rem goto skipo
  602.  
  603. return
  604.  
  605. o4
  606.  
  607. rem if object>4 then goto o5
  608.  
  609. COLUP1=$B8
  610. player1pointerlo = p1_4
  611.  
  612. rem player1:
  613. rem %00000000
  614. rem %01111110
  615. rem %01000010
  616. rem %01111110
  617. rem %01000010
  618. rem %01111110
  619. rem %00100010
  620. rem %00011110
  621. rem end
  622.  
  623. if collision(player0,player1) then object=0:key=key+1:score=score+100:slen=3:sfx=6
  624.  
  625. rem goto skipo
  626.  
  627. return
  628.  
  629. o5
  630.  
  631. rem if object>5 then goto o6
  632.  
  633. gosub hidemissile
  634. gosub shieldsprite
  635. if collision(player0,player1) then object=0:shield=shield+15:slen=3:sfx=6
  636. if shield>200 then shield=200
  637.  
  638. rem goto skipo
  639.  
  640. return
  641.  
  642. o6
  643.  
  644. rem if object>6 then goto o7
  645.  
  646. gosub hidemissile
  647. gosub ammosprite
  648. if collision(player0,player1) then object=0:ammo=ammo+10:slen=3:sfx=6
  649. if ammo>200 then ammo=200
  650.  
  651. rem goto skipo
  652.  
  653. return
  654.  
  655. o7
  656.  
  657. rem if object>7 then goto o8
  658.  
  659. COLUP1=$C6
  660. player1pointerlo = p1_5
  661.  
  662. rem player1:
  663. rem %00010000
  664. rem %00010000
  665. rem %00000000
  666. rem %11010110
  667. rem %00000000
  668. rem %00010000
  669. rem %00010000
  670. rem %00000000
  671. rem end
  672.  
  673. if collision(player0,player1) then object=0:autolock=3:slen=3:sfx=6
  674.  
  675. rem goto skipo
  676.  
  677. return
  678.  
  679. o8
  680.  
  681. rem if object>8 then goto o9
  682.  
  683. COLUP1=$0A
  684. player1pointerlo = p1_6
  685. rem player1:
  686. rem %01010100
  687. rem %01111100
  688. rem %00111000
  689. rem %00111000
  690. rem %00111000
  691. rem %00111000
  692. rem %00111000
  693. rem %00010000
  694. rem end
  695.  
  696. if collision(player0,player1) then object=0:bigmissile=3:slen=3:sfx=6
  697.  
  698. rem goto skipo
  699.  
  700. return
  701.  
  702. o9
  703.  
  704. COLUP1=$04
  705. NUSIZ1=$07
  706.  
  707. player1x=45
  708. player1y=30
  709. player1pointerlo = p1_7
  710.  
  711. rem player1:
  712. rem %11111111
  713. rem %10100101
  714. rem %10110101
  715. rem %10100101
  716. rem %10101101
  717. rem %10100101
  718. rem %10110101
  719. rem %11111111
  720. rem end
  721.  
  722. rem rigged it to fall through to win
  723. rem not sure thats such a good idea
  724. rem stack needs popped if we don't return
  725.  
  726. if !collision(player0,player1) || key<>3 then return
  727.  
  728. pop
  729.  
  730.  
  731. win
  732.  
  733. gosub titlecols
  734. AUDV0=0
  735. player0y=0
  736. player1y=0
  737. missile0y=0
  738.  
  739. playfield:
  740. ..X.X..X..XXX..XXX.X..XX..X..X.
  741. .X.X.X.X.X....X....X.X..X.XX.X.
  742. .X.X.X.X..XXX..XX..X.X..X.X.XX.
  743. .X.X.X.X....X....X.X.X..X.X..X.
  744. .X.X.X.X.XXX..XXX..X..XX..X..X.
  745. ...............................
  746. .XX..XX...X.X...X..X...X.XXX..X
  747. X...X..X.X.X.X.X.X.X..X...X..X.
  748. X...X..X.X.X.X.XX..X..XX..X..XX
  749. X...X..X.X.X.X.X...X..X...X..X.
  750. .XX..XX..X.X.X.X...XX..X..X...X
  751. end
  752.  
  753. if switchreset then reboot
  754.  
  755. drawscreen
  756.  
  757. goto win
  758.  
  759. titlecols
  760.  
  761. COLUPF=$46
  762. COLUBK=$00
  763. scorecolor=$0E
  764.  
  765. return
  766.  
  767. shieldsprite
  768.  
  769. COLUP1=$86
  770. player1pointerlo = p1_8
  771.  
  772. rem player1:
  773. rem %00000000
  774. rem %00111000
  775. rem %01000100
  776. rem %00000100
  777. rem %00111000
  778. rem %01000000
  779. rem %01000100
  780. rem %00111000
  781. rem end
  782.  
  783. return
  784.  
  785. ammosprite
  786.  
  787. COLUP1=$44
  788. player1pointerlo = p1_9
  789.  
  790. rem player1:
  791. rem %00000000
  792. rem %01000100
  793. rem %01000100
  794. rem %01000100
  795. rem %01111100
  796. rem %01000100
  797. rem %00101000
  798. rem %00010000
  799. rem end
  800.  
  801. return
  802.  
  803. hidemissile
  804.  
  805. missile0height=2
  806. missile1height=1
  807. missile1x=0
  808. missile1y=0
  809.  
  810. return
  811.  
  812. checkfire
  813.  
  814. if flag{3} then goto skipfire
  815. if ammo>0 then ammo=ammo-1:flag{3}=1:sfx=10 else goto skipfire
  816. if !collision(missile0,player1) then goto skipfire
  817. if npcshield&&!bigmissile then npcshield=npcshield-1:goto skipfire
  818. if npcshield&&bigmissile then npcshield=0
  819. if npcshield then goto skipfire
  820. if key<3 then kills=kills+object
  821. if kills>30 then flag{0}=1:kills=0
  822. if autolock then autolock=autolock-1
  823. if bigmissile then bigmissile=bigmissile-1
  824.  
  825. score=score+100
  826. explode=25
  827. object=0
  828.  
  829. skipfire
  830.  
  831. return
  832.  
  833. rem consolidating the player1
  834. rem definitions saves about 70 bytes
  835.  
  836. setup_P1
  837.  
  838. player1:
  839. %00000100
  840. %01111110
  841. %11111100
  842. %01111110
  843. %00111110
  844. %11111110
  845. %00111100
  846. %01011110
  847. %01100110
  848. %00100100
  849. %00011000
  850. %00011000
  851. %01111110
  852. %11011000
  853. %00111100
  854. %00111100
  855. %00101000
  856. %01000010
  857. %00100101
  858. %10011000
  859. %00011001
  860. %10100100
  861. %01000010
  862. %00010100
  863. %11100111
  864. %11100111
  865. %01000010
  866. %11111111
  867. %01111111
  868. %00111111
  869. %00011111
  870. %00000000
  871. %00000000
  872. %01111110
  873. %01000010
  874. %01111110
  875. %01000010
  876. %01111110
  877. %00100010
  878. %00011110
  879. %00010000
  880. %00010000
  881. %00000000
  882. %11010110
  883. %00000000
  884. %00010000
  885. %00010000
  886. %00000000
  887. %01010100
  888. %01111100
  889. %00111000
  890. %00111000
  891. %00111000
  892. %00111000
  893. %00111000
  894. %00010000
  895. %11111111
  896. %10100101
  897. %10110101
  898. %10100101
  899. %10101101
  900. %10100101
  901. %10110101
  902. %11111111
  903. %00000000
  904. %00111000
  905. %01000100
  906. %00000100
  907. %00111000
  908. %01000000
  909. %01000100
  910. %00111000
  911. %00000000
  912. %01000100
  913. %01000100
  914. %01000100
  915. %01111100
  916. %01000100
  917. %00101000
  918. %00010000
  919. %00000000
  920. %00000000
  921. %00000000
  922. %00000000
  923. %00000000
  924. %00000000
  925. %00000000
  926. %00000000
  927. end
  928.  
  929. player1height = 7
  930.  
  931. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement