diff --git a/src/game-v4.js b/src/game-v4.js index 0d0b70f..67d0a7b 100644 --- a/src/game-v4.js +++ b/src/game-v4.js @@ -101,6 +101,8 @@ class GameScene extends Phaser.Scene { } createHud() { + this.mobileHudActive = !window.matchMedia('(hover: hover) and (pointer: fine)').matches; + const fixedText = (x, y, text, style = {}) => this.add.text(x, y, text, { fontFamily: 'monospace', color: '#e8f2f7', @@ -163,6 +165,23 @@ class GameScene extends Phaser.Scene { backgroundColor: '#07101899', padding: { x: 8, y: 4 }, }).setOrigin(0.5, 1); + + if (this.mobileHudActive) { + for (const item of [ + this.hudGraphics, + this.brandText, + this.speedText, + this.headingText, + this.waveText, + this.combatText, + this.playerHullLabel, + this.enemyHullLabel, + this.status, + this.controlsHint, + ]) { + item?.setVisible(false); + } + } } createAnimations() {