mirror of https://github.com/MLXXXp/Arduboy2.git
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).
This commit is contained in:
parent
0eae58c760
commit
e0ff80a803
|
|
@ -92,9 +92,9 @@ void loop()
|
||||||
//Selects Font
|
//Selects Font
|
||||||
//Draws the new level
|
//Draws the new level
|
||||||
level = 1;
|
level = 1;
|
||||||
|
initialDraw=true;
|
||||||
newLevel();
|
newLevel();
|
||||||
score = 0;
|
score = 0;
|
||||||
initialDraw=true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lives>0)
|
if (lives>0)
|
||||||
|
|
@ -383,7 +383,8 @@ void Score()
|
||||||
score += (level*10);
|
score += (level*10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void newLevel(){
|
void newLevel()
|
||||||
|
{
|
||||||
//Undraw paddle
|
//Undraw paddle
|
||||||
arduboy.drawRect(xPaddle, 63, 11, 1, 0);
|
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
|
//Used to delay images while reading button input
|
||||||
|
|
@ -713,4 +715,3 @@ void playToneTimed(unsigned int frequency, unsigned int duration)
|
||||||
arduboy.delayShort(duration);
|
arduboy.delayShort(duration);
|
||||||
beep.noTone();
|
beep.noTone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue