diff --git a/games/breakout/breakout.c b/games/breakout/breakout.c index 1a1a8a7..d068b70 100644 --- a/games/breakout/breakout.c +++ b/games/breakout/breakout.c @@ -46,6 +46,7 @@ void borg_breakout(uint8_t demomode) uint8_t level = demomode ? random8() % 5 : 0; ball_t balls[1]; + score_reset(); /* spawn a ball in the middle bottom of the field, let it move upwards with random speed & direction */ ball_spawn_default(&(balls[0])); balls[0].strength = START_LIFES; diff --git a/games/breakout/score.h b/games/breakout/score.h index affac10..8ccdbf2 100644 --- a/games/breakout/score.h +++ b/games/breakout/score.h @@ -21,6 +21,11 @@ #define SCORE_H extern unsigned short score; +inline static void score_reset() +{ + score = 0; +} + inline static void score_add (uint8_t in_score) { score += in_score;