Carolina Posted September 18, 2015 Share Posted September 18, 2015 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, 10, 200 * Math.cos(angle), 200 * Math.sin(angle), angle);this.myBody.addRectangle(2, 10, 200 * 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 More sharing options...
Recommended Posts