import 'phaser';
import { MainScene } from './scenes/MainScene';
const config: GameConfig = {
type: Phaser.AUTO,
width: window.innerWidth,
height: window.innerHeight,
input: { keyboard: true },
parent: 'game',
physics: {
arcade: {
debug: false,
gravity: { y: 1850 }
},
default: 'arcade'
},
scale: {
width: 1536,
height: 864,
autoCenter: Phaser.Scale.CENTER_BOTH,
autoRound: true,
mode: Phaser.Scale.FIT,
zoom: window.innerWidth / 1536
},
scene: [MainScene],
render: {
antialias: false,
pixelArt: true,
roundPixels: true,
powerPreference: 'high-performance'
}
};
const game = new Phaser.Game(config);
i got error like this , and message error like this
Argument of type ‘GameConfig’ is not assignable to parameter of type ‘Phaser.Types.Core.GameConfig’.
Types of property ‘input’ are incompatible.
Type ‘boolean | InputConfig | undefined’ is not assignable to type ‘boolean | Phaser.Types.Core.InputConfig | undefined’.
Type ‘InputConfig’ is not assignable to type ‘boolean | InputConfig | undefined’.
Type ‘InputConfig’ is not assignable to type ‘Phaser.Types.Core.InputConfig’.
Types of property ‘keyboard’ are incompatible.
Type ‘boolean | KeyboardInputConfig | undefined’ is not assignable to type ‘boolean | Phaser.Types.Core.KeyboardInputConfig | undefined’.
Type ‘KeyboardInputConfig’ is not assignable to type ‘boolean | KeyboardInputConfig | undefined’.
Type ‘KeyboardInputConfig’ is not assignable to type ‘Phaser.Types.Core.KeyboardInputConfig’.
Types of property ‘capture’ are incompatible.
Type ‘number | undefined’ is not assignable to type ‘number | undefined’.
Type ‘number’ is not assignable to type ‘number | undefined’.ts(2345)