Polygon Plugin

Not favoritedFavorited Favorited 0 favourites
  • 12 posts
From the Asset Store
Per Pixel Destruction like in "Worms" (perfect performance, no third party plugins)
  • I released a new plugin.

    construct.net/en/make-games/addons/1644/polygon

    The Polygon plugin allows you to easily create polygon shapes and perform Boolean cuts, holes, merges, apply clipping masks and images.

    Its easier than css and works on the construct canvas like a sprite, and better than the drawing canvas.

    I was hoping this plugin could be used with physics, it can but it can only use the bounding box. This is because the SDK v2 doesn't allow collision points to be set.

    Any bugs or feature request let me know.

  • That looks cool.

    I was hoping this plugin could be used with physics, it can but it can only use the bounding box.

    Noooooooooo that was the ONE thing I was thinking of. "Ohh would that allow me to break physics objects into smaller ones?"

  • Thanks.

    I'm looking at integrating LiquidFun.js, since i've done all the hard work, and adding hard bodies, soft bodies, water and soup.

    Not sure if its possible yet.

  • Collisions could be possible by using a mesh distort on a separate invisible object. For example for a polygon with N points you’d need a mesh of size (N/2, 2). Then (0…N/2, 0) would be set to the first half of the points and (N/2…0,1) would be the second half (note the index order is reversed). I say invisible because while it won’t render nicely, it will have a correct collision polygon.

    Just an idea at least. You already provide expressions for getting points so it’s something users could do.

  • Thanks.

    I'm looking at integrating LiquidFun.js, since i've done all the hard work, and adding hard bodies, soft bodies, water and soup.

    Not sure if its possible yet.

    Look my plugins and behaviors in C2

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So I had a go at trying to distort a mesh to give collisions that match the polygons and it works pretty well. I'm not sure if juggling a separate object from a different plugin is feasible though.

    dropbox.com/scl/fi/9ynvheoi016450691vt86/poly_plugin_collisions.c3p

    It only works with the exterior polygon though. Unless there is a easy way to merge the holes with the outside so it's one polygon like this:

    Anyways, some feedback:

    Maybe you could make the Polygon.PointWorldX expression work with numbers as well as strings? I had to use Polygon.PointWorldX(str(loopindex)) instead of Polygon.PointWorldX(loopindex) to access point locations. Nothing major, but thought I'd bring it up.

    I see that you can set the scale of an svg when you load it, but are there any plans to be able to scale polygons after they are created?

    Other than that, pretty cool plugin.

  • real cool.usefull for sandbox game!!!

  • Wow great example R0J0hound

    Thanks for the feedback.

    I will look at adding shape scaling, and having PointWorld accept numbers as well.

    Boolean operations like cut and merge are done by the clipper.js lib, so i will have to see if it can cut shapes into one, or look at other options.

    EDIT - Actually you can already do the square with the triangle shape donut by doing 2 cuts, first the triangle, then a 1 px line through the side. This will then rebuild it as 1 concave shape.

  • New update available. Segments were not being rendered when a shape was cut. It turns out there were bigger issues with point handling effecting other areas of the plugin.

    Sorry if you tried the plugin and it was not working correctly. Should be good now.

  • New update.

    1. Added a Scale shape action under the maths category. It scales the shape while points can still be edited as normal.

    2. Found a bug with smoothing where the first point was not being smoothed. Added a new parameter for if the shape is closed, or open like a line, so it smooths correctly.

    3. Most actions and expressions now except both string and numbers.

  • can you add a paste act like drawingcanvas. i think use render api can do it.the fun called updatetexture and create dynamic texture.thanks and you can sell your plug on store or itch i will buy it

  • Can you describe what you are wanting to do, as i'm not sure what you mean exactly.

    Do you mean like paste a sprite into the polygon shape?

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)