[Extension] Concave Collision for Physics: arcs, curves and hills for Physics 2.0

everyone,

I made a free extension that builds collision for arcs, curves and hills with the Physics 2.0 behavior, which only accepts convex shapes.

How it works: you put a transparent PNG in a Sprite and call one action, “Build concave collision from image”. The extension reads the visible pixels, finds the edge of the shape, and creates static Physics 2.0 blocks along it, using a block object that you choose.

Limits, please read:

  • The blocks are static and are built once, using the position, size and angle of the Sprite at the moment the action runs. They do not follow a Sprite that moves or rotates afterwards.
  • The result is an approximation made of thin blocks, not a true curve.
  • Sprite objects only.
  • Not tested: moving arcs, very fast bodies, and Bullet mode.

Tested: a dynamic ball rolling on large arcs, on GDevelop 5.6.284.

Download (free, or pay what you want):

https://anas-alkhatib.itch.io/concave-collision-for-physics

Demo video:

Community list pull request:

The extension is a single JSON file, with no external dependencies and no network calls. The code is readable, not minified.

Disclosure: the idea, design and testing are mine. The code was written with AI assistance.

Feedback and bug reports are welcome. If something does not work, tell me your GDevelop version and what your object setup looks like.

1 Like