Closed mfpierre closed 9 years ago
:+1:
I'm using phaser v2.3 and I'm getting the following error when trying to implement the website homepage example:
Uncaught TypeError: Cannot read property '4' of undefined
Coming from the plugin
this.sprite._cache[4]
Is the problem that the example for the home page of your site uses the old phaser or am I dont something wrong.. ?
EDIT: This issue seems to come from the following line being active:
isoGroup.physicsBodyType = Phaser.Plugin.Isometric.ISOARCADE;
The homepage of the site is using the plugin in v0.9.1 you should use v0.9.2 which contains the following fix for phaser 2.3
Thanks for clearing that up. It turns out Bower install returns v0.9.0
I'll update my files!
Ola,
Sorry to be a pain, and I really appreciate the help I keep receiving, but I'm still having problems with this.
Phaser v 2.3 Iso v.0.9.2
Uncaught TypeError: Cannot read property '4' of undefined
var myself = this;
// A more suitable underwater background color
myself.game.stage.backgroundColor = '#1873CE';
// Create a group for our tiles.
isoGroup = myself.game.add.group();
// Set the global gravity for IsoArcade.
myself.game.physics.isoArcade.gravity.setTo(0, 0, -500);
// we won't really be using IsoArcade physics, but I've enabled it anyway so the debug bodies can be seen
isoGroup.enableBody = true;
isoGroup.physicsBodyType = Phaser.Plugin.Isometric.ISOARCADE;
There is an issue with the minified file, try this one instead https://github.com/lewster32/phaser-plugin-isometric/blob/master/dist/phaser-plugin-isometric.js
I've made a PR to fix it :)
Make the plugin compatible with Phaser 2.3: No _cache object anymore.
https://github.com/photonstorm/phaser/commit/8483eac6aac7e325e528af8893ac4f5b2beb512e