File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,9 @@ function clicked(){
66 }
77
88 audio_start ( 'boop' ) ;
9-
109 core_ui_update ( {
1110 'ids' : {
12- 'score' : Number . parseInt (
13- core_elements [ 'score' ] . textContent ,
14- 10
15- ) + 1 ,
11+ 'score' : ++ score ,
1612 } ,
1713 } ) ;
1814 generate ( ) ;
@@ -74,6 +70,7 @@ function repo_init(){
7470 } ,
7571 } ,
7672 'globals' : {
73+ 'score' : 0 ,
7774 'time' : 0 ,
7875 } ,
7976 'info' : '<button id=start-button type=button>Restart</button>' ,
@@ -95,6 +92,10 @@ function repo_init(){
9592}
9693
9794function reset ( ) {
95+ if ( score > 0
96+ && ! globalThis . confirm ( 'Start new game?' ) ) {
97+ return ;
98+ }
9899 stop ( ) ;
99100 if ( core_menu_open ) {
100101 core_escape ( ) ;
@@ -103,6 +104,7 @@ function reset(){
103104}
104105
105106function start ( ) {
107+ score = 0 ;
106108 time = core_storage_data [ 'time-max' ] ;
107109
108110 core_ui_update ( {
You can’t perform that action at this time.
0 commit comments