Collision Polygon Point

0 favourites
  • 4 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hi, is there any way, even if it�s hacky, to get a point of a collision polygon at runtime, like we do with imagePoints? eg: Sprite.colisionPoint(0)?

    If not, somebody know of a plugin? I need this for the GGJ, I�ll use the collision points in the tiles of a tilemap to project shadows using Canvas, but the tiles don�t have imagepoints.


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd say just create imagepoints at each of the collision poly points. But since you want to do it with a tilemap, that won't work.

    Instead, try an array. Along the X Axis is each tile in the tileset. Along the Y Axis is each point in the polygon. Then the Z Axis is the X and Y position of said point.

    It might take a bit of typing but that's how I would go about it.

  • Thanks EncryptedCow but I really need to use the polygon masks the tilemap object creates: first, they�re optimized polygons, so less garbage in the memory, second this method you describe wouldn�t permite ramps or slopes to be illuminated.

    Is there any way to expose the positions of the points in the collision polygon Ashely?

  • It would work for any polygon. The array would just be storing the X and Y position of each point in the polygon of each tile. It's just that you can't get the coordinates of the image points with events, so you have to look at the numbers with the editor and put them in yourself.

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