Add a message when research start, display statistics at the end, display boost mod on the map
This commit is contained in:
parent
6f010578c9
commit
1b76e69808
BIN
Plague.g1a
BIN
Plague.g1a
Binary file not shown.
|
@ -65,6 +65,9 @@ int next_frame(struct game *current_game, int *dna_animation)
|
|||
// Reset internal clock
|
||||
current_game->time = 0;
|
||||
|
||||
// Display the first step of research
|
||||
if (!current_game->research && current_game->priority) message("LA RECHERHCE CONTRE VOTRE VIRUS COMMENCE !");
|
||||
|
||||
// Update the game
|
||||
current_game->dna = current_game->dna + 1 + floor(current_game->severity / 10);
|
||||
if (current_game->dna > 30) current_game->dna = 30;
|
||||
|
@ -159,7 +162,8 @@ int callback_tick(volatile int *tick)
|
|||
|
||||
void message(char *msg)
|
||||
{
|
||||
int opt = GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA & ~GETKEY_REP_ARROWS;
|
||||
|
||||
display_message(msg);
|
||||
getkey();
|
||||
|
||||
getkey_opt(opt, NULL);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,9 @@ void display_foreground(const int background, const struct game *current_game, c
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
// Display if boost is activated
|
||||
if (current_game->boost) dprint(0, 0, C_BLACK, "+");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -67,6 +70,10 @@ void display_foreground(const int background, const struct game *current_game, c
|
|||
|
||||
dline(51, 60, 51 + length, 60, C_BLACK);
|
||||
dline(51, 59, 51 + length, 59, C_BLACK);
|
||||
|
||||
// Display if boost is activated
|
||||
if (current_game->boost) dprint(0, 0, C_BLACK, "+");
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
|
18
src/main.c
18
src/main.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Project name ......: Plague
|
||||
Version ...........: 1.3.4
|
||||
Last modification .: 5 June 2021
|
||||
Version ...........: 1.3.5
|
||||
Last modification .: 6 June 2021
|
||||
|
||||
code and assets provided with licence :
|
||||
GNU General Public Licence v3.0
|
||||
|
@ -20,7 +20,7 @@
|
|||
#include "mutation_engine.h"
|
||||
#include "save.h"
|
||||
|
||||
const char *VERSION = "1.3.4";
|
||||
const char *VERSION = "1.3.5";
|
||||
|
||||
// title_screen : display the title screen
|
||||
static void title_screen(void);
|
||||
|
@ -80,7 +80,17 @@ int main(void)
|
|||
int to_save = main_loop(¤t_game);
|
||||
|
||||
if (to_save) gint_world_switch(GINT_CALL(write_save, (void *)¤t_game));
|
||||
else gint_world_switch(GINT_CALL(delete_save));
|
||||
else
|
||||
{
|
||||
// Display stats at the end of the game
|
||||
display_background(6);
|
||||
display_foreground(6, ¤t_game, 0, 0);
|
||||
|
||||
int opt = GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA & ~GETKEY_REP_ARROWS;
|
||||
getkey_opt(opt, NULL);
|
||||
|
||||
gint_world_switch(GINT_CALL(delete_save));
|
||||
}
|
||||
|
||||
// Free memory
|
||||
free(current_game.grid.data);
|
||||
|
|
|
@ -62,8 +62,9 @@ void mutation_select(struct game *current_game, const int mutation_menu)
|
|||
{
|
||||
// Cursor blinking gestion
|
||||
while (!tick) sleep();
|
||||
tick = 0;
|
||||
c.display = (c.display + 1) % 2;
|
||||
tick = 1;
|
||||
//c.display = (c.display + 1) % 2;
|
||||
c.display = 0;
|
||||
|
||||
// Get and display the mutation menu
|
||||
int table[4][8];
|
||||
|
|
Loading…
Reference in New Issue