home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / amiga.free / sorgenti vari / wolf3dmacsource.sit / Wolf3DMacSource / WolfMain.c < prev    next >
MacBinary  |  1994-09-30  |  13.5 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Fri Sep 30 11:48:27 1994, modified Fri Sep 30 11:48:27 1994, creator 'CWIE', type ASCII, 13249 bytes "WolfMain.c" , at 0x3441 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 57 6f 6c 66 4d 61 | 69 6e 2e 63 00 00 00 00 |..WolfMa|in.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 33 c1 00 | 00 01 7e aa b1 e3 cb aa |.....3..|..~.....|
|00000060| b1 e3 cb 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 c1 73 00 00 |........|.....s..|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 77 6f 6c 66 64 65 |#include| "wolfde|
|00000090| 66 2e 68 22 0d 23 69 6e | 63 6c 75 64 65 20 3c 73 |f.h".#in|clude <s|
|000000a0| 74 72 69 6e 67 2e 68 3e | 0d 0d 2f 2a 2a 2a 2a 2a |tring.h>|../*****|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 0d 09 |********|*****...|
|000000d0| 52 65 74 75 72 6e 20 74 | 68 65 20 61 62 73 6f 6c |Return t|he absol|
|000000e0| 75 74 65 20 76 61 6c 75 | 65 0d 09 0d 2a 2a 2a 2a |ute valu|e...****|
|000000f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000100| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2f 0d |********|******/.|
|00000110| 0d 57 6f 72 64 20 77 5f | 61 62 73 28 69 6e 74 20 |.Word w_|abs(int |
|00000120| 76 61 6c 29 0d 7b 0d 09 | 72 65 74 75 72 6e 20 76 |val).{..|return v|
|00000130| 61 6c 3e 3d 30 20 3f 20 | 76 61 6c 20 3a 20 2d 76 |al>=0 ? |val : -v|
|00000140| 61 6c 3b 0d 7d 0d 0d 2f | 2a 2a 2a 2a 2a 2a 2a 2a |al;.}../|********|
|00000150| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0d 0d 09 52 65 74 |********|**...Ret|
|00000170| 75 72 6e 20 61 20 73 65 | 65 64 65 64 20 72 61 6e |urn a se|eded ran|
|00000180| 64 6f 6d 20 6e 75 6d 62 | 65 72 0d 09 0d 2a 2a 2a |dom numb|er...***|
|00000190| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|000001b0| 0d 0d 42 79 74 65 20 72 | 6e 64 74 61 62 6c 65 5b |..Byte r|ndtable[|
|000001c0| 32 35 36 5d 20 3d 20 7b | 0d 09 20 20 30 2c 20 20 |256] = {|.. 0, |
|000001d0| 38 2c 20 31 30 39 2c 20 | 32 32 30 2c 20 32 32 32 |8, 109, |220, 222|
|000001e0| 2c 20 32 34 31 2c 20 31 | 34 39 2c 20 31 30 37 2c |, 241, 1|49, 107,|
|000001f0| 20 20 37 35 2c 20 32 34 | 38 2c 20 32 35 34 2c 20 | 75, 24|8, 254, |
|00000200| 31 34 30 2c 20 20 31 36 | 2c 20 20 36 36 2c 0d 09 |140, 16|, 66,..|
|00000210| 20 37 34 2c 20 32 31 2c | 20 32 31 31 2c 20 20 34 | 74, 21,| 211, 4|
|00000220| 37 2c 20 20 38 30 2c 20 | 32 34 32 2c 20 31 35 34 |7, 80, |242, 154|
|00000230| 2c 20 20 32 37 2c 20 32 | 30 35 2c 20 31 32 38 2c |, 27, 2|05, 128,|
|00000240| 20 31 36 31 2c 20 20 38 | 39 2c 20 20 37 37 2c 20 | 161, 8|9, 77, |
|00000250| 20 33 36 2c 0d 09 20 39 | 35 2c 31 31 30 2c 20 20 | 36,.. 9|5,110, |
|00000260| 38 35 2c 20 20 34 38 2c | 20 32 31 32 2c 20 31 34 |85, 48,| 212, 14|
|00000270| 30 2c 20 32 31 31 2c 20 | 32 34 39 2c 20 20 32 32 |0, 211, |249, 22|
|00000280| 2c 20 20 37 39 2c 20 32 | 30 30 2c 20 20 35 30 2c |, 79, 2|00, 50,|
|00000290| 20 20 32 38 2c 20 31 38 | 38 2c 0d 09 20 35 32 2c | 28, 18|8,.. 52,|
|000002a0| 31 34 30 2c 20 32 30 32 | 2c 20 31 32 30 2c 20 20 |140, 202|, 120, |
|000002b0| 36 38 2c 20 31 34 35 2c | 20 20 36 32 2c 20 20 37 |68, 145,| 62, 7|
|000002c0| 30 2c 20 31 38 34 2c 20 | 31 39 30 2c 20 20 39 31 |0, 184, |190, 91|
|000002d0| 2c 20 31 39 37 2c 20 31 | 35 32 2c 20 32 32 34 2c |, 197, 1|52, 224,|
|000002e0| 0d 09 31 34 39 2c 31 30 | 34 2c 20 20 32 35 2c 20 |..149,10|4, 25, |
|000002f0| 31 37 38 2c 20 32 35 32 | 2c 20 31 38 32 2c 20 32 |178, 252|, 182, 2|
|00000300| 30 32 2c 20 31 38 32 2c | 20 31 34 31 2c 20 31 39 |02, 182,| 141, 19|
|00000310| 37 2c 20 20 20 34 2c 20 | 20 38 31 2c 20 31 38 31 |7, 4, | 81, 181|
|00000320| 2c 20 32 34 32 2c 0d 09 | 31 34 35 2c 20 34 32 2c |, 242,..|145, 42,|
|00000330| 20 20 33 39 2c 20 32 32 | 37 2c 20 31 35 36 2c 20 | 39, 22|7, 156, |
|00000340| 31 39 38 2c 20 32 32 35 | 2c 20 31 39 33 2c 20 32 |198, 225|, 193, 2|
|00000350| 31 39 2c 20 20 39 33 2c | 20 31 32 32 2c 20 31 37 |19, 93,| 122, 17|
|00000360| 35 2c 20 32 34 39 2c 20 | 20 20 30 2c 0d 09 31 37 |5, 249, | 0,..17|
|00000370| 35 2c 31 34 33 2c 20 20 | 37 30 2c 20 32 33 39 2c |5,143, |70, 239,|
|00000380| 20 20 34 36 2c 20 32 34 | 36 2c 20 31 36 33 2c 20 | 46, 24|6, 163, |
|00000390| 20 35 33 2c 20 31 36 33 | 2c 20 31 30 39 2c 20 31 | 53, 163|, 109, 1|
|000003a0| 36 38 2c 20 31 33 35 2c | 20 20 20 32 2c 20 32 33 |68, 135,| 2, 23|
|000003b0| 35 2c 0d 09 20 32 35 2c | 20 39 32 2c 20 20 32 30 |5,.. 25,| 92, 20|
|000003c0| 2c 20 31 34 35 2c 20 31 | 33 38 2c 20 20 37 37 2c |, 145, 1|38, 77,|
|000003d0| 20 20 36 39 2c 20 31 36 | 36 2c 20 20 37 38 2c 20 | 69, 16|6, 78, |
|000003e0| 31 37 36 2c 20 31 37 33 | 2c 20 32 31 32 2c 20 31 |176, 173|, 212, 1|
|000003f0| 36 36 2c 20 31 31 33 2c | 0d 09 20 39 34 2c 31 36 |66, 113,|.. 94,16|
|00000400| 31 2c 20 20 34 31 2c 20 | 20 35 30 2c 20 32 33 39 |1, 41, | 50, 239|
|00000410| 2c 20 20 34 39 2c 20 31 | 31 31 2c 20 31 36 34 2c |, 49, 1|11, 164,|
|00000420| 20 20 37 30 2c 20 20 36 | 30 2c 20 20 20 32 2c 20 | 70, 6|0, 2, |
|00000430| 20 33 37 2c 20 31 37 31 | 2c 20 20 37 35 2c 0d 09 | 37, 171|, 75,..|
|00000440| 31 33 36 2c 31 35 36 2c | 20 20 31 31 2c 20 20 35 |136,156,| 11, 5|
|00000450| 36 2c 20 20 34 32 2c 20 | 31 34 36 2c 20 31 33 38 |6, 42, |146, 138|
|00000460| 2c 20 32 32 39 2c 20 20 | 37 33 2c 20 31 34 36 2c |, 229, |73, 146,|
|00000470| 20 20 37 37 2c 20 20 36 | 31 2c 20 20 39 38 2c 20 | 77, 6|1, 98, |
|00000480| 31 39 36 2c 0d 09 31 33 | 35 2c 31 30 36 2c 20 20 |196,..13|5,106, |
|00000490| 36 33 2c 20 31 39 37 2c | 20 31 39 35 2c 20 20 38 |63, 197,| 195, 8|
|000004a0| 36 2c 20 20 39 36 2c 20 | 32 30 33 2c 20 31 31 33 |6, 96, |203, 113|
|000004b0| 2c 20 31 30 31 2c 20 31 | 37 30 2c 20 32 34 37 2c |, 101, 1|70, 247,|
|000004c0| 20 31 38 31 2c 20 31 31 | 33 2c 0d 09 20 38 30 2c | 181, 11|3,.. 80,|
|000004d0| 32 35 30 2c 20 31 30 38 | 2c 20 20 20 37 2c 20 32 |250, 108|, 7, 2|
|000004e0| 35 35 2c 20 32 33 37 2c | 20 31 32 39 2c 20 32 32 |55, 237,| 129, 22|
|000004f0| 36 2c 20 20 37 39 2c 20 | 31 30 37 2c 20 31 31 32 |6, 79, |107, 112|
|00000500| 2c 20 31 36 36 2c 20 31 | 30 33 2c 20 32 34 31 2c |, 166, 1|03, 241,|
|00000510| 0d 09 20 32 34 2c 32 32 | 33 2c 20 32 33 39 2c 20 |.. 24,22|3, 239, |
|00000520| 31 32 30 2c 20 31 39 38 | 2c 20 20 35 38 2c 20 20 |120, 198|, 58, |
|00000530| 36 30 2c 20 20 38 32 2c | 20 31 32 38 2c 20 20 20 |60, 82,| 128, |
|00000540| 33 2c 20 31 38 34 2c 20 | 20 36 36 2c 20 31 34 33 |3, 184, | 66, 143|
|00000550| 2c 20 32 32 34 2c 0d 09 | 31 34 35 2c 32 32 34 2c |, 224,..|145,224,|
|00000560| 20 20 38 31 2c 20 32 30 | 36 2c 20 31 36 33 2c 20 | 81, 20|6, 163, |
|00000570| 20 34 35 2c 20 20 36 33 | 2c 20 20 39 30 2c 20 31 | 45, 63|, 90, 1|
|00000580| 36 38 2c 20 31 31 34 2c | 20 20 35 39 2c 20 20 33 |68, 114,| 59, 3|
|00000590| 33 2c 20 31 35 39 2c 20 | 20 39 35 2c 0d 09 20 32 |3, 159, | 95,.. 2|
|000005a0| 38 2c 31 33 39 2c 20 31 | 32 33 2c 20 20 39 38 2c |8,139, 1|23, 98,|
|000005b0| 20 31 32 35 2c 20 31 39 | 36 2c 20 20 31 35 2c 20 | 125, 19|6, 15, |
|000005c0| 20 37 30 2c 20 31 39 34 | 2c 20 32 35 33 2c 20 20 | 70, 194|, 253, |
|000005d0| 35 34 2c 20 20 31 34 2c | 20 31 30 39 2c 20 32 32 |54, 14,| 109, 22|
|000005e0| 36 2c 0d 09 20 37 31 2c | 20 31 37 2c 20 31 36 31 |6,.. 71,| 17, 161|
|000005f0| 2c 20 20 39 33 2c 20 31 | 38 36 2c 20 20 38 37 2c |, 93, 1|86, 87,|
|00000600| 20 32 34 34 2c 20 31 33 | 38 2c 20 20 32 30 2c 20 | 244, 13|8, 20, |
|00000610| 20 35 32 2c 20 31 32 33 | 2c 20 32 35 31 2c 20 20 | 52, 123|, 251, |
|00000620| 32 36 2c 20 20 33 36 2c | 0d 09 20 31 37 2c 20 34 |26, 36,|.. 17, 4|
|00000630| 36 2c 20 20 35 32 2c 20 | 32 33 31 2c 20 32 33 32 |6, 52, |231, 232|
|00000640| 2c 20 20 37 36 2c 20 20 | 33 31 2c 20 32 32 31 2c |, 76, |31, 221,|
|00000650| 20 20 38 34 2c 20 20 33 | 37 2c 20 32 31 36 2c 20 | 84, 3|7, 216, |
|00000660| 31 36 35 2c 20 32 31 32 | 2c 20 31 30 36 2c 0d 09 |165, 212|, 106,..|
|00000670| 31 39 37 2c 32 34 32 2c | 20 20 39 38 2c 20 20 34 |197,242,| 98, 4|
|00000680| 33 2c 20 20 33 39 2c 20 | 31 37 35 2c 20 32 35 34 |3, 39, |175, 254|
|00000690| 2c 20 31 34 35 2c 20 31 | 39 30 2c 20 20 38 34 2c |, 145, 1|90, 84,|
|000006a0| 20 31 31 38 2c 20 32 32 | 32 2c 20 31 38 37 2c 20 | 118, 22|2, 187, |
|000006b0| 31 33 36 2c 0d 09 31 32 | 30 2c 31 36 33 2c 20 32 |136,..12|0,163, 2|
|000006c0| 33 36 2c 20 32 34 39 0d | 7d 3b 0d 0d 57 6f 72 64 |36, 249.|};..Word|
|000006d0| 20 72 6e 64 69 6e 64 65 | 78 20 3d 20 30 3b 0d 0d | rndinde|x = 0;..|
|000006e0| 57 6f 72 64 20 77 5f 72 | 6e 64 28 76 6f 69 64 29 |Word w_r|nd(void)|
|000006f0| 0d 7b 0d 09 72 6e 64 69 | 6e 64 65 78 20 3d 20 28 |.{..rndi|ndex = (|
|00000700| 72 6e 64 69 6e 64 65 78 | 2b 31 29 26 30 78 66 66 |rndindex|+1)&0xff|
|00000710| 3b 09 2f 2a 20 4e 65 78 | 74 20 69 6e 64 65 78 20 |;./* Nex|t index |
|00000720| 2a 2f 0d 09 72 65 74 75 | 72 6e 20 72 6e 64 74 61 |*/..retu|rn rndta|
|00000730| 62 6c 65 5b 72 6e 64 69 | 6e 64 65 78 5d 3b 09 09 |ble[rndi|ndex];..|
|00000740| 2f 2a 20 52 65 74 75 72 | 6e 20 74 68 65 20 6e 75 |/* Retur|n the nu|
|00000750| 6d 62 65 72 20 2a 2f 0d | 7d 0d 0d 0d 2f 2a 2a 2a |mber */.|}.../***|
|00000760| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0d |********|*******.|
|00000780| 0d 09 52 65 74 75 72 6e | 20 61 6e 20 61 6e 67 6c |..Return| an angl|
|00000790| 65 20 76 61 6c 75 65 20 | 62 61 73 65 64 20 6f 6e |e value |based on|
|000007a0| 20 61 20 73 6c 6f 70 65 | 2e 0d 09 41 73 73 75 6d | a slope|...Assum|
|000007b0| 65 20 74 68 61 74 20 78 | 20 69 73 20 3e 3d 20 74 |e that x| is >= t|
|000007c0| 6f 20 79 2e 0d 09 09 0d | 2a 2a 2a 2a 2a 2a 2a 2a |o y.....|********|
|000007d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000007e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2f 0d 0d 57 6f 72 |********|**/..Wor|
|000007f0| 64 20 41 6e 67 6c 65 46 | 72 6f 6d 53 6c 6f 70 65 |d AngleF|romSlope|
|00000800| 32 28 57 6f 72 64 20 79 | 2c 57 6f 72 64 20 78 29 |2(Word y|,Word x)|
|00000810| 0d 7b 0d 09 72 65 74 75 | 72 6e 20 74 61 6e 74 6f |.{..retu|rn tanto|
|00000820| 61 6e 67 6c 65 5b 28 28 | 4c 6f 6e 67 57 6f 72 64 |angle[((|LongWord|
|00000830| 29 79 3c 3c 53 4c 4f 50 | 45 42 49 54 53 29 2f 78 |)y<<SLOP|EBITS)/x|
|00000840| 5d 3b 0d 7d 0d 0d 2f 2a | 2a 2a 2a 2a 2a 2a 2a 2a |];.}../*|********|
|00000850| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000860| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0d 0d 09 43 6f 6e 76 |********|*...Conv|
|00000870| 65 72 74 20 61 6e 20 61 | 72 62 69 74 72 61 72 79 |ert an a|rbitrary|
|00000880| 20 70 6f 69 6e 74 20 66 | 72 6f 6d 20 74 68 65 20 | point f|rom the |
|00000890| 76 69 65 77 78 79 20 69 | 6e 74 6f 20 61 6e 20 61 |viewxy i|nto an a|
|000008a0| 6e 67 6c 65 2e 0d 09 0d | 09 54 6f 20 67 65 74 20 |ngle....|.To get |
|000008b0| 61 20 67 6c 6f 62 61 6c | 20 61 6e 67 6c 65 20 66 |a global| angle f|
|000008c0| 72 6f 6d 20 63 61 72 74 | 65 73 69 61 6e 20 63 6f |rom cart|esian co|
|000008d0| 6f 72 64 69 6e 61 74 65 | 73 2c 20 74 68 65 20 63 |ordinate|s, the c|
|000008e0| 6f 6f 72 64 69 6e 61 74 | 65 73 20 61 72 65 20 66 |oordinat|es are f|
|000008f0| 6c 69 70 70 65 64 20 75 | 6e 74 69 6c 20 0d 09 74 |lipped u|ntil ..t|
|00000900| 68 65 79 20 61 72 65 20 | 69 6e 20 74 68 65 20 66 |hey are |in the f|
|00000910| 69 72 73 74 20 6f 63 74 | 61 6e 74 20 6f 66 20 74 |irst oct|ant of t|
|00000920| 68 65 20 63 6f 6f 72 64 | 69 6e 61 74 65 20 73 79 |he coord|inate sy|
|00000930| 73 74 65 6d 2c 20 74 68 | 65 6e 20 74 68 65 20 79 |stem, th|en the y|
|00000940| 20 28 3c 3d 78 29 20 69 | 73 20 73 63 61 6c 65 64 | (<=x) i|s scaled|
|00000950| 20 61 6e 64 20 0d 09 64 | 69 76 69 64 65 64 20 62 | and ..d|ivided b|
|00000960| 79 20 78 20 74 6f 20 67 | 65 74 20 61 20 74 61 6e |y x to g|et a tan|
|00000970| 67 65 6e 74 20 28 73 6c | 6f 70 65 29 20 76 61 6c |gent (sl|ope) val|
|00000980| 75 65 20 77 68 69 63 68 | 20 69 73 20 6c 6f 6f 6b |ue which| is look|
|00000990| 65 64 20 75 70 20 69 6e | 20 74 68 65 20 74 61 6e |ed up in| the tan|
|000009a0| 74 6f 61 6e 67 6c 65 5b | 5d 20 74 61 62 6c 65 2e |toangle[|] table.|
|000009b0| 0d 09 54 68 65 20 2b 31 | 20 73 69 7a 65 20 69 73 |..The +1| size is|
|000009c0| 20 74 6f 20 68 61 6e 64 | 6c 65 20 74 68 65 20 63 | to hand|le the c|
|000009d0| 61 73 65 20 77 68 65 6e | 20 78 3d 3d 79 20 77 69 |ase when| x==y wi|
|000009e0| 74 68 6f 75 74 20 61 64 | 64 69 74 69 6f 6e 61 6c |thout ad|ditional|
|000009f0| 20 63 68 65 63 6b 69 6e | 67 2e 0d 09 0d 2a 2a 2a | checkin|g....***|
|00000a00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000a10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|00000a20| 0d 0d 23 64 65 66 69 6e | 65 09 41 4e 47 39 30 09 |..#defin|e.ANG90.|
|00000a30| 30 78 34 30 30 30 0d 23 | 64 65 66 69 6e 65 09 41 |0x4000.#|define.A|
|00000a40| 4e 47 31 38 30 09 30 78 | 38 30 30 30 0d 23 64 65 |NG180.0x|8000.#de|
|00000a50| 66 69 6e 65 09 41 4e 47 | 32 37 30 09 30 78 63 30 |fine.ANG|270.0xc0|
|00000a60| 30 30 0d 61 6e 67 6c 65 | 5f 74 20 50 6f 69 6e 74 |00.angle|_t Point|
|00000a70| 54 6f 41 6e 67 6c 65 28 | 66 69 78 65 64 5f 74 20 |ToAngle(|fixed_t |
|00000a80| 78 2c 20 66 69 78 65 64 | 5f 74 20 79 29 0d 7b 09 |x, fixed|_t y).{.|
|00000a90| 0d 09 78 20 2d 3d 20 76 | 69 65 77 78 3b 09 09 2f |..x -= v|iewx;../|
|00000aa0| 2a 20 41 64 6a 75 73 74 | 20 74 68 65 20 78 20 61 |* Adjust| the x a|
|00000ab0| 6e 64 20 79 20 62 61 73 | 65 64 20 6f 6e 20 74 68 |nd y bas|ed on th|
|00000ac0| 65 20 63 61 6d 65 72 61 | 20 2a 2f 0d 09 79 20 3d |e camera| */..y =|
|00000ad0| 20 76 69 65 77 79 20 2d | 20 79 3b 0d 09 0d 09 69 | viewy -| y;....i|
|00000ae0| 66 20 28 78 3e 3d 30 29 | 20 7b 09 2f 2a 20 78 20 |f (x>=0)| {./* x |
|00000af0| 69 73 20 70 6f 73 69 74 | 69 76 65 3f 20 2a 2f 0d |is posit|ive? */.|
|00000b00| 09 09 69 66 20 28 79 3e | 3d 30 29 20 7b 09 2f 2a |..if (y>|=0) {./*|
|00000b10| 20 79 20 69 73 20 70 6f | 73 69 74 69 76 65 3f 20 | y is po|sitive? |
|00000b20| 2a 2f 0d 09 09 09 69 66 | 20 28 78 3e 79 29 20 7b |*/....if| (x>y) {|
|00000b30| 0d 09 09 09 09 72 65 74 | 75 72 6e 20 41 6e 67 6c |.....ret|urn Angl|
|00000b40| 65 46 72 6f 6d 53 6c 6f | 70 65 32 28 79 2c 78 29 |eFromSlo|pe2(y,x)|
|00000b50| 3b 09 2f 2a 20 6f 63 74 | 61 6e 74 20 30 2a 2f 0d |;./* oct|ant 0*/.|
|00000b60| 09 09 09 7d 20 65 6c 73 | 65 20 7b 0d 09 09 09 09 |...} els|e {.....|
|00000b70| 72 65 74 75 72 6e 20 41 | 4e 47 39 30 2d 31 2d 41 |return A|NG90-1-A|
|00000b80| 6e 67 6c 65 46 72 6f 6d | 53 6c 6f 70 65 32 28 78 |ngleFrom|Slope2(x|
|00000b90| 2c 79 29 3b 09 2f 2a 20 | 6f 63 74 61 6e 74 20 31 |,y);./* |octant 1|
|00000ba0| 20 2a 2f 0d 09 09 09 7d | 0d 09 09 7d 20 65 6c 73 | */....}|...} els|
|00000bb0| 65 20 7b 09 2f 2a 20 79 | 3c 30 20 2a 2f 0d 09 09 |e {./* y|<0 */...|
|00000bc0| 09 79 20 3d 20 2d 79 3b | 09 2f 2a 20 4e 65 67 61 |.y = -y;|./* Nega|
|00000bd0| 74 65 20 79 20 28 4d 61 | 6b 65 20 70 6f 73 69 74 |te y (Ma|ke posit|
|00000be0| 69 76 65 29 20 2a 2f 0d | 09 09 09 69 66 20 28 78 |ive) */.|...if (x|
|00000bf0| 3e 79 29 20 7b 0d 09 09 | 09 09 72 65 74 75 72 6e |>y) {...|..return|
|00000c00| 20 2d 41 6e 67 6c 65 46 | 72 6f 6d 53 6c 6f 70 65 | -AngleF|romSlope|
|00000c10| 32 28 79 2c 78 29 3b 09 | 2f 2a 20 6f 63 74 61 6e |2(y,x);.|/* octan|
|00000c20| 74 20 38 20 2a 2f 0d 09 | 09 09 7d 20 65 6c 73 65 |t 8 */..|..} else|
|00000c30| 20 7b 0d 09 09 09 09 72 | 65 74 75 72 6e 20 41 4e | {.....r|eturn AN|
|00000c40| 47 32 37 30 2b 41 6e 67 | 6c 65 46 72 6f 6d 53 6c |G270+Ang|leFromSl|
|00000c50| 6f 70 65 32 20 28 78 2c | 79 29 3b 09 2f 2a 20 6f |ope2 (x,|y);./* o|
|00000c60| 63 74 61 6e 74 20 37 20 | 2a 2f 0d 09 09 09 7d 0d |ctant 7 |*/....}.|
|00000c70| 09 09 7d 0d 09 7d 20 65 | 6c 73 65 20 7b 09 2f 2a |..}..} e|lse {./*|
|00000c80| 20 78 3c 30 2a 2f 0d 09 | 09 78 20 3d 20 2d 78 3b | x<0*/..|.x = -x;|
|00000c90| 09 2f 2a 20 46 6f 72 63 | 65 20 78 20 70 6f 73 69 |./* Forc|e x posi|
|00000ca0| 74 69 76 65 20 2a 2f 0d | 09 09 69 66 20 28 79 3e |tive */.|..if (y>|
|00000cb0| 3d 20 30 29 20 7b 09 2f | 2a 20 49 73 20 79 20 70 |= 0) {./|* Is y p|
|00000cc0| 6f 73 69 74 69 76 65 3f | 20 2a 2f 0d 09 09 09 69 |ositive?| */....i|
|00000cd0| 66 20 28 78 3e 79 29 20 | 7b 0d 09 09 09 09 72 65 |f (x>y) |{.....re|
|00000ce0| 74 75 72 6e 20 41 4e 47 | 31 38 30 2d 31 2d 41 6e |turn ANG|180-1-An|
|00000cf0| 67 6c 65 46 72 6f 6d 53 | 6c 6f 70 65 32 28 79 2c |gleFromS|lope2(y,|
|00000d00| 78 29 3b 09 2f 2a 20 6f | 63 74 61 6e 74 20 33 20 |x);./* o|ctant 3 |
|00000d10| 2a 2f 0d 09 09 09 7d 20 | 65 6c 73 65 20 7b 0d 09 |*/....} |else {..|
|00000d20| 09 09 09 72 65 74 75 72 | 6e 20 41 4e 47 39 30 2b |...retur|n ANG90+|
|00000d30| 41 6e 67 6c 65 46 72 6f | 6d 53 6c 6f 70 65 32 28 |AngleFro|mSlope2(|
|00000d40| 78 2c 79 29 3b 09 09 2f | 2a 20 6f 63 74 61 6e 74 |x,y);../|* octant|
|00000d50| 20 32 20 2a 2f 0d 09 09 | 09 7d 0d 09 09 7d 20 65 | 2 */...|.}...} e|
|00000d60| 6c 73 65 20 7b 09 2f 2a | 20 79 3c 30 2a 2f 0d 09 |lse {./*| y<0*/..|
|00000d70| 09 09 79 20 3d 20 2d 79 | 3b 09 2f 2a 20 46 6f 72 |..y = -y|;./* For|
|00000d80| 63 65 20 79 20 70 6f 73 | 69 74 69 76 65 20 61 6c |ce y pos|itive al|
|00000d90| 73 6f 20 2a 2f 0d 09 09 | 09 69 66 20 28 78 3e 79 |so */...|.if (x>y|
|00000da0| 29 20 7b 0d 09 09 09 09 | 72 65 74 75 72 6e 20 41 |) {.....|return A|
|00000db0| 4e 47 31 38 30 2b 41 6e | 67 6c 65 46 72 6f 6d 53 |NG180+An|gleFromS|
|00000dc0| 6c 6f 70 65 32 20 28 79 | 2c 78 29 3b 09 2f 2a 20 |lope2 (y|,x);./* |
|00000dd0| 6f 63 74 61 6e 74 20 34 | 20 2a 2f 0d 09 09 09 7d |octant 4| */....}|
|00000de0| 0d 09 09 7d 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |...}..}.|.return |
|00000df0| 41 4e 47 32 37 30 2d 31 | 2d 41 6e 67 6c 65 46 72 |ANG270-1|-AngleFr|
|00000e00| 6f 6d 53 6c 6f 70 65 32 | 28 78 2c 79 29 3b 09 2f |omSlope2|(x,y);./|
|00000e10| 2a 20 6f 63 74 61 6e 74 | 20 35 20 2a 2f 0d 7d 0d |* octant| 5 */.}.|
|00000e20| 0d 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |./******|********|
|00000e30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000e40| 2a 2a 2a 2a 0d 0d 09 44 | 69 65 64 28 29 20 68 61 |****...D|ied() ha|
|00000e50| 73 20 61 6c 72 65 61 64 | 79 20 73 70 75 6e 20 74 |s alread|y spun t|
|00000e60| 68 65 20 76 69 65 77 20 | 74 6f 77 61 72 64 20 74 |he view |toward t|
|00000e70| 68 65 20 6b 69 6c 6c 65 | 72 0d 09 47 61 6d 65 4f |he kille|r..GameO|
|00000e80| 76 65 72 28 29 20 73 63 | 61 6c 65 73 20 74 68 65 |ver() sc|ales the|
|00000e90| 20 22 67 61 6d 65 20 6f | 76 65 72 22 20 73 70 72 | "game o|ver" spr|
|00000ea0| 69 74 65 20 69 6e 20 61 | 6e 64 20 70 75 6c 73 65 |ite in a|nd pulse|
|00000eb0| 73 20 69 74 20 75 6e 74 | 69 6c 20 61 6e 20 65 76 |s it unt|il an ev|
|00000ec0| 65 6e 74 0d 0d 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |ent..***|********|
|00000ed0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000ee0| 2a 2a 2a 2a 2a 2a 2a 2f | 0d 0d 76 6f 69 64 20 47 |*******/|..void G|
|00000ef0| 61 6d 65 4f 76 65 72 28 | 76 6f 69 64 29 0d 7b 09 |ameOver(|void).{.|
|00000f00| 0d 09 74 6f 70 73 70 72 | 69 74 65 6e 75 6d 20 3d |..topspr|itenum =|
|00000f10| 20 53 5f 47 41 4d 45 4f | 56 45 52 3b 09 09 2f 2a | S_GAMEO|VER;../*|
|00000f20| 20 47 61 6d 65 20 6f 76 | 65 72 20 77 6f 72 64 73 | Game ov|er words|
|00000f30| 20 2a 2f 0d 09 74 6f 70 | 73 70 72 69 74 65 73 63 | */..top|spritesc|
|00000f40| 61 6c 65 20 3d 20 38 3b | 09 2f 2a 20 53 74 61 72 |ale = 8;|./* Star|
|00000f50| 74 20 74 68 65 20 73 63 | 61 6c 65 20 66 61 63 74 |t the sc|ale fact|
|00000f60| 6f 72 20 2a 2f 0d 09 64 | 6f 20 7b 0d 09 09 52 65 |or */..d|o {...Re|
|00000f70| 6e 64 65 72 56 69 65 77 | 28 29 3b 09 09 2f 2a 20 |nderView|();../* |
|00000f80| 44 72 61 77 20 74 68 65 | 20 33 2d 64 20 76 69 65 |Draw the| 3-d vie|
|00000f90| 77 20 2a 2f 0d 09 09 74 | 6f 70 73 70 72 69 74 65 |w */...t|opsprite|
|00000fa0| 73 63 61 6c 65 2b 3d 38 | 3b 0d 09 7d 20 77 68 69 |scale+=8|;..} whi|
|00000fb0| 6c 65 20 28 74 6f 70 73 | 70 72 69 74 65 73 63 61 |le (tops|pritesca|
|00000fc0| 6c 65 3c 31 32 30 29 3b | 0d 09 0d 09 66 6f 72 20 |le<120);|....for |
|00000fd0| 28 3b 3b 29 20 7b 09 09 | 2f 2a 20 53 74 61 79 20 |(;;) {..|/* Stay |
|00000fe0| 68 65 72 65 20 66 6f 72 | 65 76 65 72 20 2a 2f 0d |here for|ever */.|
|00000ff0| 09 09 64 6f 20 7b 0d 09 | 09 09 69 66 20 28 57 61 |..do {..|..if (Wa|
|00001000| 69 74 54 69 63 6b 73 45 | 76 65 6e 74 28 31 29 29 |itTicksE|vent(1))|
|00001010| 20 7b 09 2f 2a 20 43 61 | 6e 63 65 6c 65 64 3f 20 | {./* Ca|nceled? |
|00001020| 2a 2f 0d 09 09 09 09 72 | 65 74 75 72 6e 3b 0d 09 |*/.....r|eturn;..|
|00001030| 09 09 7d 0d 09 09 09 52 | 65 6e 64 65 72 56 69 65 |..}....R|enderVie|
|00001040| 77 28 29 3b 09 09 09 09 | 2f 2a 20 53 68 6f 77 20 |w();....|/* Show |
|00001050| 74 68 65 20 33 2d 44 20 | 76 69 65 77 20 2a 2f 0d |the 3-D |view */.|
|00001060| 09 09 09 74 6f 70 73 70 | 72 69 74 65 73 63 61 6c |...topsp|ritescal|
|00001070| 65 2d 3d 32 3b 09 2f 2a | 20 4d 61 6b 65 20 73 6d |e-=2;./*| Make sm|
|00001080| 61 6c 6c 65 72 20 2a 2f | 0d 09 09 7d 20 77 68 69 |aller */|...} whi|
|00001090| 6c 65 28 74 6f 70 73 70 | 72 69 74 65 73 63 61 6c |le(topsp|ritescal|
|000010a0| 65 3e 31 30 30 29 3b 09 | 2f 2a 20 4e 6f 74 20 74 |e>100);.|/* Not t|
|000010b0| 6f 6f 20 73 6d 61 6c 6c | 2e 2e 2e 20 2a 2f 0d 09 |oo small|... */..|
|000010c0| 09 64 6f 20 7b 0d 09 09 | 09 69 66 20 28 57 61 69 |.do {...|.if (Wai|
|000010d0| 74 54 69 63 6b 73 45 76 | 65 6e 74 28 31 29 29 20 |tTicksEv|ent(1)) |
|000010e0| 7b 09 2f 2a 20 43 61 6e | 63 65 6c 65 64 3f 20 2a |{./* Can|celed? *|
|000010f0| 2f 0d 09 09 09 09 72 65 | 74 75 72 6e 3b 0d 09 09 |/.....re|turn;...|
|00001100| 09 7d 0d 09 09 09 52 65 | 6e 64 65 72 56 69 65 77 |.}....Re|nderView|
|00001110| 28 29 3b 09 09 09 09 2f | 2a 20 53 68 6f 77 20 74 |();..../|* Show t|
|00001120| 68 65 20 33 2d 44 20 76 | 69 65 77 20 2a 2f 0d 09 |he 3-D v|iew */..|
|00001130| 09 09 74 6f 70 73 70 72 | 69 74 65 73 63 61 6c 65 |..topspr|itescale|
|00001140| 2b 3d 32 3b 09 2f 2a 20 | 4d 61 6b 65 20 62 69 67 |+=2;./* |Make big|
|00001150| 67 65 72 20 2a 2f 0d 09 | 09 7d 20 77 68 69 6c 65 |ger */..|.} while|
|00001160| 20 28 74 6f 70 73 70 72 | 69 74 65 73 63 61 6c 65 | (topspr|itescale|
|00001170| 3c 31 32 30 29 3b 09 2f | 2a 20 4e 6f 74 20 74 6f |<120);./|* Not to|
|00001180| 6f 20 62 69 67 2e 2e 2e | 20 2a 2f 0d 09 7d 0d 7d |o big...| */..}.}|
|00001190| 0d 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |../*****|********|
|000011a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000011b0| 2a 2a 2a 2a 2a 0d 0d 09 | 53 68 6f 77 20 74 68 65 |*****...|Show the|
|000011c0| 20 77 6f 72 64 20 22 56 | 69 63 74 6f 72 79 22 20 | word "V|ictory" |
|000011d0| 73 63 61 6c 69 6e 67 20 | 69 6e 2e 2e 2e 0d 09 0d |scaling |in......|
|000011e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000011f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001200| 2a 2a 2f 0d 0d 76 6f 69 | 64 20 56 69 63 74 6f 72 |**/..voi|d Victor|
|00001210| 79 53 63 61 6c 65 28 76 | 6f 69 64 29 0d 7b 0d 09 |yScale(v|oid).{..|
|00001220| 74 6f 70 73 70 72 69 74 | 65 6e 75 6d 20 3d 20 53 |topsprit|enum = S|
|00001230| 5f 56 49 43 54 4f 52 59 | 3b 0d 09 74 6f 70 73 70 |_VICTORY|;..topsp|
|00001240| 72 69 74 65 73 63 61 6c | 65 20 3d 20 31 36 3b 0d |ritescal|e = 16;.|
|00001250| 09 0d 09 64 6f 20 7b 0d | 09 09 52 65 6e 64 65 72 |...do {.|..Render|
|00001260| 56 69 65 77 28 29 3b 0d | 09 09 74 6f 70 73 70 72 |View();.|..topspr|
|00001270| 69 74 65 73 63 61 6c 65 | 20 2b 3d 20 31 36 3b 0d |itescale| += 16;.|
|00001280| 09 7d 20 77 68 69 6c 65 | 20 28 74 6f 70 73 70 72 |.} while| (topspr|
|00001290| 69 74 65 73 63 61 6c 65 | 3c 32 34 30 29 3b 0d 09 |itescale|<240);..|
|000012a0| 0d 09 66 6f 72 20 28 3b | 3b 29 20 7b 0d 09 09 64 |..for (;|;) {...d|
|000012b0| 6f 20 7b 0d 09 09 09 69 | 66 20 28 57 61 69 74 54 |o {....i|f (WaitT|
|000012c0| 69 63 6b 73 45 76 65 6e | 74 28 31 29 29 20 7b 0d |icksEven|t(1)) {.|
|000012d0| 09 09 09 09 72 65 74 75 | 72 6e 3b 0d 09 09 09 7d |....retu|rn;....}|
|000012e0| 0d 09 09 09 52 65 6e 64 | 65 72 56 69 65 77 28 29 |....Rend|erView()|
|000012f0| 3b 0d 09 09 09 74 6f 70 | 73 70 72 69 74 65 73 63 |;....top|spritesc|
|00001300| 61 6c 65 2d 3d 34 3b 0d | 09 09 7d 20 77 68 69 6c |ale-=4;.|..} whil|
|00001310| 65 20 28 74 6f 70 73 70 | 72 69 74 65 73 63 61 6c |e (topsp|ritescal|
|00001320| 65 3e 32 30 30 29 3b 0d | 09 09 64 6f 20 7b 0d 09 |e>200);.|..do {..|
|00001330| 09 09 69 66 20 28 57 61 | 69 74 54 69 63 6b 73 45 |..if (Wa|itTicksE|
|00001340| 76 65 6e 74 28 31 29 29 | 20 7b 0d 09 09 09 09 72 |vent(1))| {.....r|
|00001350| 65 74 75 72 6e 3b 0d 09 | 09 09 7d 0d 09 09 09 52 |eturn;..|..}....R|
|00001360| 65 6e 64 65 72 56 69 65 | 77 28 29 3b 0d 09 09 09 |enderVie|w();....|
|00001370| 74 6f 70 73 70 72 69 74 | 65 73 63 61 6c 65 2b 3d |topsprit|escale+=|
|00001380| 34 3b 0d 09 09 7d 20 77 | 68 69 6c 65 20 28 74 6f |4;...} w|hile (to|
|00001390| 70 73 70 72 69 74 65 73 | 63 61 6c 65 3c 32 34 30 |psprites|cale<240|
|000013a0| 29 3b 09 0d 09 7d 0d 7d | 0d 0d 2f 2a 2a 2a 2a 2a |);...}.}|../*****|
|000013b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000013c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 0d 09 |********|*****...|
|000013d0| 59 6f 75 20 64 69 65 64 | 2e 2e 2e 0d 09 0d 2a 2a |You died|......**|
|000013e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000013f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001400| 2f 0d 0d 76 6f 69 64 20 | 44 69 65 64 20 28 76 6f |/..void |Died (vo|
|00001410| 69 64 29 0d 7b 0d 09 57 | 6f 72 64 20 54 69 6d 65 |id).{..W|ord Time|
|00001420| 72 3b 09 2f 2a 20 54 69 | 6d 65 20 6d 61 72 6b 20 |r;./* Ti|me mark |
|00001430| 2a 2f 0d 09 57 6f 72 64 | 20 41 64 64 73 3b 09 09 |*/..Word| Adds;..|
|00001440| 2f 2a 20 4e 75 6d 62 65 | 72 20 6f 66 20 74 69 63 |/* Numbe|r of tic|
|00001450| 73 20 65 6c 61 70 73 65 | 64 20 2a 2f 0d 09 57 6f |s elapse|d */..Wo|
|00001460| 72 64 20 54 6f 74 61 6c | 3b 09 0d 09 61 6e 67 6c |rd Total|;...angl|
|00001470| 65 5f 74 09 53 72 63 41 | 6e 67 6c 65 3b 09 2f 2a |e_t.SrcA|ngle;./*|
|00001480| 20 41 6e 67 6c 65 20 6f | 66 20 76 69 65 77 20 2a | Angle o|f view *|
|00001490| 2f 0d 09 61 6e 67 6c 65 | 5f 74 20 44 65 73 74 41 |/..angle|_t DestA|
|000014a0| 6e 67 6c 65 3b 09 2f 2a | 20 41 6e 67 6c 65 20 6f |ngle;./*| Angle o|
|000014b0| 66 20 64 65 61 74 68 20 | 2a 2f 0d 09 66 69 78 65 |f death |*/..fixe|
|000014c0| 64 5f 74 20 4d 6f 74 69 | 6f 6e 3b 09 09 2f 2a 20 |d_t Moti|on;../* |
|000014d0| 4d 6f 74 69 6f 6e 20 63 | 6f 6e 73 74 61 6e 74 20 |Motion c|onstant |
|000014e0| 2a 2f 0d 09 0d 09 67 61 | 6d 65 73 74 61 74 65 2e |*/....ga|mestate.|
|000014f0| 61 74 74 61 63 6b 66 72 | 61 6d 65 20 3d 20 30 3b |attackfr|ame = 0;|
|00001500| 09 09 2f 2a 20 52 65 6d | 6f 76 65 20 74 68 65 20 |../* Rem|ove the |
|00001510| 67 75 6e 20 73 68 61 70 | 65 20 2a 2f 0d 09 4e 6f |gun shap|e */..No|
|00001520| 57 65 61 70 6f 6e 44 72 | 61 77 20 3d 20 54 52 55 |WeaponDr|aw = TRU|
|00001530| 45 3b 09 09 09 2f 2a 20 | 54 68 65 20 77 65 61 70 |E;.../* |The weap|
|00001540| 6f 6e 20 69 73 20 6e 6f | 74 20 64 72 61 77 6e 20 |on is no|t drawn |
|00001550| 2a 2f 0d 09 50 6c 61 79 | 53 6f 75 6e 64 28 53 4e |*/..Play|Sound(SN|
|00001560| 44 5f 50 44 49 45 29 3b | 09 09 09 09 2f 2a 20 41 |D_PDIE);|..../* A|
|00001570| 52 52 52 47 47 47 48 48 | 48 48 21 21 20 2a 2f 0d |RRRGGGHH|HH!! */.|
|00001580| 09 49 4f 5f 44 72 61 77 | 46 61 63 65 28 39 29 3b |.IO_Draw|Face(9);|
|00001590| 09 09 09 09 09 2f 2a 20 | 53 68 6f 77 20 74 68 65 |...../* |Show the|
|000015a0| 20 64 65 61 64 20 66 61 | 63 65 20 2a 2f 0d 09 09 | dead fa|ce */...|
|000015b0| 0d 2f 2a 20 66 69 6e 64 | 20 61 6e 67 6c 65 20 74 |./* find| angle t|
|000015c0| 6f 20 66 61 63 65 20 61 | 74 74 61 63 6b 65 72 20 |o face a|ttacker |
|000015d0| 2a 2f 0d 0d 09 53 72 63 | 41 6e 67 6c 65 20 3d 20 |*/...Src|Angle = |
|000015e0| 67 61 6d 65 73 74 61 74 | 65 2e 76 69 65 77 61 6e |gamestat|e.viewan|
|000015f0| 67 6c 65 3c 3c 53 48 4f | 52 54 54 4f 41 4e 47 4c |gle<<SHO|RTTOANGL|
|00001600| 45 53 48 49 46 54 3b 09 | 09 2f 2a 20 47 65 74 20 |ESHIFT;.|./* Get |
|00001610| 74 68 65 20 66 69 6e 65 | 20 63 75 72 72 65 6e 74 |the fine| current|
|00001620| 20 61 6e 67 6c 65 20 2a | 2f 0d 09 44 65 73 74 41 | angle *|/..DestA|
|00001630| 6e 67 6c 65 20 3d 20 50 | 6f 69 6e 74 54 6f 41 6e |ngle = P|ointToAn|
|00001640| 67 6c 65 28 6b 69 6c 6c | 78 2c 6b 69 6c 6c 79 29 |gle(kill|x,killy)|
|00001650| 26 28 2d 31 3c 3c 53 48 | 4f 52 54 54 4f 41 4e 47 |&(-1<<SH|ORTTOANG|
|00001660| 4c 45 53 48 49 46 54 29 | 3b 09 2f 2a 20 57 68 61 |LESHIFT)|;./* Wha|
|00001670| 74 27 73 20 74 68 65 20 | 64 69 72 65 63 74 69 6f |t's the |directio|
|00001680| 6e 20 6f 66 20 74 68 65 | 20 6b 69 6c 6c 20 61 6e |n of the| kill an|
|00001690| 67 6c 65 20 2a 2f 09 0d | 09 0d 2f 2a 20 72 6f 74 |gle */..|../* rot|
|000016a0| 61 74 65 20 74 6f 20 61 | 74 74 61 63 6b 65 72 20 |ate to a|ttacker |
|000016b0| 2a 2f 0d 0d 09 69 66 20 | 28 53 72 63 41 6e 67 6c |*/...if |(SrcAngl|
|000016c0| 65 21 3d 44 65 73 74 41 | 6e 67 6c 65 29 20 7b 09 |e!=DestA|ngle) {.|
|000016d0| 09 09 09 2f 2a 20 44 6f | 20 49 20 6e 65 65 64 20 |.../* Do| I need |
|000016e0| 74 6f 20 72 6f 74 61 74 | 65 3f 20 2a 2f 0d 09 09 |to rotat|e? */...|
|000016f0| 4d 6f 74 69 6f 6e 20 3d | 20 28 66 69 78 65 64 5f |Motion =| (fixed_|
|00001700| 74 29 28 44 65 73 74 41 | 6e 67 6c 65 2d 53 72 63 |t)(DestA|ngle-Src|
|00001710| 41 6e 67 6c 65 29 2f 20 | 28 66 69 78 65 64 5f 74 |Angle)/ |(fixed_t|
|00001720| 29 33 30 3b 09 09 2f 2a | 20 44 69 66 66 65 72 61 |)30;../*| Differa|
|00001730| 6e 63 65 20 69 6e 20 66 | 69 6e 65 20 61 6e 67 6c |nce in f|ine angl|
|00001740| 65 73 20 2a 2f 0d 09 09 | 4c 61 73 74 54 69 63 43 |es */...|LastTicC|
|00001750| 6f 75 6e 74 20 3d 20 52 | 65 61 64 54 69 63 6b 28 |ount = R|eadTick(|
|00001760| 29 3b 0d 09 09 54 6f 74 | 61 6c 20 3d 20 33 30 3b |);...Tot|al = 30;|
|00001770| 09 09 09 2f 2a 20 4e 75 | 6d 62 65 72 20 6f 66 20 |.../* Nu|mber of |
|00001780| 74 69 63 73 20 74 6f 20 | 65 6c 61 70 73 65 20 2a |tics to |elapse *|
|00001790| 2f 0d 09 09 66 6f 72 20 | 28 3b 3b 29 20 7b 09 2f |/...for |(;;) {./|
|000017a0| 2a 20 54 68 65 72 65 20 | 79 65 74 3f 20 2a 2f 0d |* There |yet? */.|
|000017b0| 09 09 09 54 69 6d 65 72 | 20 3d 20 52 65 61 64 54 |...Timer| = ReadT|
|000017c0| 69 63 6b 28 29 3b 09 09 | 2f 2a 20 48 6f 77 20 6d |ick();..|/* How m|
|000017d0| 75 63 68 20 74 69 6d 65 | 20 68 61 73 20 65 6c 61 |uch time| has ela|
|000017e0| 70 73 65 64 20 2a 2f 0d | 09 09 09 41 64 64 73 20 |psed */.|...Adds |
|000017f0| 3d 20 54 69 6d 65 72 2d | 4c 61 73 74 54 69 63 43 |= Timer-|LastTicC|
|00001800| 6f 75 6e 74 3b 09 2f 2a | 20 53 61 76 65 20 74 68 |ount;./*| Save th|
|00001810| 65 20 74 69 6d 65 20 2a | 2f 0d 09 09 09 4c 61 73 |e time *|/....Las|
|00001820| 74 54 69 63 43 6f 75 6e | 74 20 3d 20 54 69 6d 65 |tTicCoun|t = Time|
|00001830| 72 3b 09 2f 2a 20 4d 61 | 72 6b 20 74 68 65 20 6e |r;./* Ma|rk the n|
|00001840| 65 77 20 74 69 6d 65 20 | 2a 2f 0d 09 09 09 69 66 |ew time |*/....if|
|00001850| 20 28 41 64 64 73 3e 3d | 54 6f 74 61 6c 29 20 7b | (Adds>=|Total) {|
|00001860| 09 09 2f 2a 20 54 6f 6f | 20 6d 75 63 68 20 74 69 |../* Too| much ti|
|00001870| 6d 65 3f 20 2a 2f 0d 09 | 09 09 09 62 72 65 61 6b |me? */..|...break|
|00001880| 3b 09 09 09 09 2f 2a 20 | 47 65 74 20 6f 75 74 20 |;..../* |Get out |
|00001890| 6e 6f 77 21 20 2a 2f 0d | 09 09 09 7d 0d 09 09 09 |now! */.|...}....|
|000018a0| 54 6f 74 61 6c 2d 3d 41 | 64 64 73 3b 09 09 09 2f |Total-=A|dds;.../|
|000018b0| 2a 20 52 65 6d 6f 76 65 | 20 65 6c 61 70 73 65 64 |* Remove| elapsed|
|000018c0| 20 74 69 6d 65 20 2a 2f | 0d 09 09 09 53 72 63 41 | time */|....SrcA|
|000018d0| 6e 67 6c 65 20 2b 3d 20 | 4d 6f 74 69 6f 6e 2a 41 |ngle += |Motion*A|
|000018e0| 64 64 73 3b 09 2f 2a 20 | 53 70 69 6e 20 2a 2f 0d |dds;./* |Spin */.|
|000018f0| 09 09 09 67 61 6d 65 73 | 74 61 74 65 2e 76 69 65 |...games|tate.vie|
|00001900| 77 61 6e 67 6c 65 20 3d | 20 53 72 63 41 6e 67 6c |wangle =| SrcAngl|
|00001910| 65 3e 3e 53 48 4f 52 54 | 54 4f 41 4e 47 4c 45 53 |e>>SHORT|TOANGLES|
|00001920| 48 49 46 54 3b 09 2f 2a | 20 53 65 74 20 74 68 65 |HIFT;./*| Set the|
|00001930| 20 6e 65 77 20 76 69 65 | 77 20 61 6e 67 6c 65 20 | new vie|w angle |
|00001940| 2a 2f 0d 09 09 09 52 65 | 6e 64 65 72 56 69 65 77 |*/....Re|nderView|
|00001950| 28 29 3b 09 09 2f 2a 20 | 53 68 6f 77 20 74 68 65 |();../* |Show the|
|00001960| 20 76 69 65 77 20 2a 2f | 0d 09 09 7d 09 09 09 09 | view */|...}....|
|00001970| 0d 09 09 67 61 6d 65 73 | 74 61 74 65 2e 76 69 65 |...games|tate.vie|
|00001980| 77 61 6e 67 6c 65 20 3d | 20 44 65 73 74 41 6e 67 |wangle =| DestAng|
|00001990| 6c 65 3e 3e 53 48 4f 52 | 54 54 4f 41 4e 47 4c 45 |le>>SHOR|TTOANGLE|
|000019a0| 53 48 49 46 54 3b 09 09 | 2f 2a 20 46 69 6e 69 73 |SHIFT;..|/* Finis|
|000019b0| 68 20 74 68 65 20 6d 6f | 74 69 6f 6e 20 2a 2f 0d |h the mo|tion */.|
|000019c0| 09 09 52 65 6e 64 65 72 | 56 69 65 77 28 29 3b 09 |..Render|View();.|
|000019d0| 09 09 2f 2a 20 44 72 61 | 77 20 74 68 65 20 73 63 |../* Dra|w the sc|
|000019e0| 72 65 65 6e 20 2a 2f 0d | 09 7d 0d 2f 2a 20 64 6f |reen */.|.}./* do|
|000019f0| 6e 65 20 2a 2f 0d 0d 09 | 69 66 20 28 21 67 61 6d |ne */...|if (!gam|
|00001a00| 65 73 74 61 74 65 2e 6c | 69 76 65 73 29 20 7b 0d |estate.l|ives) {.|
|00001a10| 09 09 47 61 6d 65 4f 76 | 65 72 28 29 3b 09 09 09 |..GameOv|er();...|
|00001a20| 2f 2a 20 53 68 6f 77 20 | 47 61 6d 65 20 6f 76 65 |/* Show |Game ove|
|00001a30| 72 2e 2e 2e 20 2a 2f 0d | 09 7d 20 65 6c 73 65 20 |r... */.|.} else |
|00001a40| 7b 0d 09 09 57 61 69 74 | 45 76 65 6e 74 28 29 3b |{...Wait|Event();|
|00001a50| 09 09 09 2f 2a 20 57 61 | 69 74 20 66 6f 72 20 61 |.../* Wa|it for a|
|00001a60| 6e 20 65 76 65 6e 74 20 | 2a 2f 0d 09 09 67 61 6d |n event |*/...gam|
|00001a70| 65 73 74 61 74 65 2e 68 | 65 61 6c 74 68 20 3d 20 |estate.h|ealth = |
|00001a80| 31 30 30 3b 09 2f 2a 20 | 52 65 73 74 6f 72 65 20 |100;./* |Restore |
|00001a90| 68 65 61 6c 74 68 20 2a | 2f 0d 09 09 69 66 20 28 |health *|/...if (|
|00001aa0| 64 69 66 66 69 63 75 6c | 74 79 29 20 7b 09 09 2f |difficul|ty) {../|
|00001ab0| 2a 20 52 65 6d 6f 76 65 | 20 77 65 61 70 6f 6e 73 |* Remove| weapons|
|00001ac0| 20 69 66 20 64 69 66 66 | 69 63 75 6c 74 20 2a 2f | if diff|icult */|
|00001ad0| 0d 09 09 09 67 61 6d 65 | 73 74 61 74 65 2e 77 65 |....game|state.we|
|00001ae0| 61 70 6f 6e 20 3d 20 67 | 61 6d 65 73 74 61 74 65 |apon = g|amestate|
|00001af0| 2e 70 65 6e 64 69 6e 67 | 77 65 61 70 6f 6e 20 3d |.pending|weapon =|
|00001b00| 20 57 50 5f 50 49 53 54 | 4f 4c 3b 0d 09 09 09 67 | WP_PIST|OL;....g|
|00001b10| 61 6d 65 73 74 61 74 65 | 2e 6d 61 63 68 69 6e 65 |amestate|.machine|
|00001b20| 67 75 6e 20 3d 20 46 41 | 4c 53 45 3b 0d 09 09 09 |gun = FA|LSE;....|
|00001b30| 67 61 6d 65 73 74 61 74 | 65 2e 63 68 61 69 6e 67 |gamestat|e.chaing|
|00001b40| 75 6e 20 3d 20 46 41 4c | 53 45 3b 0d 09 09 09 67 |un = FAL|SE;....g|
|00001b50| 61 6d 65 73 74 61 74 65 | 2e 6d 69 73 73 69 6c 65 |amestate|.missile|
|00001b60| 20 3d 20 46 41 4c 53 45 | 3b 0d 09 09 09 67 61 6d | = FALSE|;....gam|
|00001b70| 65 73 74 61 74 65 2e 66 | 6c 61 6d 65 74 68 72 6f |estate.f|lamethro|
|00001b80| 77 65 72 20 3d 20 46 41 | 4c 53 45 3b 0d 09 09 09 |wer = FA|LSE;....|
|00001b90| 67 61 6d 65 73 74 61 74 | 65 2e 61 6d 6d 6f 20 3d |gamestat|e.ammo =|
|00001ba0| 20 53 54 41 52 54 41 4d | 4d 4f 3b 0d 09 09 09 67 | STARTAM|MO;....g|
|00001bb0| 61 6d 65 73 74 61 74 65 | 2e 6d 69 73 73 69 6c 65 |amestate|.missile|
|00001bc0| 73 20 3d 20 30 3b 0d 09 | 09 09 67 61 6d 65 73 74 |s = 0;..|..gamest|
|00001bd0| 61 74 65 2e 67 61 73 20 | 3d 20 30 3b 0d 09 09 09 |ate.gas |= 0;....|
|00001be0| 67 61 6d 65 73 74 61 74 | 65 2e 6d 61 78 61 6d 6d |gamestat|e.maxamm|
|00001bf0| 6f 20 3d 20 39 39 3b 0d | 09 09 09 67 61 6d 65 73 |o = 99;.|...games|
|00001c00| 74 61 74 65 2e 6b 65 79 | 73 20 3d 20 30 3b 0d 09 |tate.key|s = 0;..|
|00001c10| 09 7d 20 65 6c 73 65 20 | 7b 0d 09 09 09 69 66 20 |.} else |{....if |
|00001c20| 28 67 61 6d 65 73 74 61 | 74 65 2e 61 6d 6d 6f 20 |(gamesta|te.ammo |
|00001c30| 3c 20 53 54 41 52 54 41 | 4d 4d 4f 2a 32 29 20 7b |< STARTA|MMO*2) {|
|00001c40| 09 2f 2a 20 49 66 20 65 | 61 73 79 2c 20 74 68 65 |./* If e|asy, the|
|00001c50| 6e 20 72 65 6c 6f 61 64 | 2e 2e 2e 20 2a 2f 0d 09 |n reload|... */..|
|00001c60| 09 09 09 67 61 6d 65 73 | 74 61 74 65 2e 61 6d 6d |...games|tate.amm|
|00001c70| 6f 20 3d 20 53 54 41 52 | 54 41 4d 4d 4f 2a 32 3b |o = STAR|TAMMO*2;|
|00001c80| 0d 09 09 09 7d 0d 09 09 | 7d 0d 09 09 67 61 6d 65 |....}...|}...game|
|00001c90| 73 74 61 74 65 2e 61 74 | 74 61 63 6b 66 72 61 6d |state.at|tackfram|
|00001ca0| 65 20 3d 20 30 3b 09 09 | 2f 2a 20 52 65 73 65 74 |e = 0;..|/* Reset|
|00001cb0| 20 74 68 65 20 61 74 74 | 61 63 6b 20 66 72 61 6d | the att|ack fram|
|00001cc0| 65 20 2a 2f 0d 09 09 67 | 61 6d 65 73 74 61 74 65 |e */...g|amestate|
|00001cd0| 2e 61 74 74 61 63 6b 63 | 6f 75 6e 74 20 3d 20 30 |.attackc|ount = 0|
|00001ce0| 3b 0d 09 7d 0d 09 46 61 | 64 65 54 6f 42 6c 61 63 |;..}..Fa|deToBlac|
|00001cf0| 6b 28 29 3b 09 09 09 2f | 2a 20 46 61 64 65 20 74 |k();.../|* Fade t|
|00001d00| 68 65 20 73 63 72 65 65 | 6e 20 74 6f 20 62 6c 61 |he scree|n to bla|
|00001d10| 63 6b 20 2a 2f 0d 7d 0d | 0d 2f 2a 2a 2a 2a 2a 2a |ck */.}.|./******|
|00001d20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001d30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0d 0d 09 43 |********|****...C|
|00001d40| 61 6c 6c 73 20 64 72 61 | 77 20 66 61 63 65 20 69 |alls dra|w face i|
|00001d50| 66 20 74 69 6d 65 20 74 | 6f 20 63 68 61 6e 67 65 |f time t|o change|
|00001d60| 0d 09 0d 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |...*****|********|
|00001d70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001d80| 2a 2a 2a 2a 2a 2f 0d 0d | 76 6f 69 64 20 55 70 64 |*****/..|void Upd|
|00001d90| 61 74 65 46 61 63 65 28 | 76 6f 69 64 29 0d 7b 0d |ateFace(|void).{.|
|00001da0| 09 57 6f 72 64 20 42 61 | 73 65 3b 0d 09 0d 09 69 |.Word Ba|se;....i|
|00001db0| 66 20 28 66 61 63 65 63 | 6f 75 6e 74 3e 54 69 63 |f (facec|ount>Tic|
|00001dc0| 43 6f 75 6e 74 29 20 7b | 09 2f 2a 20 54 69 6d 65 |Count) {|./* Time|
|00001dd0| 20 74 6f 20 63 68 61 6e | 67 65 20 74 68 65 20 66 | to chan|ge the f|
|00001de0| 61 63 65 3f 20 2a 2f 0d | 09 09 66 61 63 65 63 6f |ace? */.|..faceco|
|00001df0| 75 6e 74 2d 3d 54 69 63 | 43 6f 75 6e 74 3b 09 2f |unt-=Tic|Count;./|
|00001e00| 2a 20 57 61 69 74 20 61 | 20 62 69 74 20 2a 2f 0d |* Wait a| bit */.|
|00001e10| 09 7d 20 65 6c 73 65 20 | 7b 0d 09 09 42 61 73 65 |.} else |{...Base|
|00001e20| 20 3d 20 28 67 61 6d 65 | 73 74 61 74 65 2e 68 65 | = (game|state.he|
|00001e30| 61 6c 74 68 20 3c 3d 20 | 32 35 29 20 3f 20 35 20 |alth <= |25) ? 5 |
|00001e40| 3a 20 30 3b 0d 09 09 69 | 66 20 28 66 61 63 65 66 |: 0;...i|f (facef|
|00001e50| 72 61 6d 65 3d 3d 42 61 | 73 65 29 20 7b 09 2f 2a |rame==Ba|se) {./*|
|00001e60| 20 4e 6f 72 6d 61 6c 20 | 66 72 61 6d 65 3f 20 2a | Normal |frame? *|
|00001e70| 2f 0d 09 09 09 2b 2b 42 | 61 73 65 3b 09 09 2f 2a |/....++B|ase;../*|
|00001e80| 20 55 73 65 20 61 6c 74 | 65 72 6e 61 74 65 20 2a | Use alt|ernate *|
|00001e90| 2f 0d 09 09 7d 0d 09 09 | 66 61 63 65 66 72 61 6d |/...}...|facefram|
|00001ea0| 65 3d 42 61 73 65 3b 09 | 2f 2a 20 53 65 74 20 74 |e=Base;.|/* Set t|
|00001eb0| 68 65 20 6e 65 77 20 66 | 61 63 65 20 2a 2f 0d 09 |he new f|ace */..|
|00001ec0| 09 66 61 63 65 63 6f 75 | 6e 74 20 3d 20 28 77 5f |.facecou|nt = (w_|
|00001ed0| 72 6e 64 20 28 29 26 33 | 31 29 2b 34 3b 09 2f 2a |rnd ()&3|1)+4;./*|
|00001ee0| 20 52 61 6e 64 6f 6d 20 | 74 69 6d 65 20 2a 2f 0d | Random |time */.|
|00001ef0| 09 09 49 4f 5f 44 72 61 | 77 46 61 63 65 28 66 61 |..IO_Dra|wFace(fa|
|00001f00| 63 65 66 72 61 6d 65 29 | 3b 09 09 2f 2a 20 44 72 |ceframe)|;../* Dr|
|00001f10| 61 77 20 74 68 65 20 66 | 61 63 65 20 2a 2f 0d 09 |aw the f|ace */..|
|00001f20| 7d 0d 7d 0d 0d 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |}.}../**|********|
|00001f30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001f40| 2a 2a 2a 2a 2a 2a 2a 2a | 0d 0d 09 50 72 65 70 61 |********|...Prepa|
|00001f50| 72 65 20 66 6f 72 20 61 | 20 67 61 6d 65 20 6c 6f |re for a| game lo|
|00001f60| 6f 70 0d 09 0d 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |op...***|********|
|00001f70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001f80| 2a 2a 2a 2a 2a 2a 2a 2f | 0d 0d 76 6f 69 64 20 50 |*******/|..void P|
|00001f90| 72 65 70 50 6c 61 79 4c | 6f 6f 70 20 28 76 6f 69 |repPlayL|oop (voi|
|00001fa0| 64 29 0d 7b 0d 09 53 74 | 61 72 74 53 6f 6e 67 28 |d).{..St|artSong(|
|00001fb0| 53 6f 6e 67 4c 69 73 74 | 50 74 72 5b 67 61 6d 65 |SongList|Ptr[game|
|00001fc0| 73 74 61 74 65 2e 6d 61 | 70 6f 6e 2b 32 5d 29 3b |state.ma|pon+2]);|
|00001fd0| 09 2f 2a 20 73 74 61 72 | 74 20 6d 75 73 69 63 20 |./* star|t music |
|00001fe0| 2a 2f 0d 09 69 66 20 28 | 21 53 65 74 75 70 47 61 |*/..if (|!SetupGa|
|00001ff0| 6d 65 4c 65 76 65 6c 28 | 29 29 20 7b 09 2f 2a 20 |meLevel(|)) {./* |
|00002000| 4c 6f 61 64 20 74 68 65 | 20 67 61 6d 65 20 6d 61 |Load the| game ma|
|00002010| 70 20 2a 2f 0d 09 09 52 | 65 6c 65 61 73 65 4d 61 |p */...R|eleaseMa|
|00002020| 70 28 29 3b 09 09 09 2f | 2a 20 52 65 6c 65 61 73 |p();.../|* Releas|
|00002030| 65 20 6d 61 70 20 6d 65 | 6d 6f 72 79 20 2a 2f 0d |e map me|mory */.|
|00002040| 09 09 52 65 6c 65 61 73 | 65 53 63 61 6c 65 72 73 |..Releas|eScalers|
|00002050| 28 29 3b 09 09 2f 2a 20 | 52 65 6c 65 61 73 65 20 |();../* |Release |
|00002060| 74 68 65 20 63 6f 6d 70 | 69 6c 65 64 20 73 63 61 |the comp|iled sca|
|00002070| 6c 65 72 73 20 2a 2f 0d | 09 09 50 6c 61 79 53 6f |lers */.|..PlaySo|
|00002080| 6e 67 28 30 29 3b 0d 09 | 09 77 68 69 6c 65 20 28 |ng(0);..|.while (|
|00002090| 21 53 65 74 75 70 47 61 | 6d 65 4c 65 76 65 6c 28 |!SetupGa|meLevel(|
|000020a0| 29 29 20 7b 09 2f 2a 20 | 54 72 79 20 6c 6f 61 64 |)) {./* |Try load|
|000020b0| 69 6e 67 20 69 74 20 61 | 67 61 69 6e 20 2a 2f 0d |ing it a|gain */.|
|000020c0| 41 67 61 69 6e 3a 0d 09 | 09 09 52 65 6c 65 61 73 |Again:..|..Releas|
|000020d0| 65 4d 61 70 28 29 3b 09 | 09 2f 2a 20 4f 68 20 6f |eMap();.|./* Oh o|
|000020e0| 68 2e 2e 2e 20 2a 2f 0d | 09 09 09 69 66 20 28 21 |h... */.|...if (!|
|000020f0| 47 61 6d 65 56 69 65 77 | 53 69 7a 65 29 20 7b 09 |GameView|Size) {.|
|00002100| 2f 2a 20 53 6d 61 6c 6c | 65 73 74 20 73 63 72 65 |/* Small|est scre|
|00002110| 65 6e 3f 20 2a 2f 0d 09 | 09 09 09 42 61 69 6c 4f |en? */..|...BailO|
|00002120| 75 74 28 29 3b 09 09 2f | 2a 20 4c 65 61 76 65 2e |ut();../|* Leave.|
|00002130| 2e 2e 20 2a 2f 0d 09 09 | 09 7d 0d 09 09 09 2d 2d |.. */...|.}....--|
|00002140| 47 61 6d 65 56 69 65 77 | 53 69 7a 65 3b 09 09 2f |GameView|Size;../|
|00002150| 2a 20 53 6d 61 6c 6c 65 | 72 20 73 63 72 65 65 6e |* Smalle|r screen|
|00002160| 20 73 69 7a 65 20 2a 2f | 0d 09 09 09 47 61 6d 65 | size */|....Game|
|00002170| 56 69 65 77 53 69 7a 65 | 20 3d 20 4e 65 77 47 61 |ViewSize| = NewGa|
|00002180| 6d 65 57 69 6e 64 6f 77 | 28 47 61 6d 65 56 69 65 |meWindow|(GameVie|
|00002190| 77 53 69 7a 65 29 3b 0d | 09 09 7d 0d 09 7d 0d 09 |wSize);.|..}..}..|
|000021a0| 69 66 20 28 21 53 74 61 | 72 74 75 70 52 65 6e 64 |if (!Sta|rtupRend|
|000021b0| 65 72 69 6e 67 28 47 61 | 6d 65 56 69 65 77 53 69 |ering(Ga|meViewSi|
|000021c0| 7a 65 29 29 20 7b 0d 09 | 09 52 65 6c 65 61 73 65 |ze)) {..|.Release|
|000021d0| 53 63 61 6c 65 72 73 28 | 29 3b 0d 09 09 67 6f 74 |Scalers(|);...got|
|000021e0| 6f 20 41 67 61 69 6e 3b | 0d 09 7d 0d 09 74 6f 70 |o Again;|..}..top|
|000021f0| 73 70 72 69 74 65 73 63 | 61 6c 65 20 3d 20 30 3b |spritesc|ale = 0;|
|00002200| 09 2f 2a 20 4e 6f 20 6f | 76 65 72 6c 61 79 20 73 |./* No o|verlay s|
|00002210| 70 72 69 74 65 20 2a 2f | 0d 09 66 61 63 65 66 72 |prite */|..facefr|
|00002220| 61 6d 65 20 3d 20 31 3b | 09 09 2f 2a 20 46 69 72 |ame = 1;|../* Fir|
|00002230| 73 74 20 66 61 63 65 20 | 2a 2f 0d 09 66 61 63 65 |st face |*/..face|
|00002240| 63 6f 75 6e 74 20 3d 20 | 31 3b 09 09 2f 2a 20 63 |count = |1;../* c|
|00002250| 68 61 6e 67 65 20 66 61 | 63 65 20 6e 65 78 74 20 |hange fa|ce next |
|00002260| 74 69 63 20 2a 2f 0d 09 | 66 69 72 73 74 66 72 61 |tic */..|firstfra|
|00002270| 6d 65 20 3d 20 31 3b 09 | 09 2f 2a 20 46 6f 72 63 |me = 1;.|./* Forc|
|00002280| 65 20 61 20 66 61 64 65 | 20 69 6e 20 2a 2f 0d 09 |e a fade| in */..|
|00002290| 4e 6f 57 65 61 70 6f 6e | 44 72 61 77 20 3d 20 30 |NoWeapon|Draw = 0|
|000022a0| 3b 09 2f 2a 20 41 6c 6c | 6f 77 20 64 72 61 77 69 |;./* All|ow drawi|
|000022b0| 6e 67 20 6f 66 20 77 65 | 61 70 6f 6e 20 2a 2f 0d |ng of we|apon */.|
|000022c0| 09 6d 65 6d 73 65 74 28 | 62 75 74 74 6f 6e 73 74 |.memset(|buttonst|
|000022d0| 61 74 65 2c 30 2c 73 69 | 7a 65 6f 66 28 62 75 74 |ate,0,si|zeof(but|
|000022e0| 74 6f 6e 73 74 61 74 65 | 29 29 3b 09 2f 2a 20 4b |tonstate|));./* K|
|000022f0| 69 6c 6c 20 74 68 65 20 | 6d 6f 75 73 65 20 73 79 |ill the |mouse sy|
|00002300| 73 74 65 6d 20 2a 2f 0d | 09 69 66 20 28 70 6c 61 |stem */.|.if (pla|
|00002310| 79 73 74 61 74 65 21 3d | 45 58 5f 4c 4f 41 44 47 |ystate!=|EX_LOADG|
|00002320| 41 4d 45 29 20 7b 0d 09 | 09 50 75 73 68 57 61 6c |AME) {..|.PushWal|
|00002330| 6c 52 65 63 2e 70 77 61 | 6c 6c 63 6f 75 6e 74 20 |lRec.pwa|llcount |
|00002340| 3d 20 30 3b 09 09 2f 2a | 20 4e 6f 20 70 75 73 68 |= 0;../*| No push|
|00002350| 77 61 6c 6c 73 20 2a 2f | 0d 09 09 67 61 6d 65 73 |walls */|...games|
|00002360| 74 61 74 65 2e 70 6c 61 | 79 74 69 6d 65 20 3d 20 |tate.pla|ytime = |
|00002370| 30 3b 09 09 2f 2a 20 47 | 61 6d 65 20 68 61 73 20 |0;../* G|ame has |
|00002380| 73 74 61 72 74 65 64 20 | 2a 2f 0d 09 7d 20 65 6c |started |*/..} el|
|00002390| 73 65 20 7b 0d 09 09 46 | 69 6e 69 73 68 4c 6f 61 |se {...F|inishLoa|
|000023a0| 64 47 61 6d 65 28 29 3b | 09 09 09 2f 2a 20 46 69 |dGame();|.../* Fi|
|000023b0| 6e 69 73 68 20 74 68 65 | 20 6c 6f 61 64 20 67 61 |nish the| load ga|
|000023c0| 6d 65 20 63 6f 64 65 20 | 2a 2f 0d 09 7d 0d 09 52 |me code |*/..}..R|
|000023d0| 65 64 72 61 77 53 74 61 | 74 75 73 42 61 72 28 29 |edrawSta|tusBar()|
|000023e0| 3b 09 2f 2a 20 52 65 64 | 72 61 77 20 74 68 65 20 |;./* Red|raw the |
|000023f0| 6d 61 69 6e 20 62 61 72 | 20 2a 2f 0d 09 6d 6f 75 |main bar| */..mou|
|00002400| 73 65 79 20 3d 20 30 3b | 09 09 09 2f 2a 20 52 65 |sey = 0;|.../* Re|
|00002410| 73 65 74 20 74 68 65 20 | 6d 6f 75 73 65 20 79 20 |set the |mouse y |
|00002420| 2a 2f 0d 09 70 6c 61 79 | 73 74 61 74 65 20 3d 20 |*/..play|state = |
|00002430| 45 58 5f 53 54 49 4c 4c | 50 4c 41 59 49 4e 47 3b |EX_STILL|PLAYING;|
|00002440| 09 2f 2a 20 47 61 6d 65 | 20 69 73 20 69 6e 20 70 |./* Game| is in p|
|00002450| 72 6f 67 72 65 73 73 20 | 2a 2f 0d 7d 0d 0d 2f 2a |rogress |*/.}../*|
|00002460| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002470| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002480| 2a 0d 0d 09 50 6c 61 79 | 20 74 68 65 20 67 61 6d |*...Play| the gam|
|00002490| 65 0d 09 0d 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |e...****|********|
|000024a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000024b0| 2a 2a 2a 2a 2a 2a 2f 0d | 0d 76 6f 69 64 20 50 6c |******/.|.void Pl|
|000024c0| 61 79 4c 6f 6f 70 28 76 | 6f 69 64 29 0d 7b 0d 09 |ayLoop(v|oid).{..|
|000024d0| 4c 6f 6e 67 57 6f 72 64 | 20 54 69 6d 65 72 3b 0d |LongWord| Timer;.|
|000024e0| 09 4c 61 73 74 54 69 63 | 43 6f 75 6e 74 20 3d 20 |.LastTic|Count = |
|000024f0| 52 65 61 64 54 69 63 6b | 28 29 3b 0d 09 64 6f 20 |ReadTick|();..do |
|00002500| 7b 0d 09 09 54 69 6d 65 | 72 20 3d 20 52 65 61 64 |{...Time|r = Read|
|00002510| 54 69 63 6b 28 29 3b 09 | 09 2f 2a 20 48 6f 77 20 |Tick();.|./* How |
|00002520| 6d 75 63 68 20 74 69 6d | 65 20 68 61 73 20 65 6c |much tim|e has el|
|00002530| 61 70 73 65 64 20 2a 2f | 0d 09 09 54 69 63 43 6f |apsed */|...TicCo|
|00002540| 75 6e 74 20 3d 20 28 54 | 69 6d 65 72 2d 4c 61 73 |unt = (T|imer-Las|
|00002550| 74 54 69 63 43 6f 75 6e | 74 29 3b 0d 09 09 67 61 |tTicCoun|t);...ga|
|00002560| 6d 65 73 74 61 74 65 2e | 70 6c 61 79 74 69 6d 65 |mestate.|playtime|
|00002570| 20 2b 3d 20 54 69 63 43 | 6f 75 6e 74 3b 09 2f 2a | += TicC|ount;./*|
|00002580| 20 41 64 64 20 74 68 65 | 20 70 68 79 73 69 63 61 | Add the| physica|
|00002590| 6c 20 74 69 6d 65 20 74 | 6f 20 74 68 65 20 65 6c |l time t|o the el|
|000025a0| 61 70 73 65 64 20 74 69 | 6d 65 20 2a 2f 0d 09 09 |apsed ti|me */...|
|000025b0| 0d 09 09 4c 61 73 74 54 | 69 63 43 6f 75 6e 74 3d |...LastT|icCount=|
|000025c0| 54 69 6d 65 72 3b 0d 09 | 09 69 66 20 28 21 53 6c |Timer;..|.if (!Sl|
|000025d0| 6f 77 44 6f 77 6e 29 20 | 7b 0d 09 09 09 54 69 63 |owDown) |{....Tic|
|000025e0| 43 6f 75 6e 74 20 3d 20 | 34 3b 09 09 2f 2a 20 41 |Count = |4;../* A|
|000025f0| 64 6a 75 73 74 20 66 72 | 6f 6d 20 34 20 2a 2f 0d |djust fr|om 4 */.|
|00002600| 09 09 7d 0d 09 09 69 66 | 20 28 54 69 63 43 6f 75 |..}...if| (TicCou|
|00002610| 6e 74 3e 3d 35 29 20 7b | 0d 09 09 09 54 69 63 43 |nt>=5) {|....TicC|
|00002620| 6f 75 6e 74 20 3d 20 34 | 3b 0d 09 09 7d 0d 09 09 |ount = 4|;...}...|
|00002630| 49 4f 5f 43 68 65 63 6b | 49 6e 70 75 74 28 29 3b |IO_Check|Input();|
|00002640| 09 2f 2a 20 52 65 61 64 | 20 74 68 65 20 63 6f 6e |./* Read| the con|
|00002650| 74 72 6f 6c 73 20 66 72 | 6f 6d 20 74 68 65 20 73 |trols fr|om the s|
|00002660| 79 73 74 65 6d 20 2a 2f | 0d 09 09 6d 61 64 65 6e |ystem */|...maden|
|00002670| 6f 69 73 65 20 3d 20 46 | 41 4c 53 45 3b 09 2f 2a |oise = F|ALSE;./*|
|00002680| 20 4e 6f 20 6e 6f 69 73 | 65 20 6d 61 64 65 20 28 | No nois|e made (|
|00002690| 59 65 74 29 20 2a 2f 0d | 09 09 4d 6f 76 65 44 6f |Yet) */.|..MoveDo|
|000026a0| 6f 72 73 28 29 3b 09 09 | 2f 2a 20 4f 70 65 6e 20 |ors();..|/* Open |
|000026b0| 61 6e 64 20 63 6c 6f 73 | 65 20 61 6c 6c 20 64 6f |and clos|e all do|
|000026c0| 6f 72 73 20 2a 2f 0d 09 | 09 4d 6f 76 65 50 57 61 |ors */..|.MovePWa|
|000026d0| 6c 6c 73 28 29 3b 09 09 | 2f 2a 20 4d 6f 76 65 20 |lls();..|/* Move |
|000026e0| 61 6c 6c 20 70 75 73 68 | 20 77 61 6c 6c 73 20 2a |all push| walls *|
|000026f0| 2f 0d 09 09 4d 6f 76 65 | 50 6c 61 79 65 72 28 29 |/...Move|Player()|
|00002700| 3b 09 09 2f 2a 20 4d 6f | 76 65 20 74 68 65 20 70 |;../* Mo|ve the p|
|00002710| 6c 61 79 65 72 20 2a 2f | 0d 09 09 4d 6f 76 65 41 |layer */|...MoveA|
|00002720| 63 74 6f 72 73 28 29 3b | 09 09 2f 2a 20 4d 6f 76 |ctors();|../* Mov|
|00002730| 65 20 61 6c 6c 20 74 68 | 65 20 62 61 64 20 67 75 |e all th|e bad gu|
|00002740| 79 73 20 2a 2f 0d 09 09 | 4d 6f 76 65 4d 69 73 73 |ys */...|MoveMiss|
|00002750| 69 6c 65 73 28 29 3b 09 | 09 2f 2a 20 4d 6f 76 65 |iles();.|./* Move|
|00002760| 20 61 6c 6c 20 70 72 6f | 6a 65 63 74 69 6c 65 73 | all pro|jectiles|
|00002770| 20 2a 2f 09 0d 09 09 55 | 70 64 61 74 65 46 61 63 | */....U|pdateFac|
|00002780| 65 28 29 3b 09 09 2f 2a | 20 44 72 61 77 20 42 4a |e();../*| Draw BJ|
|00002790| 27 73 20 66 61 63 65 20 | 61 6e 64 20 61 6e 69 6d |'s face |and anim|
|000027a0| 61 74 65 20 69 74 20 2a | 2f 0d 09 09 76 69 65 77 |ate it *|/...view|
|000027b0| 78 20 3d 20 61 63 74 6f | 72 73 5b 30 5d 2e 78 3b |x = acto|rs[0].x;|
|000027c0| 09 2f 2a 20 57 68 65 72 | 65 20 69 73 20 74 68 65 |./* Wher|e is the|
|000027d0| 20 63 61 6d 65 72 61 3f | 20 2a 2f 0d 09 09 76 69 | camera?| */...vi|
|000027e0| 65 77 79 20 3d 20 61 63 | 74 6f 72 73 5b 30 5d 2e |ewy = ac|tors[0].|
|000027f0| 79 3b 09 09 0d 09 09 52 | 65 6e 64 65 72 56 69 65 |y;.....R|enderVie|
|00002800| 77 28 29 3b 09 09 2f 2a | 20 44 72 61 77 20 74 68 |w();../*| Draw th|
|00002810| 65 20 33 44 20 76 69 65 | 77 20 2a 2f 0d 09 7d 20 |e 3D vie|w */..} |
|00002820| 77 68 69 6c 65 20 28 70 | 6c 61 79 73 74 61 74 65 |while (p|laystate|
|00002830| 3d 3d 45 58 5f 53 54 49 | 4c 4c 50 4c 41 59 49 4e |==EX_STI|LLPLAYIN|
|00002840| 47 29 3b 0d 09 53 74 6f | 70 53 6f 6e 67 28 29 3b |G);..Sto|pSong();|
|00002850| 0d 7d 0d 0d 2f 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.}../***|********|
|00002860| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002870| 2a 2a 2a 2a 2a 2a 2a 0d | 0d 09 53 65 74 20 75 70 |*******.|..Set up|
|00002880| 20 6e 65 77 20 67 61 6d | 65 20 74 6f 20 73 74 61 | new gam|e to sta|
|00002890| 72 74 20 66 72 6f 6d 20 | 74 68 65 20 62 65 67 69 |rt from |the begi|
|000028a0| 6e 6e 69 6e 67 0d 0d 2a | 2a 2a 2a 2a 2a 2a 2a 2a |nning..*|********|
|000028b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000028c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2f 0d 0d 76 6f 69 64 |********|*/..void|
|000028d0| 20 4e 65 77 47 61 6d 65 | 28 76 6f 69 64 29 0d 7b | NewGame|(void).{|
|000028e0| 0d 09 6e 65 78 74 6d 61 | 70 20 3d 20 30 3b 09 09 |..nextma|p = 0;..|
|000028f0| 09 2f 2a 20 4e 6f 20 6e | 65 78 74 20 6d 61 70 20 |./* No n|ext map |
|00002900| 69 6e 69 74 65 64 20 2a | 2f 0d 09 6d 65 6d 73 65 |inited *|/..memse|
|00002910| 74 28 26 67 61 6d 65 73 | 74 61 74 65 2c 30 2c 73 |t(&games|tate,0,s|
|00002920| 69 7a 65 6f 66 28 67 61 | 6d 65 73 74 61 74 65 29 |izeof(ga|mestate)|
|00002930| 29 3b 09 2f 2a 20 5a 61 | 70 20 74 68 65 20 67 61 |);./* Za|p the ga|
|00002940| 6d 65 20 76 61 72 69 61 | 62 6c 65 73 20 2a 2f 0d |me varia|bles */.|
|00002950| 09 67 61 6d 65 73 74 61 | 74 65 2e 77 65 61 70 6f |.gamesta|te.weapo|
|00002960| 6e 20 3d 20 67 61 6d 65 | 73 74 61 74 65 2e 70 65 |n = game|state.pe|
|00002970| 6e 64 69 6e 67 77 65 61 | 70 6f 6e 20 3d 20 57 50 |ndingwea|pon = WP|
|00002980| 5f 50 49 53 54 4f 4c 3b | 09 2f 2a 20 53 65 74 20 |_PISTOL;|./* Set |
|00002990| 74 68 65 20 70 69 73 74 | 6f 6c 20 2a 2f 0d 09 67 |the pist|ol */..g|
|000029a0| 61 6d 65 73 74 61 74 65 | 2e 68 65 61 6c 74 68 20 |amestate|.health |
|000029b0| 3d 20 31 30 30 3b 09 09 | 2f 2a 20 52 65 73 65 74 |= 100;..|/* Reset|
|000029c0| 20 74 68 65 20 68 65 61 | 6c 74 68 20 2a 2f 0d 09 | the hea|lth */..|
|000029d0| 67 61 6d 65 73 74 61 74 | 65 2e 61 6d 6d 6f 20 3d |gamestat|e.ammo =|
|000029e0| 20 53 54 41 52 54 41 4d | 4d 4f 3b 09 2f 2a 20 52 | STARTAM|MO;./* R|
|000029f0| 65 73 65 74 20 74 68 65 | 20 61 6d 6d 6f 20 2a 2f |eset the| ammo */|
|00002a00| 0d 09 69 66 20 28 21 64 | 69 66 66 69 63 75 6c 74 |..if (!d|ifficult|
|00002a10| 79 29 20 7b 0d 09 09 67 | 61 6d 65 73 74 61 74 65 |y) {...g|amestate|
|00002a20| 2e 61 6d 6d 6f 20 2b 3d | 20 53 54 41 52 54 41 4d |.ammo +=| STARTAM|
|00002a30| 4d 4f 3b 09 2f 2a 20 44 | 6f 75 62 6c 65 20 74 68 |MO;./* D|ouble th|
|00002a40| 65 20 61 6d 6d 6f 20 69 | 66 20 65 61 73 79 20 2a |e ammo i|f easy *|
|00002a50| 2f 0d 09 7d 09 09 0d 09 | 67 61 6d 65 73 74 61 74 |/..}....|gamestat|
|00002a60| 65 2e 6d 61 78 61 6d 6d | 6f 20 3d 20 39 39 3b 09 |e.maxamm|o = 99;.|
|00002a70| 09 2f 2a 20 52 65 66 69 | 6c 6c 20 74 68 65 20 61 |./* Refi|ll the a|
|00002a80| 6d 6d 6f 20 2a 2f 0d 09 | 67 61 6d 65 73 74 61 74 |mmo */..|gamestat|
|00002a90| 65 2e 6c 69 76 65 73 20 | 3d 20 33 3b 09 09 2f 2a |e.lives |= 3;../*|
|00002aa0| 20 33 20 6c 69 76 65 73 | 20 2a 2f 0d 09 67 61 6d | 3 lives| */..gam|
|00002ab0| 65 73 74 61 74 65 2e 6e | 65 78 74 65 78 74 72 61 |estate.n|extextra|
|00002ac0| 20 3d 20 45 58 54 52 41 | 50 4f 49 4e 54 53 3b 09 | = EXTRA|POINTS;.|
|00002ad0| 2f 2a 20 4e 65 78 74 20 | 66 72 65 65 20 6c 69 66 |/* Next |free lif|
|00002ae0| 65 20 73 63 6f 72 65 20 | 6e 65 65 64 65 64 20 2a |e score |needed *|
|00002af0| 2f 0d 09 67 61 6d 65 73 | 74 61 74 65 2e 67 6f 64 |/..games|tate.god|
|00002b00| 6d 6f 64 65 20 3d 20 30 | 3b 09 09 2f 2a 20 46 6f |mode = 0|;../* Fo|
|00002b10| 72 63 65 20 67 6f 64 20 | 6d 6f 64 65 20 6f 66 66 |rce god |mode off|
|00002b20| 20 2a 2f 0d 7d 0d 0d 2f | 2a 2a 2a 2a 2a 2a 2a 2a | */.}../|********|
|00002b30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0d 0d 09 52 65 64 |********|**...Red|
|00002b50| 72 61 77 20 74 68 65 20 | 6d 61 69 6e 20 73 74 61 |raw the |main sta|
|00002b60| 74 75 73 20 62 61 72 20 | 61 74 20 74 68 65 20 62 |tus bar |at the b|
|00002b70| 6f 74 74 6f 6d 0d 09 0d | 2a 2a 2a 2a 2a 2a 2a 2a |ottom...|********|
|00002b80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2f 0d 0d 76 6f 69 |********|**/..voi|
|00002ba0| 64 20 52 65 64 72 61 77 | 53 74 61 74 75 73 42 61 |d Redraw|StatusBa|
|00002bb0| 72 28 76 6f 69 64 29 0d | 7b 09 0d 09 49 4f 5f 44 |r(void).|{...IO_D|
|00002bc0| 72 61 77 53 74 61 74 75 | 73 42 61 72 28 29 3b 09 |rawStatu|sBar();.|
|00002bd0| 09 09 2f 2a 20 44 72 61 | 77 20 74 68 65 20 73 74 |../* Dra|w the st|
|00002be0| 61 74 75 73 20 62 61 72 | 20 2a 2f 0d 09 49 4f 5f |atus bar| */..IO_|
|00002bf0| 44 72 61 77 46 6c 6f 6f | 72 28 67 61 6d 65 73 74 |DrawFloo|r(gamest|
|00002c00| 61 74 65 2e 6d 61 70 6f | 6e 29 3b 09 2f 2a 20 44 |ate.mapo|n);./* D|
|00002c10| 72 61 77 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |raw the |current |
|00002c20| 66 6c 6f 6f 72 20 23 20 | 2a 2f 0d 09 49 4f 5f 44 |floor # |*/..IO_D|
|00002c30| 72 61 77 53 63 6f 72 65 | 28 67 61 6d 65 73 74 61 |rawScore|(gamesta|
|00002c40| 74 65 2e 73 63 6f 72 65 | 29 3b 09 2f 2a 20 44 72 |te.score|);./* Dr|
|00002c50| 61 77 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 73 |aw the c|urrent s|
|00002c60| 63 6f 72 65 20 2a 2f 0d | 09 49 4f 5f 44 72 61 77 |core */.|.IO_Draw|
|00002c70| 54 72 65 61 73 75 72 65 | 28 67 61 6d 65 73 74 61 |Treasure|(gamesta|
|00002c80| 74 65 2e 74 72 65 61 73 | 75 72 65 29 3b 09 2f 2a |te.treas|ure);./*|
|00002c90| 20 44 72 61 77 20 74 68 | 65 20 74 72 65 61 73 75 | Draw th|e treasu|
|00002ca0| 72 65 20 73 63 6f 72 65 | 20 2a 2f 0d 09 49 4f 5f |re score| */..IO_|
|00002cb0| 44 72 61 77 4c 69 76 65 | 73 28 67 61 6d 65 73 74 |DrawLive|s(gamest|
|00002cc0| 61 74 65 2e 6c 69 76 65 | 73 29 3b 09 09 2f 2a 20 |ate.live|s);../* |
|00002cd0| 44 72 61 77 20 74 68 65 | 20 6c 69 66 65 20 63 6f |Draw the| life co|
|00002ce0| 75 6e 74 20 2a 2f 0d 09 | 49 4f 5f 44 72 61 77 48 |unt */..|IO_DrawH|
|00002cf0| 65 61 6c 74 68 28 67 61 | 6d 65 73 74 61 74 65 2e |ealth(ga|mestate.|
|00002d00| 68 65 61 6c 74 68 29 3b | 09 2f 2a 20 44 72 61 77 |health);|./* Draw|
|00002d10| 20 74 68 65 20 68 65 61 | 6c 74 68 20 2a 2f 0d 09 | the hea|lth */..|
|00002d20| 73 77 69 74 63 68 20 28 | 67 61 6d 65 73 74 61 74 |switch (|gamestat|
|00002d30| 65 2e 77 65 61 70 6f 6e | 29 20 7b 09 09 09 2f 2a |e.weapon|) {.../*|
|00002d40| 20 44 72 61 77 20 74 68 | 65 20 70 72 6f 70 65 72 | Draw th|e proper|
|00002d50| 20 61 6d 6d 6f 20 2a 2f | 0d 09 63 61 73 65 20 57 | ammo */|..case W|
|00002d60| 50 5f 46 4c 41 4d 45 54 | 48 52 4f 57 45 52 3a 0d |P_FLAMET|HROWER:.|
|00002d70| 09 09 49 4f 5f 44 72 61 | 77 41 6d 6d 6f 28 67 61 |..IO_Dra|wAmmo(ga|
|00002d80| 6d 65 73 74 61 74 65 2e | 67 61 73 29 3b 0d 09 09 |mestate.|gas);...|
|00002d90| 62 72 65 61 6b 3b 0d 09 | 63 61 73 65 20 57 50 5f |break;..|case WP_|
|00002da0| 4d 49 53 53 49 4c 45 3a | 0d 09 09 49 4f 5f 44 72 |MISSILE:|...IO_Dr|
|00002db0| 61 77 41 6d 6d 6f 28 67 | 61 6d 65 73 74 61 74 65 |awAmmo(g|amestate|
|00002dc0| 2e 6d 69 73 73 69 6c 65 | 73 29 3b 0d 09 09 62 72 |.missile|s);...br|
|00002dd0| 65 61 6b 3b 0d 09 64 65 | 66 61 75 6c 74 3a 0d 09 |eak;..de|fault:..|
|00002de0| 09 49 4f 5f 44 72 61 77 | 41 6d 6d 6f 28 67 61 6d |.IO_Draw|Ammo(gam|
|00002df0| 65 73 74 61 74 65 2e 61 | 6d 6d 6f 29 3b 0d 09 09 |estate.a|mmo);...|
|00002e00| 62 72 65 61 6b 3b 0d 09 | 7d 0d 09 49 4f 5f 44 72 |break;..|}..IO_Dr|
|00002e10| 61 77 4b 65 79 73 28 67 | 61 6d 65 73 74 61 74 65 |awKeys(g|amestate|
|00002e20| 2e 6b 65 79 73 29 3b 09 | 09 2f 2a 20 44 72 61 77 |.keys);.|./* Draw|
|00002e30| 20 74 68 65 20 6b 65 79 | 73 20 68 65 6c 64 20 2a | the key|s held *|
|00002e40| 2f 0d 09 49 4f 5f 44 72 | 61 77 46 61 63 65 28 66 |/..IO_Dr|awFace(f|
|00002e50| 61 63 65 66 72 61 6d 65 | 29 3b 09 09 09 09 2f 2a |aceframe|);..../*|
|00002e60| 20 44 72 61 77 20 42 4a | 27 73 20 66 61 63 65 20 | Draw BJ|'s face |
|00002e70| 2a 2f 0d 7d 0d 0d 2f 2a | 2a 2a 2a 2a 2a 2a 2a 2a |*/.}../*|********|
|00002e80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002e90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0d 0d 09 50 6c 61 79 |********|*...Play|
|00002ea0| 20 74 68 65 20 67 61 6d | 65 21 0d 09 0d 2a 2a 2a | the gam|e!...***|
|00002eb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ec0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|00002ed0| 0d 0d 76 6f 69 64 20 47 | 61 6d 65 4c 6f 6f 70 20 |..void G|ameLoop |
|00002ee0| 28 76 6f 69 64 29 0d 7b | 0d 09 66 6f 72 28 3b 3b |(void).{|..for(;;|
|00002ef0| 29 20 7b 0d 73 6b 69 70 | 62 72 69 65 66 3a 09 09 |) {.skip|brief:..|
|00002f00| 0d 09 09 53 68 6f 77 47 | 65 74 50 73 79 63 68 65 |...ShowG|etPsyche|
|00002f10| 64 28 29 3b 0d 09 09 50 | 72 65 70 50 6c 61 79 4c |d();...P|repPlayL|
|00002f20| 6f 6f 70 28 29 3b 09 09 | 2f 2a 20 49 6e 69 74 20 |oop();..|/* Init |
|00002f30| 69 6e 74 65 72 6e 61 6c | 20 76 61 72 69 61 62 6c |internal| variabl|
|00002f40| 65 73 20 2a 2f 0d 09 09 | 45 6e 64 47 65 74 50 73 |es */...|EndGetPs|
|00002f50| 79 63 68 65 64 28 29 3b | 0d 09 09 50 6c 61 79 4c |yched();|...PlayL|
|00002f60| 6f 6f 70 28 29 3b 09 09 | 09 2f 2a 20 50 6c 61 79 |oop();..|./* Play|
|00002f70| 20 74 68 65 20 67 61 6d | 65 20 2a 2f 0d 09 09 69 | the gam|e */...i|
|00002f80| 66 20 28 70 6c 61 79 73 | 74 61 74 65 20 3d 3d 20 |f (plays|tate == |
|00002f90| 45 58 5f 44 49 45 44 29 | 20 7b 09 09 2f 2a 20 44 |EX_DIED)| {../* D|
|00002fa0| 69 64 20 79 6f 75 20 64 | 69 65 3f 20 2a 2f 0d 09 |id you d|ie? */..|
|00002fb0| 09 09 2d 2d 67 61 6d 65 | 73 74 61 74 65 2e 6c 69 |..--game|state.li|
|00002fc0| 76 65 73 3b 09 09 09 2f | 2a 20 52 65 6d 6f 76 65 |ves;.../|* Remove|
|00002fd0| 20 61 20 6c 69 66 65 20 | 2a 2f 0d 09 09 09 44 69 | a life |*/....Di|
|00002fe0| 65 64 28 29 3b 09 09 09 | 09 09 09 2f 2a 20 52 75 |ed();...|.../* Ru|
|00002ff0| 6e 20 74 68 65 20 64 65 | 61 74 68 20 63 6f 64 65 |n the de|ath code|
|00003000| 20 2a 2f 0d 09 09 09 69 | 66 20 28 21 67 61 6d 65 | */....i|f (!game|
|00003010| 73 74 61 74 65 2e 6c 69 | 76 65 73 29 20 7b 09 09 |state.li|ves) {..|
|00003020| 2f 2a 20 4e 6f 20 6d 6f | 72 65 20 6c 69 76 65 73 |/* No mo|re lives|
|00003030| 3f 20 2a 2f 0d 09 09 09 | 09 72 65 74 75 72 6e 3b |? */....|.return;|
|00003040| 09 09 09 09 09 2f 2a 20 | 45 78 69 74 20 74 68 65 |...../* |Exit the|
|00003050| 6e 20 2a 2f 0d 09 09 09 | 7d 09 0d 09 09 09 67 6f |n */....|}.....go|
|00003060| 74 6f 20 73 6b 69 70 62 | 72 69 65 66 3b 09 09 09 |to skipb|rief;...|
|00003070| 09 2f 2a 20 54 72 79 20 | 61 67 61 69 6e 20 2a 2f |./* Try |again */|
|00003080| 0d 09 09 7d 0d 09 09 0d | 09 09 69 66 20 28 70 6c |...}....|..if (pl|
|00003090| 61 79 73 74 61 74 65 20 | 3d 3d 20 45 58 5f 53 45 |aystate |== EX_SE|
|000030a0| 43 52 45 54 29 20 7b 09 | 2f 2a 20 47 6f 69 6e 67 |CRET) {.|/* Going|
|000030b0| 20 74 6f 20 74 68 65 20 | 73 65 63 72 65 74 20 6c | to the |secret l|
|000030c0| 65 76 65 6c 3f 20 2a 2f | 0d 09 09 09 6e 65 78 74 |evel? */|....next|
|000030d0| 6d 61 70 20 3d 20 4d 61 | 70 4c 69 73 74 50 74 72 |map = Ma|pListPtr|
|000030e0| 2d 3e 49 6e 66 6f 41 72 | 72 61 79 5b 67 61 6d 65 |->InfoAr|ray[game|
|000030f0| 73 74 61 74 65 2e 6d 61 | 70 6f 6e 5d 2e 53 65 63 |state.ma|pon].Sec|
|00003100| 72 65 74 4c 65 76 65 6c | 3b 0d 09 09 7d 20 65 6c |retLevel|;...} el|
|00003110| 73 65 20 69 66 20 28 70 | 6c 61 79 73 74 61 74 65 |se if (p|laystate|
|00003120| 20 21 3d 20 45 58 5f 57 | 41 52 50 45 44 29 20 7b | != EX_W|ARPED) {|
|00003130| 0d 09 09 09 6e 65 78 74 | 6d 61 70 20 3d 20 4d 61 |....next|map = Ma|
|00003140| 70 4c 69 73 74 50 74 72 | 2d 3e 49 6e 66 6f 41 72 |pListPtr|->InfoAr|
|00003150| 72 61 79 5b 67 61 6d 65 | 73 74 61 74 65 2e 6d 61 |ray[game|state.ma|
|00003160| 70 6f 6e 5d 2e 4e 65 78 | 74 4c 65 76 65 6c 3b 20 |pon].Nex|tLevel; |
|00003170| 2f 2a 20 4e 6f 72 6d 61 | 6c 20 77 61 72 70 3f 20 |/* Norma|l warp? |
|00003180| 2a 2f 0d 09 09 7d 09 09 | 09 2f 2a 20 49 66 20 77 |*/...}..|./* If w|
|00003190| 61 72 70 65 64 2c 20 74 | 68 65 6e 20 6e 65 78 74 |arped, t|hen next|
|000031a0| 6d 61 70 20 69 73 20 70 | 72 65 73 65 74 20 2a 2f |map is p|reset */|
|000031b0| 0d 09 09 69 66 20 28 6e | 65 78 74 6d 61 70 20 3d |...if (n|extmap =|
|000031c0| 3d 20 30 78 66 66 66 66 | 29 20 7b 09 2f 2a 20 4c |= 0xffff|) {./* L|
|000031d0| 61 73 74 20 6c 65 76 65 | 6c 3f 20 2a 2f 0d 09 09 |ast leve|l? */...|
|000031e0| 09 56 69 63 74 6f 72 79 | 53 63 61 6c 65 28 29 3b |.Victory|Scale();|
|000031f0| 09 09 09 09 2f 2a 20 59 | 6f 75 20 77 69 6e 21 21 |..../* Y|ou win!!|
|00003200| 20 2a 2f 0d 09 09 09 52 | 65 6c 65 61 73 65 4d 61 | */....R|eleaseMa|
|00003210| 70 28 29 3b 09 09 2f 2a | 20 55 6e 6c 6f 61 64 20 |p();../*| Unload |
|00003220| 74 68 65 20 6d 61 70 20 | 2a 2f 0d 09 09 09 49 6e |the map |*/....In|
|00003230| 74 65 72 6d 69 73 73 69 | 6f 6e 28 29 3b 09 09 09 |termissi|on();...|
|00003240| 09 2f 2a 20 44 69 73 70 | 6c 61 79 20 74 68 65 20 |./* Disp|lay the |
|00003250| 77 72 61 70 75 70 2e 2e | 2e 20 2a 2f 0d 09 09 09 |wrapup..|. */....|
|00003260| 53 68 61 72 65 57 61 72 | 65 45 6e 64 28 29 3b 09 |ShareWar|eEnd();.|
|00003270| 09 09 2f 2a 20 45 6e 64 | 20 74 68 65 20 67 61 6d |../* End| the gam|
|00003280| 65 20 66 6f 72 20 74 68 | 65 20 73 68 61 72 65 77 |e for th|e sharew|
|00003290| 61 72 65 20 76 65 72 73 | 69 6f 6e 20 2a 2f 0d 2f |are vers|ion */./|
|000032a0| 2a 09 09 09 56 69 63 74 | 6f 72 79 49 6e 74 65 72 |*...Vict|oryInter|
|000032b0| 6d 69 73 73 69 6f 6e 28 | 29 3b 09 09 2f 2a 20 57 |mission(|);../* W|
|000032c0| 72 61 70 75 70 20 66 6f | 72 20 76 69 63 74 6f 72 |rapup fo|r victor|
|000032d0| 79 21 20 2a 2f 0d 09 09 | 09 72 65 74 75 72 6e 3b |y! */...|.return;|
|000032e0| 0d 09 09 7d 0d 09 09 52 | 65 6c 65 61 73 65 4d 61 |...}...R|eleaseMa|
|000032f0| 70 28 29 3b 09 09 09 09 | 2f 2a 20 55 6e 6c 6f 61 |p();....|/* Unloa|
|00003300| 64 20 74 68 65 20 67 61 | 6d 65 20 6d 61 70 20 2a |d the ga|me map *|
|00003310| 2f 0d 09 09 67 61 6d 65 | 73 74 61 74 65 2e 6b 65 |/...game|state.ke|
|00003320| 79 73 20 3d 20 30 3b 09 | 09 09 2f 2a 20 5a 61 70 |ys = 0;.|../* Zap|
|00003330| 20 74 68 65 20 6b 65 79 | 73 20 2a 2f 0d 09 09 57 | the key|s */...W|
|00003340| 61 69 74 54 69 63 6b 73 | 28 31 29 3b 09 09 09 09 |aitTicks|(1);....|
|00003350| 2f 2a 20 46 6c 75 73 68 | 20 74 68 65 20 74 69 63 |/* Flush| the tic|
|00003360| 6b 65 72 20 2a 2f 0d 09 | 09 57 61 69 74 54 69 63 |ker */..|.WaitTic|
|00003370| 6b 73 28 33 30 29 3b 09 | 09 09 09 2f 2a 20 57 61 |ks(30);.|.../* Wa|
|00003380| 69 74 20 66 6f 72 20 74 | 68 65 20 73 6f 75 6e 64 |it for t|he sound|
|00003390| 20 74 6f 20 66 69 6e 69 | 73 68 20 2a 2f 0d 09 09 | to fini|sh */...|
|000033a0| 69 66 20 28 70 6c 61 79 | 73 74 61 74 65 20 21 3d |if (play|state !=|
|000033b0| 20 45 58 5f 57 41 52 50 | 45 44 29 20 7b 09 2f 2a | EX_WARP|ED) {./*|
|000033c0| 20 4e 6f 20 62 6f 6e 75 | 73 20 66 6f 72 20 77 61 | No bonu|s for wa|
|000033d0| 72 70 69 6e 67 21 20 2a | 2f 0d 09 09 09 49 6e 74 |rping! *|/....Int|
|000033e0| 65 72 6d 69 73 73 69 6f | 6e 28 29 3b 09 09 09 09 |ermissio|n();....|
|000033f0| 2f 2a 20 53 68 6f 77 20 | 74 68 65 20 77 72 61 70 |/* Show |the wrap|
|00003400| 20 75 70 2e 2e 2e 20 2a | 2f 0d 09 09 7d 0d 09 09 | up... *|/...}...|
|00003410| 67 61 6d 65 73 74 61 74 | 65 2e 6d 61 70 6f 6e 20 |gamestat|e.mapon |
|00003420| 3d 20 6e 65 78 74 6d 61 | 70 3b 09 2f 2a 20 4e 65 |= nextma|p;./* Ne|
|00003430| 78 74 20 6c 65 76 65 6c | 20 2a 2f 0d 09 7d 0d 7d |xt level| */..}.}|
|00003440| 0d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003480| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00003490| 28 00 34 b2 6b 87 ea 7d | 3d 20 0e 5b 76 5b 45 59 |(.4.k..}|= .[v[EY|
|000034a0| 4d 58 01 21 6e 5b 5e 20 | 0c 5c 20 3d 52 60 4c 01 |MX.!n[^ |.\ =R`L.|
|000034b0| 0a 57 6f 6c 66 4d 61 69 | 6e 2e 63 00 02 00 00 00 |.WolfMai|n.c.....|
|000034c0| 54 45 58 54 70 64 6f 73 | 01 00 01 a0 01 00 00 00 |TEXTpdos|........|
|000034d0| 00 00 54 45 58 54 70 64 | 6f 73 01 00 01 a0 01 00 |..TEXTpd|os......|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 a9 61 c9 bc 00 00 | 33 c1 00 00 01 7e 02 bc |...a....|3....~..|
|00003500| a8 00 42 6d be 03 be a8 | 00 3e 67 38 7f 02 21 46 |..Bm....|.>g8..!F|
|00003510| 00 42 7f 02 21 47 00 3e | 86 20 23 86 20 22 01 51 |.B..!G.>|. #. ".Q|
|00003520| 44 20 43 68 81 73 01 18 | c0 79 20 0c 5c 24 55 7f |D Ch.s..|.y .\$U.|
|00003530| 03 22 28 00 54 b2 ab 81 | 02 66 20 22 28 ee 01 b2 |."(.T...|.f "(...|
|00003540| ab a8 01 66 16 56 52 60 | 4c 01 fe 9a 6d de b4 02 |...f.VR`|L...m...|
|00003550| 4a 01 67 02 7d 3d 5f 65 | 4e ff 00 00 02 68 a8 9f |J.g.}=_e|N....h..|
|00003560| 65 72 00 12 08 01 00 00 | 03 46 33 03 00 00 00 00 |er......|.F3.....|
|00003570| 01 1b 80 6f 63 4b 5c 6a | 14 26 6e 00 0c 28 6e 00 |...ocK\j|.&n..(n.|
|00003580| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00003590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035a0| 00 00 00 00 00 00 00 03 | 00 04 00 43 00 08 01 b3 |........|...C....|
|000035b0| 02 6c 00 43 00 08 01 b3 | 02 6c aa b9 b8 1f 00 00 |.l.C....|.l......|
|000035c0| 2f 10 00 00 2f 17 00 00 | 2e fd 01 00 00 00 01 00 |/.../...|........|
|000035d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 7e b6 28 |...L...L|...2.~.(|
|000035e0| 11 a2 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|000035f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+