• 2D
  • Draw 2D borders supporting collision

Hi,

I'm trying to build something like a playfield with concave and convex curves. Think of a heart - so as long as my character is inside of the heart, he's fine. When the character tries to leave it and hits the border of the heart, then a collision event should be fired. The opposite way would be easy to build - but how to define a "inverted" collision shape in 2D?

One more thing - the playfield is somehow large. I could provide a real big image containing the hart, but that would produce performance issues. So I'm thinking about splitting the one image into multiple small ones. Or are there any better solutions - like drawing a heart programmatically with Polygon2D?

Thx

What about defining a collision shape ( or shapes) that contains the borders of the playfield, i.e. thin walls?

An image won't cause performance issues simply because its dimensions are large.

5 days later

Hi Dave,

thx - I had also such an idea. You gave me confidence to try this out... it looks promising.

Regards