Jump to content

Phaser Box2d Draw or Update points


NistorCristian
 Share

Recommended Posts

Hi,

I want to make a Box2d Sof body. I made something like that but I don't know if I'm using the right method. As you can see in the attached image there is a circle and some smaller circles to define the Soft body area. To make it purple I'm using graphics.

    graphics.clear();
    graphics.beginFill(0xFF33ff);
    graphics.drawPolygon(polygonStructure);
    graphics.endFill();

That is what I put in update function. polygonStructure is an array made with position x and y of every little circle.

What is better, to update the points of a polygon and put a graphic sprite over it or draw it like I'm doing it now?

And ... How can I do the edges more soft? Using some arc or something?

 

Thank you

img.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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