- Created HuntingScene with mouse and keyboard controls - Crosshair can be controlled by mouse or WASD/Arrow keys - TAB key toggles between control modes - Whales spawn and swim across screen from both directions - Harpoon shooting mechanic (click or SPACE) - Collision detection and whale hit animations - Whale oil rewards (+1 per successful hunt) - HUD displays fuel, oil, and whales hunted - Return to map button - Updated MapScene to transition to HuntingScene 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
28 lines
717 B
JavaScript
28 lines
717 B
JavaScript
import Phaser from 'phaser';
|
|
import ShipDeckScene from './scenes/ShipDeckScene.js';
|
|
import MapScene from './scenes/MapScene.js';
|
|
import TransitionScene from './scenes/TransitionScene.js';
|
|
import HuntingScene from './scenes/HuntingScene.js';
|
|
|
|
const config = {
|
|
type: Phaser.AUTO,
|
|
width: 800,
|
|
height: 600,
|
|
parent: 'game-container',
|
|
backgroundColor: '#2d5f8e',
|
|
scene: [ShipDeckScene, MapScene, TransitionScene, HuntingScene],
|
|
physics: {
|
|
default: 'arcade',
|
|
arcade: {
|
|
gravity: { y: 0 },
|
|
debug: false
|
|
}
|
|
},
|
|
scale: {
|
|
mode: Phaser.Scale.FIT,
|
|
autoCenter: Phaser.Scale.CENTER_BOTH
|
|
}
|
|
};
|
|
|
|
const game = new Phaser.Game(config);
|