Polygon Plugin

Not favoritedFavorited Favorited 0 favourites
From the Asset Store
Per Pixel Destruction like in "Worms" (perfect performance, no third party plugins)
  • Very cool. You’re on a roll with the updates!

    This is the kind of thing that brings life to the forums. I like seeing people creating stuff and having fun doing it.

    Any thoughts on doing some more rendering in the editor than just the box? I know the plugin is geared toward generating shapes at runtime, but even approximate shapes would help with layouting. If not users would have come up with some kind of strategy to do it I suppose. I know there are many hard limits with the plugin sdk.

    On the events side, I was able to access the points of the outer main polygon, but I may have missed how to access the points of other polygons (like holes and such). I probably just need to mess with it more as I may just have missed it.

    Anyways, keep up the good work.

  • Thanks.

    Internally, the plugin flattens all shapes into an array of paths (Segments).

    Segment 0: The main outer polygon boundary.

    Segment 1: The first hole (or first fractured shard).

    Segment 2: The second hole (or second fractured shard).

    Polygon.PointWorldX("0_5") gets the 6th point of the main outer boundary.

    Polygon.PointWorldX("1_0") gets the 1st point of the first hole/fragment.

    Polygon.PointWorldX("2_4") gets the 5th point of the second hole/fragment.

    Using a loop,

    Polygon.PointWorldX( str(SegmentLoopIndex) & "_" & str(PointLoopIndex) )

    If you want to spawn objects along the paths of the holes, you can nest two loops,

    + (Event Trigger)

    + System: Repeat Polygon.PathCount times (Loops through the main shape and all holes)

    + System: Local Number 'seg' = LoopIndex

    + System: Repeat Polygon.SegmentPointCount(seg) times (Loops through the points of this specific hole)

    + System: Local Number 'pt' = LoopIndex

    -> System: Create Object Dot at X: Polygon.PointWorldX(str(seg) & "_" & str(pt)), Y: Polygon.PointWorldY(str(seg) & "_" & str(pt))

    If a polygon was created based on the image points of a sprite, it will adopt those image point names.

    If you create a polygon and name the point "bob", you can access that point by that specific name.

    Points can be retrieved both by their unique name or the default "SegmentIndex_PointIndex".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • New Update.

    Shapes now support dashed lines.

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