You know how in various SNES games, some enemies or objects had arms or necks or whatever created from just a bunch of lined up sprites? You know, how their “neck” was made of balls and such?
That’s what I’m trying to recreate here. I have an old Construct 3 example that does exactly that, so I started to translate that into GDevelop’s format instead:
(Loopindex only exists here currently as a placeholder)
I tried looking online for a substitute expression, or to see if this kind of object hierarchy system has been questioned before, but I had no luck. GDevelop doesn’t seem to have it’s own loop expression either…?
What can I use in place of loopindex to get this to work?
Instead of doing balls check out what Keith come up with
Try that project and see if that would not be better solution for you
If not i think only thing you need is expression to proportionally position balls on distance between two objects
For example you would set position of ball closest to head and most far from body to distance between two objects - 90% of that distance
So all you would need to get is expression for how to calculate 90% of something
And then for next ball 80% and so go on
And that would do the trick
So if you don’t like solution Keith made you better make post to ask about that kind of expression cause i just have IDEA how to do it but i am not good with expression
I guess it could be calculated same way as we calculate HP for HP bars but idk how to do that
I love that concept. What about if you use scene variable, in this case i ?
lerp(head.X(),body.X(),i/(SceneInstancesCount(neck)+1))
lerp(head.Y(),body.Y(),i/(SceneInstancesCount(neck)+1))
Drag the “head”, click a “neck” object to delete and click the “body” to add a “neck” object
You need to drag the head to realign everything.
edit: Did I tell you how much I love this concept? This would automatically add or delete objects. (if you needed to) It might be more efficient to hide and show segments than delete them.