I wanted to make a mechanic in my game. Where the player can throw a yarn ball to create a chain link ability. One that can be used between all enemies in the Object group enemies.
Anyone able to help me?
Right-click to throw a ball of yarn. If it hits an enemy, it sticks to them.
The yarn links up to two additional nearby enemies (within 100 pixels), forming a chain of up to three enemies.
All linked enemies share damage: if one is hurt, they all take damage.
A visible line connects all linked enemies.
The yarn disappears after the first attack to the linked group.
Once linked the chain won’t break even if the enemies leave the 100 pixel distance.
Here is a flowchart:
1 Like
That’s such an interesting concept. Have you made any progress? Is this a top-down game? 2D?
Can you share any screenshots of the game setup or gameplay or events.
I imagine shooting the yarn like shooting a bullet. Is it shooting in the direction of the mouse or the direction the player is facing?
I would imagine when an enemy is hit by the yarn a linked boolean can be set to true or you could use object linking.
The yarn can be a simple line drawn on a shape painter or you could place tiled sprites similar to this post minus the animation part.
https://forum.gdevelop.io/t/creating-tracing-line-that-perfectly-follows-your-mouse-and-the-object-from-where-your-drag-began-is-tough/65269/10?u=keith_1357
If you want them to physically pull each other then you could use Rope Joints from Physics2 behavior.
If not, you could just use the built-in “link objects” action. Once linked you can pick them later using the condition “take into account linked objects.”