Greetings! I always wanted to script a jump like in Zelda games (the one given by the engine is too limited), where you can control the hero during the jump. I had an idea of how we could program this (although there may be other better ways).
The idea is, when using the item to jump, we first create a custom entity with transparent sprite and solid ground that follows the hero under him, and we start the jumping animation on the hero. (The custom entity would allow to move over holes, water and lava while we are jumping, because it has solid ground. It should have smaller size than the hero to avoid traversing walls.) When the jump animation finishes, we destroy the custom entity. It would be necessary to use the save solid ground function before the jump, just in case the hero ends in bad ground, and reset the solid ground function when the jump ends.
One of the advantages (or disadvantages) of doing it this way is that it allows the hero to jump over lower layers (in case that the current layer ends) without falling to the lower ones until the end of the jump. In other words, this would allow to jump between solid grounds on the same layer that have "empty" grounds (not holes!) between them without falling to lower layers. (I was planning to use this to make puzzles where you move boxes of the low layer to make a way on the middle layer where you can jump over the boxes without falling to the lower layer.)
I have not programmed this yet (someday I wil try it) so I am not sure if this will work as I expect. Anyway, I have hope in this trick to program the jump, so I wanted to share the idea.
The idea is, when using the item to jump, we first create a custom entity with transparent sprite and solid ground that follows the hero under him, and we start the jumping animation on the hero. (The custom entity would allow to move over holes, water and lava while we are jumping, because it has solid ground. It should have smaller size than the hero to avoid traversing walls.) When the jump animation finishes, we destroy the custom entity. It would be necessary to use the save solid ground function before the jump, just in case the hero ends in bad ground, and reset the solid ground function when the jump ends.
One of the advantages (or disadvantages) of doing it this way is that it allows the hero to jump over lower layers (in case that the current layer ends) without falling to the lower ones until the end of the jump. In other words, this would allow to jump between solid grounds on the same layer that have "empty" grounds (not holes!) between them without falling to lower layers. (I was planning to use this to make puzzles where you move boxes of the low layer to make a way on the middle layer where you can jump over the boxes without falling to the lower layer.)
I have not programmed this yet (someday I wil try it) so I am not sure if this will work as I expect. Anyway, I have hope in this trick to program the jump, so I wanted to share the idea.