Is it possible to read the collision polygon points?

0 favourites
  • 14 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • I'm mostly talking about sprites. Is there a way to read the collision polygon points similar to how you can read image points?

    For example on a sprite, you can do ImagePointX and ImagePointY. I don't see any expression like this for collision polygon points.

    If not that would be an excellent new feature.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think so, at least not with built-in features.

  • Darn. Would anyone else besides me find it extremely useful to read the collision polygon points?

  • What do you need it for? I've never heard anyone ask about this before.

  • I would, sometimes you want to show polly even for the end game user.

    You could put an image point at each polygon point if you need to, but it would be easier to have access.

    yours

    winkr7

  • I would, sometimes you want to show polly even for the end game user.

    But why though?

    Given how limited our resources are we need a good justification for any feature. The collision poly seems like an internal game detail that you wouldn't show to the user.

  • in some games the player does "editing" too.

    I have a game where the player builds his ship out of parts. Some of those parts are armor and he wants to know while he is building his ship in game--how much is cosmetic and what is the real pollygon?

    I could make up collision polygon shaped sprites and show that or put image points on pollygon points and draw lines or--you could tell me where the polygom points are.

    There are work arounds--just sometimes you want to know where they are. For me it would not be a high priority--but since you asked thats why.

    yours

    Winkr7

  • Colludium's plugin has collision point detection, and visible collision mask as well. You can ask him if it will help in your particular case.

  • I was also looking for this when i started using Construct.

    Like many other tools in construct, customization possibilities are very limited to specific use-cases.

    Set image points and forget about the collision mask and its related actions altogether.

    Gives you so much more possibilities.

    Not just for picking points or ingame visibility, but for actual mathematical solutions for simply everything.

    If you're going for something simple, that's great.

    Otherwise stop trying to use the built-in tools because they're most likely not going to serve your needs.

  • I also asked the same thing a long time ago.

    My idea was for a car game.

    The car was in a mud zone and if the player accelerated then the car sank into the mud zone, for that he had to move / create a collision point in the mud in the wheel area and move it down to make The car sinks.

  • The LFJS plugin allows you to edit the collision polygon for the box2d physics engine (so you can create shapes on the fly).

    I made a plugin for c2 that did this (a long time ago); I'll convert it to c3 soon.

  • I made a demo for another post where I used image points for detecting the exact point of collision:

    construct.net/en/forum/construct-2/how-do-i-18/spawn-particles-on-the-point-2-59886/page-3

  • Here you go - a plugin to get/set a sprite's collision polygon: link

  • Thank you Colludium!

    Ashley As for use cases:

    • The simplest is to draw them at runtime just for debugging purposes.
    • As Colludium alluded to, drawing custom shapes with accurate collider at runtime
    • When 2 sprites collide we could compute the exact overlap shape
    • To easily compute line of sight & shadow casting by casting rays from player to polygon collider points (like here: https://www.youtube.com/watch?v=fc3nnG2CG8U)(yes I realize C3 already has LOS behavior & shadow casting plugin)
    • To create more advanced lighting effects by combining drawing canvas plus casting rays from light positions to polygon collider points (like here: https://medium.com/@NoelFB/remaking-celestes-lighting-3478d6f10bf)
    • Who knows what else the community will come up with
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)