I want to make a breakable armor(more like skin) system for a 2D game. It would be similar to a dissolve shader but broken parts simply get a different color.
No limb destruction or anything like that. However, I need to be able to, say, break the armor at a certain point on the body. Armor within a certain radius would get broken.
Ex: from gunshot.
I’m not sure how I’d accomplish this. One thing I thought was:
- Divide the the body into small rectangles.
- Each rectangle had some float value denoting how much armor is intact.
- Fetch all of the rectangles within the radius and decrease thier values.
- Create/update a texture from rectangle values.
- Use it in dissolve shader.
However, this is probably not viable for a spritesheet based 2D game because I’d need to micromanage rectangles for every sprite.
Would it be possible to make a bonebased animation system work with a dissolve shader? Like, instead of rectangles, I’d save the armor values of each bone and somehow access in a shader. Is this possible?
If not, I guess the other choice is to make the game 2.5D.