Author Topic: Falling down animation  (Read 3299 times)

Zeror

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Falling down animation
« on: July 20, 2015, 11:02:49 pm »
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.

polyglot762

  • Newbie
  • *
  • Posts: 49
  • a Quirk Storm... a coming.
    • View Profile
Re: Falling down animation
« Reply #1 on: July 21, 2015, 11:40:09 pm »
If you go to sprites
then to hero
then to tunic1,2,3 (any of those)
then select falling.
PG

Zeror

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Falling down animation
« Reply #2 on: July 22, 2015, 12:30:09 am »
I mean the animation that happens when you fall down a floor. The part where you see Link landing somewhere.

Diarandor

  • Hero Member
  • *****
  • Posts: 1061
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Falling down animation
« Reply #3 on: July 22, 2015, 02:48:49 am »
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.”

Zeror

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Falling down animation
« Reply #4 on: July 22, 2015, 11:32:56 am »
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.
« Last Edit: July 22, 2015, 11:34:57 am by Zeror »

Diarandor

  • Hero Member
  • *****
  • Posts: 1061
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Falling down animation
« Reply #5 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.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1185
    • View Profile
Re: Falling down animation
« Reply #6 on: July 22, 2015, 01:15:04 pm »
I confirm, this animation is not provided by the engine. You can script it as Diarandor suggests.

Zeror

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Falling down animation
« Reply #7 on: July 23, 2015, 04:20:41 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...

Diarandor

  • Hero Member
  • *****
  • Posts: 1061
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Falling down animation
« Reply #8 on: July 23, 2015, 07:03:28 pm »
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.”