home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume18 / xboing / part19 < prev    next >
Encoding:
Internet Message Format  |  1993-09-13  |  59.4 KB

  1. Path: uunet!news.tek.com!news.cna.tek.com!not-for-mail
  2. From: billr@saab.cna.tek.com (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v18i078:  xboing - blockout variant with color and sound for X, Part19/30
  5. Date: 30 Aug 1993 10:28:48 -0700
  6. Organization: Tektronix, Inc., Redmond, OR
  7. Lines: 1983
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <25tdcg$i1b@saab.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1878
  12.  
  13. Submitted-by: jck@kimba.catt.citri.edu.au (Justin Kibell)
  14. Posting-number: Volume 18, Issue 78
  15. Archive-name: xboing/part19
  16. Environment: X11, Xlib, XPM
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 19 (of 30)."
  27. # Contents:  bitmaps/highscores.xpm.uu bonus.c gun.c include/audio.h
  28. # Wrapped by billr@saab on Mon Aug 30 09:14:28 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'bitmaps/highscores.xpm.uu' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'bitmaps/highscores.xpm.uu'\"
  32. else
  33. echo shar: Extracting \"'bitmaps/highscores.xpm.uu'\" \(19805 characters\)
  34. sed "s/^X//" >'bitmaps/highscores.xpm.uu' <<'END_OF_FILE'
  35. Xbegin 644 highscores.xpm
  36. XM+RH@6%!-("HO"G-T871I8R!C:&%R("H@:&EG:'-C;W)E<U]X<&U;72`]('L*
  37. XM+RH@=VED=&@@:&5I9VAT(&YC;VQO<G,@8VAA<G-?<&5R7W!I>&5L("HO"B(S
  38. XM-S<@,S<@."`Q(BP*+RH@8V]L;W)S("HO"B(@"7,@3F]N90EC($YO;F4B+`HB
  39. XM+@EC("-%.$4X13@B+`HB6`EC("-"1D)&1#(B+`HB;PEC("-!-$$T.3`B+`HB
  40. XM3PEC("-!-#=".3`B+`HB*PEC(",U135%-44B+`HB0`EC(",W0CDP030B+`HB
  41. XM(PEC(",T1#1$-$0B+`HO*B!P:7AE;',@*B\*(B`@("`@("`@("`@("`@("`@
  42. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  43. XM("`@("`N+E@N+BX@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  44. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  45. XM("`@("`@("`@("`@("`@+BY8+BXN6"XN6"`@("`@("`@("`@("`@("`@("`@
  46. XM("`@("`@("`@+BY8+BXN("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  47. XM("`@("XN6"XN+E@@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  48. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  49. XM("`@("`@("`@("`@("`@("`@("`@("`N+E@N+BY8+BY8("`@("`@("`@("`@
  50. XM(BP*(BY8+BXN6"XN6"Y86"`@("`@("`@("XN6"XN+E@N+E@N6"`@("`N+E@N
  51. XM+BY8+BY8+E@@("`@("`@("`@("`@("`N6"Y8;T\K;V\N+E@N("`@("`@("`@
  52. XM("`@("`@+E@N+BY8+BY8+EA8("`@("`@("`@+BY8+BXN6"XN6"Y8("`@("`@
  53. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("!8+E@N0$]/;T\K;V]8
  54. XM+BXN("`@("`@("`@("`@("`@("`@("`@("`@+E@N6&]/*V]O+BY8+B`@("`@
  55. XM("`@("`@("`@("`@("`@("`@("`@("Y8+EAO3RMO;RXN6"X@("`@("`@("`@
  56. XM("`@("`@+E@N+BY8+BY8+BXN+E@N+BY8+BY8+E@@("`@("`@("`@("`@("Y8
  57. XM+BXN6"XN6"Y8+BXN+BXN+E@N+BY8+BY8+BXN6"`@("`@("`@("`@(%@N6"Y`
  58. XM3T]O3RMO;U@N+BX@("`@("`@("`@(BP*(EAO3V]/;RMO0$]O3R`@("`@("`@
  59. XM(%AO6$]O6$]/*V]/3R`@("!86%AO6"LK3RM/3T\@("`@("`@("`@("!8+BYO
  60. XM;UA/*UA/*T!O6&]/+BY8("`@("`@("`@("`@6&]/;T]O*V]`3V]/("`@("`@
  61. XM("`@6&]83V]83T\K;T]/("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  62. XM("`@("`@6"Y/;V]O;UA/*UA/*T!O6&]/6"X@("`@("`@("`@("`@("`@("`@
  63. XM6"XN;V]83RM83RM`;UAO3RXN6"`@("`@("`@("`@("`@("`@("`@(%@N+F]O
  64. XM6$\K6$\K0&]8;T\N+E@@("`@("`@("`@("`@6&]O6%@K;U@C0&]`;U@K;T!/
  65. XM3T!/3T\N+B`@("`@("`@("`@(%AO6"LK3RM/3V]/6%@K;T]O0%A/;UAO;UAO
  66. XM3T]O3R`@("`@("`@("!8+D]O;V]O6$\K6$\K0&]8;T]8+B`@("`@("`@(BP*
  67. XM(EA8;T`K;T\K3V]83R`@("`@("`@(%A`;UAO;UA8;T]O3R`@("!8;V\K3V]O
  68. XM3V]83T\@("`@("`@("`@("Y8;V]/6"MO6$]O;V]83T!80$\K6"`@("`@("`@
  69. XM("`@6%AO0"MO3RM/;UA/("`@("`@("`@6$!O6&]O6%AO3V]/("`@("`@("`@
  70. XM("`@("`@("`@("`@("`@("`@("`@("`@(%@N3T]/;V]/6"MO6$]O;V]83T!8
  71. XM0$]8;R`@("`@("`@("`@("`@("`N6&]O3U@K;UA/;V]O6$]`6$!/*U@@("`@
  72. XM("`@("`@("`@("`@("`@+EAO;T]8*V]83V]O;UA/0%A`3RM86"`@("`@("`@
  73. XM("`@6%AO;T]86&]O3V]O;T\K3T!83V]O;UAO6"Y8("`@("`@("`@(%@K3V]O
  74. XM3V]83V]83V]`(T]`6$]/3UA8;RM8;UA83R`@("`@("`@6"Y/3T]O;T]8*V]8
  75. XM3V]O;UA/0%A`3UAO("`@("`@(BP*(EA83T]83V]8;V]`3R`@("`@("`@(&]O
  76. XM(T]/;UA/*V]`3R`@("!83V]O6"MO3T]8;T\@("`@("`@("!8+E@C0&]`;U@K
  77. XM;T!/3T!/3T]O3T]/3RX@("`@("`@("`@6%A/3UA/;UAO;T!/("`@("`@("`@
  78. XM;V\C3T]O6$\K;T!/("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  79. XM6%@K;U@C0&]`;U@K;T!/3T!/3T]O3T]/3U@@("`@("`@("`@("`@6"Y8(T!O
  80. XM0&]8*V]`3T]`3T]/;T]/3T\N("`@("`@("`@("`@("`@(%@N6"-`;T!O6"MO
  81. XM0$]/0$]/3V]/3T]/6%@@("`@("`@("`@6&]/3V]/6&]86&]8;T]`;UA/6&]8
  82. XM;V]`;UA/6%@@("`@("`@(%AO6"MO3T]8;UA`6%A/6$]O(UA83T]O0$]/3T]8
  83. XM*R`@("`@("!86"MO6"-`;T!O6"MO0$]/0$]/3V]/3T]/6"`@("`@(BP*(EAO
  84. XM6&]O3V]/;RMO3R`@("`@("`@(%A/3T]`6$]/;UAO3R`@("!8;T]/;T]`;T!8
  85. XM0$\@("`@("`@(%A86&]O3V]O;T\K3T!83V]O;UAO6$]8;T!/("`@("`@("`@
  86. XM6&]8;V]/;T]O*V]/("`@("`@("`@6$]/3T!83T]O6&]/("`@("`@("`@("`@
  87. XM("`@("`@("`@("`@("`@("`@("!O;T]86&]O3V]O;T\K3T!83V]O;UAO6$]8
  88. XM;T!O("`@("`@("`@("!86%AO;T]O;V]/*T]`6$]O;V]8;UA/6&]`3R`@("`@
  89. XM("`@("`@("`@6%A8;V]/;V]O3RM/0%A/;V]O6&]83UAO0&]8("`@("`@("`@
  90. XM6&]/;U@K3T]83T]/6$]/6%A/*UAO6$]/3V]O;V]8("`@("`@(%A/;T]`;T!8
  91. XM0$]83V]O3T]86%AO6$]86%A8;T!83R`@("`@(&]O3UA8;V]/;V]O3RM/0%A/
  92. XM;V]O6&]83UAO0&\@("`@(BP*(EA`;T\K6&]`;T\K3R`@("`@("`@(%AO3V]`
  93. XM;RMO6&]/3R`@("!8;UA/3UA86%AO6$\@("`@("`@6&]/6&]86&]8;T]`;UA/
  94. XM6&]8;V]`;UA/3T!80"`@("`@("`@6$!O3RM8;T!O3RM/("`@("`@("`@6&]/
  95. XM;T!O*V]8;T]/("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@($]/3V]/
  96. XM6&]86&]8;T]`;UA/6&]8;V]`;UA/3T!80"`@("`@("`@(%AO3UAO6%AO6&]/
  97. XM0&]83UAO6&]O0&]83T]`6$`@("`@("`@("`@("!8;T]8;UA8;UAO3T!O6$]8
  98. XM;UAO;T!O6$]/0%A`6"`@("`@("`@6&]86"-8*V\K6$]/*UAO0%@K;T\K3T]O
  99. XM6$]/;RMO6"`@("`@(%A/3UA86%AO6%AO6&]83UA86$]/3UA/6%AO;T]O3R`@
  100. XM("`@3T]/;T]8;UA8;UAO3T!O6$]8;UAO;T!O6$]/0%A`("`@(BP*(EA/3UA/
  101. XM6$]86%A8*R`@("`@("`@(&]/6$!O3V]83T]/*R`@("!83V]86&]86%A`;RL@
  102. XM("`@("!8;U@K3T]83T]/6$]/6%A/*UAO6$]/3V]O;T]`3V\@("`@("`@6$]/
  103. XM6$]83UA86%@K("`@("`@("`@;T]80&]/;UA/3T\K("`@("`@("`@("`@("`@
  104. XM("`@("`@("`@("`@("`@(&]/;U@K3T]83T]/6$]/6%A/*UAO6$]/3V]O;T]`
  105. XM3T\@("`@("`@6&]8*T]/6$]/3UA/3UA83T!8;UA/3T]O;V]/0$]O("`@("`@
  106. XM("`@(%AO6"M/3UA/3T]83T]86&]`6&]83T]/;V]O3T!/;V\@("`@("`@6$\K
  107. XM6"-/6&]8*UA/6&]86$]83RM8;UA83V]O3UA8;R`@("`@(%A86&]86%A`;T]8
  108. XM6$!86%A8;T]O3V]`6&]8*T]8*R`@("`@;T]O6"M/3UA/3T]83T]86$\K6&]8
  109. XM3T]/;V]O3T!/3R`@(BP*(F]/*UA83T]O6%A83R`@("`@("`@(%A/3V\K6&]8
  110. XM6&]/3R`@("!O3T]O*T]8;UAO6$\@("`@(&]86"-8*V\K6$]/*UAO6",C(T\K
  111. XM3T]O6$]/;RM`3T]`("`@("`@;T\K6%A/3V]86%A/("`@("`@("`@6$]/;RM8
  112. XM;UA8;T]/("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@3V]86"-8*V\K
  113. XM6$]/*UAO6%@K;T\K3T]O6$]/;RM`3T\@("`@("!O6%@C6"MO*UA/3RM8;U@C
  114. XM(R-/0$]/;UA/3V\K0$]/0"`@("`@("`@;UA8(U@K;RM83T\K6&]`(R,C0$!/
  115. XM3V]83T]O*T!/3T!O("`@("`@;V]O3T!83V]86$]O3UA8*T!/3V]86$]O0&]8
  116. XM;UA`6$\@("`@(&]O*T]8;UAO6%AO3UAO6%A8*UA/;V\K3T]`3T]/3R`@("!/
  117. XM;UA8(U@K;RM83T\K6&]86"MO3RM/3V]83T]O*T!/3R`@(BP*(EA/6$]8;V]/
  118. XM6&]/3R`@("`@("`@(&]O6&]/;RM8*V]/3R`@("!83UA/6%A83UA8;T\@("`@
  119. XM(%@K6"-/6&]8*UA/6&\C*R`@("LC;UA83V]O3UA86"M80"`@("`@6$]83UAO
  120. XM;T]8;T]/("`@("`@("`@;V]8;T]O*U@K;T]/("`@("`@("`@("`@("`@("`@
  121. XM("`@("`@("`@("`@3T\K6"-/6&]8*UA/6$\K(RLC(R,K*UA83V]O3UA86$`K
  122. XM("`@("!8*U@C3UAO6"M83UAO(RL@("`K(V]86$]O;T]86%@K6$`@("`@("`@
  123. XM6"M8(T]8;U@K6$]8;R,K("`@*R-O6%A/;V]/6%A8*UAO("`@("`@6&]/6$]/
  124. XM6&]O3U@K(R,K(R,K(T]O0"MO6&]/;T]O6&\@("`@(%A/6%A83UA8;UA8*R,C
  125. XM(R,C(R,C*R,C(R,C(RLC(R`@("!/3RM8(T]8;U@K6$]83RLC*R,C(RLK6%A/
  126. XM;V]/6%A80"L@(BP*(EAO3V]/6$]O3T`K3R`@("`@("`@(&]86%AO6$!/6$]O
  127. XM3R`@("!86&]O6&]83V]8*T\@("`@;UAO3T!83V]86$]O3RL@("`@("`@*T]O
  128. XM0&]8;UA`6"M80"`@("`@6&]/;T]83V]/0"M/("`@("`@("`@;UA86&]80$]8
  129. XM3V]/("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@;V]O3T!83V]86"M/
  130. XM*R`@("`@("`@($]O0&]8;UA`6"M/("`@(&]8;T]`6$]O6%A/;T\K("`@("`@
  131. XM("M/;T!O6&]80%@K6$`@("`@("!O6&]/0%A/;UA83V]/*R`@("`@("!/3V]`
  132. XM;UAO6$!8*UA`;R`@("`@6$]8;UA/6&]/3V\K("`@("`@("!O3T]/;U@K6$]/
  133. XM0&\@("`@(%AO6&]83V]8*UAO*R`@("`@("`@("`@("`@("`@("`@("!O;V]/
  134. XM0%A/;UA8*T\K("`@("`@("`@3V]`;UAO6$!8*T\@(BP*(F]O*UA8*UAO6%@K
  135. XM3R`@("`@("`@(%A83T]/6$]/;U@K3R`@("!O3T!/6%A80&]80$\@("`@;V]/
  136. XM6$]/6&]O3UA8*R`@("`@("`@($]O6&]/;T]O6&\C3T`@("`@;V\K6%@K6&]8
  137. XM6"M/("`@("`@("`@6%A/3T]83T]O6"M/("`@("`@("`@("`@("`@("`@("`@
  138. XM("`@("`@("`@*V]/6$]/6&]O3UA/("`@("`@("`@("LC(RLC(RLC(R,K("`@
  139. XM(&]O3UA/3UAO;T]86"L@("`@("`@("!/;UAO3V]/;UAO(T]`("`@("!O;T]8
  140. XM3T]8;V]/6%@K("`@("`@("`@3V]8;T]O3V]8;R-/0"`@("`@;T]/6$]86$]8
  141. XM6%@K("`@("`@("`C3UA/6$\K6$]`6$\@("`@(&]/6%A80&]80%A8*R`@("`@
  142. XM("`@("`@("`@("`@("`@("`K;T]83T]8;V]/6$\@("`@("`@("`@*R,C*R,C
  143. XM*R,C(RL@(BP*(EA86%A86%AO3UA/+BXN+BXN+E@N+EA`3T]/6&]83T]O3R`@
  144. XM("!8*T]/;V]86%A83T\@("`@;T]8;UA/6&]/3V\K("`@("`@("`@("!/;U@K
  145. XM6$]/0%A/;T`@("`@6%A86%A86&]/6$\N+BXN+BXN6"XN6$!/3T]8;UA/3V]/
  146. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@3T]8;UA/6&]/3V]/;R`@
  147. XM("`@("`@("`@("`@("`@("`@("`@(&]/6&]83UAO3T]O*R`@("`@("`@("`@
  148. XM3V]8*UA/3T!83V]`("`@("!O3UAO6$]8;T]/;RL@("`@("`@("`@($]O6"M8
  149. XM3T]`6$]O0&\@("`@6%AO6$]8;T]/;T]/("`@("`@("`@;V]O;V]/6%A83RL@
  150. XM("`@(%A/;V]86%A83UA8*R`@("`@("`@("`@("`@("`@("`@("!/3UAO6$]8
  151. XM;T]/;T]O("`@("`@("`@("`@("`@("`@("`@(BP*(F]86%A86%A8;UA/6%AO
  152. XM6$]/6$]/3UA`6&]O6%A/3T]O*R`@("!O;UA8;V]86&]86"L@("!O6$]/6$]8
  153. XM6$]86%@K("`@("`@("`@("`K(R,C(RLC(R,K(R,@("`@;UA86%A86%AO6$]8
  154. XM6&]83T]83T]/6$!8;V]86$]/3V\K("`@("`@("`@("`@("`@("`@("`@("`@
  155. XM("`@("`@*T]/6$]86$]86%A8;V]8+BXN6"XN+E@@("`@("`@("`@("`@;UA/
  156. XM3UA/6%A/6%A8*R`@("`@("`@("`@3R,C*R,C(R,C(RLC("`@(&]83T]83UA8
  157. XM3UA86$\@("`@("`@("`@($!/3UA`3T!/3T]8;T\@("`@;T]/3UA8;UA86$\K
  158. XM("`@("`@("`@6%AO3T]O6&]/3T\@("`@(&]8;V]86&]86%A/3U@N6"XN6"XN
  159. XM+E@N+BY8+B`@("`@("`K3T]83UA83UA86%AO;U@N+BY8+BXN6"`@("`@("`@
  160. XM("`@(BP*(EA8;UAO6%@K3UA86%A8;T]8(T]O6&]8;V]O3T\K3V]83R`@("!8
  161. XM6%A86$!O6$]/6$\@("!`6%AO6$]8;T]/;T\K("`@("`@("`@("`@("`@("`@
  162. XM("`@("`@("`@6%AO6&]86"M/6%A86%AO3U@C3V]8;UAO;V]/3RM/;UA/("`@
  163. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@($]O6$]8;T]/;T]/;T]/;UA/
  164. XM6$\C6&\N+EA8("`@("`@("`@0%A8;UA/6&]/3V]/*R`@("`@("`@("`@("`@
  165. XM("`@("`@("`@("`@($!86&]83UAO3T]O3RL@("`@("`@("`@($]83T]/6$!8
  166. XM;V]86$!O("`@6%A/3T]/;UAO3U@K("`@("`@("!O6%A/3UA8;T]`;RL@("`@
  167. XM(%A86$!O6$]/6%AO3T]83UA/3T]8;T]/*T]/*R`@("`@("`@3V]83UAO3T]O
  168. XM3T]O3T]O6$]83R-8;RXN6%@@("`@("`@(BP*(F]/3V\K3RM/;V]86&]86"MO
  169. XM;T]O6%A8;V]O;UA/3T]83R`@("!O6&]86%A/3UA/6$\@("!O;T]/3UA8;UA8
  170. XM6$\@("`@("`@("`@("`@("`@("`@("`@("`@("`@;T]/;RM/*T]O;UA8;UA8
  171. XM*V]O3V]86%AO;V]O6$]/3UA/("`@("`@("`@("`@("`@("`@("`@("`@("`@
  172. XM("`@("M/3UA8;UA86$]O3RM/3UAO6%AO;UAO3T]O6%@@("`@("`@;V]/3T]8
  173. XM6&]86%A/("`@("`@("`@("`@("`@("`@("`@("`@("`@(&]O3T]/6%AO6%A8
  174. XM3R`@("`@("`@("`@("!`3V]8;UAO;V]/3RM/("`@;RM86&]8*UAO3UA/+BXN
  175. XM6"XN6%AO3V]O3UA/3UA/*R`@("`@(&]86%A/3UA/6%A/;RM86&]/;UA/3V]8
  176. XM*UA/3R`@("`@("`@*T]/6%AO6%A83V]/*T]/6&]86&]O6&]/3V]86"`@("`@
  177. XM(BP*(F]O6$]86&]/6$]83UAO6$]/6&]/6&]/;V]/6$]/0"MO*R`@("!O*UA/
  178. XM6&]83T]/6"L@("!`3UA/3T]/;UAO3RL@("`@("`@("`@("`@("`@("`@("`@
  179. XM("`@("`@;V]83UA8;T]83UA/6&]83T]8;T]8;T]O;T]83T]`*V\K("`@("`@
  180. XM("`@("`@("`@("`@("`@("`@("`@("`@("`K3T]/;UAO3UA/6&]8;T!86"M8
  181. XM6%A/3UA8;T]`("`@("`@0$]83T]/3V]8;T\K("`@("`@("`@("`@("`@("`@
  182. XM("`@("`@("`@($!/6$]/3T]O6&]/*R`@("`@("`@("`@("!O3V]86%AO;V]O
  183. XM6$]/("`@;UAO6%A/6%A/6$]O3V]83T]8*RM86&]/;T`K6$]8*R`@("`@(&]/
  184. XM6&]83T]/6$]83UA/;UAO*T]O6%A/6%A/*R`@("`@("`@("M/3T]O6&]/6$]8
  185. XM;UAO0%A8*UA86$]/6%AO3T`@("`@(BP*(EA86%A83V]`6%AO0$!83UA83T]8
  186. XM6%A80&]/6$\K;V]/3R`@("!86&]O6%A/6$]/;T\@("!`*RM86&]8*UAO3T\@
  187. XM("`@("`@("`N6"XN6"Y8+BXN+BXN+E@@("`@6%A86%A/;T!86&]`0%A/6%A/
  188. XM3UA86%A`;T]83RMO;T]/("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  189. XM("`@*V]8*UAO3UA86%A/3V]86"MO3V]O3UA/3UA/;R`@("`@0"LK6%AO6"M8
  190. XM;T]/("`@("`@("`@("`@("`@("`@("`@("`@("`@($`K*UA8;U@K6&]/3R`@
  191. XM("`@("`@("`@("!`;T]8;T]O;T]83T\K("`@6%A/;V]O6$]/3UA86%A80%A/
  192. XM6&]O;UA8;UAO6&\C("`@("`@(%AO6%A/6$]/;UA/6$]83UA/6%@K*T]O6&]O
  193. XM*R`@("`@("`@("`K;U@K6&]/6%A86$]/;UA8*V]/;V]/6$]/6$]O("`@(BP*
  194. XM(F]83UAO6$]O3V]O3V]/6$]83T]O;V]/6&]83T]/3V]`*R`@("!O;T]/6$!O
  195. XM6%A86"L@("!O*UAO6%A/6%A/6$\@("`@("`@("!86"LK3V]8;V]/6$]O6$\@
  196. XM("`@;UA/6&]83V]/;V]/;T]83UA/3V]O;T]8;UA/3T]/;T`K("`@("`@("`@
  197. XM("`@("`@("`@("`@("`@("`@("`@("`@("M/6%A/6$]O3V]83T]8*RM86&]/
  198. XM;T`K6$]86&\@("`@;RM8;UA83UA83UA/("`@("`@("`@("`@("`@("`@("`@
  199. XM("`@("`@(&\K6&]86$]86$]83R`@("`@("`@("`@("!/3UA86%A`;T]83RM/
  200. XM("`@;T]86$]83UA/3UA83V\K3T]8;UA/;V]/0&]/6",@("`@("`@(&]/6$!O
  201. XM6%A86%A86$]86%A8;T]/6"M8;V\K3R`@("`@("`@("`@*T]86$]83V]/;UA/
  202. XM3U@K*UA8;T]O0"M83UA8;R`@(BP*(F]86$]/6%AO6$]86%@C6$]`3T!83T]/
  203. XM6$]O;T]86&]`*R`@("!O6&]86$]O3V]O3RL@("!`3UA/;V]O6$]/3T`@("`@
  204. XM("`@("!O3T]8*UAO;RM/3UAO6"L@("`@;UA83T]86&]83UA86"-83T!/0%A/
  205. XM3T]83V]O3UA8;T`K("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  206. XM("`@*T]/3UAO6%A80%A/6&]O;UA8;UAO6&]/3T]`("`@0$]83V]O;UA/3T]`
  207. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@($!/6$]O;V]83T]/0"`@("`@
  208. XM("`@("`@("!O3V]O;T]8;UA/3T]/("`@;V]O6%A/6%A86$\K*T]O6$!O6%@K
  209. XM6%A86$\C(R`@("`@("`@(&]86$]O3V]O3UAO3UA86$]80$]/*UAO3T!8*R`@
  210. XM("`@("`@("`@("`K3T]/6&]86%A`6$]8;V]O6%AO6&]8;T]/3T`@(BP*(E@K
  211. XM;UAO*T]8;UAO*R,C*R,C(R,K(RM/6&]`6%A83V]/3R`@("!86%A86%@C3UA8
  212. XM6$\@("!`;T]86$]83UA/3T\@("`@("`@("!`3T\K6&]/0%A/;RM83T\@("`@
  213. XM6"MO6&\K3UAO6&\K(R,K(R,C(RLC*T]8;T!86%A/;T]/("`@("`@("`@("`@
  214. XM("`@("`@("`@("`@("`@("`@("`@("`@(",K*V]83V\K3T]8;UA/;V]/0&]/
  215. XM6%A86$]O("`@0&]/6%A/6$]83T]/("`@("`@("`@("`@("`@("`@("`@("`@
  216. XM("`@($!O3UA83UA/6$]/3R`@("`@("`@("`@("!/0%A/3T]83V]O3U@K("`@
  217. XM6%A83UA/;UA86$]/6%A`6%AO3V]8;UAO3T]/(R`@("`@("`@(%A86%@C3UA8
  218. XM6$]8;T]86&]/6$]`0$!/;RM/*R`@("`@("`@("`@("`@(RLK;UA/;RM/3UAO
  219. XM6$]O;T]`;T]86%A83V\@(BP*(D!8*V]86%AO6&]O*R`@("`@("`@(&]O;T]8
  220. XM3UA/3UA/*R`@("!`*UA86&]8;R-8;RL@("!O*V]O6%A/6%A86$`@("`@("`@
  221. XM("!83T!`0$]O*T]O;RM/6$\@("`@0%@K;UA86&]8;V\K("`@("`@("`@;V]O
  222. XM3UA/6$]/6$\K("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  223. XM("`@("LK(R,C(R,C*R,K6%A86$]/*V]O6%A/;R`@;RMO;UA83UA86%A`("`@
  224. XM("`@("`@("`@("`@("`@("`@("`@("`@(&\K;V]86$]86%A80"`@("`@("`@
  225. XM("`@("!O6%A/6$]8;T!86%A/("`@0%A86"MO6%AO6%A83T]/6$]/3T]86%A8
  226. XM6&]/;R`@("`@("`@($!86&]8;R-8;UA8*R,K(R,C*R,C(R,C(R,C*R`@("`@
  227. XM("`@("`@("`@("`@*RLC(R,C(R,K(RM86%A83T\K;V]86$]O(BP*(F]/;T]/
  228. XM6$]/;T]/3R`@("`@("`@(&]8;UA/*UA8;T\K*R`@("!O6&]/6&]/3U@C6"L@
  229. XM("`@0%A83UA/;UA86$]`("`@("`@("!`3V]/*V]/*T]`3T]/3RL@("`@;T]O
  230. XM3T]83T]O3T]/("`@("`@("`@;UAO6$\K6%AO3RLK("`@("`@("`@("`@("`@
  231. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("-O3T]/6$]/
  232. XM6%A/3R`@($!86$]83V]86%A/0"`@("`@("`@("`@("`@("`@("`@("`@("`@
  233. XM("!`6%A/6$]O6%A83T`@("`@("`@("`@(&\K6&]O6&]O3UA/6"L@("`@;V]8
  234. XM;UA`;T]/6&]83T]O3UAO6&]/3V]86&]83T\@("`@("`@(&]/6&]/3U@C6$]8
  235. XM*R`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  236. XM(V]/3T]83T]86$]/(BP*(D!/6"M83RM86%A8*R`@("`@("`@($!8*UA/3T]`
  237. XM;UA/*R`@("!`*V]86&]/6&]83RL@("`@3UA86"MO6%AO6%AO("`@("`@("`K
  238. XM(R,C;V]8;V]86$]`3T\@("`@0$]8*UA/*UA86%@K("`@("`@("`@0%@K6$]/
  239. XM3T!O6$\K("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  240. XM("`@("`@("`@("`@("!/6&]/3UAO3UA8;R`@($]86%@K;UA8;UA8;R`@("`@
  241. XM("`@("`@+BXN+E@N+BXN+BXN3R`@("!/6%A8*V]86&]86&\@("`@("`@("`@
  242. XM(%A/3T]/;UAO6$\K6$\@("`@0"M/*T!O6%A/6"LK(R,K(R,K6&]O6&]/*UA`
  243. XM3T]O("`@("`@($!86&]/6&]83UA8*R`@("`@("`@("`@("`@("`@("`@("`@
  244. XM("`@("`@("`@("`@("`@("`@("`@($]8;T]/6&]/6%AO(BP*(EA86"M8;T]O
  245. XM6%A/3R`@("`@("`@(%A83UA/6&]`6&]O3R`@("!83UA/6%A8;UA/3T\@("`@
  246. XM0&]8;UA`;T]/6&]8("`@("`@("`@("!86&]83T]/(UA83RL@("`@6%A8*UAO
  247. XM3V]86$]/("`@("`@("`@6%A/6$]8;T!8;V]/("`@("`@("`@("`@("`@("`@
  248. XM("`@("`@("`@("!8+BY8+E@N+BY8+BXN6"`@("`@("`@("`@6&]83T]/(UA8
  249. XM3R`@($!O6&]80&]/3UAO6"`@("`@("`@("`@6%AO6$]/3R-86$]8*R`@("!`
  250. XM;UAO6$!O3T]8;U@@("`@("`@("`@(%A8;UA/3T\C6%A/6"L@("`@6&]/;UAO
  251. XM*V]O6%@K("`@("`C(V\K6$]/3V]O3UA/("`@("`@(%A/6%A8;UA/3T]O*R`@
  252. XM("`@("`@("`@("`@("`@("`@(%@N+E@N6"XN+E@N+BY8("`@("`@("`@("!8
  253. XM;UA/3T\C6%A/(BP*(F]83UAO3V]/0%A8*R`@("`@("`@(&]8;V]8;T]80$]O
  254. XM*R`@("!O3UA/6$]86&]/3RL@("`@($]/*T!O6%A/6"LK;R`@("`@("`@(%A/
  255. XM*UA`3T\K3T]O3RL@("`@;UA/6&]/;T]`6%@K("`@("`@("`@;UAO;UAO3UA`
  256. XM3V\K("`@("`@("`@("`@("`@("`@("`@("`@("`@("!O6"M/*T!O6%A/6"LK
  257. XM;R`@("`@("`@("!8*UA`3T\K3T]O3R`@("!/3RM`;UA83U@K*V\@("`@("`@
  258. XM("!83RM80$]/*T]/;T]O*R`@("`@3T\K0&]86$]8*RMO("`@("`@("`@6$\K
  259. XM6$!/3RM/3V]/;RL@("`@;V]/;T]86%AO;V\K("`@("`@*T]/3RLK*V]/*T!`
  260. XM;R`@("`@(&]/6$]86&]/3V]/*R`@("`@("`@("`@("`@("`@("`@(&]8*T\K
  261. XM0&]86$]8*RMO("`@("`@("`@(%@K6$!/3RM/3V]/(BP*(D!/;T]86&]86&]8
  262. XM*R`@("`@("`@($!83V]/3V]/3V]/*R`@("!`;UAO6%AO*V]/6"L@("`@($!/
  263. XM;UAO*V]O6%A86%@@("`@("`@6$]/3V]O3V]8;T!`*T\@("`@0$]O3UA8;UA8
  264. XM;U@K("`@("`@("`@0%A/;T]/;T]/;T\K("`@("`@("`@("`@("`@("`@("`@
  265. XM("`@("`@("!83V]/;UAO*V]O6%A86%@@("`@("`@(%A/3V]O3UA/*UA83R`@
  266. XM("!`3V]8;RMO;UA86%A8("`@("`@(%A/3T]O;T]83RM86%@K("`@("`@0$]O
  267. XM6&\K;V]86%A86"`@("`@("!83T]/;V]/6$\K6%A8*R`@("`@0&]83V]O6%A8
  268. XM*T]/("`@("`@("M`3T]8;V\K;UA`;R`@("`@($!O6%AO*V]/6%A/*R`@("`@
  269. XM("`@("`@("`@("`@("`@(%A/;T]O6&\K;V]86%A86"`@("`@("`@6$]/;V]/
  270. XM6$\K6%A/(BP*(D!/3UA86$]86$]/*R`@("`@("`@($!`3T]8;V]O6$]O*R`@
  271. XM("!`;T]86%A`6&]/3RL@("`@("!/;T]86%AO;V]/6%@N+B`@(%@N3RLK*V]/
  272. XM6%A8*T]83RL@("`@0$]/6%A83UA83T\K("`@("`@("`@0$!/3UAO;V]83V\K
  273. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("!O6&]/;T]86%AO;V]/6%@N
  274. XM6"Y8+BY8+BLK*V]/*T!`;UAO*R`@("`@3V]/6%A8;V]O3UA8+BX@("!8+D\K
  275. XM*RMO3RM`0&]8;T\K("`@("`@($]O3UA86&]O;T]86"XN("`@6"Y/*RLK;T\K
  276. XM0$!O6&]/*R`@("`@0"M80%A83UA86$\K("`@("`@("M/6&]/3T]8(T]/;R`@
  277. XM("`@($!86%A`6&]/3UA/3RY8+BXN+E@N6"XN6"XN+E@N3R`@(&]8;T]O3UA8
  278. XM6&]O;T]86"Y8+E@N+E@N*RLK;T\K0$!O6&\K(BP*(D!86%@K3V]86$!/3R`@
  279. XM("`@("`@($!/;V]`3V]/3V]O*R`@("!`;UAO3T]O6%A/;RL@("`@("!/3V]O
  280. XM6%A8*T]/3V]86"XN+EA`3T]8;V\K3V]/3RM/3RL@("`@0%A86"M/;UA80$]/
  281. XM("`@("`@("`@0$]O;T!/;T]/;V\K("`@("`@("`@("`@("`@("`@("`@("`@
  282. XM("`@("`@3V]83V]O6%A8*T]/3V]86%AO6%A`3T]8;V\K;UA`3T]/("`@("`@
  283. XM3T]O;UA86"M/3T]O6%@N+BY80$]/6&]O*V]80$]/3RL@("`@("`@($]/;V]8
  284. XM6%@K3T]/;UA8+BXN6$!/3UAO;RMO6$!/3T\K("`@("`@0$]8;V]O6$]86%@K
  285. XM("`@("`@("!/;T!/6$]/;T]/6&\@("`@($!O3T]O6%A/;V]/3T]O;U@K6$]O
  286. XM(UA86$]/6"-O*R`@("!/;UA/;V]86%@K3T]/;UA86&]86$!/3UAO;RMO6$!/
  287. XM3T\@(BP*(F]86%A/3T]/6&]8*R`@("`@("`@(&]O;T\K6&]8;T]83R`@("!O
  288. XM;UA/3UA/;UA/3T\@("`@("`@3UA83UA86$]83UAO6$]83V]/6&]/3T]83V]8
  289. XM;T!`*RL@("`@;UA86$]/3T]8;U@K("`@("`@("`@;V]O3RM8;UAO3UA/("`@
  290. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@;RM80%A83UA86$]83UAO6$]8
  291. XM3V]/6&]/3T]8(T]/;T\K("`@("`@($]86$]86%A/6$]8;UA/6$]O3UAO3T]/
  292. XM6"-/3V]/(R`@("`@("`@("!/6%A/6%A83UA/6&]83UA/;T]8;T]/3U@C3T]O
  293. XM3R,@("`@("`@;UA86%A/3UAO;V]/("`@("`@("!/(T]83UAO;RMO3U@@("`@
  294. XM(&]/3UA/;UA/3V\K;T]O3T]/*T]/;V]83V]83T]O3R`@("!O*UA`6%A/6%A8
  295. XM3UA/6&]83UA/;T]8;T]/3U@C3T]O3RL@(BP*(D!/3V]/;UA83T]/*R`@("`@
  296. XM("`@($!O3RM/0%@K;R-8*R`@("!`*T]/3T]83V\K6"L@("`@("`@($]O6$]8
  297. XM6%A/*UAO*RM/6"M/;T!/6$]/6%A8*T]83RL@("`@0$]/;T]O6%A/3T\K("`@
  298. XM("`@("`@0&]/*T]`6"MO(U@K("`@("`@("`@("`@("`@("`@("`@("`@("`@
  299. XM("`@($]8;V]O6$]86%A/*UAO*RM/6"M/;T!/6$]/;T]/6$\@("`@("`@("!/
  300. XM;UA/6%A83RM8;RLK3U@K3V]`3UA/3V]/3U@K("`@("`@("`@("`@3V]83UA8
  301. XM6$\K6&\K*T]8*T]O0$]83T]O3T]8*R`@("`@("`@0$]/3T]/6&]/;V\K("`@
  302. XM("`@("!`3UA`6&]86&]/6&\@("`@($!/3T]83V\K6$]83V]/;UAO*V]`0&\K
  303. XM3V]O*T]/*R`@("`@3UAO;V]83UA86$\K6&\K*T]8*T]O0$]83T]O3T]83R`@
  304. XM(BP*(D!/;RM86%A/6&]O*R`@("`@("`@($!O3V]/;V]O;T]8*R`@("!`3T]8
  305. XM*UA86%A83RL@("`@("`@("`K3UAO;V]O;UA/3V]O3V]8(T]83UAO3V]/3RM/
  306. XM3T\@("`@0$]O*UA86$]8;V\K("`@("`@("`@0&]/;T]O;V]O3U@K("`@("`@
  307. XM("`@("`@("`@("`@("`@("`@("`@("`@("!/6%A/3UAO;V]O;UA/3V]O3V]8
  308. XM(T]83UAO;RMO*R`@("`@("`@("`@*T]8;V]O;V]83T]O;T]O6"-/6$]8;V\K
  309. XM;RL@("`@("`@("`@("`@("M/6&]O;V]O6$]/;V]/;U@C3UA/6&]O*V\K("`@
  310. XM("`@("`@0&]8*RMO3UAO3U@K("`@("`@("!/6&]`3RM/3V]O3V]8("`@($!8
  311. XM*UA86%A83T!80$]O3T\C*V]83UA/0$`K;T\K*R`@("`@($]86$]/6&]O;V]O
  312. XM6$]/;V]/;U@C3UA/6&]O*V\K("`@(BP*(D!/6%A/3UA/6$]O3R`@("`@("`@
  313. XM($!O*V]O;UAO;V]8*R`@("!`6&]86"MO3V]/3RL@("`@("`@("`@*V]/;V]8
  314. XM;V]8;T]8;T]/3UA`6&]83UA8(T]/3RL@("`@0$]86$]/6$]83V]/("`@("`@
  315. XM("`@0&\K;V]O6&]O;U@K("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  316. XM("`@3T]/6&]/;V]8;V]8;T]8;T]/3UA`6&]86&]/("`@("`@("`@("`@("MO
  317. XM3V]O6&]O6&]/6&]/3T]80%AO6%@C*R`@("`@("`@("`@("`@("`K;T]O;UAO
  318. XM;UAO3UAO3T]/6$!8;UA8(RL@("`@("`@("`@0&]O3T]8;V\K0"LK("`@("`@
  319. XM("`@0&]O3UAO;T]86%A8("`@($!86"MO3V]/3V]/3V]`3V]O;T]O;V]/*V]/
  320. XM;RMO*R`@("`@("!/3T]8;T]O;UAO;UAO3UAO3T]/6$!8;UA8;T\@("`@(BP*
  321. XM(D!/6"M8;UA/3V]O*R`@("`@("`@($!/3T]O3V]`3UA/*R`@("!`3V]86&]/
  322. XM6%AO3RL@("`@("`@("`@("LK3UAO6%A86%A/;T`K6&]`3RLK*T!/6%AO;RL@
  323. XM("`@0$]8*UAO6$]/;V\K("`@("`@("`@0$]/3V]/;T!/6$\K("`@("`@("`@
  324. XM("`@("`@("`@("`@("`@("`@("`@("`@("LK3UAO3UAO6%A86%A/;T`K6&]`
  325. XM3RM/3RL@("`@("`@("`@("`@("`K*T]8;UA86%A83V]`*UAO0$\K3RL@("`@
  326. XM("`@("`@("`@("`@("`@*RM/6&]86%A86$]O0"M8;T!/*T\K("`@("`@("`@
  327. XM("`@0&]O6$]/;T]O6&\C("`@("`@("`@0$]/;V]/;T]83UAO("`@($!86&]/
  328. XM6%AO3UA83T]83V]/;V]/3V]O3V]/3RLK3R`@("`@("`@*RM/6&]/6&]86%A8
  329. XM6$]O0"M8;T!/*T]/*R`@("`@(BP*(D!O3UA/;T]O3T]8*R`@("`@("`@($`K
  330. XM;V]/3UA/3T]/*R`@("!`3T]86$]/6$]O6"L@("`@("`@("`@("`@*RMO3V]/
  331. XM6$]O;T]/;V]O*RL@*T]/*RM/3RL@("`@0&]/6$]O3V]/3U@K("`@("`@("`@
  332. XM0"MO;T]/6$]/3T\K("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  333. XM("`@*RLK0"MO3V]/6$]O;T]/;V]O3U@K(R`@("`@("`@("`@("`@("`@("LK
  334. XM;T]O3UA/;V]/3V]O;RLK(R`@("`@("`@("`@("`@("`@("`@("`K*V]/;T]8
  335. XM3V]O3T]O;V\K*R,@("`@("`@("`@("`@0$!/3UAO3RMO3T\K("`@("`@("`@
  336. XM($!8;T]O;V]O3V]O6"`@($!86$]/6$]O6$]`*T]83T]/;V]O3T]/0$]8;T`K
  337. XM*R`@("`@("`@("`K*RM`*V]/;T]83V]O3T]O;V]/6"LC("`@("`@(BP*(BLC
  338. XM(R,K(R,C*R,C*R`@("`@("`@("LC(R,K(R,C*R,C*R`@("`K(R,C*R,C(RLC
  339. XM(RL@("`@("`@("`@("`@("`C(RLC6%@C3T`C(R,C("`@*R,C(RLC(RL@("`@
  340. XM*R,C(RLC(R,K(R,K("`@("`@("`@*R,C(RLC(R,K(R,K("`@("`@("`@("`@
  341. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@*R-/3T]`6%@C3T!O*RLC*R,@
  342. XM("`@("`@("`@("`@("`@("`@("`@(R,K(UA8(T]`(R,C(R`@("`@("`@("`@
  343. XM("`@("`@("`@("`@("`@(",C*R-86&]/0",C(R,@("`@("`@("`@("`@("`@
  344. XM*R,C*R,K(R,C(R,K("`@("`@("`@("LC(RLC(R,K(R,C*R`@("LC(R,C*R,C
  345. XM(R,C(R,C*R,C(R,C(RLC(R,C(R,C*R`@("`@("`@("`@("`K(T]/3T!86"-/
  346. XM0&\K*R,K(R`@("`@("`@(BP*(B`@("`@("`@("`@("`@("`@("`@("`@("`@
  347. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`K(R,C
  348. XM(R,K("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  349. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  350. XM("`@("`C(RLC(R,K(R,C("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  351. XM(",C(R,C*R`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("LC(R,C
  352. XM(RL@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  353. XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
  354. XH("`@("`@("`@("`@(",C*R,C(RLC(R,@("`@("`@("`@("`@(GT["B`@
  355. X`
  356. Xend
  357. END_OF_FILE
  358. if test 19805 -ne `wc -c <'bitmaps/highscores.xpm.uu'`; then
  359.     echo shar: \"'bitmaps/highscores.xpm.uu'\" unpacked with wrong size!
  360. fi
  361. # end of 'bitmaps/highscores.xpm.uu'
  362. fi
  363. if test -f 'bonus.c' -a "${1}" != "-c" ; then 
  364.   echo shar: Will not clobber existing file \"'bonus.c'\"
  365. else
  366. echo shar: Extracting \"'bonus.c'\" \(19041 characters\)
  367. sed "s/^X//" >'bonus.c' <<'END_OF_FILE'
  368. X#include "include/copyright.h"
  369. X
  370. X/*
  371. X *  Include file dependencies:
  372. X */
  373. X
  374. X#include <stdio.h>
  375. X#include <stdlib.h>
  376. X#include <stddef.h>
  377. X#include <X11/Xlib.h>
  378. X#include <X11/Xutil.h>
  379. X#include <X11/Xos.h>
  380. X#include <xpm.h>
  381. X
  382. X#include "include/error.h"
  383. X#include "include/audio.h"
  384. X#include "include/highscore.h"
  385. X#include "include/misc.h"
  386. X#include "include/main.h"
  387. X#include "include/gun.h"
  388. X#include "include/init.h"
  389. X#include "include/stage.h"
  390. X#include "include/blocks.h"
  391. X#include "include/sfx.h"
  392. X#include "include/ball.h"
  393. X#include "include/score.h"
  394. X#include "include/paddle.h"
  395. X#include "include/level.h"
  396. X#include "include/mess.h"
  397. X#include "include/intro.h"
  398. X
  399. X#include "bitmaps/titleSmall.xpm"
  400. X
  401. X#include "include/bonus.h"
  402. X
  403. X/*
  404. X *  Internal macro definitions:
  405. X */
  406. X
  407. X#define GAP                    30
  408. X#define KEY_TYPE_VOL        50
  409. X#define LINE_DELAY            15
  410. X
  411. X#define BONUS_SCORE            3000
  412. X#define SUPER_BONUS_SCORE    50000
  413. X#define BULLET_SCORE        500
  414. X#define LEVEL_SCORE            1000
  415. X#define TIME_BONUS            100
  416. X
  417. X#define BORDER_LEFT            55
  418. X#define BORDER_RIGHT        ((PLAY_WIDTH + MAIN_WIDTH) - 50)
  419. X#define BORDER_TOP            73
  420. X#define BORDER_BOTTOM        ((PLAY_HEIGHT + MAIN_HEIGHT) - 85)
  421. X
  422. X/*
  423. X *  Internal type declarations:
  424. X */
  425. X
  426. X#if NeedFunctionPrototypes
  427. Xstatic void DoBullets(Display *display, Window window);
  428. Xstatic void DoTimeBonus(Display *display, Window window);
  429. X#else
  430. Xstatic void DoTimeBonus();
  431. Xstatic void DoBullets();
  432. X#endif
  433. X
  434. X/*
  435. X *  Internal variable declarations:
  436. X */
  437. X
  438. Xstatic int         nextFrame = 0;
  439. Xstatic int         count, numBonus;
  440. Xenum BonusStates BonusState;
  441. Xstatic Pixmap     titlePixmap, titlePixmapM;
  442. Xstatic int         ypos;
  443. Xstatic int         waitingFrame, waitMode;
  444. Xstatic char     string[80];
  445. Xstatic Pixmap     backingStoreTitle = (Pixmap) NULL;
  446. Xstatic u_long     bonusScore;
  447. Xstatic int         firstTime = True;
  448. X
  449. X
  450. X#if NeedFunctionPrototypes
  451. Xvoid SetUpBonus(Display *display, Window window, Colormap colormap)
  452. X#else
  453. Xvoid SetUpBonus(display, window, colormap)
  454. X    Display *display;
  455. X    Window window;
  456. X    Colormap colormap;
  457. X#endif
  458. X{
  459. X    XpmAttributes   attributes;
  460. X    int             XpmErrorStatus;
  461. X
  462. X    attributes.valuemask = XpmColormap;
  463. X    attributes.colormap = colormap;
  464. X
  465. X    /* Create the small title pixmap */
  466. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, titleSmall_xpm,
  467. X        &titlePixmap, &titlePixmapM, &attributes);
  468. X    HandleXPMError(display, XpmErrorStatus, "InitialiseBonus()");
  469. X
  470. X    /* Free the xpm pixmap attributes */
  471. X    XpmFreeAttributes(&attributes);
  472. X}
  473. X
  474. X#if NeedFunctionPrototypes
  475. Xvoid DecNumberBonus(void)
  476. X#else
  477. Xvoid DecNumberBonus()
  478. X#endif
  479. X{
  480. X    /* bump down the number of bonuses. sic */
  481. X    numBonus--;
  482. X}
  483. X
  484. X#if NeedFunctionPrototypes
  485. Xvoid IncNumberBonus(void)
  486. X#else
  487. Xvoid IncNumberBonus()
  488. X#endif
  489. X{
  490. X    /* bump up the number of bonuses. sic */
  491. X    numBonus++;
  492. X}
  493. X
  494. X#if NeedFunctionPrototypes
  495. Xint GetNumberBonus(void)
  496. X#else
  497. Xint GetNumberBonus()
  498. X#endif
  499. X{
  500. X    /* Umm - return the number of bonuses */
  501. X    return numBonus;
  502. X}
  503. X
  504. X#if NeedFunctionPrototypes
  505. Xvoid ResetNumberBonus(void)
  506. X#else
  507. Xvoid ResetNumberBonus()
  508. X#endif
  509. X{
  510. X    /* No more bonuses thanks */
  511. X    numBonus = 0;
  512. X}
  513. X
  514. X#if NeedFunctionPrototypes
  515. Xvoid DrawBallBorder(Display *display, Window window)
  516. X#else
  517. Xvoid DrawBallBorder(display, window)
  518. X    Display *display;
  519. X    Window window;
  520. X#endif
  521. X{
  522. X    int x, y;
  523. X    static int slide = 0;
  524. X
  525. X    /* Draw a row of balls along the top and bottom of screen */
  526. X    for (x = BORDER_LEFT; x < BORDER_RIGHT; x += 22)
  527. X    {
  528. X        DrawTheBall(display, window, x, BORDER_TOP, slide);
  529. X        DrawTheBall(display, window, x, BORDER_BOTTOM, slide);
  530. X
  531. X        /* Next frame of ball animation */
  532. X        slide++;
  533. X
  534. X        /* Wrap around animation */
  535. X        if (slide == BALL_SLIDES) slide = 0;
  536. X    }
  537. X
  538. X    /* Draw a row of balls along both sides of the screen */
  539. X    for (y = BORDER_TOP; y < BORDER_BOTTOM; y += 22)
  540. X    {
  541. X        DrawTheBall(display, window, BORDER_LEFT, y, slide);
  542. X        DrawTheBall(display, window, BORDER_RIGHT, y, slide);
  543. X
  544. X        /* Next frame of ball animation */
  545. X        slide++;
  546. X
  547. X        /* Wrap around animation */
  548. X        if (slide == BALL_SLIDES) slide = 0;
  549. X    }
  550. X
  551. X}
  552. X
  553. X#if NeedFunctionPrototypes
  554. Xvoid DrawSmallIntroTitle(Display *display, Window window, int x, int y)
  555. X#else
  556. Xvoid DrawSmallIntroTitle(display, window, x, y)
  557. X    Display *display;
  558. X    Window window;
  559. X    int x;
  560. X    int y;
  561. X#endif
  562. X{
  563. X    /* Draw the small title pixmap */
  564. X    RenderShape(display, window, titlePixmap, titlePixmapM,
  565. X        x - SMALL_TITLE_WC, y - SMALL_TITLE_HC, 
  566. X        SMALL_TITLE_WIDTH, SMALL_TITLE_HEIGHT, False);
  567. X}
  568. X
  569. X#if NeedFunctionPrototypes
  570. Xvoid MoveSmallIntroTitle(Display *display, Window window, int x, int y)
  571. X#else
  572. Xvoid MoveSmallIntroTitle(display, window, x, y)
  573. X    Display *display;
  574. X    Window window;
  575. X    int x;
  576. X    int y;
  577. X#endif
  578. X{
  579. X    static int oldx, oldy;
  580. X
  581. X    /* Make a copy of the new titles position */
  582. X    if (backingStoreTitle != (Pixmap) NULL)
  583. X        XCopyArea(display, backingStoreTitle, window, gc,
  584. X            0, 0, SMALL_TITLE_WIDTH, SMALL_TITLE_HEIGHT, oldx, oldy);
  585. X    else
  586. X    {
  587. X        /* Create a pixmap for the backing store title */
  588. X        backingStoreTitle = XCreatePixmap(display, window,
  589. X            SMALL_TITLE_WIDTH, SMALL_TITLE_HEIGHT,
  590. X            DefaultDepth(display, XDefaultScreen(display)));
  591. X    }
  592. X
  593. X    /* Update the variables for the title position */
  594. X    oldx = x - SMALL_TITLE_WC; oldy = y - SMALL_TITLE_HC;
  595. X
  596. X    /* Copy back the old position picture */
  597. X    if (backingStoreTitle)
  598. X        XCopyArea(display, window, backingStoreTitle, gc,
  599. X            x - SMALL_TITLE_WC, y - SMALL_TITLE_HC, 
  600. X            SMALL_TITLE_WIDTH, SMALL_TITLE_HEIGHT, 0, 0);
  601. X
  602. X    DrawSmallIntroTitle(display, window, x, y);
  603. X}
  604. X
  605. X
  606. X#if NeedFunctionPrototypes
  607. Xvoid SetupBonusScreen(Display *display, Window window)
  608. X#else
  609. Xvoid SetupBonusScreen(display, window)
  610. X    Display *display;
  611. X    Window window;
  612. X#endif
  613. X{
  614. X    /* Clear the background again */
  615. X    ClearMainWindow(display, window);
  616. X
  617. X    /* Draw the rectangular border of balls */
  618. X    DrawBallBorder(display, window);
  619. X
  620. X    /* Draw the main title pixmap */
  621. X    DrawSmallIntroTitle(display, window, TOTAL_WIDTH / 2, 120);
  622. X
  623. X    /* The new state will be the text */
  624. X    ResetBonus();
  625. X
  626. X    /* Remove the window to show bonus stuff */
  627. X    while (WindowFadeEffect(display, playWindow));
  628. X    XUnmapWindow(display, playWindow);
  629. X}
  630. X
  631. X#if NeedFunctionPrototypes
  632. Xvoid DrawTitleText(Display *display, Window window)
  633. X#else
  634. Xvoid DrawTitleText(display, window)
  635. X    Display *display;
  636. X    Window window;
  637. X#endif
  638. X{
  639. X    SetCurrentMessage(display, messWindow, "- Bonus Tally -", True);
  640. X    
  641. X    /* Indicate which level the bonus is for */
  642. X    sprintf(string, "- Level %d -", level);
  643. X    DrawShadowCentredText(display, window, titleFont, 
  644. X        string, ypos, red, TOTAL_WIDTH);
  645. X    ypos += (titleFont->ascent + GAP);
  646. X
  647. X    strcpy(string, "Press space for next level");
  648. X    DrawShadowCentredText(display, window, textFont, 
  649. X        string, PLAY_HEIGHT - 12, tann, TOTAL_WIDTH);
  650. X
  651. X    BonusState = BONUS_SCORE;
  652. X
  653. X    /* Just in case it has changed */
  654. X    SetGameSpeed(FAST_SPEED);
  655. X}
  656. X
  657. X#if NeedFunctionPrototypes
  658. Xstatic void DoScore(Display *display, Window window)
  659. X#else
  660. Xstatic void DoScore(display, window)
  661. X    Display *display;
  662. X    Window window;
  663. X#endif
  664. X{
  665. X    SetGameSpeed(MEDIUM_SPEED);
  666. X
  667. X    /* Nice message rewarding you for your efforts */
  668. X    strcpy(string, "Congratulations on finishing this level.");
  669. X    DrawShadowCentredText(display, window, textFont, 
  670. X        string, ypos, white, TOTAL_WIDTH);
  671. X    XFlush(display);
  672. X
  673. X    count = 0;
  674. X    ypos += (35 + GAP);
  675. X    SetBonusWait(BONUS_BONUS, frame + LINE_DELAY);
  676. X    SetGameSpeed(SLOW_SPEED);
  677. X}
  678. X
  679. X#if NeedFunctionPrototypes
  680. Xstatic void DoBonuses(Display *display, Window window)
  681. X#else
  682. Xstatic void DoBonuses(display, window)
  683. X    Display *display;
  684. X    Window window;
  685. X#endif
  686. X{
  687. X    int x, plen;
  688. X    static int maxLen;
  689. X
  690. X    if (firstTime)
  691. X    {
  692. X        /* Set up the bonus coin sequence */
  693. X        firstTime = False;
  694. X
  695. X        if (numBonus == 0)
  696. X        {
  697. X            /* No bonus coins - so tell user */
  698. X            strcpy(string, "Sorry, no bonus coins collected.");
  699. X            DrawShadowCentredText(display, window, textFont, 
  700. X                string, ypos, blue, TOTAL_WIDTH);
  701. X
  702. X            SetGameSpeed(MEDIUM_SPEED);
  703. X
  704. X            /* Now skip to the next sequence */
  705. X            SetBonusWait(BONUS_LEVEL, frame + LINE_DELAY);
  706. X            count = 0;
  707. X            firstTime = True;
  708. X            ypos += (textFont->ascent + GAP * 2);
  709. X            return;
  710. X        }
  711. X
  712. X        if (numBonus > MAX_BONUS)
  713. X        {
  714. X            /* Play the sound for the super bonus */
  715. X            if (noSound == False) 
  716. X                playSoundFile("superbonus", 80);
  717. X
  718. X            /* More than 10 coins collected - super bonus reward */
  719. X            sprintf(string, "Super Bonus - %d", SUPER_BONUS_SCORE);
  720. X                DrawShadowCentredText(display, window, titleFont, 
  721. X                    string, ypos, blue, TOTAL_WIDTH);
  722. X
  723. X            /* Update the score with more points */
  724. X            bonusScore += SUPER_BONUS_SCORE;
  725. X            DisplayScore(display, scoreWindow, bonusScore);
  726. X    
  727. X            SetGameSpeed(MEDIUM_SPEED);
  728. X
  729. X            /* Now skip to the next sequence */
  730. X            SetBonusWait(BONUS_LEVEL, frame + LINE_DELAY);
  731. X            count = 0;
  732. X            firstTime = True;
  733. X            ypos += (textFont->ascent + GAP * 2);
  734. X            return;
  735. X        }
  736. X
  737. X        /* Calculate where to draw these coins centred */
  738. X        maxLen = ((numBonus * 27) + (10 * numBonus) + 5);
  739. X    }
  740. X
  741. X    /* Find out where the next bonus coin will go next */
  742. X    plen = ((numBonus * 27) + (10 * numBonus));
  743. X    x = (((PLAY_WIDTH + MAIN_WIDTH) / 2) + (maxLen / 2)) - plen;
  744. X
  745. X    /* Draw the bonus coin shape */
  746. X    DrawTheBlock(display, window, x, ypos, BONUS_BLK, 0);
  747. X
  748. X    /* Play the sound for the bonus */
  749. X    if (noSound == False) 
  750. X        playSoundFile("bonus", 50);
  751. X
  752. X    /* Increment the score by the value of the bonus */
  753. X    bonusScore += BONUS_SCORE;
  754. X    DisplayScore(display, scoreWindow, bonusScore);
  755. X
  756. X    /* Reduce number of bonuses */
  757. X    DecNumberBonus();
  758. X
  759. X    if (numBonus <= 0)
  760. X    {
  761. X        /* Set up bonus state for next sequence */
  762. X        SetBonusWait(BONUS_LEVEL, frame + LINE_DELAY);
  763. X        count = 0;
  764. X
  765. X        /* Make sure bonus is reset */
  766. X        ResetNumberBonus();
  767. X
  768. X        ypos += (textFont->ascent + GAP * 1.5);
  769. X        firstTime = True;
  770. X
  771. X        SetGameSpeed(MEDIUM_SPEED);
  772. X    }
  773. X}
  774. X
  775. X#if NeedFunctionPrototypes
  776. Xstatic void DoLevel(Display *display, Window window)
  777. X#else
  778. Xstatic void DoLevel(display, window)
  779. X    Display *display;
  780. X    Window window;
  781. X#endif
  782. X{
  783. X    int secs, theLevel;
  784. X
  785. X    SetGameSpeed(MEDIUM_SPEED);
  786. X
  787. X    /* Get the number of seconds left on the clock */
  788. X    secs = GetLevelTimeBonus();
  789. X
  790. X    if (secs > 0)
  791. X    {
  792. X        /* Adjust the level so that the starting level is taken into account */
  793. X        theLevel = (int) level - GetStartingLevel() + 1;
  794. X
  795. X        /* Draw level bonus text */
  796. X        sprintf(string, "Level bonus - level %d x %d = %d points", 
  797. X            theLevel, LEVEL_SCORE, theLevel * LEVEL_SCORE);
  798. X        DrawShadowCentredText(display, window, textFont, 
  799. X            string, ypos, yellow, TOTAL_WIDTH);
  800. X
  801. X        /* Increment the score by the value of the level bonus */
  802. X        bonusScore += (LEVEL_SCORE * theLevel);
  803. X        DisplayScore(display, scoreWindow, bonusScore);
  804. X    }
  805. X    else
  806. X    {
  807. X        strcpy(string, "No level bonus - Timer ran out.");
  808. X        DrawShadowCentredText(display, window, textFont, 
  809. X            string, ypos, yellow, TOTAL_WIDTH);
  810. X    }
  811. X
  812. X    count = 0;
  813. X
  814. X    /* Next section setup */
  815. X    ypos += (textFont->ascent + GAP * 1.5);
  816. X    SetBonusWait(BONUS_BULLET, frame + LINE_DELAY);
  817. X}
  818. X
  819. X#if NeedFunctionPrototypes
  820. Xstatic void DoBullets(Display *display, Window window)
  821. X#else
  822. Xstatic void DoBullets(display, window)
  823. X    Display *display;
  824. X    Window window;
  825. X#endif
  826. X{
  827. X    int x, plen;
  828. X    static int maxLen;
  829. X
  830. X    if (firstTime)
  831. X    {
  832. X        /* For the first time setup the bullet bonus seq. */
  833. X        firstTime = False;
  834. X
  835. X        if (GetNumberBullets() == 0)
  836. X        {
  837. X            /* No bullets - say so */
  838. X            strcpy(string, "You have used all your bullets. No bonus!");
  839. X            DrawShadowCentredText(display, window, textFont, 
  840. X                string, ypos, blue, TOTAL_WIDTH);
  841. X            
  842. X            SetGameSpeed(MEDIUM_SPEED);
  843. X
  844. X            /* Get ready for the next sequence */
  845. X            SetBonusWait(BONUS_TIME, frame + LINE_DELAY);
  846. X            count = 0;
  847. X            firstTime = True;
  848. X            ypos += (textFont->ascent + GAP/2);
  849. X            return;
  850. X        }
  851. X
  852. X        /* Position where the first bullet will be drawn */
  853. X        maxLen = ((GetNumberBullets() * 7) + (3 * GetNumberBullets()));
  854. X    }
  855. X
  856. X    /* Find out where the next bonus bullet will go next */
  857. X    plen = ((GetNumberBullets() * 7) + (3 * GetNumberBullets()));
  858. X    x = (((PLAY_WIDTH + MAIN_WIDTH) / 2) + (maxLen / 2)) - plen;
  859. X
  860. X    DrawTheBullet(display, window, x, ypos);
  861. X
  862. X    /* Play the sound for the bullets */
  863. X    if (noSound == False) 
  864. X        playSoundFile("key", 50);
  865. X
  866. X    /* Increment the score by the value of the bullet bonus */
  867. X    bonusScore += BULLET_SCORE;
  868. X    DisplayScore(display, scoreWindow, bonusScore);
  869. X
  870. X    /* Ummm. Draw a bullet */
  871. X    DeleteABullet(display);    
  872. X
  873. X    if (GetNumberBullets() == 0)
  874. X    {
  875. X        /* Reset bullets and get ready for next sequence */
  876. X        SetBonusWait(BONUS_TIME, frame + LINE_DELAY);
  877. X        count = 0;
  878. X        ypos += (textFont->ascent + GAP/2);
  879. X        firstTime = True;
  880. X        SetGameSpeed(MEDIUM_SPEED);
  881. X    }
  882. X}
  883. X
  884. X#if NeedFunctionPrototypes
  885. Xstatic void DoTimeBonus(Display *display, Window window)
  886. X#else
  887. Xstatic void DoTimeBonus(display, window)
  888. X    Display *display;
  889. X    Window window;
  890. X#endif
  891. X{
  892. X    int secs = 0;
  893. X
  894. X    SetGameSpeed(MEDIUM_SPEED);
  895. X
  896. X    /* Get the number of seconds left on the clock */
  897. X    secs = GetLevelTimeBonus();
  898. X
  899. X    if (secs > 0)
  900. X    {
  901. X        /* Draw time bonus text */
  902. X        sprintf(string, "Time bonus - %d seconds x %d = %d points", 
  903. X            secs, TIME_BONUS, secs * TIME_BONUS);
  904. X        DrawShadowCentredText(display, window, textFont, 
  905. X            string, ypos, yellow, TOTAL_WIDTH);
  906. X
  907. X        /* Increment the score by the value of the time bonus */
  908. X        bonusScore += (TIME_BONUS * secs);
  909. X        DisplayScore(display, scoreWindow, bonusScore);
  910. X    }
  911. X    else
  912. X    {
  913. X        /* Draw no time bonus text */
  914. X        strcpy(string, "No time bonus - not quick enough!");
  915. X        DrawShadowCentredText(display, window, textFont, 
  916. X            string, ypos, yellow, TOTAL_WIDTH);
  917. X    }
  918. X
  919. X    /* Next section setup */
  920. X    ypos += (textFont->ascent + GAP/2);
  921. X    SetBonusWait(BONUS_HSCORE, frame + LINE_DELAY);
  922. X    count = 0;
  923. X}
  924. X
  925. X#if NeedFunctionPrototypes
  926. Xstatic void DoHighScore(Display *display, Window window)
  927. X#else
  928. Xstatic void DoHighScore(display, window)
  929. X    Display *display;
  930. X    Window window;
  931. X#endif
  932. X{
  933. X    int myrank = 0;
  934. X    char str[5];
  935. X
  936. X    SetGameSpeed(MEDIUM_SPEED);
  937. X
  938. X    /* Obtain current ranking for this score */
  939. X    myrank = GetHighScoreRanking(score);
  940. X
  941. X    if (myrank > 0)
  942. X    {
  943. X        /* Special case for first place */
  944. X        if (myrank == 1)
  945. X            sprintf(string, "You are ranked 1st. Well done!");
  946. X        else
  947. X        {
  948. X            /* Add the correct grammer for the sentence */
  949. X            switch (myrank)
  950. X            {
  951. X                case 1:
  952. X                    strcpy(str, "st");
  953. X                    break;
  954. X                
  955. X                case 2:
  956. X                    strcpy(str, "nd");
  957. X                    break;
  958. X                
  959. X                case 3:
  960. X                    strcpy(str, "rd");
  961. X                    break;
  962. X                
  963. X                case 4:
  964. X                case 5:
  965. X                case 6:
  966. X                case 7:
  967. X                case 8:
  968. X                case 9:
  969. X                case 10:
  970. X                    strcpy(str, "th");
  971. X                    break;
  972. X                
  973. X                default:
  974. X                    strcpy(str, "");
  975. X                    break;
  976. X            }
  977. X
  978. X            /* Construct beautiful sentence */
  979. X            sprintf(string, "You are currently ranked %d%s.", 
  980. X                myrank, str);
  981. X        }
  982. X    }
  983. X    else
  984. X        /* What a loser ;-) */
  985. X        strcpy(string, "You haven't even qualified for a highscore!");
  986. X
  987. X    /* Draw the text for the game ranking */
  988. X    DrawShadowCentredText(display, window, textFont, 
  989. X        string, ypos, red, TOTAL_WIDTH);
  990. X    ypos += (textFont->ascent + GAP/2);
  991. X
  992. X    count = 0;
  993. X    SetBonusWait(BONUS_END_TEXT, frame + LINE_DELAY);
  994. X}
  995. X
  996. X#if NeedFunctionPrototypes
  997. Xstatic void DoEndText(Display *display, Window window)
  998. X#else
  999. Xstatic void DoEndText(display, window)
  1000. X    Display *display;
  1001. X    Window window;
  1002. X#endif
  1003. X{
  1004. X    SetGameSpeed(MEDIUM_SPEED);
  1005. X
  1006. X    /* Finishing sentence - so you know what level to do */
  1007. X    sprintf(string, "Prepare for level %d", level+1);
  1008. X    DrawShadowCentredText(display, window, textFont, 
  1009. X        string, ypos, yellow, TOTAL_WIDTH);
  1010. X    XFlush(display);
  1011. X
  1012. X    count = 0;
  1013. X    SetBonusWait(BONUS_FINISH, frame + 60);
  1014. X}
  1015. X
  1016. X#if NeedFunctionPrototypes
  1017. Xstatic void DoFinish(Display *display, Window window)
  1018. X#else
  1019. Xstatic void DoFinish(display, window)
  1020. X    Display *display;
  1021. X    Window window;
  1022. X#endif
  1023. X{
  1024. X    /* Setup game window for the next level */
  1025. X    level++;
  1026. X    SetupStage(display, playWindow);
  1027. X
  1028. X    BonusState = BONUS_TEXT;
  1029. X    SetGameSpeed(FAST_SPEED);
  1030. X
  1031. X    mode = MODE_GAME;
  1032. X
  1033. X    XSetWindowBorder(display, playWindow, red);
  1034. X    XMapWindow(display, playWindow);
  1035. X
  1036. X    /* Only redraw if the server hasn't backing store on */
  1037. X    if (DoesBackingStore(XDefaultScreenOfDisplay(display)) != Always)
  1038. X        SelectiveRedraw(display);
  1039. X}
  1040. X
  1041. X#if NeedFunctionPrototypes
  1042. Xvoid SetBonusWait(int newMode, int waitFrame)
  1043. X#else
  1044. Xvoid SetBonusWait(newMode, waitFrame)
  1045. X    int newMode;
  1046. X    int waitFrame;
  1047. X#endif
  1048. X{
  1049. X    waitingFrame = waitFrame;
  1050. X    waitMode = newMode;
  1051. X    BonusState = BONUS_WAIT;
  1052. X}
  1053. X
  1054. X#if NeedFunctionPrototypes
  1055. Xvoid DoBonusWait(void)
  1056. X#else
  1057. Xvoid DoBonusWait()
  1058. X#endif
  1059. X{
  1060. X    /* Wait for the frame we want to come along - then change modes */
  1061. X    if (frame == waitingFrame)
  1062. X        BonusState = waitMode;
  1063. X}
  1064. X
  1065. X#if NeedFunctionPrototypes
  1066. Xvoid DoBonus(Display *display, Window window)
  1067. X#else
  1068. Xvoid DoBonus(display, window)
  1069. X    Display *display;
  1070. X    Window window;
  1071. X#endif
  1072. X{
  1073. X    /* The states within the bonus mode */
  1074. X    switch (BonusState)
  1075. X    {
  1076. X        case BONUS_TEXT:
  1077. X            DrawTitleText(display, window);
  1078. X            break;
  1079. X
  1080. X        case BONUS_SCORE:
  1081. X            DoScore(display, window);
  1082. X            break;
  1083. X
  1084. X        case BONUS_BONUS:
  1085. X            DoBonuses(display, window);
  1086. X            break;
  1087. X
  1088. X        case BONUS_LEVEL:
  1089. X            DoLevel(display, window);
  1090. X            break;
  1091. X
  1092. X        case BONUS_BULLET:
  1093. X            DoBullets(display, window);
  1094. X            break;
  1095. X
  1096. X        case BONUS_TIME:
  1097. X            DoTimeBonus(display, window);
  1098. X            break;
  1099. X
  1100. X        case BONUS_HSCORE:
  1101. X            DoHighScore(display, window);
  1102. X            break;
  1103. X
  1104. X        case BONUS_END_TEXT:
  1105. X            DoEndText(display, window);
  1106. X            break;
  1107. X
  1108. X        case BONUS_FINISH:
  1109. X            DoFinish(display, window);
  1110. X            break;
  1111. X
  1112. X        case BONUS_WAIT:
  1113. X            DoBonusWait();
  1114. X            break;
  1115. X
  1116. X        default:
  1117. X            break;
  1118. X    }
  1119. X}
  1120. X
  1121. X#if NeedFunctionPrototypes
  1122. Xvoid RedrawBonus(Display *display, Window window)
  1123. X#else
  1124. Xvoid RedrawBonus(display, window)
  1125. X    Display *display;
  1126. X    Window window;
  1127. X#endif
  1128. X{
  1129. X    /* This will redraw the entire screen */
  1130. X    SetupBonusScreen(display, mainWindow);
  1131. X}
  1132. X
  1133. X#if NeedFunctionPrototypes
  1134. Xvoid FreeBonus(Display *display)
  1135. X#else
  1136. Xvoid FreeBonus(display)
  1137. X    Display *display;
  1138. X#endif
  1139. X{
  1140. X    /* Free all the hungry memory leaks */
  1141. X    if (titlePixmap)    XFreePixmap(display, titlePixmap);
  1142. X    if (titlePixmapM)    XFreePixmap(display, titlePixmapM);
  1143. X}
  1144. X
  1145. X#if NeedFunctionPrototypes
  1146. Xvoid ComputeAndAddBonusScore(void)
  1147. X#else
  1148. Xvoid ComputeAndAddBonusScore()
  1149. X#endif
  1150. X{
  1151. X    /* This function will pre compute the bonus score and add it to the
  1152. X     * score. The bonus screen will only change the score by updating the
  1153. X     * score display and not the score value. This means the user can hit
  1154. X     * space and go to the next screen without delay. Cool.
  1155. X     */
  1156. X    int secs = 0;
  1157. X    int theLevel = 0;
  1158. X
  1159. X    /* Compute bonus coin bonus */
  1160. X    if (numBonus > MAX_BONUS)
  1161. X    {
  1162. X        /* More than MAX_BONUS bonus so give super bonus */
  1163. X        AddToScore((u_long) SUPER_BONUS_SCORE);
  1164. X    }
  1165. X    else
  1166. X    {
  1167. X        /* Less than MAX_BONUS so work out bonus score */
  1168. X        AddToScore((u_long) (numBonus * BONUS_SCORE));
  1169. X    }
  1170. X
  1171. X       /* Adjust the level so that the starting level is taken into account */
  1172. X       theLevel = (int) level - GetStartingLevel() + 1;
  1173. X
  1174. X    /* Increment the score by the value of the level bonus */
  1175. X    AddToScore((u_long) (LEVEL_SCORE * theLevel));
  1176. X
  1177. X    /* Increment the score by the value of the bullet bonus */
  1178. X    if (GetNumberBullets() != 0)
  1179. X        AddToScore((u_long) (GetNumberBullets() * BULLET_SCORE));
  1180. X
  1181. X    /* Get the number of seconds left on the clock */
  1182. X    secs = GetLevelTimeBonus();
  1183. X    if (secs > 0)
  1184. X    {
  1185. X        /* Increment the score by the value of the time bonus */
  1186. X        AddToScore((u_long) (TIME_BONUS * secs));
  1187. X    }
  1188. X}
  1189. X
  1190. X#if NeedFunctionPrototypes
  1191. Xvoid ResetBonus(void)
  1192. X#else
  1193. Xvoid ResetBonus()
  1194. X#endif
  1195. X{
  1196. X    /* Setup for bonus screen from start */
  1197. X    BonusState = BONUS_TEXT;
  1198. X    nextFrame = frame + 500;
  1199. X    count = 0;
  1200. X    firstTime = True;
  1201. X    bonusScore = score;
  1202. X    ComputeAndAddBonusScore();
  1203. X    ypos = 180;
  1204. X    SetGameSpeed(FAST_SPEED);
  1205. X}
  1206. END_OF_FILE
  1207. if test 19041 -ne `wc -c <'bonus.c'`; then
  1208.     echo shar: \"'bonus.c'\" unpacked with wrong size!
  1209. fi
  1210. # end of 'bonus.c'
  1211. fi
  1212. if test -f 'gun.c' -a "${1}" != "-c" ; then 
  1213.   echo shar: Will not clobber existing file \"'gun.c'\"
  1214. else
  1215. echo shar: Extracting \"'gun.c'\" \(16237 characters\)
  1216. sed "s/^X//" >'gun.c' <<'END_OF_FILE'
  1217. X#include "include/copyright.h"
  1218. X
  1219. X/*
  1220. X *  Include file dependencies:
  1221. X */
  1222. X
  1223. X#include <xpm.h>
  1224. X#include <stdio.h>
  1225. X#include <math.h>
  1226. X#include <assert.h>
  1227. X
  1228. X#include "bitmaps/bullet.xpm"
  1229. X#include "bitmaps/tink.xpm"
  1230. X
  1231. X#include "include/error.h"
  1232. X#include "include/audio.h"
  1233. X#include "include/score.h"
  1234. X#include "include/init.h"
  1235. X#include "include/main.h"
  1236. X#include "include/stage.h"
  1237. X#include "include/blocks.h"
  1238. X#include "include/paddle.h"
  1239. X#include "include/misc.h"
  1240. X#include "include/level.h"
  1241. X#include "include/ball.h"
  1242. X#include "include/special.h"
  1243. X
  1244. X#include "include/gun.h"
  1245. X
  1246. X/*
  1247. X *  Internal macro definitions:
  1248. X */
  1249. X
  1250. X#define BULLET_DY            -10
  1251. X
  1252. X#define BULLET_WIDTH        7
  1253. X#define BULLET_HEIGHT        16
  1254. X
  1255. X#define BULLET_START_Y        (PLAY_HEIGHT - 40)
  1256. X
  1257. X#define BULLET_WC            (BULLET_WIDTH / 2)
  1258. X#define BULLET_HC            (BULLET_HEIGHT / 2)
  1259. X
  1260. X#define TINK_WIDTH            10
  1261. X#define TINK_HEIGHT            5
  1262. X
  1263. X#define TINK_WC                (TINK_WIDTH / 2)
  1264. X#define TINK_HC                (TINK_HEIGHT / 2)
  1265. X
  1266. X#define X2COL(col, x)         (col = x / colWidth)
  1267. X#define Y2ROW(row, y)         (row = y / rowHeight)
  1268. X
  1269. X#define BULLET_FRAME_RATE    5
  1270. X
  1271. X#define MAX_BULLETS            20    
  1272. X
  1273. X/* Should be the same */
  1274. X#define MAX_MOVING_BULLETS    10    
  1275. X#define MAX_TINKS            10    
  1276. X
  1277. X#define TINK_DELAY            100    
  1278. X
  1279. X/*
  1280. X *  Internal type declarations:
  1281. X */
  1282. X
  1283. X#if NeedFunctionPrototypes
  1284. Xstatic int     ResetBulletStart(Display *display, Window window);
  1285. Xstatic void CheckTinks(Display *display, Window window);
  1286. Xstatic void AddTink(Display *display, Window window, int xpos);
  1287. Xstatic void ClearTinks(void);
  1288. Xstatic void UpdateBullet(Display *display, Window window);
  1289. Xstatic int    StartABullet(Display *display, Window window, int xpos);
  1290. Xstatic void ClearBullet(int i);
  1291. Xstatic void DrawTheTink(Display *display, Window window, int x, int y);
  1292. Xstatic void EraseTheTink(Display *display, Window window, int x, int y);
  1293. Xstatic void DrawBullet(Display *display, Window window, int i);
  1294. Xstatic int CheckForBulletCollision(Display *display, Window window, 
  1295. X    int x, int y);
  1296. Xstatic int CheckBallBulletCollision(Display *display, Window window, 
  1297. X    int bx, int by, int j);
  1298. X#else
  1299. Xstatic int     ResetBulletStart();
  1300. Xstatic void CheckTinks();
  1301. Xstatic void AddTink();
  1302. Xstatic void ClearTinks();
  1303. Xstatic void UpdateBullet();
  1304. Xstatic int     StartABullet();
  1305. Xstatic void ClearBullet();
  1306. Xstatic void DrawTheTink();
  1307. Xstatic void EraseTheTink();
  1308. Xstatic void DrawBullet();
  1309. Xstatic int CheckForBulletCollision();
  1310. Xstatic int CheckBallBulletCollision();
  1311. X#endif
  1312. X
  1313. Xstatic struct 
  1314. X{
  1315. X    int xpos;            /* x position of tink centre */
  1316. X    int    clearFrame;        /* Last frame to clear it */
  1317. X} tinks[MAX_TINKS];
  1318. X
  1319. Xstatic struct 
  1320. X{
  1321. X    int xpos;            /* x position of bullet */
  1322. X    int ypos;            /* y position of bullet */
  1323. X    int oldypos;        /* previous y position */
  1324. X    int dy;                /* Change in y positoon */
  1325. X} bullets[MAX_MOVING_BULLETS];
  1326. X
  1327. X/*
  1328. X *  Internal variable declarations:
  1329. X */
  1330. X
  1331. Xstatic Pixmap bulletPixmap, bulletMask;
  1332. Xstatic Pixmap tinkPixmap, tinkMask;
  1333. Xstatic int numBullets;
  1334. X
  1335. X#if NeedFunctionPrototypes
  1336. Xvoid InitialiseBullet(Display *display, Window window, Colormap colormap)
  1337. X#else
  1338. Xvoid InitialiseBullet(display, window, colormap)
  1339. X    Display *display;
  1340. X    Window window;
  1341. X    Colormap colormap;
  1342. X#endif
  1343. X{
  1344. X    XpmAttributes   attributes;
  1345. X    int            XpmErrorStatus;
  1346. X
  1347. X    attributes.valuemask = XpmColormap;
  1348. X    attributes.colormap = colormap;
  1349. X
  1350. X    /* Create the xpm pixmap bullet */
  1351. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, bullet_xpm,
  1352. X        &bulletPixmap, &bulletMask, &attributes);
  1353. X    HandleXPMError(display, XpmErrorStatus, "InitialiseBullet(bullet)");
  1354. X
  1355. X    /* Create the xpm pixmap tink for bullet */
  1356. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, tink_xpm,
  1357. X        &tinkPixmap, &tinkMask, &attributes);
  1358. X    HandleXPMError(display, XpmErrorStatus, "InitialiseBullet(tink)");
  1359. X
  1360. X    /* Free the xpm pixmap attributes */
  1361. X    XpmFreeAttributes(&attributes);
  1362. X
  1363. X    SetNumberBullets(4);
  1364. X    ClearTinks();
  1365. X    ClearBullets();
  1366. X}
  1367. X
  1368. X#if NeedFunctionPrototypes
  1369. Xstatic void CheckTinks(Display *display, Window window)
  1370. X#else
  1371. Xstatic void CheckTinks(display, window)
  1372. X    Display *display;
  1373. X    Window window;
  1374. X#endif
  1375. X{
  1376. X    int i;
  1377. X
  1378. X    /* Clear and tinks that need to be cleared */
  1379. X    for (i = 0; i < MAX_TINKS; i++)
  1380. X    {
  1381. X        /* Is this tink active */
  1382. X        if (tinks[i].xpos != -1)
  1383. X        {
  1384. X            /* Time to clear tink? */
  1385. X            if (frame >= tinks[i].clearFrame)
  1386. X            {
  1387. X                /* Clear the tink! */
  1388. X                EraseTheTink(display, window, tinks[i].xpos, 2);
  1389. X                    
  1390. X                /* Free the tink up for another */
  1391. X                tinks[i].xpos = -1;
  1392. X                tinks[i].clearFrame = 0;
  1393. X            }
  1394. X        }
  1395. X    }
  1396. X}
  1397. X
  1398. X#if NeedFunctionPrototypes
  1399. Xstatic void AddTink(Display *display, Window window, int xpos)
  1400. X#else
  1401. Xstatic void AddTink(display, window, xpos)
  1402. X    Display *display;
  1403. X    Window window;
  1404. X    int xpos;
  1405. X#endif
  1406. X{
  1407. X    int i;
  1408. X
  1409. X    /* Cycle through tinks and try to add one */
  1410. X    for (i = 0; i < MAX_TINKS; i++)
  1411. X    {
  1412. X        /* Is this tink free? */
  1413. X        if (tinks[i].xpos == -1)
  1414. X        {
  1415. X            /* Set the tink array position */
  1416. X            tinks[i].xpos = xpos;
  1417. X            tinks[i].clearFrame = frame + TINK_DELAY;
  1418. X
  1419. X            /* Draw the new found tink! */
  1420. X            DrawTheTink(display, window, xpos, 2);
  1421. X
  1422. X            return;
  1423. X        }
  1424. X    }
  1425. X
  1426. X    /* Full tink array - lots of shooting? */
  1427. X    WarningMessage("Cannot draw tink - tink array full.");
  1428. X}
  1429. X
  1430. X#if NeedFunctionPrototypes
  1431. Xstatic void ClearTinks(void)
  1432. X#else
  1433. Xstatic void ClearTinks()
  1434. X#endif
  1435. X{
  1436. X    int i;
  1437. X
  1438. X    /* Initialise tinks array to empty */
  1439. X    for (i = 0; i < MAX_TINKS; i++)
  1440. X    {
  1441. X        tinks[i].xpos = -1;
  1442. X        tinks[i].clearFrame = 0;
  1443. X    }
  1444. X}
  1445. X
  1446. X
  1447. X#if NeedFunctionPrototypes
  1448. Xstatic void UpdateBullet(Display *display, Window window)
  1449. X#else
  1450. Xstatic void UpdateBullet(display, window)
  1451. X    Display *display;
  1452. X    Window window;
  1453. X#endif
  1454. X{
  1455. X    int i, j;
  1456. X    int row, col;
  1457. X    int ballX, ballY;
  1458. X    struct aBlock *blockP;
  1459. X
  1460. X    /* Obtain the position of the ball */
  1461. X    GetBallPosition(&ballX, &ballY, 0);
  1462. X
  1463. X    /* Draw all bullets that need updating */
  1464. X    for (i = 0; i < MAX_MOVING_BULLETS; i++)
  1465. X    {
  1466. X        /* Is this bullet active */
  1467. X        if (bullets[i].xpos != -1)
  1468. X        {
  1469. X            /* Update bullet position using dy value */    
  1470. X            bullets[i].ypos = bullets[i].oldypos + bullets[i].dy;
  1471. X
  1472. X            /* Has the bullet gone off the top edge */
  1473. X            if (bullets[i].ypos < -BULLET_HC)
  1474. X            {
  1475. X                /* Clear the bullet from the screen */
  1476. X                EraseTheBullet(display, window, 
  1477. X                    bullets[i].xpos, bullets[i].oldypos);
  1478. X
  1479. X                /* Draw a tink on the top edge */
  1480. X                AddTink(display, window, bullets[i].xpos);
  1481. X
  1482. X                /* Free the bullet up for another */
  1483. X                ClearBullet(i);
  1484. X
  1485. X                continue;
  1486. X            }
  1487. X
  1488. X            if (mode == MODE_GAME)
  1489. X            {
  1490. X                for (j = 0; j < MAX_BALLS; j++)
  1491. X                {
  1492. X                    if (balls[j].active == True)
  1493. X                    {
  1494. X                        /* Has the bullet killed the ball */
  1495. X                        if (CheckBallBulletCollision(display, window, 
  1496. X                            bullets[i].xpos, bullets[i].ypos, j))
  1497. X                        {
  1498. X                            /* Clear the bullet from the screen */
  1499. X                            EraseTheBullet(display, window, 
  1500. X                                bullets[i].xpos, bullets[i].oldypos);
  1501. X                            ClearBullet(i);
  1502. X
  1503. X                            /* Kill the ball off */
  1504. X                            ClearBallNow(display, window, j);
  1505. X
  1506. X                            /* Play the lovel ahhh pop sound for ball shot */
  1507. X                            if (noSound == False) playSoundFile("ballshot", 50);
  1508. X                            break;
  1509. X                        }
  1510. X                    }
  1511. X                }
  1512. X            }
  1513. X
  1514. X            /* Convert the new bullet pos to rows and cols for collision */
  1515. X            X2COL(col, bullets[i].xpos);
  1516. X            Y2ROW(row, bullets[i].ypos);
  1517. X
  1518. X            /* Pointer to the correct block we need - speed things up */
  1519. X            blockP = &blocks[row][col];
  1520. X
  1521. X            /* Check if the bullet has hit a brick or something */
  1522. X            if (CheckForBulletCollision(display, window, 
  1523. X                bullets[i].xpos, bullets[i].ypos) == True)
  1524. X            {
  1525. X                /* Clear the bullet from the screen */
  1526. X                EraseTheBullet(display, window, 
  1527. X                    bullets[i].xpos, bullets[i].oldypos);
  1528. X
  1529. X                /* Switch on the type of block hit */
  1530. X                switch (blockP->blockType)
  1531. X                {
  1532. X                    case COUNTER_BLK:
  1533. X                        if (blockP->counterSlide == 0)
  1534. X                        {
  1535. X                            /* Counter has counted down to 0 so kill off */
  1536. X                            DrawBlock(display, window, row, col, KILL_BLK);
  1537. X                        }
  1538. X                        else
  1539. X                        {
  1540. X                            /* Decrement counter block and draw new one */
  1541. X                            blockP->counterSlide--;
  1542. X                            DrawBlock(display, window, row, col, 
  1543. X                                COUNTER_BLK);
  1544. X                        }
  1545. X                        break;
  1546. X
  1547. X                    case HYPERSPACE_BLK:
  1548. X                        DrawBlock(display, window, row, col, HYPERSPACE_BLK);
  1549. X                        break;
  1550. X
  1551. X                    case BLACK_BLK:
  1552. X                        DrawBlock(display, window, row, col, BLACK_BLK);
  1553. X                        break;
  1554. X
  1555. X                    case REVERSE_BLK:        
  1556. X                    case MGUN_BLK:        
  1557. X                    case STICKY_BLK:        
  1558. X                    case WALLOFF_BLK:        
  1559. X                    case MULTIBALL_BLK:        
  1560. X                    case DEATH_BLK:        
  1561. X                    case PAD_EXPAND_BLK:        
  1562. X                    case PAD_SHRINK_BLK:        
  1563. X                        /* Shoot the block times to kill it */
  1564. X                        blockP->counterSlide--;
  1565. X
  1566. X                        if (blockP->counterSlide == 0)
  1567. X                        {
  1568. X                            /* Ok then a hit, explode that block */
  1569. X                            DrawBlock(display, window, row, col, KILL_BLK);
  1570. X                        }
  1571. X                        else if (noSound == False)
  1572. X                            playSoundFile("shootdeath", 70);
  1573. X                        break;
  1574. X
  1575. X                    default:
  1576. X                        /* Ok then a hit, explode that block */
  1577. X                        DrawBlock(display, window, row, col, KILL_BLK);
  1578. X                        break;
  1579. X                }
  1580. X
  1581. X                /* Free the bullet up for another */
  1582. X                ClearBullet(i);
  1583. X            }
  1584. X            else
  1585. X                DrawBullet(display, window, i);
  1586. X
  1587. X            /* Keep track of old position */
  1588. X            bullets[i].oldypos = bullets[i].ypos;
  1589. X
  1590. X        }    /* Bullet active? */
  1591. X    }    /* For loop */
  1592. X}
  1593. X
  1594. X
  1595. X#if NeedFunctionPrototypes
  1596. Xstatic int StartABullet(Display *display, Window window, int xpos)
  1597. X#else
  1598. Xstatic int StartABullet(display, window, xpos)
  1599. X    Display *display;
  1600. X    Window window;
  1601. X    int xpos;
  1602. X#endif
  1603. X{
  1604. X    int i;
  1605. X
  1606. X    /* Cycle through bullets and try to add one */
  1607. X    for (i = 0; i < MAX_MOVING_BULLETS; i++)
  1608. X    {
  1609. X        /* Is this bullet free? */
  1610. X        if (bullets[i].xpos == -1)
  1611. X        {
  1612. X            /* Set the bullet array position */
  1613. X            bullets[i].xpos = xpos;
  1614. X
  1615. X            /* Get out of here */
  1616. X            return True;
  1617. X        }
  1618. X        
  1619. X        /* Break out as the machine gun is not active */
  1620. X        if (fastGun == False) return False;
  1621. X    }
  1622. X
  1623. X    /* Full moving bullet array - lots of shooting? */
  1624. X    WarningMessage("Cannot draw bullet - bullet array full.");
  1625. X
  1626. X    return False;
  1627. X}
  1628. X
  1629. X#if NeedFunctionPrototypes
  1630. Xstatic void ClearBullet(int i)
  1631. X#else
  1632. Xstatic void ClearBullet(i)
  1633. X    int i;
  1634. X#endif
  1635. X{
  1636. X    /* Setup the bullet entry */
  1637. X    bullets[i].xpos             = -1;
  1638. X    bullets[i].ypos             = BULLET_START_Y;
  1639. X    bullets[i].oldypos             = BULLET_START_Y;
  1640. X    bullets[i].dy                 = BULLET_DY;
  1641. X}
  1642. X
  1643. X#if NeedFunctionPrototypes
  1644. Xvoid ClearBullets(void)
  1645. X#else
  1646. Xvoid ClearBullets()
  1647. X#endif
  1648. X{
  1649. X    int i;
  1650. X
  1651. X    /* Initialise bullets array to empty */
  1652. X    for (i = 0; i < MAX_MOVING_BULLETS; i++)
  1653. X        ClearBullet(i);
  1654. X}
  1655. X
  1656. X#if NeedFunctionPrototypes
  1657. Xvoid FreeBullet(Display *display)
  1658. X#else
  1659. Xvoid FreeBullet(display)
  1660. X    Display *display;
  1661. X#endif
  1662. X{
  1663. X    if (bulletPixmap)    XFreePixmap(display, bulletPixmap);
  1664. X     if (bulletMask)     XFreePixmap(display, bulletMask);
  1665. X
  1666. X    if (tinkPixmap)    XFreePixmap(display, tinkPixmap);
  1667. X     if (tinkMask)     XFreePixmap(display, tinkMask);
  1668. X}
  1669. X
  1670. X#if NeedFunctionPrototypes
  1671. Xvoid SetNumberBullets(int num)
  1672. X#else
  1673. Xvoid SetNumberBullets(num)
  1674. X    int num;
  1675. X#endif
  1676. X{
  1677. X    /* Set the number of bullets available */
  1678. X    numBullets = num;
  1679. X}
  1680. X
  1681. X#if NeedFunctionPrototypes
  1682. Xvoid IncNumberBullets(void)
  1683. X#else
  1684. Xvoid IncNumberBullets()
  1685. X#endif
  1686. X{
  1687. X    /* Increment the number of bullets */
  1688. X    numBullets++;
  1689. X
  1690. X    /* But don't give to many */
  1691. X    if (numBullets > MAX_BULLETS) 
  1692. X        numBullets = MAX_BULLETS;
  1693. X}
  1694. X
  1695. X#if NeedFunctionPrototypes
  1696. Xvoid DecNumberBullets(void)
  1697. X#else
  1698. Xvoid DecNumberBullets()
  1699. X#endif
  1700. X{
  1701. X    /* Decrement the number of bullets */
  1702. X    numBullets--;
  1703. X
  1704. X    /* But not to far */
  1705. X    if (numBullets < 0) 
  1706. X        numBullets = 0;
  1707. X}
  1708. X
  1709. X#if NeedFunctionPrototypes
  1710. Xint GetNumberBullets(void)
  1711. X#else
  1712. Xint GetNumberBullets()
  1713. X#endif
  1714. X{
  1715. X    assert(numBullets >= 0);
  1716. X
  1717. X    /* How many bullets do I have */
  1718. X    return numBullets;
  1719. X}
  1720. X
  1721. X#if NeedFunctionPrototypes
  1722. Xvoid shootBullet(Display *display, Window window)
  1723. X#else
  1724. Xvoid shootBullet(display, window)
  1725. X    Display *display;
  1726. X    Window window;
  1727. X#endif
  1728. X{
  1729. X    /* Only shoot if no bullet is active and bullets and ball active */
  1730. X    if ((GetNumberBullets() > 0) && (IsBallWaiting() == False))
  1731. X    {
  1732. X        /* Reset the bullet to the starting possy to go forward */
  1733. X        if (ResetBulletStart(display, window) == True)
  1734. X        {
  1735. X            /* Remove a bullet from the ammunition */
  1736. X            DeleteABullet(display);
  1737. X
  1738. X            /* Play a shooting sound */
  1739. X            if (noSound == False) playSoundFile("shoot", 50);
  1740. X        }
  1741. X    }
  1742. X    else if (GetNumberBullets() == 0)
  1743. X    {
  1744. X        /* Play an trigger clicking sound */
  1745. X        if (noSound == False) playSoundFile("click", 100);
  1746. X    }
  1747. X}
  1748. X
  1749. X#if NeedFunctionPrototypes
  1750. Xvoid EraseTheBullet(Display *display, Window window, int x, int y)
  1751. X#else
  1752. Xvoid EraseTheBullet(display, window, x, y)
  1753. X    Display *display;
  1754. X    Window window;
  1755. X    int x;
  1756. X    int y;
  1757. X#endif
  1758. X{
  1759. X    /* Erase the bullet pixmap from the window */
  1760. X    XClearArea(display, window, x - BULLET_WC, y - BULLET_HC, 
  1761. X        BULLET_WIDTH, BULLET_HEIGHT, False);
  1762. X}
  1763. X
  1764. X#if NeedFunctionPrototypes
  1765. Xstatic void DrawTheTink(Display *display, Window window, int x, int y)
  1766. X#else
  1767. Xstatic void DrawTheTink(display, window, x, y)
  1768. X    Display *display;
  1769. X    Window window;
  1770. X    int x;
  1771. X    int y;
  1772. X#endif
  1773. X{
  1774. X    /* Draw the tink pixmap into the window */
  1775. X    RenderShape(display, window, tinkPixmap, tinkMask,
  1776. X        x - TINK_WC, y - TINK_HC, TINK_WIDTH, TINK_HEIGHT, False);
  1777. X}
  1778. X
  1779. X#if NeedFunctionPrototypes
  1780. Xstatic void EraseTheTink(Display *display, Window window, int x, int y)
  1781. X#else
  1782. Xstatic void EraseTheTink(display, window, x, y)
  1783. X    Display *display;
  1784. X    Window window;
  1785. X    int x;
  1786. X    int y;
  1787. X#endif
  1788. X{
  1789. X    /* Erase the tink pixmap from the window */
  1790. X    XClearArea(display, window, x - TINK_WC, y - TINK_HC, 
  1791. X        TINK_WIDTH, TINK_HEIGHT, False);
  1792. X}
  1793. X
  1794. X#if NeedFunctionPrototypes
  1795. Xvoid DrawTheBullet(Display *display, Window window, int x, int y)
  1796. X#else
  1797. Xvoid DrawTheBullet(display, window, x, y)
  1798. X    Display *display;
  1799. X    Window window;
  1800. X    int x;
  1801. X    int y;
  1802. X#endif
  1803. X{
  1804. X    /* Draw the bullet pixmap into the window */
  1805. X    RenderShape(display, window, bulletPixmap, bulletMask,
  1806. X        x - BULLET_WC, y - BULLET_HC, BULLET_WIDTH, BULLET_HEIGHT, False);
  1807. X}
  1808. X
  1809. X#if NeedFunctionPrototypes
  1810. Xstatic void DrawBullet(Display *display, Window window, int i)
  1811. X#else
  1812. Xstatic void DrawBullet(display, window, i)
  1813. X    Display *display;
  1814. X    Window window;
  1815. X    int i;
  1816. X#endif
  1817. X{
  1818. X    /* Clear the window of the bullet in the old position */
  1819. X    XClearArea(display, window, bullets[i].xpos - BULLET_WC, 
  1820. X        bullets[i].oldypos - BULLET_HC, BULLET_WIDTH, BULLET_HEIGHT, False);
  1821. X
  1822. X    /* Now draw the new bullet in the new position */
  1823. X    DrawTheBullet(display, window, bullets[i].xpos, bullets[i].ypos);
  1824. X}
  1825. X
  1826. X#if NeedFunctionPrototypes
  1827. Xstatic int CheckBallBulletCollision(Display *display, Window window, 
  1828. X    int bx, int by, int j)
  1829. X#else
  1830. Xstatic int CheckBallBulletCollision(display, window, bx, by, j)
  1831. X    Display *display;
  1832. X    Window window;
  1833. X    int bx;
  1834. X    int by;
  1835. X    int j;
  1836. X#endif
  1837. X{
  1838. X    int ballX, ballY;
  1839. X
  1840. X    GetBallPosition(&ballX, &ballY, j);
  1841. X
  1842. X    /* Check if any part of the bullets coords is inside the balls box */
  1843. X    if (((bx + BULLET_WC) >= (ballX - BALL_WC)) &&
  1844. X           ((bx - BULLET_WC) <= (ballX + BALL_WC)) &&
  1845. X        ((by + BULLET_HC) >= (ballY - BALL_HC)) &&
  1846. X        ((by - BULLET_HC) <= (ballY + BALL_HC)))
  1847. X        return True;
  1848. X    else
  1849. X        return False;
  1850. X}
  1851. X
  1852. X#if NeedFunctionPrototypes
  1853. Xstatic int CheckForBulletCollision(Display *display, Window window, 
  1854. X    int x, int y)
  1855. X#else
  1856. Xstatic int CheckForBulletCollision(display, window, x, y)
  1857. X    Display *display;
  1858. X    Window window;
  1859. X    int x;
  1860. X    int y;
  1861. X#endif
  1862. X{
  1863. X    /* Check for bullet to block collision */
  1864. X    int row, col;
  1865. X    struct aBlock *blockP;
  1866. X
  1867. X    /* Get the row and col for block where bullet is */
  1868. X    X2COL(col, x);
  1869. X    Y2ROW(row, y);
  1870. X
  1871. X    blockP = &blocks[row][col];
  1872. X
  1873. X    /* If blocks is occupied then check for collision */
  1874. X    if (blockP->occupied == 1 && blockP->exploding == False)
  1875. X    {
  1876. X        /* Check if x adjusted for bullet width is in block region */
  1877. X        if (((x + BULLET_WC) > blockP->x) &&
  1878. X          ((x - BULLET_WC) < (blockP->x + blockP->width)))
  1879. X        {
  1880. X            if (((y + BULLET_HC) > blockP->y) &&
  1881. X              ((y - BULLET_HC) < (blockP->y + blockP->height)))
  1882. X            {
  1883. X                /* Collision */
  1884. X                return True;
  1885. X            }
  1886. X        }
  1887. X    }
  1888. X
  1889. X    /* No collision if reached here */
  1890. X    return False;
  1891. X}
  1892. X
  1893. X#if NeedFunctionPrototypes
  1894. Xstatic int ResetBulletStart(Display *display, Window window)
  1895. X#else
  1896. Xstatic int ResetBulletStart(display, window)
  1897. X    Display *display;
  1898. X    Window window;
  1899. X#endif
  1900. X{
  1901. X    /* Start a bullet on the way if possible */
  1902. X    return StartABullet(display, window, paddlePos);
  1903. X}
  1904. X
  1905. X#if NeedFunctionPrototypes
  1906. Xvoid HandleBulletMode(Display *display, Window window)
  1907. X#else
  1908. Xvoid HandleBulletMode(display, window)
  1909. X    Display *display;
  1910. X    Window window;
  1911. X#endif
  1912. X{
  1913. X    /* Update all the bullets that may be moving */
  1914. X    if ((frame % BULLET_FRAME_RATE) == 0)
  1915. X        UpdateBullet(display, window);
  1916. X
  1917. X    /* Clear any tinks that are due to be cleared */
  1918. X    CheckTinks(display, window);
  1919. X}
  1920. X
  1921. END_OF_FILE
  1922. if test 16237 -ne `wc -c <'gun.c'`; then
  1923.     echo shar: \"'gun.c'\" unpacked with wrong size!
  1924. fi
  1925. # end of 'gun.c'
  1926. fi
  1927. if test -f 'include/audio.h' -a "${1}" != "-c" ; then 
  1928.   echo shar: Will not clobber existing file \"'include/audio.h'\"
  1929. else
  1930. echo shar: Extracting \"'include/audio.h'\" \(605 characters\)
  1931. sed "s/^X//" >'include/audio.h' <<'END_OF_FILE'
  1932. X#ifndef _AUDIO_H_
  1933. X#define _AUDIO_H_
  1934. X
  1935. X#include "copyright.h"
  1936. X
  1937. X/*
  1938. X *  Dependencies on other include files:
  1939. X */
  1940. X
  1941. X#include <X11/Xlib.h>
  1942. X
  1943. X/*
  1944. X *  Constants and macros:
  1945. X */
  1946. X
  1947. X#define SBUF_SIZE    32
  1948. X
  1949. X/*
  1950. X *  Type declarations:
  1951. X */
  1952. X
  1953. X/*
  1954. X *  Function prototypes:
  1955. X */
  1956. X
  1957. X#if NeedFunctionPrototypes
  1958. Xint     SetUpAudioSystem(Display *display);
  1959. Xvoid FreeAudioSystem(void);
  1960. Xvoid playSoundFile(char *filename, int volume);
  1961. Xvoid audioDeviceEvents(void);
  1962. Xvoid SetMaximumVolume(int Volume);
  1963. X#else
  1964. Xvoid SetMaximumVolume();
  1965. Xvoid audioDeviceEvents();
  1966. Xint  SetUpAudioSystem();
  1967. Xvoid FreeAudioSystem();
  1968. Xvoid playSoundFile();
  1969. X#endif
  1970. X
  1971. X#endif
  1972. END_OF_FILE
  1973. if test 605 -ne `wc -c <'include/audio.h'`; then
  1974.     echo shar: \"'include/audio.h'\" unpacked with wrong size!
  1975. fi
  1976. # end of 'include/audio.h'
  1977. fi
  1978. echo shar: End of archive 19 \(of 30\).
  1979. cp /dev/null ark19isdone
  1980. MISSING=""
  1981. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  1982.     if test ! -f ark${I}isdone ; then
  1983.     MISSING="${MISSING} ${I}"
  1984.     fi
  1985. done
  1986. if test "${MISSING}" = "" ; then
  1987.     echo You have unpacked all 30 archives.
  1988.     echo "Now execute sdecode.sh to build files."
  1989.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1990. else
  1991.     echo You still need to unpack the following archives:
  1992.     echo "        " ${MISSING}
  1993. fi
  1994. ##  End of shell archive.
  1995. exit 0
  1996.