Jump to content

melonjs-particle system


Anna
 Share

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

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...