shoot.wb 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. 1000 rem シューティング by ワンべぇ
  2. 1005 rem Nov.7,2000 by autumn
  3. 1010 rem a,b 自機座標
  4. 1020 rem c,d 自ミサイル座標
  5. 1030 rem e,f 敵座標
  6. 1040 rem @(n*2*0),@(n*2+1) 敵ミサイル座標(nは0~7)
  7. 1050 rem g ミサイル生成カウンタ
  8. 1060 rem h ミサイル生成タイミングカウンタ
  9. 2000 rem 座標の初期化
  10. 2010 a=14:b=16
  11. 2020 c=-1:d=-1
  12. 2030 e=15:f=2
  13. 2040 for i=0 to 7:@(i*2)=-1:@(i*2+1)=-1:next
  14. 2050 g=0:h=0
  15. 3000 rem 開始を待つ
  16. 3010 cls
  17. 3020 locate 3,6:print "PUSH BUTTON TO START"
  18. 3030 locate 3,10:print " (NOT START BUTTON)"
  19. 3040 z=wait
  20. 3050 cls:locate 10,8:print "GO!";
  21. 3060 waitvb 30
  22. 4000 rem 表示を更新
  23. 4010 cls
  24. 4020 locate a,b:print "▲";
  25. 4030 locate e,f:print "▼";
  26. 4040 if c>=0 then locate c,d:print "|";
  27. 4050 for i=0 to 7
  28. 4060 if @(i*2)>=0 then locate @(i*2),@(i*2+1):print "*"
  29. 4070 next
  30. 5000 rem 当たり判定
  31. 5010 if (c=e)and(d=f) then goto 8000 '自ミサイルが命中・勝利
  32. 5020 for i=0 to 7
  33. 5030 if (a=@(i*2))and(b=@(i*2+1)) then goto 9000 '敵ミサイルが命中・敗北
  34. 5040 next
  35. 6000 rem 敵移動処理
  36. 6010 r=rnd(2)
  37. 6020 if (r=0)and(e<26) then e=e+1
  38. 6030 if (r<>0)and(e>0) then e=e-1
  39. 6100 rem 敵ミサイル移動処理
  40. 6110 for i=0 to 7
  41. 6120 @(i*2+1)=@(i*2+1)+1
  42. 6130 if @(i*2+1)>16 then @(i*2)=-1:@(i*2+1)=-1
  43. 6140 next
  44. 6200 rem 敵ミサイル生成処理
  45. 6210 h=h+1
  46. 6220 if h>3 then h=0
  47. 6230 if h<>0 then goto 6300
  48. 6240 @(g*2)=e:@(g*2+1)=f+1 '新しいミサイル
  49. 6250 g=g+1:if g>7 then g=0
  50. 6300 rem 自機移動処理
  51. 6310 s=scan
  52. 6320 if s and scan_x2 then if a<26 then a=a+1
  53. 6330 if s and scan_x4 then if a>0 then a=a-1
  54. 6400 rem 自ミサイル移動処理
  55. 6410 if c>=0 then d=d-1:if d<0 then c=-1:d=-1
  56. 6500 rem 自ミサイル発射処理
  57. 6510 if s and scan_a then if c<0 then c=a:d=b-1
  58. 6800 waitvb 3
  59. 6900 goto 4000
  60. 8000 rem 勝利
  61. 8010 X=e:Y=f:gosub 10000
  62. 8020 locate 10,10:print "YOU WIN!"
  63. 8030 goto 9500
  64. 9000 rem 敗北
  65. 9010 X=a:Y=b:gosub 10000
  66. 9020 locate 10,10:print "YOU LOSE..."
  67. 9500 locate 0,12:print "PUSH START BUTTON TO EXIT"
  68. 9510 locate 0,13:print " ANOTHER IS AGAIN"
  69. 9520 z=wait
  70. 9900 goto 2000
  71. 10000 rem 爆発表現
  72. 10010 for i=0 to 9
  73. 10020 locate X,Y:print "+";
  74. 10030 waitvb 10
  75. 10040 locate X,Y:print "×";
  76. 10050 waitvb 10
  77. 10060 next
  78. 10090 return