import Phaser from 'phaser'; import { GAME_WIDTH, GAME_HEIGHT, DEBUG, WORLD_SCALE } from './config.js'; import BootScene from './scenes/BootScene.js'; import PreloadScene from './scenes/PreloadScene.js'; import IntroScene from './scenes/IntroScene.js'; import MainMenuScene from './scenes/MainMenuScene.js'; import LevelSelectScene from './scenes/LevelSelectScene.js'; import PlayScene from './scenes/PlayScene.js'; import LevelCompleteScene from './scenes/LevelCompleteScene.js'; import LevelFailedScene from './scenes/LevelFailedScene.js'; window.__PHASER_GAME__ = new Phaser.Game({ type: Phaser.AUTO, parent: 'game-container', width: GAME_WIDTH, height: GAME_HEIGHT, backgroundColor: '#8fc7e8', physics: { default: 'matter', matter: { // Gravity is a constant absolute px/s^2 regardless of body size (it's // mass-proportional force, so acceleration = force/mass is scale- // independent) - has to scale with WORLD_SCALE or a 2x-bigger world // falls proportionally slower (everything free-falls for longer to // cover the now-doubled pixel distances). gravity: { x: 0, y: 1 * WORLD_SCALE }, debug: DEBUG, }, }, scale: { mode: Phaser.Scale.FIT, autoCenter: Phaser.Scale.CENTER_BOTH, }, scene: [ BootScene, PreloadScene, IntroScene, MainMenuScene, LevelSelectScene, PlayScene, LevelCompleteScene, LevelFailedScene, ], });