Closed ghost closed 4 years ago
Hi, did you started the physics system in the creation of the game?
Something like this:
var game = new Phaser.Game({
"title": "Sunny Land Woods",
"width": 288,
"height": 192,
"type": Phaser.WEBGL,
"backgroundColor": "#000",
"parent": "game-container",
"scale": {
"mode": Phaser.Scale.FIT,
"autoCenter": Phaser.Scale.CENTER_BOTH
},
physics: {
default: "arcade",
arcade: {
debug: false
}
},
pixelArt: true
});
Note the physics
configuration.
yes
Uncaught TypeError: Cannot set property 'x' of undefined
Well, if you send me the project (developers@phasereditor2d.com) I can test here locally and try to reproduce the issue, to find a solution.
Version
Description
Possible solution
VM27:52 Uncaught TypeError: Cannot set property 'x' of undefined at Function.eval (eval at addToCache (phaser.js:171065),:52:77)
at World.collideSpriteVsSprite (phaser.js:100039)
at World.collideHandler (phaser.js:99968)
at World.collideObjects (phaser.js:99878)
at Collider.update (phaser.js:103006)
at World.update (phaser.js:99108)
at EventEmitter.emit (phaser.js:1774)
at Systems.step (phaser.js:35504)
at SceneManager.update (phaser.js:77851)
at Game.step (phaser.js:139643)
eval @ VM27:52
collideSpriteVsSprite @ phaser.js:100039
collideHandler @ phaser.js:99968
collideObjects @ phaser.js:99878
update @ phaser.js:103006
update @ phaser.js:99108
emit @ phaser.js:1774
step @ phaser.js:35504
update @ phaser.js:77851
step @ phaser.js:139643
step @ phaser.js:67227
step @ phaser.js:67474
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
requestAnimationFrame (async)
step @ phaser.js:67476
my code:
// You can write more code here
/ START OF COMPILED CODE /
class Scene1 extends Phaser.Scene {
hit(){ this.fPig.x = Phaser.Math.Between(0, 500); } update() {
}
/ END OF COMPILED CODE /
// You can write more code here
// You can write more code here
/ START OF COMPILED CODE /
/ END OF COMPILED CODE /
// You can write more code here