游戏引擎phaser.js3的使用

首先要加载对应的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 ()

{

//更新

}

下一节介绍使用细节

相关推荐
AI视觉网奇1 天前
虚幻引擎 metahuman
游戏引擎·虚幻
技术探讨者1 天前
Unity 框架:从核心构成到实践应用的全面解析
unity·游戏引擎
牛掰是怎么形成的1 天前
Unity Legacy动画与骨骼动画的本质区别
unity·游戏引擎
萘柰奈1 天前
Unity学习--2D动画--[序列帧动画]2D序列帧动画
学习·unity·游戏引擎
EQ-雪梨蛋花汤1 天前
【Unity笔记】Unity 模型渲染优化:从 Batching 到 GI 设置的完整指南
笔记·unity·游戏引擎
花花_11 天前
一步封神:Unity环境搭建终极全宇宙级攻略(Win/Mac/云)
macos·unity·游戏引擎
Unity打怪升级1 天前
【Unity精品源码】Ultimate Character Controller:高级角色控制器完整解决方案
游戏·unity·ue5·游戏引擎·godot·游戏程序·cocos2d
qq_312982131 天前
Unity国际版下载方法 https://unity.com/releases 被重定向问题导致下载不到Unity国际版的问题解决
unity·游戏引擎
光光的奇妙冒险1 天前
Luban+Unity使用,看这一篇文章就够了
unity·游戏引擎·游戏程序·游戏策划