update red7game with new game confirmation

master
Kevin Whitaker 2023-04-26 11:20:25 -04:00
parent 2f2000db5e
commit 3c03aef619
3 changed files with 14 additions and 1 deletions

View File

@ -2,3 +2,4 @@
0.02: Fix mistake preventing game from ending in some cases. 0.02: Fix mistake preventing game from ending in some cases.
0.03: Update help screen with more details. 0.03: Update help screen with more details.
0.04: Update cards to draw rounded on newer firmware. Make sure in-game menu can't be pulled up during end of game. 0.04: Update cards to draw rounded on newer firmware. Make sure in-game menu can't be pulled up during end of game.
0.05: add confirmation prompt to new game to prevent fat fingering new game during existing one.

View File

@ -2,7 +2,7 @@
"name": "Red 7 Card Game", "name": "Red 7 Card Game",
"shortName" : "Red 7", "shortName" : "Red 7",
"icon": "icon.png", "icon": "icon.png",
"version":"0.04", "version":"0.05",
"description": "An implementation of the card game Red 7 for your watch. Play against the AI and be the last player still in the game to win!", "description": "An implementation of the card game Red 7 for your watch. Play against the AI and be the last player still in the game to win!",
"tags": "game", "tags": "game",
"supports":["BANGLEJS2"], "supports":["BANGLEJS2"],

View File

@ -814,8 +814,20 @@ function drawMainMenu() {
} }
} }
menu["New Game"] = function() { menu["New Game"] = function() {
if(startedGame == true) {
E.showPrompt("Discard and start new game?").then(function(v) {
if(v) {
E.showMenu();
resetToNewGame();
} else {
E.showMenu();
drawScreen1();
}
});
} else {
E.showMenu(); E.showMenu();
resetToNewGame(); resetToNewGame();
}
}; };
menu["Help"] = function() { menu["Help"] = function() {
drawScreenHelp(); drawScreenHelp();