For fun I am trying to replicate the mechanics from The Floor is Jelly. So far I have successfully created "jelly islands/blocks" which are represented by an array of points and then drawn by using quadratic curves between the points. I am also able to get the jelly effect by having each point hold a velocity value as well as a relationship with its neighboring points to allow the springyness effect.
The above works well and gives a good representation of how the actual game seems to do it.
The part that I am kind of stuck on is how to resolve collisions with the character. I can successfully detect when my character (currently just a square represented by 4 points) comes into contact with the jelly island. However, I cannot think of an efficient way to make it "stick" to the ground and then smoothly interpolate along the curve once a force is applied to the jelly that causes it to move. Also, I want the character to stick to the ground unless the user "jumps" which means that the character should follow the ground through it's wobbles rather than go up into the air.
I could pass the character controller the array of points representing the island that it is currently colliding with, but then iterating through all of the points and finding the points closest to the character seems like a lot of work to do on each frame. In addition I am still not sure how I would get the correct position of the character along the curved ground (particularly when it is wobbling).
Any suggestions are appreciated
Clarification as I fear that I wasn't clear enough above. What I mean when I say that I can successfully detect when my character comes into contact with the jelly island is that I am currently using the Point in Polygon algorithm to detect when the jelly island is not moving/wobbling this breaks of course once the jelly island has a force applied to it.
To fix this I have been looking into breaking the island into many line segments along the curves (how collisions with quadratic/bezier curves are usually handled), but I'm afraid that this will be too much work to do on each frame. In addition I am still stuck on the problems described above.