#define DL_LASER_ENABLED 1
/* values for 'click_delay_value' in ClickElement() */
-#define CLICK_DELAY_SHORT 125
-#define CLICK_DELAY_LONG 250
+#define CLICK_DELAY_FIRST 12 /* delay (frames) after first click */
+#define CLICK_DELAY 6 /* delay (frames) for pressed butten */
-#define AUTO_ROTATE_DELAY CLICK_DELAY_SHORT
-#define INIT_GAME_ACTIONS_DELAY ONE_SECOND_DELAY
+#define AUTO_ROTATE_DELAY CLICK_DELAY
+#define INIT_GAME_ACTIONS_DELAY (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
#define NUM_INIT_CYCLE_STEPS 16
+#define PACMAN_MOVE_DELAY 12
+#define ENERGY_DELAY (4 * ONE_SECOND_DELAY / GAME_FRAME_DELAY)
+#define HEALTH_DEC_DELAY 3
+#define HEALTH_INC_DELAY 9
+#define HEALTH_DELAY(x) ((x) ? HEALTH_DEC_DELAY : HEALTH_INC_DELAY)
/* forward declaration for internal use */
static int MovingOrBlocked2Element_MM(int, int);
void InitGameActions_MM()
{
- int num_init_game_frames = INIT_GAME_ACTIONS_DELAY / GAME_FRAME_DELAY;
+ int num_init_game_frames = INIT_GAME_ACTIONS_DELAY;
int cycle_steps_done = 0;
int i;
void ClickElement(int x, int y, int button)
{
static unsigned int click_delay = 0;
- static int click_delay_value = CLICK_DELAY_SHORT;
+ static int click_delay_value = CLICK_DELAY;
static boolean new_button = TRUE;
int element;
if (button == MB_RELEASED)
{
new_button = TRUE;
- click_delay_value = CLICK_DELAY_SHORT;
+ click_delay_value = CLICK_DELAY;
/* release eventually hold auto-rotating mirror */
RotateMirror(x, y, MB_RELEASED);
return;
}
- if (!DelayReached(&click_delay, click_delay_value) && !new_button)
+ if (!FrameReached(&click_delay, click_delay_value) && !new_button)
return;
if (button == MB_MIDDLEBUTTON) /* middle button has no function */
DrawLaser(0, DL_LASER_ENABLED);
}
- click_delay_value = (new_button ? CLICK_DELAY_LONG : CLICK_DELAY_SHORT);
+ click_delay_value = (new_button ? CLICK_DELAY_FIRST : CLICK_DELAY);
new_button = FALSE;
}
static unsigned int rotate_delay = 0;
int x, y;
- if (!DelayReached(&rotate_delay, AUTO_ROTATE_DELAY))
+ if (!FrameReached(&rotate_delay, AUTO_ROTATE_DELAY))
return;
for (x = 0; x < lev_fieldx; x++)
static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
{
- static unsigned int action_delay = 0;
static unsigned int pacman_delay = 0;
static unsigned int energy_delay = 0;
static unsigned int overload_delay = 0;
int r, d;
- WaitUntilDelayReached(&action_delay, GameFrameDelay);
-
for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
Stop[x][y] = FALSE;
CT = Counter();
- if (game_mm.num_pacman && DelayReached(&pacman_delay, 250))
+ if (game_mm.num_pacman && FrameReached(&pacman_delay, PACMAN_MOVE_DELAY))
{
MovePacMen();
}
}
- if (DelayReached(&energy_delay, 4000))
+ if (FrameReached(&energy_delay, ENERGY_DELAY))
{
game_mm.energy_left--;
if (game_mm.energy_left >= 0)
if (((laser.overloaded && laser.overload_value < MAX_LASER_OVERLOAD) ||
(!laser.overloaded && laser.overload_value > 0)) &&
- DelayReached(&overload_delay, 60 + !laser.overloaded * 120))
+ FrameReached(&overload_delay, HEALTH_DELAY(laser.overloaded)))
{
if (laser.overloaded)
laser.overload_value++;