Jump to content

P2 Physics with Layer Object


black_c
 Share

Recommended Posts

How to use P2 Physics with each layer object?
Code

this.saws = this.game.add.group();
this.saws.enableBody = true;
this.map.createFromObjects('saws', 4, 'saw', 0, true, false, this.saws);

this.saws.forEach(function(saw) {
  saw.body.clearShapes();
  saw.body.loadPolygon('physicsData', 'saw');
});
Quote

saw.body.clearShapes is not a function

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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