mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-05 12:37:29 +00:00
Refactoring
This commit is contained in:
1 parent
fbcf680625
commit
c8d68a0cb5
1 file changed
+10
-7
+10
-7
@@ -164,6 +164,14 @@ int randInt(int min, int max) {
|
||||
return min + (rand_custom() % (max - min + 1));
|
||||
}
|
||||
|
||||
// Reset
|
||||
void reset(void)
|
||||
{
|
||||
ballCount = BALL_NUMBER;
|
||||
levelCountBreackout = 1;
|
||||
score = 0;
|
||||
}
|
||||
|
||||
// PlayBeep
|
||||
void playBeep(uint16_t tone)
|
||||
{
|
||||
@@ -244,10 +252,7 @@ void drawBall() {
|
||||
isBeep = true;
|
||||
tone = 800;
|
||||
if (ballCount < 0) {
|
||||
ballCount = BALL_NUMBER;
|
||||
levelCountBreackout = 1;
|
||||
score = 0;
|
||||
|
||||
reset();
|
||||
initWall();
|
||||
drawWall();
|
||||
|
||||
@@ -458,9 +463,7 @@ void APP_RunBreakout(void) {
|
||||
|
||||
// Init game
|
||||
UI_DisplayClear();
|
||||
score = 0;
|
||||
ballCount = BALL_NUMBER;
|
||||
levelCountBreackout = 1;
|
||||
reset();
|
||||
initWall();
|
||||
initRacket();
|
||||
initBall();
|
||||
|
||||
Reference in new issue
Block a user