* compilers suck.
*/
-#include "display.h"
-#include "tile.h"
-#include "level.h"
-#include "sample.h"
+#include "main_em.h"
#define RANDOM (random = random << 31 | random >> 1)
void synchro_2(void)
{
- register unsigned int x = 0;
- register unsigned int y = 1;
- register unsigned long random = RandomEM;
- register unsigned short *cave_cache = Cave[y]; /* might be a win */
- unsigned long score = 0;
-
- unsigned int temp = 0; /* initialized to make compilers happy */
- unsigned int dx; /* only needed to find closest player */
- unsigned int dy;
+ int x = 0;
+ int y = 1;
+ unsigned long random = RandomEM;
+ short *cave_cache = Cave[y]; /* might be a win */
+ int score = 0;
+
+ int temp = 0; /* initialized to make compilers happy */
+ int dx; /* only needed to find closest player */
+ int dy;
int element;
loop:
Boom[y+2][x-1] = Xemerald;
Boom[y+2][x] = Xemerald;
Boom[y+2][x+1] = Xemerald;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
score += lev.bug_score;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
score += lev.tank_score;
Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6];
Boom[y+2][x] = lev.eater_array[lev.eater_pos][7];
Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8];
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
lev.eater_pos = (lev.eater_pos + 1) & 7;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
score += lev.alien_score;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
goto loop;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
goto loop;
Boom[y+2][x-1] = Xemerald;
Boom[y+2][x] = Xemerald;
Boom[y+2][x+1] = Xemerald;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
score += lev.bug_score;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
score += lev.tank_score;
Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6];
Boom[y+2][x] = lev.eater_array[lev.eater_pos][7];
Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8];
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
lev.eater_pos = (lev.eater_pos + 1) & 7;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
score += lev.alien_score;
Boom[y+1][x-1] = Xblank;
Boom[y+1][x] = Xblank;
Boom[y+1][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
goto loop;
Boom[y+1][x-1] = Xemerald;
Boom[y+1][x] = Xemerald;
Boom[y+1][x+1] = Xemerald;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
goto loop;
Boom[y+1][x-1] = Xblank;
Boom[y+1][x] = Xblank;
Boom[y+1][x+1] = Xblank;
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, element);
#endif
goto loop;
case Xboom_android:
-#if 0
+#if PLAY_ELEMENT_SOUND
play_element_sound(x, y, SAMPLE_boom, Xandroid);
#endif
case Xboom_1:
Next[y][x] = Xboom_2;
-#if 1
- play_sound(x, y, SAMPLE_boom);
+#if !PLAY_ELEMENT_SOUND
+ if (x != lev.exit_x && y != lev.exit_y)
+ play_sound(x, y, SAMPLE_boom);
+ else
+ lev.exit_x = lev.exit_y = -1;
#endif
goto loop;