// Structure holding all data belonging to a cave.
// ----------------------------------------------------------------------------
-#define GD_HIGHSCORE_NUM 20
+#define GD_HIGHSCORE_NUM 20
+#define GD_PLAYER_MEM_SIZE 16
typedef struct _gd_cave
{
boolean sweet_eaten; // player ate sweet, he's strong. prob_sweet applies,
// and also able to push chasing stones
int player_x, player_y; // Coordinates of player (for scrolling)
- int px[16], py[16]; // coordinates of player, for chasing stone
+ int player_x_mem[GD_PLAYER_MEM_SIZE]; // coordinates of player, for chasing stone
+ int player_y_mem[GD_PLAYER_MEM_SIZE];
int key1, key2, key3; // The player is holding this number of keys of each color
boolean diamond_key_collected; // Key collected, so trapped diamonds convert to diamonds
boolean inbox_flash_toggle; // negated every scan. helps drawing inboxes, and making
case O_CHASING_STONE:
{
- int px = cave->px[0];
- int py = cave->py[0];
+ int px = cave->player_x_mem[0];
+ int py = cave->player_y_mem[0];
boolean horizontal = gd_rand_boolean(cave->random);
boolean dont_move = FALSE;
int i = 3;
}
// record coordinates of player for chasing stone
- for (i = 0; i < ARRAY_SIZE(cave->px) - 1; i++)
+ for (i = 0; i < GD_PLAYER_MEM_SIZE - 1; i++)
{
- cave->px[i] = cave->px[i + 1];
- cave->py[i] = cave->py[i + 1];
+ cave->player_x_mem[i] = cave->player_x_mem[i + 1];
+ cave->player_y_mem[i] = cave->player_y_mem[i + 1];
}
- cave->px[ARRAY_SIZE(cave->px) - 1] = cave->player_x;
- cave->py[ARRAY_SIZE(cave->py) - 1] = cave->player_y;
+ cave->player_x_mem[GD_PLAYER_MEM_SIZE - 1] = cave->player_x;
+ cave->player_y_mem[GD_PLAYER_MEM_SIZE - 1] = cave->player_y;
// SCHEDULING