home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1991 / 05 / mirror / mirrorst.lst < prev    next >
Encoding:
File List  |  1991-04-03  |  10.8 KB  |  545 lines

  1. '   ========================================================================
  2. '   =                    MIRROR für GFA-Basic 2.0-2.01                     =
  3. '   =                   von Wolfgang Hübner, Wiesbaden                     =
  4. '   =                    (c) 1989 ATARImagazin (4'89)                      =
  5. '   ========================================================================
  6. '
  7. '
  8. Defmouse 3
  9. Dim Shield$(3),Swupp$(20,8),X%(11,8),Y%(11,8),Sco%(2),Dead%(2),Shoot!(2,6)
  10. Dim Stone!(6,6),Gx%(2),Gy%(2)
  11. '
  12. ' Spiegel Zeichnen
  13. '
  14. For I%=0 To 3
  15.   If I%<2
  16.     Deffill 1,2,2
  17.   Else
  18.     Deffill 1,2,5
  19.   Endif
  20.   Defline 1,1
  21.   Pcircle 25,25,15
  22.   Defline 1,3
  23.   If I%=0
  24.     Line 10,10,40,40
  25.   Endif
  26.   If I%=1
  27.     Line 10,40,40,10
  28.   Endif
  29.   If I%=2
  30.     Line 10,10,40,40
  31.     Defline 1,1
  32.     Graphmode 3
  33.     Line 11,11,39,39
  34.     Graphmode 1
  35.   Endif
  36.   If I%=3
  37.     Line 10,40,40,10
  38.     Defline 1,1
  39.     Graphmode 3
  40.     Line 11,39,39,11
  41.     Graphmode 1
  42.   Endif
  43.   Get 2,2,48,48,Shield$(I%)
  44.   Cls
  45. Next I%
  46. '
  47. ' Scoresteine zeichnen
  48. '
  49. Dim Score$(8)
  50. Deftext 1,0,0,32
  51. Defline 1,1
  52. Deffill 1,0
  53. Graphmode 3
  54. For J%=0 To 8
  55.   Text 11+J%*50,37,Chr$(17+J%)+Chr$(16)
  56.   Text 10+J%*50,36,Chr$(17+J%)+Chr$(16)
  57.   Text 10+J%*50,37,Chr$(17+J%)+Chr$(16)
  58.   Get 8+J%*50,0,45+J%*50,50,Score$(J%)
  59. Next J%
  60. Graphmode 1
  61. For I%=0 To 20
  62.   Cls
  63.   For J%=0 To 8
  64.     Put 8+J%*50,0,Score$(J%)
  65.     Box 5+I%+J%*50,5+I%,45-I%+J%*50,45-I%
  66.     Get 5+I%+J%*50,5+I%,45-I%+J%*50,45-I%,Swupp$(I%,J%)
  67.   Next J%
  68. Next I%
  69. Erase Score$()
  70. '
  71. ' Bild Aufbauen
  72. '
  73. Cls
  74. Deffill 1,3,8
  75. Pbox 400,0,639,399
  76. Deffill 1,0
  77. Pbox 412,12,628,388
  78. Box 415,15,625,385
  79. Box 416,16,624,384
  80. Graphmode 3
  81. Deftext 1,0,0,32
  82. A$="MIRROR"
  83. Text 425,45,190,A$
  84. Text 426,46,190,A$
  85. Text 425,46,190,A$
  86. Graphmode 1
  87. Deftext 1,0,0,6
  88. Text 421,380,200,Chr$(189)+" 1989 by Wolfgang Hübner"
  89. '
  90. ' Neuanfang
  91. '
  92. Again:
  93. '
  94. Graphmode 1
  95. Repeat
  96.   Print At(1,1);
  97.   Input "Schwierigkeit (1/2)";Bad%
  98. Until Bad%=1 Or Bad%=2
  99. Dec Bad%
  100. Repeat
  101.   Print At(1,1);
  102.   Input "Anzahl der Spiegel im Spiel (15-36)";Anzahl%
  103. Until Anzahl%>14 And Anzahl%<37
  104. '
  105. Deffill 1,2,4
  106. Pbox 0,0,400,399
  107. '
  108. Clr E%,Anz%
  109. Tell%=((Tell%-1) Xor 1)+1
  110. Arrayfill Sco%(),0
  111. Arrayfill X%(),0
  112. Arrayfill Y%(),0
  113. Arrayfill Shoot!(),0
  114. Arrayfill Dead%(),0
  115. Graphmode 1
  116. '
  117. ' Scoresteine setzen
  118. '
  119. Deffill 1,2,2
  120. Deftext 1,0,0,32
  121. For H%=0 To 1
  122.   For N%=0 To 5
  123.     E1%=Random(9)
  124.     X%(E%,E1%)=25+H%*350
  125.     Y%(E%,E1%)=75+N%*50
  126.     Put X%(E%,E1%)-20,Y%(E%,E1%)-20,Swupp$(0,E1%)
  127.     '
  128.     Pbox 55+N%*50,5+H%*350,95+N%*50,45+H%*350
  129.     Graphmode 2
  130.     Text 68+N%*50,37+H%*350,2-H%
  131.     Graphmode 1
  132.     Inc E%
  133.   Next N%
  134. Next H%
  135. Deftext 1,0,0,6
  136. '
  137. ' Spiegelfeld zeichnen
  138. '
  139. Deffill 1,0
  140. Pbox 49,49,351,351
  141. Defline 3
  142. For X%=0 To 6
  143.   Line 50+X%*50,50,50+X%*50,350
  144.   Line 50,X%*50+50,350,X%*50+50
  145. Next X%
  146. Defline 1
  147. '
  148. ' Spiegel setzen
  149. '
  150. Anz%=Anzahl%
  151. Arrayfill Stone!(),0
  152. While Anz%>0
  153.   Stx%=Random(6)+1
  154.   Sty%=Random(6)+1
  155.   If Stone!(Stx%,Sty%)=False
  156.     Put Stx%*50+2,Sty%*50+2,Shield$(Random(2+Bad%*2))
  157.     Stone!(Stx%,Sty%)=True
  158.     Dec Anz%
  159.   Endif
  160. Wend
  161. '
  162. Deffill 1,2,8
  163. Graphmode 3
  164. Pbox 55,5,95,45
  165. Pbox 55,355,95,395
  166. Graphmode 1
  167. Gx%(1)=1
  168. Gy%(1)=7
  169. Gx%(2)=1
  170. Gy%(2)=0
  171. Deffill 1,2,2
  172. Tell%=2
  173. '
  174. ' Hauptroutine
  175. '
  176. Do
  177.   '
  178.   Clr R%,Merki%,Merkh%,Key%,Out!,Mex%,First!
  179.   '
  180.   Tell%=((Tell%-1) Xor 1)+1
  181.   @Tell
  182.   If Again!=True
  183.     Again!=False
  184.     Goto Again
  185.   Endif
  186.   Graphmode 3
  187.   While Mousek
  188.   Wend
  189.   Repeat
  190.     '
  191.     Mouse Xx%,Yy%,K%
  192.     Xx%=Int(Xx%/50)*50
  193.     Yy%=Int(Yy%/50)*50
  194.     Key$=Upper$(Inkey$)
  195.     While Inkey$<>""
  196.     Wend
  197.     '
  198.     If Key$="Q"
  199.       Alert 3,"|    Wirklich Ende ?",1,"Weiter|Neu|Quit",A
  200.       If A=2
  201.         Goto Again
  202.       Endif
  203.       If A=3
  204.         Edit
  205.       Endif
  206.     Endif
  207.     '
  208.     ' Spiegel drehen oder verschieben
  209.     '
  210.     If Xx%=>50 And Xx%<=300 And Yy%>=50 And Yy%<=300 And Out!=False
  211.       Stx%=Xx%/50
  212.       Sty%=Yy%/50
  213.       '
  214.       If K% And Stone!(Stx%,Sty%)=True
  215.         If K%=2 And Sco%(Tell%)=>50              !verschieben
  216.           @Klang(1)
  217.           Sub Sco%(Tell%),50
  218.           @Tell                                     !?
  219.           Get Xx%+2,Yy%+2,Xx%+48,Yy%+48,Shield$
  220.           Stone!(Stx%,Sty%)=False
  221.           Graphmode 1
  222.           Deffill 0
  223.           Pbox Xx%+1,Yy%+1,Xx%+49,Yy%+49
  224.           Deffill 1
  225.           Graphmode 3
  226.           Ok!=False
  227.           Repeat
  228.             Mouse Xx%,Yy%,K%
  229.             Xx%=Int(Xx%/50)*50
  230.             Yy%=Int(Yy%/50)*50
  231.             Stx%=Xx%/50
  232.             Sty%=Yy%/50
  233.             If Xx%=>50 And Xx%<=300 And Yy%>=50 And Yy%<=300
  234.               If Stone!(Stx%,Sty%)=False
  235.                 Put Xx%+2,Yy%+2,Shield$,6
  236.                 Put Xx%+2,Yy%+2,Shield$,6
  237.                 Ok!=True
  238.               Else
  239.                 Ok!=False
  240.               Endif
  241.             Else
  242.               Ok!=False
  243.             Endif
  244.           Until K%=0 And Ok!=True
  245.           Put Xx%+2,Yy%+2,Shield$
  246.           Stone!(Xx%/50,Yy%/50)=True
  247.             Out!=True
  248.           @Klang(1)
  249.         Endif
  250.         If K%=1                                  !drehen
  251.           @Klang(2)
  252.           If First!=False
  253.             If Point(Xx%+10,Yy%+10)
  254.               Key%=0
  255.             Else
  256.               Key%=1
  257.             Endif
  258.             If Point(Xx%+25,Yy%+25)=0 And Bad%=1
  259.               Ugh%=2
  260.             Else
  261.               Ugh%=0
  262.             Endif
  263.             First!=True
  264.             Mx%=Xx%
  265.             My%=Yy%
  266.           Endif
  267.           Inc Key%
  268.           If Xx%<>Mx% Or My%<>Yy%
  269.             Out!=True
  270.           Endif
  271.           If K%<>3 And Out!=False
  272.             Put Xx%+2,Yy%+2,Shield$(Even(Key%)+1+Ugh%)
  273.             While Mousek
  274.             Wend
  275.           Endif
  276.         Endif
  277.       Endif
  278.       '
  279.     Endif
  280.     '
  281.     ' Schwarzes Feld bewegt sich
  282.     '
  283.     If Xx%/50<>Mex% And Xx%=>50 And Xx%<=300
  284.       Mex%=Xx%/50
  285.       Deffill 1,2,8
  286.       Pbox Gx%(Tell%)*50+5,Gy%(Tell%)*50+5,Gx%(Tell%)*50+45,Gy%(Tell%)*50+45
  287.       Gx%(Tell%)=Xx%/50
  288.       Gy%(Tell%)=((Tell%-1) Xor 1)*7
  289.       Pbox Gx%(Tell%)*50+5,Gy%(Tell%)*50+5,Gx%(Tell%)*50+45,Gy%(Tell%)*50+45
  290.       Deffill 1,2,2
  291.     Endif
  292.     '
  293.   Until K% And ((Xx%=>50 And Xx%<=300 And Yy%=350 And Tell%=1) Or (Xx%=>50 And Xx%<=300 And Yy%=0 And Tell%=2))
  294.   '
  295.   ' S C H U S S
  296.   '
  297.   Graphmode 1
  298.   '
  299.   If Gy%(Tell%)=0
  300.     Wx%=0
  301.     Wy%=1
  302.     X%=Gx%(Tell%)*50+25
  303.     Y%=25
  304.   Endif
  305.   If Gy%(Tell%)=7
  306.     Wx%=0
  307.     Wy%=-1
  308.     X%=Gx%(Tell%)*50+25
  309.     Y%=375
  310.   Endif
  311.   '
  312.   Get 0,0,399,399,Monitor$
  313.   @Klang(3)
  314.   Repeat
  315.     For T%=1 To 50
  316.       Add X%,Wx%
  317.       Add Y%,Wy%
  318.       Plot X%,Y%
  319.       For G%=1 To 50
  320.       Next G%
  321.     Next T%
  322.     '
  323.     If Point(X%+3,Y%+3) And Point(X%-3,Y%-3)
  324.       @Klang(4)
  325.       If Wx%=1 And Wy%=0
  326.         Wx%=0
  327.         Wy%=1
  328.       Else
  329.         If Wx%=-1 And Wy%=0
  330.           Wx%=0
  331.           Wy%=-1
  332.         Else
  333.           If Wx%=0 And Wy%=1
  334.             Wx%=1
  335.             Wy%=0
  336.           Else
  337.             If Wx%=0 And Wy%=-1
  338.               Wx%=-1
  339.               Wy%=0
  340.             Endif
  341.           Endif
  342.         Endif
  343.       Endif
  344.     Endif
  345.     If Point(X%+3,Y%-3) And Point(X%-3,Y%+3)
  346.       @Klang(4)
  347.       If Wx%=1 And Wy%=0
  348.         Wx%=0
  349.         Wy%=-1
  350.       Else
  351.         If Wx%=-1 And Wy%=0
  352.           Wx%=0
  353.           Wy%=1
  354.         Else
  355.           If Wx%=0 And Wy%=1
  356.             Wx%=-1
  357.             Wy%=0
  358.           Else
  359.             If Wx%=0 And Wy%=-1
  360.               Wx%=1
  361.               Wy%=0
  362.             Endif
  363.           Endif
  364.         Endif
  365.       Endif
  366.     Endif
  367.   Until X%=25 Or X%=375 Or Y%=25 Or Y%=375
  368.   Put 0,0,Monitor$
  369.   '
  370.   ' Zahlenfeld getroffen?
  371.   '
  372.   If Y%=25 Or Y%=375
  373.     @Shoot
  374.     Goto Out
  375.   Endif
  376.   '
  377.   ' Scorefeld getroffen.
  378.   '
  379.   Clr U%
  380.   For H%=0 To 8
  381.     For I%=0 To 11
  382.       If X%=X%(I%,H%) And Y%=Y%(I%,H%)
  383.         U%=H%
  384.         Merki%=I%
  385.         Merkh%=H%
  386.         Add Sco%(Tell%),(H%+1)*10
  387.       Endif
  388.     Next I%
  389.   Next H%
  390.   '
  391.   Uu%=Random(9)
  392.   X%(Merki%,Merkh%)=0
  393.   Y%(Merki%,Merkh%)=0
  394.   X%(Merki%,Uu%)=X%
  395.   Y%(Merki%,Uu%)=Y%
  396.   '
  397.   ' Scorefeld animieren
  398.   '
  399.   For I%=0 To 40
  400.     @Klang(5)
  401.     If I%<20
  402.       Put X%-20+R%,Y%-20+R%,Swupp$(R%,U%)
  403.     Else
  404.       Put X%-20+R%,Y%-20+R%,Swupp$(R%,Uu%)
  405.     Endif
  406.     If I%<20
  407.       Inc R%
  408.     Else
  409.       Dec R%
  410.     Endif
  411.     For H%=1 To 50
  412.     Next H%
  413.   Next I%
  414.   Out:
  415. Loop
  416. '
  417. ' Infobox aktualisieren
  418. '
  419. Procedure Tell
  420.   Print At(59,10);"  Player : ";Tell%;"  "
  421.   Print At(57,11);"Turn the Mirrors ! "
  422.   If Sco%(Tell%)=>50
  423.     Print At(57,12);"Move the Mirrors !"
  424.   Else
  425.     Print At(57,12);"                  "
  426.   Endif
  427.   If Sco%(Tell%)=>200
  428.     Print At(58,13);"Kill the Enemy !"
  429.   Else
  430.     Print At(58,13);"                "
  431.   Endif
  432.   Print At(55,16);"Score Player 1 : ";Using "####",Sco%(1)
  433.   Print At(55,17);"Score Player 2 : ";Using "####",Sco%(2)
  434.   If Sco%(((Tell%-1) Xor 1)+1)<0
  435.     @Dead(((Tell%-1) Xor 1)+1)
  436.   Endif
  437.   If Sco%(Tell%)<0
  438.     @Dead(Tell%)
  439.   Endif
  440. Return
  441. '
  442. ' Zahlenfeld getroffen
  443. '
  444. Procedure Shoot
  445.   Sub Sco%(Tell%),200
  446.   If Y%=25
  447.     G%=2
  448.   Endif
  449.   If Y%=375
  450.     G%=1
  451.   Endif
  452.   If (Y%=25 And Tell%=1) Or (Y%=375 And Tell%=2)
  453.     If X%<>Gx%(((Tell%-1) Xor 1)+1)*50+25
  454.       If Shoot!(G%,(X%-25)/50)=False
  455.         If Sco%(Tell%)=>0
  456.           @Klang(7)
  457.           Pbox X%-20,Y%-20,X%+20,Y%+20
  458.           Shoot!(G%,(X%-25)/50)=True
  459.           Sub Sco%(((Tell%-1) Xor 1)+1),100
  460.           Inc Dead%(G%)
  461.           If Dead%(G%)=5
  462.             @Dead(G%)
  463.           Endif
  464.         Else
  465.           Shit!=True
  466.           Print At(57,22);"Punkte sind Minus !"
  467.         Endif
  468.       Else
  469.         Shit!=True
  470.         Print At(57,22);"Stein war einmal!"
  471.       Endif
  472.     Else
  473.       Shit!=True
  474.       Print At(57,22);"Schwarzer Stein !"
  475.     Endif
  476.   Else
  477.     Shit!=True
  478.     Print At(57,23);"Falsche Seite !"
  479.   Endif
  480.   If Shit!=True
  481.     Shit!=False
  482.     @Klang(6)
  483.     Add Sco%(((Tell%-1) Xor 1)+1),100
  484.     Print At(57,22);"                   "
  485.     Print At(57,23);"                   "
  486.   Endif
  487. Return
  488. '
  489. ' Sieger
  490. '
  491. Procedure Dead(Tell%)
  492.   @Klang(8)
  493.   Alert 0,"Player "+Str$(((Tell%-1) Xor 1)+1)+"|You've won ! |Once more ?",1,"YEAH|NO",A
  494.   If A=1
  495.     Again!=True
  496.   Else
  497.     End
  498.   Endif
  499. Return
  500. '
  501. ' GOOD SOUNDS
  502. '
  503. Procedure Klang(Flag%)
  504.   If Flag%=1
  505.     Sound 1,15,1,1
  506.     Wave 1,1,9,10000
  507.   Endif
  508.   If Flag%=2
  509.     Sound 1,15,1,1
  510.     Wave 8,1,5,600
  511.   Endif
  512.   If Flag%=3
  513.     Sound 1,15,4,4
  514.     Wave 8,1,9,3000
  515.   Endif
  516.   If Flag%=4
  517.     Sound 1,15,1,1
  518.     Wave 1,1,0,6000
  519.   Endif
  520.   If Flag%=5
  521.     Sound 1,15,1,3
  522.     Wave 1,15,0,1000
  523.   Endif
  524.   If Flag%=6
  525.     For I%=1100 To 1300 Step 4
  526.       Sound 1,15,#I%,1
  527.     Next I%
  528.     Wave 0,0
  529.   Endif
  530.   If Flag%=7
  531.     For I%=1600 To 1100 Step -20
  532.       Sound 1,15,#I%,1
  533.     Next I%
  534.     Wave 0,0
  535.   Endif
  536.   If Flag%=8
  537.     For H%=1 To 3
  538.       For I%=1100 To 1300 Step 10
  539.         Sound 1,15,#I%,1
  540.       Next I%
  541.     Next H%
  542.     Wave 0,0
  543.   Endif
  544. Return
  545.