diff --git a/CMakeLists.txt b/CMakeLists.txt index 98adcb5..b003fff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,8 +32,6 @@ set(ASSETS_cg assets-cg/mutations.png assets-cg/cursor.png assets-cg/title.png - assets-cg/dna.png - assets-cg/explosion.png assets-cg/mutations_table/abilities_1.txt assets-cg/mutations_table/abilities_2.txt assets-cg/mutations_table/abilities_3.txt diff --git a/assets-cg/dna.png b/assets-cg/dna.png deleted file mode 100644 index 02cffb0..0000000 Binary files a/assets-cg/dna.png and /dev/null differ diff --git a/assets-cg/explosion.png b/assets-cg/explosion.png deleted file mode 100644 index 771d8af..0000000 Binary files a/assets-cg/explosion.png and /dev/null differ diff --git a/assets-cg/title.png b/assets-cg/title.png index 545b734..fbccf38 100644 Binary files a/assets-cg/title.png and b/assets-cg/title.png differ diff --git a/src/core.c b/src/core.c index 585492f..3fd433d 100644 --- a/src/core.c +++ b/src/core.c @@ -9,7 +9,7 @@ #include "display_engine.h" -int next_frame(struct game *current_game, int *dna_animation, int *vaccine) +int next_frame(struct game *current_game, int *vaccine) { for (int i = 0; current_game->planes[i]; i++) { @@ -58,8 +58,6 @@ int next_frame(struct game *current_game, int *dna_animation, int *vaccine) current_game->time += ENGINE_TICK; current_game->total_time += ENGINE_TICK; - if (!(current_game->time % 150)) *dna_animation = (*dna_animation + 1) % 16; - if (current_game->time > limit_tick) { // Reset internal clock diff --git a/src/core.h b/src/core.h index 95aff76..425e19d 100644 --- a/src/core.h +++ b/src/core.h @@ -6,7 +6,6 @@ // Duration for internal clock (ms) #define ENGINE_TICK 50 #define CURSOR_TICK 110 -#define DNA_ANIMATION_TICK 150 // Duration for DNA points and infectious model (ms) #define LIMIT_TICK 10000 @@ -90,7 +89,7 @@ struct cursor int get_inputs(const int background, int *mutation_menu, int *boost); // next_frame : compute the plane's positions -int next_frame(struct game *current_game, int *dna_animation, int *vaccine); +int next_frame(struct game *current_game, int *vaccine); // rtc_key : get the key with RTC system int rtc_key(void); diff --git a/src/display_engine.c b/src/display_engine.c index 1d8c066..6cfdae0 100644 --- a/src/display_engine.c +++ b/src/display_engine.c @@ -40,11 +40,10 @@ void display_background(const int background) } -void display_foreground(const int background, const struct game *current_game, const int mutation_menu, const int dna_animation) +void display_foreground(const int background, const struct game *current_game, const int mutation_menu) { extern const bopti_image_t img_mutations; extern const bopti_image_t img_planes; - extern const bopti_image_t img_dna; extern const uint8_t world[184][396]; GUNUSED int length; @@ -68,9 +67,6 @@ void display_foreground(const int background, const struct game *current_game, c if (current_game->planes[i]->y + 8 < 184) 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); } - // Animated DNA - dsubimage(1, 51, &img_dna, dna_animation * 8, 0, 7, 12, DIMAGE_NONE); - // Research bar int length = 73 * current_game->research / current_game->limit; dprint(30, 200, C_WHITE, "%d", current_game->dna); @@ -89,7 +85,7 @@ void display_foreground(const int background, const struct game *current_game, c */ // Display if boost is activated - if (current_game->boost) dprint(0, 0, C_BLACK, "+"); + if (current_game->boost) dprint(0, 0, C_WHITE, "+"); break; diff --git a/src/display_engine.h b/src/display_engine.h index 99bc213..cd4fc31 100644 --- a/src/display_engine.h +++ b/src/display_engine.h @@ -7,7 +7,7 @@ void display_background(const int background); // display_foreground : display the foreground, planes, statistics -void display_foreground(const int background, const struct game *current_game, const int mutation_menu, const int dna_animation); +void display_foreground(const int background, const struct game *current_game, const int mutation_menu); // display_mutation : display the mutation selection screen void display_mutation(const int table[4][8], const struct cursor c, const int mutation_menu); diff --git a/src/main.c b/src/main.c index 8ba27cb..835d2b5 100644 --- a/src/main.c +++ b/src/main.c @@ -86,7 +86,7 @@ int main(void) // Display stats at the end of the game dclear(C_WHITE); display_background(6); - display_foreground(6, ¤t_game, 0, 0); + display_foreground(6, ¤t_game, 0); dupdate(); sleep_ms(250); @@ -106,35 +106,13 @@ int main(void) static void title_screen(void) { extern bopti_image_t img_title; - extern bopti_image_t img_explosion; dclear(C_BLACK); - dsubimage(0, 0, &img_title, 0, 0, DWIDTH, DHEIGHT, DIMAGE_NONE); - dprint_opt(32, 120, C_WHITE, C_NONE, 0, 0, "VERSION %s", VERSION, -1); + dimage(0, 0, &img_title); + dprint_opt(5, 200, C_WHITE, C_NONE, 0, 0, "VERSION %s", VERSION, -1); dupdate(); - sleep_ms(1000); - - for (int frame = 0; frame < 5; frame ++) - { - dsubimage(0, 0, &img_title, 0, 0, DWIDTH, DHEIGHT, DIMAGE_NONE); - dsubimage(225, 70, &img_explosion, 123 * frame, 0, 120, 120, DIMAGE_NONE); - dupdate(); - sleep_ms(80); - } - - sleep_ms(120); - for (int times = 0; times < 3; times ++) - { - dsubimage(0, 0, &img_title, 0, DHEIGHT, DWIDTH, DHEIGHT, DIMAGE_NONE); - dupdate(); - sleep_ms(200); - dsubimage(0, 0, &img_title, 0, DHEIGHT*2, DWIDTH, DHEIGHT, DIMAGE_NONE); - dupdate(); - sleep_ms(200); - } - getkey(); } @@ -142,7 +120,7 @@ static void title_screen(void) int main_loop(struct game *current_game) { int background = 1, mutation_menu = 4; - int end = 0, to_save = 1, dna_animation = 0, vaccine = 0; + int end = 0, to_save = 1, vaccine = 0; static volatile int tick = 1; int t = timer_configure(TIMER_ANY, ENGINE_TICK*1000, GINT_CALL(callback_tick, &tick)); @@ -157,11 +135,11 @@ int main_loop(struct game *current_game) // Update the screen dclear(C_WHITE); display_background(background); - display_foreground(background, current_game, mutation_menu, dna_animation); + display_foreground(background, current_game, mutation_menu); dupdate(); // Compute the motion of planes, DNA points and infectious model - to_save = next_frame(current_game, &dna_animation, &vaccine); + to_save = next_frame(current_game, &vaccine); if (!to_save) return 0; // Get inputs from the keyboard and manage it