Sign in to follow this  
drhayes

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

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.