Jump to content

Don't stop body that collides with other body?


spinnerbox
 Share

Recommended Posts

I see the docs of the Body class http://phaser.io/docs/2.6.2/Phaser.Physics.Arcade.Body.html

But i am not sure which would be the right property to change. I have two balloons falling down and they might both at the same time or one after the other, hit my rectangle. The problem is, both objects stop moving after they hit the rectangle. i am sure this has to do something with physics. As if the vertical(y coordinate) velocity gets set to 0 when they hit the rectangle.

Here is a sample code:

graphics = si.gameObject.add.sprite(boxX, boxY, si.ImageAssetKeys.BALLOON_ANIM_ATLAS, 0);
floatingAnim = graphics.animations.add('floating', si.GraphicsUtility.getFloatingAnimArray(), 30, true);
splashAnim = graphics.animations.add('splash', si.GraphicsUtility.getSplashAnimArray(), 30, false);
splashAnim.onComplete.add(si.LetterBox.splashComplete, this);

graphics.animations.play('floating');
balloon.graphics = graphics;

balloon.graphics.anchor.setTo(0.5, 0.5);
balloon.graphics.body.checkCollision.up = false;
balloon.graphics.body.checkCollision.left = false;
balloon.graphics.body.checkCollision.right = false;
balloon.graphics.body.checkCollision.down = true;
balloon.graphics.body.velocity.y = velocity;
balloon.graphics.allowGravity = false;
balloon.graphics.allowRotation = false;

Which body property should I change to prevent the stop in movement of balloons?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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