プチコンmkII

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