Scaffold tactical RPG web prototype
This commit is contained in:
31
src/main.ts
Normal file
31
src/main.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import Phaser from 'phaser';
|
||||
import { BattleScene } from './game/scenes/BattleScene';
|
||||
import { BootScene } from './game/scenes/BootScene';
|
||||
import { StoryScene } from './game/scenes/StoryScene';
|
||||
import { TitleScene } from './game/scenes/TitleScene';
|
||||
import './styles/global.css';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__HEROS_GAME__?: Phaser.Game;
|
||||
}
|
||||
}
|
||||
|
||||
const config: Phaser.Types.Core.GameConfig = {
|
||||
type: Phaser.AUTO,
|
||||
parent: 'game',
|
||||
width: 1280,
|
||||
height: 720,
|
||||
backgroundColor: '#10131a',
|
||||
scale: {
|
||||
mode: Phaser.Scale.FIT,
|
||||
autoCenter: Phaser.Scale.CENTER_BOTH
|
||||
},
|
||||
scene: [BootScene, TitleScene, StoryScene, BattleScene]
|
||||
};
|
||||
|
||||
const game = new Phaser.Game(config);
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
window.__HEROS_GAME__ = game;
|
||||
}
|
||||
Reference in New Issue
Block a user