@@ -13,6 +13,11 @@ import ShipDebrisSystem from '../systems/ShipDebrisSystem.js';
1313import AsteroidsAttractAdapter from './AsteroidsAttractAdapter.js' ;
1414import AsteroidsHighScoreService from '../systems/AsteroidsHighScoreService.js' ;
1515import AsteroidsInitialsEntry from '../systems/AsteroidsInitialsEntry.js' ;
16+ import {
17+ ASTEROIDS_GAME_OVER_AUTO_EXIT_SECONDS ,
18+ ASTEROIDS_GAME_OVER_RETURN_MODE ,
19+ ASTEROIDS_GAME_OVER_RETURN_STATUS
20+ } from '../rules/gameFlowRules.js' ;
1621
1722const HUD_FONT = '"Vector Battle", monospace' ;
1823const SCORE_ONE_X = 136 ;
@@ -21,9 +26,6 @@ const SCORE_TWO_X = 824;
2126const LIFE_SPACING = 22 ;
2227const PAUSE_OVERLAY_COLOR = 'rgba(2, 6, 23, 0.58)' ;
2328const INITIALS_OVERLAY_COLOR = 'rgba(1, 6, 19, 0.62)' ;
24- const GAME_OVER_AUTO_EXIT_SECONDS_DEFAULT = 30 ;
25- const GAME_OVER_RETURN_MODE = 'menu' ;
26- const GAME_OVER_RETURN_STATUS = 'Press 1 for one player or 2 for two players.' ;
2729const LIFE_ICON_POINTS = [
2830 [ 14 , 0 ] ,
2931 [ - 10 , - 8 ] ,
@@ -118,7 +120,7 @@ export default class AsteroidsGameScene extends Scene {
118120 1 ,
119121 Math . floor (
120122 Number ( this . session . getGameOverAutoExitSeconds ?. ( ) )
121- || GAME_OVER_AUTO_EXIT_SECONDS_DEFAULT ,
123+ || ASTEROIDS_GAME_OVER_AUTO_EXIT_SECONDS ,
122124 ) ,
123125 ) ;
124126 this . gameOverAutoExitRemainingSeconds = 0 ;
@@ -214,8 +216,8 @@ export default class AsteroidsGameScene extends Scene {
214216 }
215217
216218 returnToIntroAttract ( ) {
217- this . session . mode = GAME_OVER_RETURN_MODE ;
218- this . session . status = GAME_OVER_RETURN_STATUS ;
219+ this . session . mode = ASTEROIDS_GAME_OVER_RETURN_MODE ;
220+ this . session . status = ASTEROIDS_GAME_OVER_RETURN_STATUS ;
219221 this . attractController . resetIdle ( ) ;
220222 this . resetGameOverAutoExitTimer ( ) ;
221223 }
0 commit comments