スルーカ by petacorn

再生

 スピーディーなシューティングタイプのアクションゲームだ。
 自機「スルーカ」を十字ボタンで操って、スターを逃さず取っていこう。スルーカの通ったあとは不毛の大地が緑に変わるオマケ付き。
 壁や赤い敵機に当たれば1ミス。Aボタンで敵機を倒すボムが発射できるので、ここぞという場面で使っていこう。ボムの残量は画面上部のゲージで確認できるぞ。スターを取り続ければゲージは回復する。
 STARTボタンはポーズに使う。ゲーム終了はR+STARTボタンだ。
 キミはスターを連続で取るCHAINカウントをどこまで稼げるかな?

私が作りました

petacorn

BASICで書くのは二十数年ぶりじゃわい。


 CHECK POiNT 

博士
爆撃機スツーカ + 敵をすり抜けるスルー力(りょく)で「スルーカ(するーか)」ということかの。なかなか凝った言葉遊びじゃわい。

ワンパク
ヘンなとこで感心してねえで、プログラムを見ろや、ファック! コレけっこう本格的なんじゃねえのか?

神崎
ゲームのシステム上いわゆるショットはないけど、縦スクロールシューティングのヒナ型としてもよさそうだね。

インテリ
通過した後のグラフィックが変わるのは、シューティング以外にも応用できそうな面白い工夫だね。BG面の手前側が透過されて、奥側のBG面が見えるしくみだよ。

