Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Animation or emitter?


Yupoong
 Share

Recommended Posts

Dear readers,

 

I want to ask a question about Phaser, if my enemy gets killed I want to start a blood animations (spritesheet) , I tried to put it in my collisionHandler where my bullet and enemy die but this doesn't work. 

On phaser itself I found emitters but i'm not great with that, so if someone could help me understand the logic that would be great

Thanks,

Yupoong

Link to comment
Share on other sites

Quote

 

I find emitters very handy, this is a basic script snippet I modify as I see fit :

var emitter = this.game.add.emitter(this.player.x, this.player.y, 15);
emitter.makeParticles('star');
emitter.minParticleSpeed.setTo(-300, -300);
emitter.maxParticleSpeed.setTo(300, 300);
emitter.gravity = 0;
emitter.start(true, 750, null, 15);

this emitter is from my player sprite with a star png, you could easily modify this for your own needs

hope it helps you

Eric

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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