diff --git a/w/w.c b/w/w.c index 48ef002..a2ca0b2 100644 --- a/w/w.c +++ b/w/w.c @@ -18,6 +18,7 @@ #define SC_STATION 2 #define SC_MAP 3 #define SC_MONSTER 4 +#define SC_GAMEOVER 5 #define NORTH 0 #define EAST 1 @@ -485,7 +486,7 @@ void update(char command[CMD_LEN]) state.hero.hp--; if (state.hero.hp <= 0) { - // game over ? + state.screen = SC_GAMEOVER; } } @@ -579,6 +580,12 @@ void draw() printf("f: Tenter de fuir\n"); printf("a: Attaquer\n"); } + else if (state.screen == SC_GAMEOVER) + { + printf("%s est fatiguée\n"); + state.hero.hp = 10; + state.screen = SC_STATION; + } if (state.screen == SC_MONSTER || state.screen == SC_STATION