File tree Expand file tree Collapse file tree 7 files changed +8
-9
lines changed
Expand file tree Collapse file tree 7 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function setup() {
1414 // Initialize the game Runner.
1515 runner = new Runner ( '.game' , {
1616 T_REX_COUNT : 4 ,
17- onRestart : handleRestart ,
17+ onReset : handleRestart ,
1818 onCrash : handleCrash ,
1919 onRunning : handleRunning
2020 } ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function setup() {
1717 // Initialize the game Runner.
1818 runner = new Runner ( '.game' , {
1919 T_REX_COUNT : 10 ,
20- onRestart : handleRestart ,
20+ onReset : handleRestart ,
2121 onCrash : handleCrash ,
2222 onRunning : handleRunning
2323 } ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function setup() {
1010 // Initialize the game Runner.
1111 runner = new Runner ( '.game' , {
1212 T_REX_COUNT : 1 ,
13- onRestart : handleRestart ,
13+ onReset : handleRestart ,
1414 onCrash : handleCrash ,
1515 onRunning : handleRunning
1616 } ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function setup() {
1010 // Initialize the game Runner.
1111 runner = new Runner ( '.game' , {
1212 T_REX_COUNT : 3 ,
13- onRestart : handleRestart ,
13+ onReset : handleRestart ,
1414 onCrash : handleCrash ,
1515 onRunning : handleRunning
1616 } ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function setup() {
1010 // Initialize the game Runner.
1111 runner = new Runner ( '.game' , {
1212 T_REX_COUNT : 10 ,
13- onRestart : handleRestart ,
13+ onReset : handleRestart ,
1414 onCrash : handleCrash ,
1515 onRunning : handleRunning
1616 } ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ let runner = null;
88function setup ( ) {
99 // Initialize the game Runner.
1010 runner = new Runner ( '.game' , {
11- onRestart : handleRestart ,
11+ onReset : handleRestart ,
1212 onRunning : handleRunning ,
1313 onCrash : handleCrash
1414 } ) ;
Original file line number Diff line number Diff line change @@ -168,7 +168,6 @@ export default class Runner {
168168
169169 // Draw t-rex
170170 this . tRexGroup = new TrexGroup ( this . config . T_REX_COUNT , this . canvas , this . spriteDef . TREX ) ;
171- this . tRexGroup . onReset = this . config . onReset ;
172171 this . tRexGroup . onRunning = this . config . onRunning ;
173172 this . tRexGroup . onCrash = this . config . onCrash ;
174173 this . tRex = this . tRexGroup . tRexes [ 0 ] ;
@@ -448,12 +447,12 @@ export default class Runner {
448447 this . distanceMeter . reset ( this . highestScore ) ;
449448 this . horizon . reset ( ) ;
450449 this . tRexGroup . reset ( ) ;
451- this . config . onRestart ( this . tRexGroup . tRexes ) ;
450+ this . config . onReset ( this . tRexGroup . tRexes ) ;
452451 this . update ( ) ;
453452 } else {
454453 this . isFirstTime = true ;
455454 this . tRexGroup . reset ( ) ;
456- this . config . onRestart ( this . tRexGroup . tRexes ) ;
455+ this . config . onReset ( this . tRexGroup . tRexes ) ;
457456 if ( ! this . playing ) {
458457 this . playing = true ;
459458 this . update ( ) ;
You can’t perform that action at this time.
0 commit comments