diff --git a/Old assets/Plague Logo.png b/Old assets/Plague Logo.png new file mode 100644 index 0000000..f207bed Binary files /dev/null and b/Old assets/Plague Logo.png differ diff --git a/Old assets/title.png b/Old assets/title.png new file mode 100644 index 0000000..f0beb69 Binary files /dev/null and b/Old assets/title.png differ diff --git a/src/display_engine.c b/src/display_engine.c index 1c83ed9..25ecd00 100644 --- a/src/display_engine.c +++ b/src/display_engine.c @@ -16,28 +16,53 @@ void display_foreground(const int background, const struct game *current_game) { extern const bopti_image_t img_mutations; extern const bopti_image_t img_planes; + extern const unsigned int world[64][128]; + GUNUSED int length; switch (background) { case 1: + + // Planes animations for (int i = 0; current_game->planes[i]; i++) { dsubimage(current_game->planes[i]->x - 4, current_game->planes[i]->y - 4, &img_planes, 0, 8 * (current_game->planes[i]->direction - 1), 8, 8, DIMAGE_NONE); } + // Disease propagation + for (int i = 0; i < current_game->grid.height; i ++) + { + for (int j = 0; j < current_game->grid.width, j ++) + { + if (current_game->grid[i + j * current_game->grid.width] == 1 && world[i][j] != 0) dpixel(i, j, C_BLACK); + } + } break; + case 2: + + // Planes animations for (int i = 0; current_game->planes[i]; i++) { if (current_game->planes[i]->y + 8 < 57) dsubimage(current_game->planes[i]->x - 4, current_game->planes[i]->y - 4, &img_planes, 0, 8 * (current_game->planes[i]->direction - 1), 8, 8, DIMAGE_NONE); } + // Status bottom bar int length = 74 * current_game->research / current_game->limit; dprint(9, 58, C_BLACK, "%d", current_game->dna); dline(51, 60, 51 + length, 60, C_BLACK); dline(51, 59, 51 + length, 59, C_BLACK); + + // Disease propagation + for (int i = 0; i < current_game->grid.height; i ++) + { + for (int j = 0; j < 50, j ++) + { + if (current_game->grid[i + j * current_game->grid.width] == 1 && world[i][j] != 0) dpixel(i, j, C_BLACK); + } + } break; case 3: diff --git a/src/main.c b/src/main.c index 27a6009..ad8cbd4 100644 --- a/src/main.c +++ b/src/main.c @@ -67,6 +67,8 @@ int main(void) /* allocate memory */ current_game.grid.data = calloc(current_game.grid.width * current_game.grid.height, sizeof(uint8_t)); + current_game.grid.data[95 + 25 * currnet_game.grid.width] = 1; + main_loop(¤t_game); /* free memory */