BS-style character movement

Started by Rui 'Trovatore' Pires, Wed 01/12/2004 08:20:37

Previous topic - Next topic

Rui 'Trovatore' Pires

It's not for a game, or a template, or anything, this just popped into my head.

Is it at all possible, in AGS, to currently move characters like in Broken Sword? Meaning, George would only move if the player clicked in a destination which he could arrive at by regular (or smaller) steps. Meaning, his animation *never*, say, goes back to frame 0 if the previous frame was in the middle of the animation.

Just being picky, I know. But IS there a way to feasibly, good lookingly achieve this?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

YOke

Oh yes. This is fully possible. The only thing you have to do is to calculate how far the character will travel in one pass of the walking animation. Then for each loop of the walking animation you will check if the next step takes you closer than you currently are by checking if (target_xpos - character[EGO].x) < ((character[EGO].x + length_of_one_more_step) - target_xpos)
Obviously you have to calculate the Y value too, but since the question was theoretical this is as far into it I will go.

Enlightenment is not something you earn, it's something you pay for the rest of your life.

Rui 'Trovatore' Pires

Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk