Phaser vscode 发射
phaser on vscode launch
我在 vscode 上使用 Phaser 创建了一个简单的游戏。
我读到我需要在本地 运行 它才能在 chrome 上 运行 它,但我无法使用 vscode 的 F5 做到这一点。
当我打开 "index.html" 并按 F5 时,它会弹出一个警告框,上面写着 "cannot find progrem to debug"。
当 im 在任何其他文件上时按 F5 会导致调试器出错 "window is not defined"(当 im 在 phanser.js 上时)/"Phaser is not defined"(当 im 在任何其他文件上时)
我怎样才能正确启动这个程序?抱歉这个基本问题。
必须从 npm 安装 http-server 并 运行 它在终端中。
以前试过,不小心安装的不是全局的。
现在可以了。谢谢!
http-server 工作正常。但是如果你想轻松调试游戏。您可能需要按照 post 中的步骤操作:https://divillysausages.com/2015/06/09/using-phaser-with-visual-studio-code/
这是vscode中关于设置Typescript phaser开发的说明,但是教你如何设置节点服务器的步骤也适用于javascript用例。如果你想让它更容易调试(在游戏时暂停代码执行运行,等等)尝试以这种方式设置它。
我在 vscode 上使用 Phaser 创建了一个简单的游戏。 我读到我需要在本地 运行 它才能在 chrome 上 运行 它,但我无法使用 vscode 的 F5 做到这一点。
当我打开 "index.html" 并按 F5 时,它会弹出一个警告框,上面写着 "cannot find progrem to debug"。 当 im 在任何其他文件上时按 F5 会导致调试器出错 "window is not defined"(当 im 在 phanser.js 上时)/"Phaser is not defined"(当 im 在任何其他文件上时)
我怎样才能正确启动这个程序?抱歉这个基本问题。
必须从 npm 安装 http-server 并 运行 它在终端中。
以前试过,不小心安装的不是全局的。 现在可以了。谢谢!
http-server 工作正常。但是如果你想轻松调试游戏。您可能需要按照 post 中的步骤操作:https://divillysausages.com/2015/06/09/using-phaser-with-visual-studio-code/
这是vscode中关于设置Typescript phaser开发的说明,但是教你如何设置节点服务器的步骤也适用于javascript用例。如果你想让它更容易调试(在游戏时暂停代码执行运行,等等)尝试以这种方式设置它。