Hi there! I really need your help, I spent all day on the code.
I have group with sprite inside. At some step, the sprites are added to the array.
Next I need to change the image of only the last sprite in the array.
I do it like this:
var special = selectedGems.pop();
special.loadTexture('bomb');
Of course, before that, I upload assets:
Level.prototype.preload = function () {
this.load.pack('gem', 'assets/assets.json');
this.load.pack('special_gem', 'assets/assets.json');
game = this;
};
I have an Error:
phaser.js:47498 Uncaught TypeError: Cannot read property 'cache' of null
Just came here to say Phaser is the most frustrating thing ever. The fact nothing at all is cross reference-able makes it impossible to do anything. I swear I have jumped back and forth between versions and physics and absolutely nothing is compatible. Now I can’t even load a json file sprite that works perfectly fine in phaser 2 in phaser 3 without getting all these undefined errors. Where can I find accurate information to get my sprite to work as an animated json? I am making a platformer/sidescroller so ideally I want my game to be played on mobile and desktop. That means I will need a virtual controller as well as keyboard input. I can only seem to get one to work, not both simultaneously.