From e0ff80a803d571ad1bf4ce5e5f27f59d2e7ca6a6 Mon Sep 17 00:00:00 2001 From: Dan O'Shea <6539132+uXeBoy@users.noreply.github.com> Date: Sun, 1 Jul 2018 10:06:32 +0930 Subject: [PATCH] newLevel() displaying / clearing newLevel() displays blocks on the screen for a moment after entering high score initials, before displaying the title screen (annoyed me enough to want to create a PR for it). --- examples/ArduBreakout/ArduBreakout.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/ArduBreakout/ArduBreakout.ino b/examples/ArduBreakout/ArduBreakout.ino index 4dcd4ef..81bb3b2 100644 --- a/examples/ArduBreakout/ArduBreakout.ino +++ b/examples/ArduBreakout/ArduBreakout.ino @@ -92,9 +92,9 @@ void loop() //Selects Font //Draws the new level level = 1; + initialDraw=true; newLevel(); score = 0; - initialDraw=true; } if (lives>0) @@ -383,7 +383,8 @@ void Score() score += (level*10); } -void newLevel(){ +void newLevel() +{ //Undraw paddle arduboy.drawRect(xPaddle, 63, 11, 1, 0); @@ -408,7 +409,8 @@ void newLevel(){ } } - arduboy.display(); + if (!initialDraw) arduboy.clear(); + else arduboy.display(); } //Used to delay images while reading button input @@ -713,4 +715,3 @@ void playToneTimed(unsigned int frequency, unsigned int duration) arduboy.delayShort(duration); beep.noTone(); } -