Posted April 15, 2021 by Dave Green
#update
Originally I wanted to do a more sophisticated point fracture system but it always turned out to be a complicated mess. Finally I figured out a simpler way with using the already implemented Cut-Fracture system. I added a func to generate a randomized polygon and with a point (like a collision point), this randomized polygon can be used in the cut fracture method.
Polygons with applied textures can now be cut. Texture properties of the source polygon are updated and transferred to the final shape and fracture shards.
- Polygon Lib transform clean up -> polygonLib.gd now uses transforms instead of positions and rotations.
- Polygon Lib no longer rotates the source polygon to match the source node's rotation. Now the cut shape is transformed to the local space of the source polygon and the final spawned body is rotated/scaled like the source node.
- Fracture Shard(Polygon2d) implemented as an alternative to Fracture Bodies (Rigibody2d). Fracture Shards a simple fake rigidbodies for adding a nice visual effect without using the physics system.
- General code clean-up.
- Comments added for newly added functions.
I am going to use this system in my current game project Nomads Sky if you want to check it out in action. Please consider supporting me here on itch or on Ko-Fi if you like my work, it makes it that much easier to keep working on projects like this.
Thanks for reading!