feat: add fullscreen mode toggle button

- Add src/utils/fullscreen.js with createFullscreenButton() helper
- Fullscreen button appears in bottom-right corner of all scenes
- Click to toggle fullscreen mode
- Uses Phaser's built-in scale manager

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Thomas Richter
2026-02-05 00:05:03 +01:00
parent 1154a78908
commit be41f912a2
6 changed files with 95 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import Phaser from 'phaser';
import { fontSize } from '../utils/responsive.js';
import { createFullscreenButton } from '../utils/fullscreen.js';
export default class HuntingScene extends Phaser.Scene {
constructor() {
@@ -47,6 +48,9 @@ export default class HuntingScene extends Phaser.Scene {
// Message display
const shootMessage = this.isMobile ? 'Hunt whales! Tap to shoot harpoon.' : 'Hunt whales! Click or press SPACE to shoot harpoon.';
this.showMessage(shootMessage);
// Fullscreen button (positioned to avoid HUD)
createFullscreenButton(this, { x: 30, y: 580 });
}
update() {