I make my own game, start to finish (Devlog) - 62: Dynamic Collision and Occluder shapes from Sprite

Channel:
Subscribers:
1,910
Published on ● Video Link: https://www.youtube.com/watch?v=Rp6Ifm5GpDo



Duration: 0:00
308 views
10


In this devlog I figured out how to automatically create a CollisionPolygon2D shape and LightOccluder2D just from an image! This is the first step into making my ship editor where I can create ships more easily from inside the game (and also make it easier for modders to play around once the game is released)

I basically load an Image file, convert it to a Bitmap, and then use an obscure method to convert it into a 2D array of Vector2's that define the polygon. There's definitely some room for an improvement, but it's a start!