Closed tobspr closed 6 years ago
that branch is unmaintained, please, feel free to update
in my case, a change in Game.js will do it:
this.mushroom = new Mushroom({
// from
// game: this,
// to:
game: this.game,
x: this.world.centerX,
y: this.world.centerY,
asset: 'mushroom'
})
When trying the typescript branch, I got the following error:
phaser-split.js:24791 Uncaught Error: The value passed as the `game` argument ([object Object]) is not an instance of Phaser.Game.
The error happens at the Mushroom class:
When inspecting
game
, it looks likegame
is an instance ofPhaser.Game
, which was very weird. Also, comparinggame.__proto__
toPhaser.Game.prototype
looked the same. However,game.__proto__ == Phaser.Game.prototype
yieldsfalse
, which is why the check fails.It seems that the
import Phaser from 'phaser'
import causes the problem. When usingimport Phaser from 'phaser-ce'
it works, at least for me, since its picking up the correct class then.