@@ -8,7 +8,7 @@ import {TitleScreen} from "../../classes/gui/window/title";
88import { initializeSounds } from "../../classes/audio/audio" ;
99import { Mobile } from "../../classes/gui/window/mobile" ;
1010import { PotionEffectType } from "../../classes/collectibles/potion/potioneffect" ;
11- import { LeaderboardService } from "../../services/leaderboard .service" ;
11+ import { GameService } from "../../services/game .service" ;
1212
1313@Component ( {
1414 selector : 'app-game' ,
@@ -21,8 +21,7 @@ export class GameComponent implements AfterViewInit {
2121 public static canvasWidth = 64 * 16 ;
2222 public static canvasHeight = 64 * 9 ;
2323 public static player : Player ;
24- public static volume : number = 1.0 ;
25- public static isTitleScreen : boolean = false ;
24+ public static isTitleScreen : boolean = true ;
2625 public static hasInteracted : boolean = false ;
2726 public static isFlashLightShaderOn : boolean = true ;
2827 public static levels = [ level1 , level4 ] ;
@@ -35,13 +34,12 @@ export class GameComponent implements AfterViewInit {
3534 public cameraContext : CanvasRenderingContext2D | undefined ;
3635 public context : CanvasRenderingContext2D | undefined ;
3736 public flashLightShader = new FlashlightShader ( ) ;
38- public volume : number = localStorage . getItem ( 'volume' ) ? parseFloat ( localStorage . getItem ( 'volume' ) ! ) : 1.0 ;
3937 private oldFrameTime : number = 1 ;
4038
4139 public static isFinished : boolean = false ;
4240
4341
44- constructor ( public readonly leaderboard : LeaderboardService ) {
42+ constructor ( public readonly leaderboard : GameService ) {
4543 GameComponent . player = new Player ( ) ;
4644 initializeSounds ( ) ;
4745 this . registerGuiListener ( ) ;
@@ -197,8 +195,6 @@ export class GameComponent implements AfterViewInit {
197195
198196 }
199197
200- GameComponent . volume = parseFloat ( localStorage . getItem ( 'volume' ) || '1.0' ) ;
201- localStorage . setItem ( 'volume' , this . volume . toString ( ) ) ;
202198 this . changeCanvasSize ( GameComponent . getCurrentLevel ( ) . getBackground ( ) . getWidth ( ) , GameComponent . getCurrentLevel ( ) . getBackground ( ) . getHeight ( ) ) ;
203199
204200
0 commit comments