Only display "clear" message for a short time
This commit is contained in:
10
game.c
10
game.c
@@ -109,9 +109,9 @@ static shape_t shapes[MAX_SHAPES];
|
|||||||
|
|
||||||
static unsigned entity_count;
|
static unsigned entity_count;
|
||||||
static unsigned shape_count;
|
static unsigned shape_count;
|
||||||
static unsigned asteroid_count;
|
|
||||||
|
|
||||||
static bool dead;
|
static bool dead;
|
||||||
|
static unsigned asteroid_count;
|
||||||
static float aspect;
|
static float aspect;
|
||||||
static uint8_t counter;
|
static uint8_t counter;
|
||||||
|
|
||||||
@@ -461,6 +461,9 @@ void game_update()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (asteroid_count == 0 && counter <= COUNTER_MASK)
|
||||||
|
++counter;
|
||||||
|
|
||||||
ship_update();
|
ship_update();
|
||||||
|
|
||||||
for (unsigned i = 0; i < entity_count; ++i) {
|
for (unsigned i = 0; i < entity_count; ++i) {
|
||||||
@@ -501,8 +504,9 @@ void game_draw()
|
|||||||
shapes[i].connect);
|
shapes[i].connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (asteroid_count == 0)
|
|
||||||
text_draw("CLEAR");
|
|
||||||
if (dead && !(counter & COUNTER_MASK))
|
if (dead && !(counter & COUNTER_MASK))
|
||||||
text_draw("GAME OVER");
|
text_draw("GAME OVER");
|
||||||
|
|
||||||
|
if (asteroid_count == 0 && counter < COUNTER_MASK)
|
||||||
|
text_draw("CLEAR");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user