Falling down animation

Started by Zeror, July 20, 2015, 11:02:49 PM

Previous topic - Next topic
How can i do a falling down animation?
Like when you fall down into a hole from an upper floor to a lower floor.

Can't find how it's done.

If you go to sprites
then to hero
then to tunic1,2,3 (any of those)
then select falling.
PG

I mean the animation that happens when you fall down a floor. The part where you see Link landing somewhere.

You should clarify more your question, it is quite ambiguous. Anyway, you should check Christopho's tutorials on youtube.

If you mean how to make the hero fall from a map to a different map, you may find the answer in this tutorial:
https://www.youtube.com/watch?v=4VIVdz3LPM4
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

July 22, 2015, 11:32:56 AM #4 Last Edit: July 22, 2015, 11:34:57 AM by Zeror
I mean this:

https://youtu.be/xf2IO7P5DVA?t=4m20s

On 4m25s you see that Link falls down a hole and ends up on a new map (the castle dungeon). The falling down animation on the upper map is not what i mean. That animation you see on the new map where link falls from the ceiling to the floor IS what i mean.

I know how to connect maps for this in Solarus, but not how to add the falling down animation to it.

I have never done this, so maybe this is not the best way to do it. This is what I would do, I hope it works.

Use the event teletransporter:on_activated() to set a custom state on the hero (or save the info that he is falling in some boolean variable). Then, on the method game:on_map_changed(), that you may have already defined in some of your main scripts, you call a function to simulate the falling "animation" in case it is necessary (I would save that function in some other script).

To do this function for the falling animation, you should freeze the hero, maybe make him able to traverse walls or ignore obstacles, create the shadow at his coordinates, change hero's position, start the movement and, at the end of the movement restore everything to normal.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

I confirm, this animation is not provided by the engine. You can script it as Diarandor suggests.

Quote from: Diarandor on July 22, 2015, 12:59:46 PM
I have never done this, so maybe this is not the best way to do it. This is what I would do, I hope it works.

Use the event teletransporter:on_activated() to set a custom state on the hero (or save the info that he is falling in some boolean variable). Then, on the method game:on_map_changed(), that you may have already defined in some of your main scripts, you call a function to simulate the falling "animation" in case it is necessary (I would save that function in some other script).

To do this function for the falling animation, you should freeze the hero, maybe make him able to traverse walls or ignore obstacles, create the shadow at his coordinates, change hero's position, start the movement and, at the end of the movement restore everything to normal.
And this goes in main.lua or should i use another file for it?

* Zeror is still learning and stuff...

You can write everything directly in the event game:on_map_changed(map), but I would write a function in another script (made just for this) and call it in the event. You can do it as you prefer, that's not important.

I don't know how are your scripts. I have the event game:on_map_changed(map) defined in my game manager script, although you may have it in the main.lua. I cannot help you more, sorry.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."