Jump to content

Collision groups and kinematic sprites


tomfog
 Share

Recommended Posts

Hi

I'm new to phaser and have been trying to use some of the examples as a starting point. I'm planning on using the "Pick Up Object" example, but restrict the area that the tetris shapes are placed in - so that they land on a solid platform. I would then add 3 x buttons to add more of the shapes onto the screen. Example here: https://phaser.io/examples/v2/p2-physics/pick-up-object

Would the best way to achieve this be to build the solid platform using a kinematic sprite as documented here: http://phaser.io/examples/v2/p2-physics/kinematic-body

If not, what is the best way define the area that the shapes are placed in - so they do not fall behind or in front of the platform and buttons?

 

Thanks!

Tom

Link to comment
Share on other sites

  • 2 weeks later...

Update: I have tried the following with no luck:

solidBlock = game.add.sprite(167, 400, 'solidBlock');

game.physics.p2.enable( [ solidBlock ]);

// first I tried this
solidBlock.body.static = true;

// then I tried this
solidBlock.body.kinematic = true;

Any help or advice would be much appreciated!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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