Sign in to follow this  

Particles not bouncing against tilemap layer

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.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?

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.