Timshark

Hi
Does any user has any links or advice on how to use/create a "good looking" stair climb animation.
The animation is no problem to do in Spine with a reference image of stairs.
But how do you move and loop the sprite in the game and keeping the feet hit the stairs instead of floating and going through them?

Another problem is that this is going to be used on a escalator....with moving stairs, but I guess if I solve the first problem, It's easier to solve the second.
Timshark
  • Сообщения: 18

Nate

I guess you'd have to know at what points in your animation does a foot hit the top of a stair. Then at runtime you'd look at the X position of the character in relation to the stair, and set the animation time accordingly.

Eg, your animation takes 0.5 seconds (he's really slow :p) for the character to lift his foot to the next stair. At runtime you determine he is 50% between stairs, so you set the animation time to 50% of 0.5 = 0.25 and pose the character with that. As the character moves left/right, his feet should hit each step. You'll have to handle moving him up/down at runtime of course. You'll probably have at least 2 places in your animation where his foot hits a step, but the idea is the same. If he stops walking on the stairs, you probably would stop showing the stair stepping animation and show an idle animation, otherwise his foot could hang in the air over a step.

You do realize that most people just stand on an escalator? ;) For stepping up an escalator its the same problem, just with moving stairs and something in your runtime to add the escalator speed to your character's speed.
Аватара пользователя
Nate

Nate
  • Сообщения: 9845

Timshark

Thanks Nate , giving me the numbers really helped and gave me confidence. :) I had a feeling I should control the x,y placement of the character according to the frame. I just wasn't sure. Now I am. This is must be the only way to do it to make it look like the character hits the stairs and use it's weight.

"You do realize that most people just stand on an escalator?" - :) Yes, but this "little" prototype I'm doing is based on a friends comic strip about people who try to climb an endless escalator in the opposite direction. It's an absurd little piece, but perfect for a small game project - and great learning it seems. You know: limited in scope and in a graphical way, but some real coding challenges.

The challenge reminds me of the first thing I tried to do when I got Spine. An Inchworm animation. I think the same rule applies for that - Even if you could make a simple looping of the inchworm - it really moves its left part the first halve of the animation (when it streches out) and then it's right halve when it contracts again. So it's the same approach. Move the inchworm x-wise in the middle of the animation and at the start of it...

Thanks. Great help. I'm diving into it with more confidence.
Timshark
  • Сообщения: 18

Søren

If I understand this right you could do a single stair step and place it on multiple bones, then place the bones using numerical values. Once you've done that, you just move them and when a step reaches the end, you use a stepped key to place it back at the start, so you're basically just reusing steps.
Аватара пользователя
Søren

Shiu
  • Сообщения: 2396


Вернуться в Editor