Anna Posted January 20, 2017 Share Posted January 20, 2017 Hi, I am try to use particles in my code. so i have registered it like this "me.pool.register("droplet", game.dropletParticle, true);" and in my entity.js i have written "game.dropletParticle = me.SpriteObject.extend({ init: function(x, y) { // class constructor this.parent(x, y, me.loader.getImage("droplet")); }, game.startEmitter = function(x, y, count) { // add count particles in the game, all at once! for (var i = 0; i < count; i++) // add the particle in the game, using the mouse coordinates and game layer 5 // use the objects pool for better performance! me.game.world.addChild(me.pool.pull("droplet", x, y), 5); };" i have mentioned the image in resources.js as well but I am getting the following error ---me.Error: Cannot register object 'droplet', invalid class--- all my other images i have used tmx file. Can someone help me here!!! Quote Link to comment Share on other sites More sharing options...
obiot Posted January 20, 2017 Share Posted January 20, 2017 stupid question, but is " game.dropletParticle " defined before the call to me.pool.register() ? are you using the latest 4.1.0 version ? (we added some check when registering object in the pool) https://github.com/melonjs/melonJS/releases/tag/4.1.0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.