2D blood decal

jcyuan

Member
I'm finding clues on how to make blood decal dynamically, like

this.
Katana ZONE, which is I think made by GMS.

Anyone here know something about this? thanks!
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Hello! Okay, the best and easiest way to do this with a surface... basically you create an instance for the blood while it's moving and then when it stops moving you destroy it and draw it to a surface. The surface is then drawn to the screen and gives the illusion of a permanent decal.

This is actually pretty easy to do, however it has a few downsides... The first one is that if the room is very large then you need to use a large surface which might not be viable for memory reasons, which means you'll need to tile the surfaces. You also have the risk that the surface data will be wiped if the game window is moved or minimised or goes from fullscreen to windowed or vice versa. This can be avoided by making a sprite from the surface every few steps and drawing that instead of the surface though (so, instance to surface, surface to sprite, draw the sprite).

If it's any help, I actually have a marketplace asset that does this for you and is pretty much bullet-proof: https://marketplace.yoyogames.com/assets/8563/infinite-debris
 

jcyuan

Member
Hello! Okay, the best and easiest way to do this with a surface... basically you create an instance for the blood while it's moving and then when it stops moving you destroy it and draw it to a surface. The surface is then drawn to the screen and gives the illusion of a permanent decal.

This is actually pretty easy to do, however it has a few downsides... The first one is that if the room is very large then you need to use a large surface which might not be viable for memory reasons, which means you'll need to tile the surfaces. You also have the risk that the surface data will be wiped if the game window is moved or minimised or goes from fullscreen to windowed or vice versa. This can be avoided by making a sprite from the surface every few steps and drawing that instead of the surface though (so, instance to surface, surface to sprite, draw the sprite).

If it's any help, I actually have a marketplace asset that does this for you and is pretty much bullet-proof: https://marketplace.yoyogames.com/assets/8563/infinite-debris
so nice!!! really helpful, I'll look into your assets, thanks so much.
 
Top