首先要加载对应的phaser.js资源,正常引入就可以了,线上的js路径为
https://cdn.jsdelivr.net/npm/phaser@3.15.1/dist/phaser-arcade-physics.min.js
引入后就可以正常进行使用了
以下就是初始使用方法
代码结构如下
var config = {
     type: Phaser.AUTO,
     width: 800,
     height: 600,
     scene: {
         preload: preload,
         create: create,
         update: update
     }
 };
var game = new Phaser.Game(config);
function preload ()
 {
//在这里加载游戏所需资源
 }
function create ()
 {
//绘制游戏的内容
 }
function update ()
 {
//更新
 }
下一节介绍使用细节










