我有一个相位游戏与两个不同的状态,即preloadState和gameState。声音文件首先使用Phaser.Loader在preloadState中加载。但是,在完成加载和输入gameState时,我无法检索所述声音文件。
调用堆栈:
Uncaught TypeError: this.cache.getSound(...).play is not a function
(anonymous function) @ game.js:232
Phaser.SignalBinding.execute @ phaser.js:29960
Phaser.Signal.dispatch @ phase
我正在尝试将法线贴图应用于相位器精灵,但在相位器2.1.1 (Pixi 1.6.1)中得到以下WebGL错误:
Could not initialise shaders phaser.js:3411
WebGL: INVALID_OPERATION: useProgram: program not valid phaser.js:3475
WebGL: INVALID_OPERATION: getUniformLocation: program not linked phaser.js:3478
WebGL: INVALID_OPERATION: getAttribLocation: prog
目标是让用户编辑一个SVG,它是预定义的动画集的源纹理。由于某些原因,动画无法播放,它总是停留在第一个帧上,当我显式调用play()时,会得到一个错误:
Uncaught TypeError: Cannot read properties of undefined (reading 'texture')
at AnimationState.setCurrentFrame (phaser.js:43946:1)
at AnimationState.handleStart (phaser.js:43412:1)
at AnimationState.updat
我试图上传插件到我的项目,尝试了所有的方法,但没有任何工作。返回一个错误
Uncaught TypeError: Cannot read properties of undefined (reading 'createSkeleton')
at initialize.set Skeleton (<anonymous>:1:290667)
at new initialize (<anonymous>:1:289262)
at Game Object Factory.spine (<anonymous>:1:54310)
我正在学习phaser.js,我甚至不能加载图像。
以下是代码:
// Need state. All game logic goes in state
var GameState = {
// Load all your images. Thats what the preload function is
preload : function(){
//Load Image
this.load.image( 'background', 'https://encrypted-tbn3.gstatic.com/images?q=
我正在尝试学习如何使用Phaser,遵循关于如何加载图像的在线说明;phaser提供的示例之一是load图像示例。
这是Phaser提供的代码。
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create });
function preload() {
// You can fill the preloader with as many assets as your game requires
// H
我使用“相位器”,‘离子-相位’和一个相位插件‘网格引擎’整合一个相位游戏的反应。我可以成功地初始化游戏,然后销毁它,没有错误。但是,当我尝试重新初始化它时,İ不会给出两个错误
Scene Plugin key in use: GridEngine
和
Uncaught TypeError: Cannot read properties of undefined (reading 'create')
at Scene.create (isometric.js:93:1)
at SceneManager.create (phaser.js:84684:1)
at SceneMa
我遵循本教程,并已达到加载的天空。然而,天空的图像,不幸没有载入。为了验证这不是代码的问题,我运行了教程提供的part3.html文件,它说它应该从一开始就加载天空,但是没有效果。任何帮助都是非常感谢的!(谢谢:)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Making your first Phaser 3 Game - Part 3</title>
&
我正在Phaser3上开发一款游戏,目前我正在努力使用回调。我已经创建了两个类,一个叫做"Entitee“,另一个叫做"objet” class Entitee extends Phaser.Physics.Arcade.Sprite{
constructor(scene, x, y, pv, mana, speed, poise, asset){
//Private
var _pv = pv;
var _pvMax = pv;
var _mana = mana;
var _manaMax = m
根据,自3.53.0版- Anastasia -2021年3月8日起
SceneManager.loadComplete将不再尝试解锁声音管理器,在每个场景完成加载后防止AudioContext was not allowed to start控制台警告。
然而,每次我在Chrome96.0.4664.110上运行一个phaser3应用程序(官方版本) (x86_64)
var game = new Phaser.Game();
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js
所以是的,Chrome有自己的本地存储API。我用过
chrome.storage.local.set({"item": itemValue});
和
chrome.storage.local.get("item", function (result) {
console.log(result);
});
我所有的存储电话。
我面临的问题是,我已经用Phaser.js开发了一个Phaser.js游戏,其中包含了localStorage语句,这完全不允许我查看我的游戏。因此,我在控制台中得到了这个错误:
window.localStorage is no
我正在尝试在我的游戏中启用全屏功能,我是在Scene类中通过
this.game.scale.startFullScreen();
但在f12浏览器控制台中出现错误
Uncaught TypeError: this.game.scale.startFullScreen is not a function
at TitleScene.<anonymous> (TitleScene.js:23)
at InputPlugin.emit (phaser.js:2025)
at InputPlugin.processDownEvents (phaser.js:167