Jump to content

Don't stop body that collides with other body?


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 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...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...