mirror of
https://codeberg.org/hkzlab/TK2048.git
synced 2025-12-26 01:22:33 +11:00
Add reset key combo
This commit is contained in:
parent
56c290ed50
commit
9b7646d434
3 changed files with 19 additions and 4 deletions
|
|
@ -99,6 +99,11 @@ __task int main(void) {
|
|||
done = step_game(STEP_RIGHT);
|
||||
ddraw_direction_arrows(ARROW_RIGHT);
|
||||
break;
|
||||
case K_CTRL_R:
|
||||
BELL1();
|
||||
score = 0; // We'll reset the score
|
||||
done = -1;
|
||||
break;
|
||||
default:
|
||||
continue; // Do nothing, loop again
|
||||
}
|
||||
|
|
@ -106,9 +111,9 @@ __task int main(void) {
|
|||
// Increase the count of moves we made
|
||||
moves_count++;
|
||||
|
||||
// If we have won, break out of this loop
|
||||
// If we have won, or we got a reset request, break out of this loop
|
||||
if(done) {
|
||||
score += WIN_SCORE_BONUS;
|
||||
score += (done > 0) ? WIN_SCORE_BONUS : 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue