import { Game } from 'phaser';

import PreloadScene from "./scenes/PreloadScene";
import { GameScene } from './scenes/GameScene';

const config: Phaser.Types.Core.GameConfig = {
    type: Phaser.CANVAS,
    roundPixels: true,
    pixelArt: true,
    scale: {
        width: 720,
        height: 700,
        autoCenter: Phaser.Scale.CENTER_BOTH,
        // mode: Phaser.Scale.RESIZE,
        mode: Phaser.Scale.HEIGHT_CONTROLS_WIDTH,
    },
    // backgroundColor: "#ffffff",
    transparent: true,

    physics: {
        default: 'arcade',
        arcade: {
            gravity: { y: 0, x: 0 },
            debug: false,
        },
    },
    scene: [PreloadScene, GameScene],
};

const StartGame = (parent: string) => {
    return new Game({ ...config, parent });
}

export default StartGame;
