Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Thank you for your answer ! I didn't know the RenderTexture used with a camera, that will be useful thank you ! I understood how you found which part to erase but can you specify how you erased part of the texture ? I always saw it with making an animated sprite or with a shader so I'm really curious how you made it in script.

It's really cool to read you on the jam process, thank you for detailing all that !

(1 edit)

To erase parts of the image, I looped through all the pixels that were going to be erased and changed their color to clear with this nested for loop:

for (int x = relativePos.x-7; x <= relativePos.x+7; x++)
{
    for (int y = relativePos.y - 7; y <= relativePos.y + 7; y++)
    {
        erasingTexture.SetPixel(x,y,Color.clear);
    }
}
erasingTexture.Apply();

Here, relativePos is a Vector2Int that stores the position of the player on the render texture, and erasingTexture is the Texture2D that is being erased. It was pretty simple actually, although it’s probably not the fastest way of doing it.

I managed to reproduce it in Godot thanks to your explanations ! You helped me so much since I tried doing that a long time ago but failed to find a way. Thank you very much for taking the time to explain and once again good job on the jam, I'll be sure to check your future games keep up the good work !

Thank you and you’re welcome!