#include "display.h"
+#if 0
+extern int centered_player_nr;
+#endif
+
+extern boolean checkIfAllPlayersFitToScreen();
+
static void check_player(struct PLAYER *);
static void kill_player(struct PLAYER *);
static boolean player_digfield(struct PLAYER *, int, int);
int start_check_nr;
int i;
+ game_em.any_player_moving = FALSE;
+
/* must test for death and actually kill separately */
for (i = 0; i < MAX_PLAYERS; i++)
}
#endif
+ if (dx || dy)
+ {
+ int oldx = ply->x;
+ int oldy = ply->y;
+ int x = oldx + dx;
+ int y = oldy + dy;
+ boolean can_move = TRUE;
+
+ ply->x = x;
+ ply->y = y;
+
+ can_move = (game.centered_player_nr != -1 ||
+ checkIfAllPlayersFitToScreen());
+
+ ply->x = oldx;
+ ply->y = oldy;
+
+ if (!can_move)
+ {
+ ply->joy_n = ply->joy_e = ply->joy_s = ply->joy_w = 0;
+
+ return;
+ }
+ }
+
if (dx == 0 && dy == 0)
{
ply->joy_stick = 0;
ply->joy_stick = 1;
ply->joy_n = ply->joy_e = ply->joy_s = ply->joy_w = 0;
- ply->dynamite_cnt = 0; /* reset dynamite timer if we move */
+ ply->dynamite_cnt = 0; /* reset dynamite timer if we move */
ply->joy_spin = !ply->joy_spin;
if (ply->joy_snap == 0) /* player wants to move */
ply->last_move_dir = (dx < 0 ? MV_LEFT : MV_RIGHT);
else if (oldy != ply->y)
ply->last_move_dir = (dy < 0 ? MV_UP : MV_DOWN);
+
+ game_em.any_player_moving = TRUE;
+ game_em.last_moving_player = ply->num;
+ game_em.last_player_direction[ply->num] = ply->last_move_dir;
}
}
else /* player wants to snap */