How do i get a sprite to walk over a line that is being drawn by the player?

How do i get a sprite to walk over a line that is being drawn by the player?

What i want to achieve is this:

The game starts without a floor, and the character starts falling from the top of the screen and a force is being applied to the character in order to keep moving forward.
The player needs to keep drawing floor by holding the mouse button, so that the characters moves on top of the floor that is being created.

At the moment i was able to create everything and everything works exactly like I want, except a really BIG detail… the character falls through the floor since the floor has no colision mask.

Here is a video showing what i have now:

Any ideas?

Here is a game that has exactly what i want to do:

Any ideas on how to achieve this?

By the way, on discord this aproach was sugested by someone:

marching-squares-platforms-painter (sorry can only put 2 links because im new)

I tried using it but this is not exactly what i want, main issues with this aproach, if the circle is small whn moving the cursor fast it will create gaps, with the camera moving it will stop drawing after it reaches the first screen limit, it allows to draw everyone and from front to back…

It can be done using the marching squares extension (example is here for anyone who reads this thread and wants the link).

Draw from last mouse position to current position, not just plot a circle.

As for the other issue you listed about marching squares, those are programming challenges to overcome.

Could you elaborate? I’m new to this extension.
Here is the what i have:

Instead of instead of drawing a circle, draw a line. And instead of “Mask a disk…”, use “Mask a line…”.

To keep track of the previous position of the mouse, create an unconditional event at the very end of the event sheet with actions to store the x & y values of the mouse (say called prev_mouse_x and prev_mouse_y). Use these variables as the start position of the “Mask a line…” action mentioned at the start of this post.