プチコン

  1. ’┌─────────────────────────┐
  2. ’│スフ゜ライトサンフ゜ル              │
  3. ’└─────────────────────────┘
  4. ’スフ゜ライト ワリアテ
  5. ’  0〜:Г myship
  6. ’  8〜:↑ myshot
  7. ’ 16〜:Е enemy
  8. ’ 24〜:↓ enshot
  9. ’ 64〜:● explosion
  10. ’ 72〜:Н boss
  11. @INIT ’ショキカ
  12.  CLEAR
  13.  UNUSED=-4096
  14.  PHASE=0
  15.  STAGE=1
  16.  PHASCNT=0
  17.  ’カ゛メン
  18.  CLS
  19.  GPAGE 0:GCLS 0
  20.  SPPAGE 0:SPCLR
  21.  BGMPLAY 23
  22.  VISIBLE 0,1,0,0,0,0
  23.  VSYNC 0
  24.  ’フ゜レイヤ-
  25.  SCORE=0: HISCORE=0
  26.  MYX=120 : MYY=192 : MYSPD=3
  27.  MYCNT=0 : MYSTAT=1
  28.  SPSET 0,288,11,0,0,1
  29.  SPOFS 0,MYX,MYY
  30.  SPSET 1,289,11,0,0,1
  31.  SPOFS 1,MYX,MYY+10
  32.  ’ショット
  33.  MSHMAX=4
  34.  MSHCNT=0
  35.  DIM MYSHOTX(4),MYSHOTY(4)
  36.  FOR I=0 TO 3
  37.   MYSHOTX(I) = UNUSED
  38.   MYSHOTY(I) = 0
  39.   SPSET I+8,223,12,0,0,1
  40.   SPOFS I+8,-16,-16
  41.  NEXT
  42.  ’ハイケイ
  43.  DIM STARX(16),STARY(16)
  44.  DIM STARSPD(16)
  45.  FOR I=0 TO 15
  46.   STARX(I) = RND(256)
  47.   STARY(I) = RND(192)
  48.   STARSPD(I) = (RND(16)+1)/4
  49.  NEXT
  50.  ’テキ
  51.  DIM ENMX(8),ENMY(8),ENMCNT(8),ENMHP(8)
  52.  GENMCNT=0 : ENMMAX=8
  53.  FOR I=0 TO 7
  54.   ENMX(I) = UNUSED
  55.   ENMY(I) = 0
  56.   ENMHP(I) = 0
  57.   SPSET I+16,178,11,0,0,1
  58.   SPANIM I+16,3,4,0
  59.   SPOFS I+16,-16,-16
  60.  NEXT
  61.  ’テキタ゛ン
  62.  DIM ENSHOTX(32),ENSHOTY(32),ENSHDIR(32)
  63.  ESHTCNT=0 : ESHTMAX=32
  64.  FOR I=0 TO 31
  65.   ENSHOTX(I) = UNUSED
  66.   ENSHOTY(I) = 0
  67.   SPSET I+24,214,0,0,0,1
  68.   SPANIM I+24,2,4,0
  69.   SPOFS I+24,-16,-16
  70.  NEXT
  71.  ’ハ゛クハツ
  72.  DIM EXPX(4),EXPY(4),EXPCNT(4)
  73.  GEXPCNT=0 : EXPMAX=4
  74.  FOR I=0 TO 3
  75.   EXPX(I) = UNUSED
  76.   EXPY(I) = 0
  77.   EXPCNT(I) = 0
  78.   SPSET I+64,248,0,0,0,1
  79.   SPOFS I+64,-16,-16
  80.  NEXT
  81.  ’ホ゛ス
  82.  SPSET 72,340,11,0,0,1
  83.  SPSET 73,341,11,0,0,1
  84.  SPSET 74,342,11,0,0,1
  85.  SPSET 75,343,11,0,0,1
  86.  SPOFS 72,-16,-16
  87.  SPOFS 73,-16,-16
  88.  SPOFS 74,-16,-16
  89.  SPOFS 75,-16,-16
  90.  BOSSX=UNUSED
  91.  BOSSY=0
  92.  BOSSHP=60
  93.  BOSSCNT=0
  94.  VISIBLE 1,1,0,0,1,1
  95. @MAIN ’メインル-フ゜
  96.  OLDBTN = BTN
  97.  BTN = BUTTON()
  98.  ON PHASE GOSUB @TITLE,@GAME,@BOSSSCN,@GAMEOVER
  99.  PHASCNT=PHASCNT+1
  100.  VSYNC 0
  101. GOTO @MAIN
  102. @ANYBTN
  103.  R=0
  104.  IF OLDBTN THEN RETURN
  105.  IF BTN THEN R=BTN
  106. RETURN
  107. @TITLE
  108.  GOSUB @ANYBTN
  109.  LOCATE 6,4:PRINT”┗┫┻┻┓┨┻┏┓┛ ┣━ ┗┫┃┣┳┏┫”
  110.  LOCATE 6,5:PRINT”┫┓┻┻┃┻┻┠━┛ ┯┓ ┫┓ ┛┻┳┠”
  111.  LOCATE 6,6:PRINT”┓┻┻┻ ┻┻  ┛ ┛  ┓┻ ┛┻ ┻”
  112.  LOCATE 6,7:PRINT”┃━┃┃ ┃┃  ┏━┏━ ┃━ ━ ┏━”
  113.  LOCATE 9,17:PRINT”PUSH ANY BUTTON”
  114.  IF PHASCNT<2 THEN RETURN
  115.  IF R THEN PHASE = 1:BGMPLAY 23:PHASCNT=0:CLS
  116. RETURN
  117. @GAME
  118.  IF PHASCNT<60 THEN LOCATE 11,11:PRINT ”STAGE ”;STAGE
  119.  IF PHASCNT==60 THEN LOCATE 11,11:PRINT ”          ”
  120.  GOSUB @DISPBG
  121.  GOSUB @DISPSCOR
  122.  GOSUB @ENSHOT
  123.  GOSUB @ENEMY
  124.  GOSUB @MYSHOT
  125.  GOSUB @MYSHIP
  126.  GOSUB @EXPLSION
  127.  IF PHASCNT==1200 THEN GOSUB @TOBOSS
  128. RETURN
  129. @TOBOSS
  130.  PHASE=2
  131.  PHASCNT=0
  132.  BGMSTOP
  133.  BOSSX=112
  134.  BOSSY=-32
  135.  BOSSHP=60+STAGE
  136.  BOSSCNT=1
  137.  TARGETX=112
  138.  SPCHR 72,340
  139.  SPCHR 73,341
  140.  SPCHR 74,342
  141.  SPCHR 75,343
  142. RETURN
  143. @BOSSSCN
  144.  COLOR 13
  145.  IF PHASCNT<60 THEN LOCATE 12,11:PRINT ”WARNING!!”
  146.  IF PHASCNT==60 THEN LOCATE 12,11:PRINT ”         ”
  147.  COLOR 0
  148.  IF PHASCNT==120 THEN BGMPLAY 13
  149.  GOSUB @DISPBG
  150.  GOSUB @DISPSCOR
  151.  GOSUB @ENSHOT
  152.  GOSUB @ENEMY
  153.  GOSUB @MYSHOT
  154.  GOSUB @MYSHIP
  155.  GOSUB @EXPLSION
  156.  GOSUB @BOSS
  157. RETURN
  158. @BOSS ’ホ゛ス
  159.  IF BOSSHP==0 THEN @BOSSTHRU
  160.  ’ホ゛スノ ウコ゛キ
  161.  IF BOSSCNT%120==0 THEN TARGETX=RND(160)+32
  162.  IF BOSSX>TARGETX THEN BOSSX=BOSSX-1
  163.  IF BOSSX<TARGETX THEN BOSSX=BOSSX+1
  164.  IF BOSSCNT<80 THEN BOSSY=BOSSY+1:GOTO @BOSHTHRU
  165.  IF BOSSCNT%30==0 THEN GOSUB @BOSSSHOT
  166.  @BOSHTHRU
  167.  SPOFS 72,BOSSX,BOSSY
  168.  SPOFS 73,BOSSX+16,BOSSY
  169.  SPOFS 74,BOSSX,BOSSY+16
  170.  SPOFS 75,BOSSX+16,BOSSY+16
  171.  ’ハンテイ
  172.  FOR I=0 TO 3
  173.   IF BOSSX-8>MYSHOTX(I) THEN @BOSSJDNX
  174.   IF BOSSX+24<MYSHOTX(I) THEN @BOSSJDNX
  175.   IF BOSSY-8>MYSHOTY(I) THEN @BOSSJDNX
  176.   IF BOSSY+8<MYSHOTY(I) THEN @BOSSJDNX
  177.   BOSSHP=BOSSHP-1
  178.   MYSHOTY(I)=-16
  179.   SPOFS I+8,0,-16
  180.   BEEP 0
  181.   IF BOSSHP==0 THEN BOSSCNT=0:BGMSTOP:SCORE=SCORE+5000
  182.   @BOSSJDNX
  183.  NEXT
  184.  @BOSSTHRU
  185.  BOSSCNT=BOSSCNT+1
  186.  IF BOSSHP==0 THEN GOSUB @BOSSEXP
  187. RETURN
  188. @BOSSSHOT
  189.  DIR = (RND(256)-128)*PI()/512
  190.  FOR I=0 TO STAGE
  191.   IF I==6 THEN RETURN
  192.   IF ENSHOTX(ESHTCNT)!=UNUSED THEN RETURN
  193.   ENSHOTX(ESHTCNT)=BOSSX+8
  194.   ENSHOTY(ESHTCNT)=BOSSY+8
  195.   ENSHDIR(ESHTCNT)=(RND(256)-128)*PI()/512
  196.   SPOFS ESHTCNT+24,ENSHOTX(ESHTCNT),ENSHOTY(ESHTCNT)
  197.   ESHTCNT=ESHTCNT+1
  198.   IF ESHTCNT>=ESHTMAX THEN ESHTCNT=0
  199.  NEXT
  200. RETURN
  201. @BOSSEXP ’ホ゛ス キエル
  202.  IF BOSSCNT<64 THEN BEEP 13
  203.  IF BOSSCNT==1 THEN @BOSSEXP1
  204.  IF BOSSCNT==16 THEN @BOSSEXP2
  205.  IF BOSSCNT==32 THEN @BOSSEXP3
  206.  IF BOSSCNT==48 THEN @BOSSEXP4
  207.  IF BOSSCNT==64 THEN @BOSSCLR
  208.  IF BOSSCNT==240 THEN PHASE=1:STAGE=STAGE+1:PHASCNT=0:BGMPLAY 23
  209.  RETURN
  210.  @BOSSEXP1
  211.  SPCHR 72,352
  212.  SPCHR 73,353
  213.  SPCHR 74,354
  214.  SPCHR 75,355
  215.  RETURN
  216.  @BOSSEXP2
  217.  SPCHR 72,356
  218.  SPCHR 73,357
  219.  SPCHR 74,358
  220.  SPCHR 75,359
  221.  RETURN
  222.  @BOSSEXP3
  223.  SPCHR 72,360
  224.  SPCHR 73,361
  225.  SPCHR 74,362
  226.  SPCHR 75,363
  227.  RETURN
  228.  @BOSSEXP4
  229.  SPCHR 72,364
  230.  SPCHR 73,365
  231.  SPCHR 74,366
  232.  SPCHR 75,367
  233.  RETURN
  234.  @BOSSCLR
  235.  SPOFS 72,-16,-16
  236.  SPOFS 73,-16,-16
  237.  SPOFS 74,-16,-16
  238.  SPOFS 75,-16,-16
  239. RETURN
  240. @GAMEOVER
  241.  FOR I=0 TO 99
  242.   SPCLR I
  243.  NEXT
  244.  GLINE MYX+8,MYY+8,RND(256),RND(256),RND(256)
  245.  GCIRCLE MYX+8,MYY+8,RND(100)+2,RND(256)
  246.  LOCATE 12,12:PRINT ”GAME OVER”
  247.  GOSUB @ANYBTN
  248.  IF R AND 16 THEN @INIT
  249. RETURN
  250. @DISPBG ’ハイケイ ヒョウシ゛
  251.  FOR I=0 TO 7
  252.   GPSET STARX(I),STARY(I),0
  253.   STARY(I)=STARY(I)+STARSPD(I)
  254.   GPSET STARX(I),STARY(I),STAGE
  255.   IF STARY(I) > 192 THEN GOSUB @STARINIT
  256.  NEXT
  257. RETURN
  258. @STARINIT ’ホシノイチ モト゛ス
  259.  STARX(I) = RND(256)
  260.  STARY(I) = 0
  261.  STARSPD(I) = (RND(16)+1)/4
  262. RETURN
  263. @ENSHOT ’テキ ショット
  264.  FOR I=0 TO 31
  265.   IF ENSHOTX(I)==UNUSED THEN @ESHTHRU
  266.   ENSHOTX(I)=ENSHOTX(I)+SIN(ENSHDIR(I))*2
  267.   ENSHOTY(I)=ENSHOTY(I)+COS(ENSHDIR(I))*2
  268.   SPOFS I+24,ENSHOTX(I),ENSHOTY(I),2
  269.   IF ENSHOTX(I)>256 THEN ENSHOTX(I)=UNUSED
  270.   IF ENSHOTX(I)<-16 THEN ENSHOTX(I)=UNUSED
  271.   IF ENSHOTY(I)>192 THEN ENSHOTX(I)=UNUSED
  272.   IF ENSHOTY(I)<-16 THEN ENSHOTX(I)=UNUSED
  273.   @ESHTHRU
  274.  NEXT
  275. RETURN
  276. @ENEMY ’テキ
  277.  IF PHASE!=1 THEN @GENMTHRU
  278.  IF MAINCNTL%64 THEN @GENMTHRU
  279.  IF ENMX(GENMCNT)!=UNUSED THEN @GENMTHRU
  280.   ENMX(GENMCNT) = RND(240)
  281.   ENMY(GENMCNT) = -16
  282.   ENMHP(GENMCNT)= STAGE
  283.   ENMCNT(GENMCNT) = 0
  284.   SPOFS GENMCNT+16,ENMX(GENMCNT),-16
  285.   GENMCNT=GENMCNT+1
  286.   IF GENMCNT>=ENMMAX THEN GENMCNT=0
  287.  @GENMTHRU
  288.  FOR I=0 TO 7
  289.   IF ENMX(I)==UNUSED THEN @ENMTHRU
  290.   ENMY(I) = ENMY(I)+0.75
  291.   ENMCNT(I) = ENMCNT(I)+1
  292.   IF ENMY(I)>192 THEN ENMX(I)=UNUSED
  293.   IF ENMCNT(I)%60==0 THEN GOSUB @GENMSHOT
  294.   ’ハンテイ
  295.   J=0
  296.   @ENMJUDGE
  297.    IF MYSHOTX(J)==UNUSED THEN @ENMJDGNX
  298.    IF ENMX(I)-8>MYSHOTX(J) THEN @ENMJDGNX
  299.    IF ENMX(I)+8<MYSHOTX(J) THEN @ENMJDGNX
  300.    IF ENMY(I)-8>MYSHOTY(J) THEN @ENMJDGNX
  301.    IF ENMY(I)+8<MYSHOTY(J) THEN @ENMJDGNX
  302.    ENMHP(I)=ENMHP(I)-1
  303.    MYSHOTY(J)=-32
  304.    SPOFS J+8,-32,0
  305.    IF ENMHP(I)>0 THEN @ENMJDGNX
  306.    P1=ENMX(I):P2=ENMY(I)
  307.    GOSUB @GENEXP
  308.    ENMX(I)=UNUSED
  309.    SCORE=SCORE+200
  310.    @ENMJDGNX
  311.    J=J+1
  312.   IF J<=3 THEN @ENMJUDGE
  313.   SPOFS I+16,ENMX(I),ENMY(I),2
  314.   @ENMTHRU
  315.  NEXT
  316. RETURN
  317. @GENMSHOT ’テキタ゛ン ハッシャ
  318.  FOR J=0 TO STAGE
  319.   IF J==6 GOTO @ENSHTHRU
  320.   IF ENSHOTX(ESHTCNT)!=UNUSED THEN @ENSHTHRU
  321.   ENSHOTX(ESHTCNT)=ENMX(I)
  322.   ENSHOTY(ESHTCNT)=ENMY(I)
  323.   ENSHDIR(ESHTCNT)=RND(1024)*PI()/512
  324.   SPOFS ESHTCNT+24,ENSHOTX(ESHTCNT),ENSHOTY(ESHTCNT)
  325.   ESHTCNT=ESHTCNT+1
  326.   IF ESHTCNT>=ESHTMAX THEN ESHTCNT=0
  327.   @ENSHTHRU
  328.  NEXT
  329. RETURN
  330. @GENEXP ’ハ゛クハツ セイセイ
  331.  BEEP 11
  332.  EXPX(GEXPCNT)=P1
  333.  EXPY(GEXPCNT)=P2
  334.  EXPCNT(GEXPCNT)=0
  335.  SPOFS GEXPCNT+64,P1,P2
  336.  SPANIM GEXPCNT+64,4,8,1
  337.  GEXPCNT=GEXPCNT+1
  338.  IF GEXPCNT>=EXPMAX THEN GEXPCNT=0
  339. RETURN
  340. @MYSHOT ’シ゛キ ショット
  341.  FOR I=0 TO 3
  342.   IF MYSHOTX(I)==UNUSED THEN @MYSHTHR
  343.   MYSHOTY(I) = MYSHOTY(I)-8
  344.   SPOFS I+8,MYSHOTX(I),MYSHOTY(I),2
  345.   IF MYSHOTY(I) < -16 THEN GOSUB @RMVMYSHT
  346.   @MYSHTHR
  347.  NEXT
  348. RETURN
  349. @RMVMYSHT ’ショット ケス
  350.  MYSHOTX(I) = UNUSED
  351. RETURN
  352. @EXPLSION ’ハ゛クハツ
  353.  FOR I=0 TO 3
  354.   IF EXPCNT(I) == 20 THEN SPOFS I+64,-16,-16
  355.   EXPCNT(I)=EXPCNT(I)+1
  356.  NEXT
  357. RETURN
  358. @DISPSCOR ’スコア ヒョウシ゛
  359.  LOCATE 8,0
  360.  PRINT ”SCORE:”;SCORE
  361. RETURN
  362. @MYSHIP ’フ゜レイヤ-
  363.  IF MYCNT<24 THEN MYY=MYY-2
  364.  IF MYCNT==128 THEN MYSTAT=0
  365.  SPCHR 0,288:SPCHR 1,289
  366.  IF BTN AND 1 THEN MYY=MYY-MYSPD
  367.  IF BTN AND 2 THEN MYY=MYY+MYSPD
  368.  IF BTN AND 4 THEN MYX=MYX-MYSPD:SPCHR 0,292:SPCHR 1,293
  369.  IF BTN AND 8 THEN MYX=MYX+MYSPD:SPCHR 0,290:SPCHR 1,291
  370.  IF MYX<0 THEN MYX=0
  371.  IF MYX>239 THEN MYX=239
  372.  IF MYY<0 THEN MYY=0
  373.  IF MYY>175 THEN MYY=175
  374.  IF MYCNT%4 THEN @GMSHTHRU
  375.  IF BTN AND 16 THEN GOSUB @GENMYSHT
  376.  @GMSHTHRU
  377.  FOR I=0 TO 31
  378.   IF ENSHOTX(I)==UNUSED THEN @ESJDTHRU
  379.   IF ENSHOTX(I)<MYX-8 THEN @ESJDTHRU
  380.   IF ENSHOTX(I)>MYX+8 THEN @ESJDTHRU
  381.   IF ENSHOTY(I)<MYY-8 THEN @ESJDTHRU
  382.   IF ENSHOTY(I)>MYY+8 THEN @ESJDTHRU
  383.   GMOVFLG=TRUE
  384.   PHASE=3
  385.   BEEP 11
  386.   BGMPLAY 6
  387.   SPOFS 0,-16,-16
  388.   SPOFS 1,-16,-16
  389.   RETURN
  390.   @ESJDTHRU
  391.  NEXT
  392.  SPOFS 0,MYX,MYY-5,2
  393.  SPOFS 1,MYX,MYY+5,2
  394.  MYCNT=MYCNT+1
  395. RETURN
  396. @GENMYSHT ’ショット セイセイ
  397.  M=MSHCNT
  398.  IF MYSHOTX(M)!=UNUSED THEN RETURN
  399.  BEEP 9
  400.  MYSHOTX(M)=MYX
  401.  MYSHOTY(M)=MYY
  402.  SPOFS M+8,MYX,MYY
  403.  MSHCNT=MSHCNT+1
  404.  IF MSHCNT>=MSHMAX THEN MSHCNT=0
  405. RETURN
  406. ’┌─────────────────────────┐
  407. ’│オワリ                      │
  408. ’└─────────────────────────┘