Jump to content

Particles not bouncing against tilemap layer


drhayes
 Share

Recommended Posts

I have this Sprite that has a child Emitter. At certain points, dictated by the AI, the emitter explodes out all the particles. I collide the emitter against my tilemap's collision layer and overlap it against the player. Both the collision layer and the player are exposed as properties on my game instance. When a particle overlaps the player I set alive to false and kill the particle. That works great. The particles also successfully collide against the collision layer.

 

However, they don't bounce. It looks like the tilemap separator code *should* be bouncing them, but it's not.

 

Here's the emitter's creation in my Sprite constructor:

  var screamEmitter = game.add.emitter(0, 0, 20);  screamEmitter.makeParticles('screamParticle');  screamEmitter.setAllChildren('body.allowGravity', false);  screamEmitter.setXSpeed(-200, 200);  screamEmitter.setYSpeed(-100, 75);  screamEmitter.setAlpha(1, 0, 1500, Phaser.Easing.Quadratic.In);  screamEmitter.setScale(1, 2, 1, 2, 1500, Phaser.Easing.Cubic.Out);  this.addChild(screamEmitter);  screamEmitter.x = 0;  screamEmitter.y = -10;  this.scream = screamEmitter;

Here's the collision and overlap calls from my Sprite's update method:

  this.game.physics.arcade.collide(this.scream, this.game.collisionLayer);  this.game.physics.arcade.overlap(this.scream, this.game.player, this.onScreamVsPlayerCollision, null, this);

Here's how I start the emitter via a timed event off a state machine:

this.scream.start(true, 1500, null, 1000);

Like I said: the particles come out just fine, they collide with player and collision layer just fine... they just don't bounce. Any ideas?

Link to comment
Share on other sites

  • 4 months later...
 Share

  • Recently Browsing   0 members

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