Jump to content

get Element of a object BOX2D


Carolina
 Share

Recommended Posts

Hello, I can create a element ('body') and add different elements, for example:

 

this.myBody = new Phaser.Physics.Box2D.Body(this.game, null, this.rolyCenter.x, this.rolyCenter.y);

 

and this element add many elements:

 

this.myBody.addRectangle(2, 10, 200 * Math.cos(angle)200 * Math.sin(angle), angle);

this.myBody.addRectangle(2, 10200 * Math.cos(angle)200 * Math.sin(angle), angle);

this.myBody.addRectangle(210200 * Math.cos(angle)200 * Math.sin(angle)angle);

 

I need know:

 

1 - can I add a 'Id' to the elements added to this.myBody?

2 - if 'x' element did collision with some object of my Body, How get the object that did collision with this.myBody?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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