プログラムリスト

  1. ’************
  2. ’スル-カ
  3. CLEAR:CLS
  4. VISIBLE 1,1,0,0,0,0
  5. GW=256:GH=192
  6. CW=32:CH=24
  7. BGW=64:BGH=64
  8. FOR I=0 TO 31:SP$=SP$+” ”:NEXT
  9. FPS=0:CNTL=0:CNTF=0
  10. REQ=0:FLW=-1
  11. BTN=0:BTNO=0:BTND=0
  12. TMR=0:PAUSE=0
  13. SCORE=0:HISCORE=10000:SCMAX=500000
  14. LIFE=0:LIFEMAX=3
  15. LEVEL=0:LEVELMAX=99
  16. CHAIN=0:CHAINMAX=0:CHAINMUL=10
  17. CHG=0:CHGMAX=16
  18. SCRX=0:SCRY=0:BGPY=0
  19. SSPD=0:SSPDMIN=2:SSPDMAX=6
  20. STMR=0:STMRMIN=60*20:STMRMAX=0
  21. RX=0:RW=0:RWMIN=13:RWMAX=18
  22. BTMR=-1:BTMRMAX=30
  23. CTMR=0:CTMRMAX=48
  24. ETMR=0:ETMRMIN=32:ETMRMAX=0
  25. PW=8:PH=8:PWH=PW/2:PHH=PH/2
  26. PX=0:PY=0:PSPD=2
  27. OX=8:OY=8
  28. BCSH=5:BSH=(BCSH*2+1)*8/2
  29. DIM RANK(10)
  30. FOR I=0 TO 10-1
  31.  RANK(I)=HISCORE-I*1000
  32. NEXT
  33. DIM BC(4),BP(4)
  34. BC(0)=&H020:BP(0)=1
  35. BC(1)=&H30F:BP(1)=2
  36. BC(2)=&H025:BP(2)=9
  37. BC(3)=&H065:BP(3)=9
  38. ESN=8:EN=4
  39. CSN=ESN+EN:CN=6
  40. BSN=CSN+CN:BN=10
  41. DIM EX(EN),EY(EN),EF(EN)
  42. DIM CX(CN),CY(CN),CF(CN)
  43. DIM BX(BN),BY(BN),BS(BN,2)
  44. ’************
  45. @LOOP
  46. CNTL=MAINCNTL:FPS=0
  47. BTNO=BTN:BTN=BUTTON()
  48. BTND=BTNO XOR BTN AND BTN
  49. IF BTN==512+1024 THEN @EXIT
  50. GOSUB @PAUSECHK
  51. IF PAUSE GOTO @JPPAUSE
  52. IF FLW==REQ GOTO @JPFLOW
  53. FLW=REQ
  54. ON FLW GOSUB @TTLI,@GNEWI,@GSTI,@GAMEI,@GMSI,@GCLRI,@GOVI,@RNKI
  55. @JPFLOW
  56. ON FLW GOSUB @TTLL,@GNEWL,@GSTL,@GAMEL,@GMSL,@GCLRL,@GOVL,@RNKL
  57. @JPPAUSE
  58. VSYNC 1
  59. CNTF=(CNTF+1) AND &H7FFFF
  60. GOSUB @FPSPRT
  61. GOTO @LOOP
  62. @EXIT
  63. PNLTYPE”KYA”
  64. VISIBLE 1,1,0,0,0,0
  65. BGMSTOP
  66. GOSUB @GALLCLR
  67. END
  68. ’************
  69. ’SUB
  70. @FPSPRT
  71. CNTL=MAINCNTL-CNTL
  72. IF CNTL THEN FPS=60/CNTL
  73. COLOR 3:LOCATE 0,23
  74. PRINT FLOOR(FPS);” ”;
  75. RETURN
  76. ’PAUSE CHECK START BUTTON PAUSE
  77. @PAUSECHK
  78. IF FLW!=3 THEN RETURN
  79. IF (BTND AND 1024)==0 THEN RETURN
  80. PAUSE=(PAUSE==0)
  81. BEEP 3
  82. S$=”PAUSE”
  83. IF PAUSE==0 THEN S$=MID$(SP$,0,LEN(S$))
  84. COLOR 3:LOCATE 13,11
  85. PRINT S$
  86. RETURN
  87. ’ALL CLEAR
  88. @GALLCLR
  89. CLS:COLOR 0
  90. SPPAGE 1:SPCLR:SPPAGE 0:SPCLR
  91. FOR I=0 TO 1
  92.  BGPAGE I
  93.  BGOFS 0,0,0:BGOFS 1,0,0
  94.  BGCLIP 0,0,31,23
  95.  FOR Y=0 TO BGH-1
  96.   FOR X=0 TO BGW-1
  97.    BGPUT 0,X,Y,0,0,0,0
  98.    BGPUT 1,X,Y,0,0,0,0
  99.   NEXT
  100.  NEXT
  101. NEXT
  102. BGPAGE 0
  103. GPAGE 1:GCOLOR 0:GCLS
  104. GPAGE 0:GCOLOR 0:GCLS
  105. RETURN
  106. ’************
  107. ’FLOW
  108. ’TITLE
  109. @TTLI
  110. BGMSTOP
  111. VISIBLE 1,1,0,0,0,0
  112. GOSUB @GALLCLR
  113. RESTORE @TITLED
  114. YY=CH
  115. FOR Y=0 TO 5
  116.  XX=2
  117.  FOR X=0 TO 1
  118.   READ C
  119.   B=&H8000
  120.   FOR I=0 TO 15
  121.    IF C AND B THEN BGPUT 1,XX,YY,BC(1),BP(1),0,0
  122.    XX=XX+1:B=B/2
  123.   NEXT
  124.  NEXT
  125.  YY=YY+1
  126. NEXT
  127. VISIBLE 1,1,1,1,1,1
  128. BGOFS 1,0,GH-2*8,60
  129. TMR=60*10
  130. RETURN
  131. @TTLL
  132. TMR=TMR-1
  133. IF TMR<=0 THEN REQ=7
  134. COLOR 0:LOCATE 9,16
  135. S$=”PUSH A BUTTON”
  136. IF CNTF AND &H20 THEN S$=MID$(SP$,0,LEN(S$))
  137. PRINT S$
  138. IF BTND AND 16 THEN REQ=1
  139. LOCATE 11,20
  140. PRINT CHR$(&H13);”:MOVE”
  141. LOCATE 11,21
  142. PRINT CHR$(&H01);”:BOMBER”
  143. RETURN
  144. ’NEW GAME
  145. @GNEWI
  146. SCORE=0:LEVEL=0
  147. SSPD=SSPDMIN
  148. RW=RWMAX
  149. LIFE=LIFEMAX
  150. CHG=0
  151. REQ=2
  152. RETURN
  153. @GNEWL
  154. RETURN
  155. ’GAME START
  156. @GSTI
  157. CLS
  158. TMR=60*2
  159. L=LEVEL%10
  160. STMR=0
  161. STMRMAX=LEVEL*60*2+STMRMIN
  162. RW=RWMAX-L
  163. IF RW<RWMIN THEN RW=RWMIN
  164. RX=(CW-RW)/2
  165. SSPD=SSPDMIN+(L*0.5)
  166. IF SSPD>SSPDMAX THEN SSPD=SSPDMAX
  167. ETMRMAX=100-(L*5)
  168. IF ETMRMAX<ETMRMIN THEN ETMRMAX=ETMRMIN
  169. PX=GW/2:PY=GH-PH-16
  170. SCRX=0:SCRY=0:BGPY=9999
  171. CHAIN=0:CHAINMAX=0
  172. CHG=CHGMAX
  173. BTMR=-1
  174. GOSUB @GBGI
  175. GOSUB @PLAYERI
  176. GOSUB @ENEMYI
  177. GOSUB @COINI
  178. GOSUB @BOMBEFFI
  179. GOSUB @SCOREI
  180. BGOFS 1,SCRX,SCRY
  181. SPOFS 0,PX-OX,PY-OY
  182. VISIBLE 1,1,1,1,1,1
  183. BGMPLAY 4
  184. COLOR 0:LOCATE 12,10
  185. PRINT”LEVEL ”;LEVEL+1
  186. LOCATE 12,12
  187. PRINT”LEFT  ”;LIFE-1
  188. LOCATE 12,14
  189. PRINT FLOOR(STMRMAX/60);”SEC THROUGH”
  190. RETURN
  191. @GSTL
  192. TMR=TMR-1
  193. IF TMR<=0 THEN REQ=3
  194. IF REQ!=FLW THEN CLS:GOSUB @SCOREI
  195. RETURN
  196. ’GAME
  197. @GAMEI
  198. BGMPLAY 3
  199. RETURN
  200. @GAMEL
  201. GOSUB @GBG
  202. GOSUB @PLAYER
  203. GOSUB @ENEMY
  204. GOSUB @COIN
  205. GOSUB @BOMBEFF
  206. GOSUB @SCORE
  207. RETURN
  208. ’GAME MISS
  209. @GMSI
  210. LIFE=LIFE-1
  211. TMR=60*2
  212. SPSET 1,&HF8,0,0,0,1
  213. SPOFS 1,PX-OX,PY-OY
  214. SPANIM 1,3,4,0
  215. BEEP 13:BGMSTOP
  216. RETURN
  217. @GMSL
  218. TMR=TMR-1
  219. IF TMR<=0 THEN REQ=2
  220. IF REQ==2 AND LIFE<=0 THEN REQ=6
  221. IF REQ!=FLW THEN SPCLR 1
  222. RETURN
  223. ’GAME STAGE CLEAR
  224. @GCLRI
  225. LEVEL=LEVEL+1
  226. IF LEVEL>LEVELMAX THEN LEVEL=LEVELMAX
  227. TMR=60*3
  228. SCORE=SCORE+CHAINMAX*CHAINMUL
  229. GOSUB @SCORE
  230. BGMPLAY 5
  231. SPOFS 0,PX-OX,PY-OY-GH-16,TMR/3
  232. COLOR 0
  233. LOCATE 13,10
  234. PRINT”CLEAR”
  235. LOCATE 10,12
  236. PRINT”MAX CHAIN ”;CHAINMAX
  237. LOCATE 10,14
  238. PRINT”BONUS ”;CHAINMAX*CHAINMUL;”0”
  239. RETURN
  240. @GCLRL
  241. TMR=TMR-1
  242. IF TMR<=0 THEN REQ=2
  243. GOSUB @BOMBEFF
  244. RETURN
  245. ’GAME OVER
  246. @GOVI
  247. TMR=60*6
  248. BGMPLAY 6
  249. COLOR 13
  250. LOCATE 11,11:PRINT”GAME OVER”
  251. COLOR 0
  252. RETURN
  253. @GOVL
  254. IF BTND AND 16 THEN REQ=7
  255. TMR=TMR-1
  256. IF TMR<=0 THEN REQ=7
  257. RETURN
  258. ’RANKING
  259. @RNKI
  260. BGMSTOP
  261. GOSUB @GALLCLR
  262. TMR=60*10
  263. IF SCORE>HISCORE THEN HISCORE=SCORE
  264. RANKIN=-1
  265. FOR I=0 TO 9
  266.  IF SCORE>=RANK(I) THEN RANKIN=I:I=9999
  267. NEXT
  268. IF RANKIN<0 THEN @JPRANKIN
  269. FOR I=8 TO RANKIN STEP -1
  270.  RANK(I+1)=RANK(I)
  271. NEXT
  272. RANK(RANKIN)=SCORE
  273. @JPRANKIN
  274. COLOR 0:LOCATE 8,5
  275. PRINT”TODAY’S RANKING”
  276. FOR I=0 TO 10-1
  277.  COLOR 0
  278.  IF I==RANKIN THEN COLOR 3
  279.  S$=STR$(I+1)
  280.  LOCATE 8+(6-LEN(S$)),7+I
  281.  PRINT S$
  282.  S$=STR$(RANK(I))
  283.  LOCATE 15+(6-LEN(S$)),7+I
  284.  PRINT S$;”0”
  285. NEXT
  286. SCORE=0
  287. RETURN
  288. @RNKL
  289. TMR=TMR-1
  290. IF TMR<=0 THEN REQ=0
  291. IF BTND AND 16 THEN REQ=0
  292. RETURN
  293. ’************
  294. ’GAME SUB
  295. ’PLAYER
  296. @PLAYERI
  297. SPSET 0,&H8B,11,0,0,2
  298. RETURN
  299. @PLAYER
  300. IF BTN AND 1 THEN PY=PY-PSPD
  301. IF BTN AND 2 THEN PY=PY+PSPD
  302. IF BTN AND 4 THEN PX=PX-PSPD
  303. IF BTN AND 8 THEN PX=PX+PSPD
  304. IF PX<OX THEN PX=OX
  305. IF PX>GW-OX THEN PX=GW-OX
  306. IF PY<OY THEN PY=OY
  307. IF PY>GH-OY THEN PY=GH-OY
  308. SPOFS 0,PX-OX,PY-OY
  309. GOSUB @BOMBER
  310. HF=0
  311. FOR Y=-PHH TO PHH STEP PHH
  312.  YY=(Y+PY+SCRY)/PH
  313.  FOR X=-PWH TO PWH STEP PWH
  314.   XX=(X+PX+SCRX)/PW
  315.   BGREAD(1,XX,YY),C,P,H,V
  316.   IF C==BC(1) THEN HF=1
  317.   IF C==BC(3) THEN REQ=5
  318.   IF C!=BC(0) THEN @JPHIT
  319.   BGPUT 1,XX,YY,BC(2),BP(2),0,0
  320.   SCORE=SCORE+1
  321. @JPHIT
  322.  NEXT
  323. NEXT
  324. IF HF THEN REQ=4
  325. RETURN
  326. ’BOMBER
  327. @BOMBER
  328. IF (BTND AND 16)==0 THEN RETURN
  329. IF CHG<CHGMAX THEN RETURN
  330. CHG=0
  331. BEEP 10:BEEP 13
  332. YY=(PY+SCRY)/8
  333. FOR Y=-BCSH TO BCSH
  334.  XX=(PX+SCRX)/8
  335.  FOR X=-BCSH TO BCSH
  336.   BGPUT 1,XX+X,YY+Y,BC(2),BP(2),0,0
  337.  NEXT
  338. NEXT
  339. FOR I=0 TO EN-1
  340.  IF EF(I)<=0 THEN @JPBOMB
  341.  IF PY-BSH>EY(I)+OY THEN @JPBOMB
  342.  IF PY+BSH<EY(I)-OY THEN @JPBOMB
  343.  IF PX-BSH>EX(I)+OX THEN @JPBOMB
  344.  IF PX+BSH<EX(I)-OX THEN @JPBOMB
  345.  EF(I)=0
  346.  SPCLR ESN+I
  347. @JPBOMB
  348. NEXT
  349. BTMR=BTMRMAX
  350. S=BSH/BTMR
  351. FOR I=0 TO BN-1
  352.  BX(I)=PX:BY(I)=PY
  353.  R=RAD(I*360/BN)
  354.  BS(I,0)=COS(R)*S
  355.  BS(I,1)=SIN(R)*S
  356.  SPSET BSN+I,&H34,3,0,0,1
  357.  SPOFS BSN+I,BX(I)-OX,BY(I)-OY
  358.  SPANIM BSN+I,4,4,0
  359. NEXT
  360. RETURN
  361. ’BOMBER EFFECT
  362. @BOMBEFFI
  363. FOR I=0 TO BN-1
  364.  SPCLR BSN+I
  365. NEXT
  366. RETURN
  367. @BOMBEFF
  368. IF BTMR<0 THEN RETURN
  369. BTMR=BTMR-1
  370. IF BTMR<0 THEN @BOMBEFFI
  371. FOR I=0 TO BN-1
  372.  BX(I)=BX(I)+BS(I,0)
  373.  BY(I)=BY(I)+BS(I,1)+SSPD
  374.  SPOFS BSN+I,BX(I)-OX,BY(I)-OY
  375. NEXT
  376. RETURN
  377. ’ENEMY
  378. @ENEMYI
  379. FOR I=0 TO EN-1
  380.  EF(I)=0
  381.  SPCLR ESN+I
  382. NEXT
  383. RETURN
  384. @ENEMYGEN
  385. IF STMR>=STMRMAX THEN RETURN
  386. ETMR=ETMR+SSPD
  387. IF ETMR<ETMRMAX THEN RETURN
  388. EI=-1:ETMR=0
  389. FOR I=0 TO EN-1
  390.  IF EF(I)<=0 THEN EI=I:I=9999
  391. NEXT
  392. IF EI<0 THEN RETURN
  393. EX(EI)=(RX+RND(RW))*8
  394. EY(EI)=-OY
  395. EF(EI)=1
  396. SPSET ESN+EI,&HB2,11,0,0,2
  397. SPOFS ESN+EI,EX(EI)-OX,EY(EI)-OY
  398. SPANIM ESN+EI,3,8,0
  399. RETURN
  400. @ENEMY
  401. GOSUB @ENEMYGEN
  402. FOR I=0 TO EN-1
  403.  IF EF(I)<=0 THEN @JPENE
  404.  EY(I)=EY(I)+SSPD
  405.  IF EY(I)>=GH+OY THEN @ENECLR
  406.  SPOFS ESN+I,EX(I)-OX,EY(I)-OY
  407.  IF PY-PHH>EY(I)+OY THEN @JPENE
  408.  IF PY+PHH<EY(I)-OY THEN @JPENE
  409.  IF PX-PWH>EX(I)+OX THEN @JPENE
  410.  IF PX+PWH<EX(I)-OX THEN @JPENE
  411.  REQ=4
  412. @ENECLR
  413.  EF(I)=0
  414.  SPCLR ESN+I
  415. @JPENE
  416. NEXT
  417. RETURN
  418. ’COINトイウカSTAR
  419. @COINI
  420. CTMR=0
  421. FOR I=0 TO CN-1
  422.  CF(I)=0
  423.  SPCLR CSN+I
  424. NEXT
  425. RETURN
  426. @COINGEN
  427. IF STMR>=STMRMAX THEN RETURN
  428. CTMR=CTMR+SSPD
  429. IF CTMR<CTMRMAX THEN RETURN
  430. CTMR=0:CI=-1
  431. FOR I=0 TO CN-1
  432.  IF CF(I)<=0 THEN CI=I:I=9999
  433. NEXT
  434. IF CI<0 THEN RETURN
  435. CX(CI)=(RX+RW/2)*8+RND(32)-16
  436. CY(CI)=-OY
  437. CF(CI)=1
  438. SPSET CSN+CI,&H9C,3,0,0,2
  439. SPOFS CSN+CI,CX(CI)-OX,CY(CI)-OY
  440. SPANIM CSN+CI,4,4,0
  441. RETURN
  442. @COIN
  443. GOSUB @COINGEN
  444. FOR I=0 TO CN-1
  445.  IF CF(I)<=0 THEN @JPCOIN
  446.  CY(I)=CY(I)+SSPD
  447.  IF CY(I)>=GH+OY THEN CHAIN=0:GOTO @COINCLR
  448.  SPOFS CSN+I,CX(I)-OX,CY(I)-OY
  449.  IF PY-PHH>CY(I)+OY THEN @JPCOIN
  450.  IF PY+PHH<CY(I)-OY THEN @JPCOIN
  451.  IF PX-PWH>CX(I)+OX THEN @JPCOIN
  452.  IF PX+PWH<CX(I)-OX THEN @JPCOIN
  453.  BEEP 7
  454.  SCORE=SCORE+1
  455.  CHAIN=CHAIN+1
  456.  IF CHAIN>CHAINMAX THEN CHAINMAX=CHAIN
  457.  CHGO=CHG:CHG=CHG+1
  458.  IF CHG>CHGMAX THEN CHG=CHGMAX
  459.  IF CHGO!=CHG AND CHG==CHGMAX THEN BEEP 37
  460. @COINCLR
  461.  CF(I)=0
  462.  SPCLR CSN+I
  463. @JPCOIN
  464. NEXT
  465. RETURN
  466. ’BG
  467. @GBGI
  468. BGPAGE 0
  469. FOR Y=0 TO CH-1
  470.  FOR X=0 TO CW-1
  471.   BGPUT 1,X,Y,BC(1),BP(1),0,0
  472.  NEXT
  473.  FOR X=RX TO RX+RW-1
  474.   BGPUT 1,X,Y,BC(0),BP(0),0,0
  475.  NEXT
  476. NEXT
  477. RETURN
  478. @GBG
  479. STMR=STMR+1
  480. BGPYO=BGPY
  481. BGPY=((SCRY-7)/8) AND 63
  482. IF BGPYO==BGPY THEN @JPGBG
  483. IF STMR>=STMRMAX THEN @BGGOAL
  484. FOR X=0 TO RX-1
  485.  BGPUT 1,X,BGPY,BC(1),BP(1),0,0
  486. NEXT
  487. FOR X=RX TO RX+RW-1
  488.  BGPUT 1,X,BGPY,BC(0),BP(0),0,0
  489. NEXT
  490. FOR X=RX+RW TO CW-1
  491.  BGPUT 1,X,BGPY,BC(1),BP(1),0,0
  492. NEXT
  493. GOTO @JPBGGOAL
  494. @BGGOAL
  495. FOR X=0 TO CW-1
  496.  BGPUT 1,X,BGPY,BC(3),BP(3),0,0
  497. NEXT
  498. @JPBGGOAL
  499. RX=RX+RND(3)-1
  500. IF RX<1 THEN RX=1
  501. IF RX>CW-RW-1 THEN RX=CW-RW-1
  502. @JPGBG
  503. SCRY=SCRY-SSPD
  504. IF SCRY<0 THEN SCRY=SCRY AND 511
  505. BGOFS 1,SCRX,SCRY
  506. RETURN
  507. ’SCORE ETC.
  508. @SCOREI
  509. COLOR 3:LOCATE 0,0
  510. ’0123456789012345678901234567890123456789
  511. PRINT”SCORE:      0   HI-SCORE:      0”;
  512. LOCATE 0,1
  513. FOR I=0 TO LIFE-2
  514.  PRINT CHR$(5);
  515. NEXT
  516. S$=STR$(HISCORE)
  517. LOCATE 25+(6-LEN(S$)),0
  518. PRINT S$
  519. @SCORE
  520. IF SCORE>SCMAX THEN SCORE=SCMAX
  521. COLOR 3
  522. S$=STR$(SCORE)
  523. LOCATE 6+(6-LEN(S$)),0
  524. PRINT S$
  525. P=0
  526. IF (CHG>=CHGMAX) AND (CNTF AND 2)!=0 THEN P=2
  527. SPSET 2,&HDB,P,0,0,1
  528. SPOFS 2,112,12-16*CHG/CHGMAX
  529. SPSCALE 2,CHG/CHGMAX*200
  530. RETURN
  531. ’************
  532. ’DATA
  533. ’TITLE DATA
  534. @TITLED
  535. DATA &H7C04,&H0080
  536. DATA &H0824,&H03F0
  537. DATA &H1024,&HF890
  538. DATA &H2048,&H0120
  539. DATA &H5092,&H0220
  540. DATA &H8D1C,&H0440