Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Phaser 3类型脚本错误游戏不绑定_Javascript_Phaser Framework - Fatal编程技术网

Javascript Phaser 3类型脚本错误游戏不绑定

Javascript Phaser 3类型脚本错误游戏不绑定,javascript,phaser-framework,Javascript,Phaser Framework,到目前为止,我已经尝试过使用Typescript绑定简单地启动Phaser3游戏。下面是我的main.js入口点 /**@type {import("../typings/phaser")} */ let config = { type: Phaser.AUTO, width: 800, height: 600 }; let game = Phaser.Game(config); 我正在使用我认为是phaser.d.ts中最新的类型脚本定义。然而,当我加载游戏时,我得到

到目前为止,我已经尝试过使用Typescript绑定简单地启动Phaser3游戏。下面是我的main.js入口点

/**@type {import("../typings/phaser")} */
let config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600
};
let game = Phaser.Game(config);
我正在使用我认为是phaser.d.ts中最新的类型脚本定义。然而,当我加载游戏时,我得到以下错误

phaser.min.js:1 Uncaught TypeError: Cannot read property 'bind' of undefined
    at Object.initialize [as Game] (phaser.min.js:1)
    at Object.parcelRequire.src/main.js (main.js:7)
    at newRequire (main.1e43358e.js:49)
    at main.1e43358e.js:81
    at main.1e43358e.js:107

Phaser.Game
是一个构造函数函数,需要使用关键字
new

let game = new Phaser.Game(config);

啊!非常感谢你!