Closed Laokoont closed 8 years ago
Hi, @Laokoont. Thanks for trying my Yeoman generator.
I didn't knew much about the Isometric plugin, haven't tried it yet, but I made a little test to see how things are, and looked in the source codes for some clues.
The correct class to extend is Phaser.Plugin.Isometric.IsoSprite
.
export default class Tile extends Phaser.Plugin.Isometric.IsoSprite {
constructor (game, x, y, z, key, frame) {
super(game, x, y, z, key, frame);
// ... etc ...
}
}
isoSprite
is just a function added by the plugin so you can create isometric sprites the same way you could create regular sprites using the game.add.*
API calls.
I'm using an external plugin called phaser-plugin-isometric to create isometric game spaces. I add this plugin to Phaser via simple command within the
preload()
method of myBoot
state:It seems to work fine in all forthcoming states as well.
It, among other things, extends
Phaser
object withisoSprite
function that creates isometric sprites. It works like charm when I use it explicitly in myGame
state:I would like to be able to describe object classes that inherit from
isoSprite
the same way they can inherit basicSprite
class from Phaser with something like this:However I have found out that in this case the
isoSprite
method appears undefined. How can I make it visible in the scope of my object class?