Sign in to follow this  
Anna

melonjs-particle system

Recommended Posts

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!!!

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.