Bend and stretch a texture at arbitrary angles

Godot Version

4.3

Question

I am working in the typical 3 in line game (such as candy crush). I am trying to replicate one called “the curse of montezuma”. https://www.youtube.com/watch?v=oIcQEL04YUs

In that game, when you link 3 or more stones of the same type an “electricity texture” flows through the stones before they disappear.

This “electricity texture” takes the same direction as the line that connect the stones.

I am absolutely clueless in what node/s to use for such purpose, I tried line2d, sprites with vertex shaders, chatGPT, etc. none with useful results.

I am seeking for someone to point me in the right path, so I can investigate towards something that will give me the result I want. Perhaps I do need to think harder on what I tried before, but I want to know that I won’t be wasting my time anymore.

Below are some pictures of what I am talking about (from “the curse of montezuma”)
electricity
electricity5
electricity6
electricity7

For dynamic lines these would be the things I would reach for. line2d or “mesh2d”, both you seem to mention.

What was the issue with them?

The main issue is my own insecurity and perhaps overthinking.
I got a “prototype” that looks like this with line2d:
image
So, if you reckon this is the way to go… adding more points and working on the texture & perhaps shaders on the texture, I am fine with exploring that further.
I just need guidance to choose the correct way. This is my first attempt at doing anything related to Godot, so there are many unknowns :slight_smile:

1 Like

Yeah that prototype looks promising. the texture subject could be worked to be a little more center and wider, while making the purple transplant .

If you wanted a more wild and random lightning, a second line could be added with a transparent and off-center texture (maybe just use the same texture with a more random line near the first line. Keeping it fresh.)

Mixing the two styles could potentially be done in a shader.

Particles could be an option too for a more animated effect.

1 Like

Thanks @pennyloafers I will follow in that direction then.