Skip to content

Commit 59651f3

Browse files
committed
added new game confirmation
1 parent 03ef1ee commit 59651f3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

repo.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ function repo_escape(){
8282
if(!entity_entities['negative-0']
8383
&& !entity_entities['positive-0']
8484
&& !core_menu_open){
85-
canvas_setmode();
85+
start();
8686
}
8787
}
8888

8989
function repo_init(){
9090
core_repo_init({
9191
'events': {
9292
'start': {
93-
'onclick': canvas_setmode,
93+
'onclick': start,
9494
},
9595
},
9696
'globals': {
@@ -178,3 +178,11 @@ function repo_init(){
178178
},
179179
});
180180
}
181+
182+
function start(){
183+
if(score !== 0
184+
&& !globalThis.confirm('Start new game?')){
185+
return;
186+
}
187+
canvas_setmode();
188+
}

0 commit comments

Comments
 (0)