Search code examples
libgdxcurve

How to add Curve walls in libGdx to a world?


I'm making a game, where walls (static bodies) are supposed to simultaneously be appearing (growing) on the screen in shape of different curves. I have no idea how to achieve this. Maybe somehow attaching circle shaped fixtures 1 by 1? I really hope you could set me up on a right direction. Thanks in advance!


Solution

  • Why use CircleShapes and stick them together in a curve?

    It's much easier and more efficient to use an EdgeShape where you can define "Lines" of vertices to form any shape. Put the vertices close enough together and they'll form something curvy.