9 unsigned char *SpriteBuf
;
10 unsigned char *BlocksBuf
;
14 unsigned char Grid
[17][17],
36 #include "BomberInclude.c"
38 #include "BomberVarious.c"
39 #include "BomberSounds.c"
40 #include "BomberKeyboard.c"
41 #include "BomberSprites.c"
42 #include "BomberMap.c"
43 #include "BomberPlayers.c"
44 #include "BomberExpl.c"
45 #include "BomberBonus.c"
46 #include "BomberBombs.c"
47 #include "BomberMidi.c"
48 #include "BomberSetup.c"
49 #include "BomberWinLose.c"
50 #include "BomberMenu.c"
58 for (p
= 0; p
< Players
; p
++) PlayerWon
[p
] = 0;
66 //Player one, start at bottom right
67 PlayerX
[0] = PlayerY
[0] = (15 << 4) + 8;
68 //Player two start at top left
69 PlayerX
[1] = PlayerY
[1] = (1 << 4) + 8;
70 //Player three, start at bottom left
71 PlayerX
[2] = PlayerX
[1];
72 PlayerY
[2] = PlayerY
[0];
73 //Player four start at top right
74 PlayerX
[3] = PlayerX
[0];
75 PlayerY
[3] = PlayerY
[1];
76 //Draw to the backbuffer
77 TargetData
= BackBitmapData
;
84 //Set time out at 3 minutes = 2770 frames
87 //Player is not dead, looking down
88 for (p
= 0; p
< Players
; p
++) {
92 //Wait until enter has been released
95 HandleIntuiMessages();
96 } while (GetAsyncKeyState (VK_RETURN
));
101 //Check whether the game should end
104 int LivingPlayers
= Players
, p
;
106 //Move towards timeout
109 //Count amount of living players
110 for (p
= 0; p
< Players
; p
++)
111 if (PlayerDead
[p
]) LivingPlayers
--;
112 //Set timeout and disallow bombs
113 if (LivingPlayers
< 2) {
114 if (TimeOut
> 60) TimeOut
= 60;
118 //If timeout has been reached, show win/lose screen
125 //Initialize the game
128 srand ((unsigned)time (NULL
));
144 //The actual game itself
150 if (!Playing
) PlayMidi ("BOMBER.MID");
167 WaitFor (65); /* 65 */ /* 1000 / FPS */
168 //Escape quits to menu
182 //Call appropriate frame
183 if (State
== IN_MENU
) MenuLoop ();
184 if (State
== IN_SETUP
) SetupLoop ();
185 if (State
== IN_GAME
) GameLoop ();
186 if (State
== IN_WNLS
) WinLoseLoop ();