diff --git a/games/breakout/breakout.c b/games/breakout/breakout.c index 2cb6051..f484692 100644 --- a/games/breakout/breakout.c +++ b/games/breakout/breakout.c @@ -39,27 +39,11 @@ void borg_breakout_game() void borg_breakout(uint8_t demomode) { - // save pointer address just in case that the breakout demo was previously - // running so it can reentered - char (*old_playfield)[NUM_COLS][NUM_ROWS] = playfield; - // new playing field char my_playfield[NUM_COLS][NUM_ROWS]; playfield = &my_playfield; - uint8_t ignorescore_buffer = ignorescore; uint16_t cycles = DEMO_CYCLES; - uint8_t level; - if (demomode) - { - level = random8() % 5; - ignorescore = 1; - } - else - { - level = 0; - ignorescore = 0; - } - + uint8_t level = demomode ? random8() % 5 : 0; ball_t balls[1]; /* spawn a ball in the middle bottom of the field, let it move upwards with random speed & direction */ @@ -104,8 +88,4 @@ void borg_breakout(uint8_t demomode) // alternate the value of the tick divider tick_divider = tick_divider ? 0 : 1; } - - ignorescore = ignorescore_buffer; - // restore saved pointer - playfield = old_playfield; } diff --git a/games/breakout/score.c b/games/breakout/score.c index a88a75c..16a726a 100644 --- a/games/breakout/score.c +++ b/games/breakout/score.c @@ -20,8 +20,7 @@ static uint16_t score = 0; void score_add (uint8_t in_score) { - if (!ignorescore) - score += in_score; + score += in_score; } uint16_t score_get() diff --git a/games/breakout/score.h b/games/breakout/score.h index 73de979..bbb51f9 100644 --- a/games/breakout/score.h +++ b/games/breakout/score.h @@ -20,8 +20,6 @@ #ifndef SCORE_H #define SCORE_H -uint8_t ignorescore; - void score_add(uint8_t); uint16_t score_get(); #endif