Default to Pose When Not Walking (Solved)

Started by Virgil, Mon 28/09/2009 03:27:52

Previous topic - Next topic

Virgil

Okay, so, say in a side scroller, when my characters stops walking, I want him to stand in a specific pose, so he's not midstep.

I have this in..

Code: ags
function room_AfterFadeIn(){
  
  if(!IsKeyPressed(eKeyLeftArrow) || !IsKeyPressed(eKeyRightArrow)){
    cCharacter.Say("Done.");
   }
 }


Just to check if the character was moving or not. After that I would just do an Animate with one frame in it, until the character decided to move again. However, when I load up my room, the character says 'Done.' When I move around and stop, it doesn't respond. If I have it on Repeatedly Execute, I can't move at all, and the character just says 'Done."

I know there's a way to go about this, but I can't figure it out.. thanks for any help.

Tijne

Ex. Code:
Code: ags

bool DidAction = true;

function repeatedly_execute()
{
  if( !IsKeyPressed(eKeyLeftArrow) && !IsKeyPressed(eKeyRightArrow) && DidAction == false)
 {
   DidAction = true;
   cCharacter.Say("Done.");
 }
 else { DidAction = false; }
}


Hope that helps! 

Virgil


TerranRich

Am I missing something, or isn't the first frame of a walking animation supposed to be the standing-still pose?
Status: Trying to come up with some ideas...

Virgil

You're right. Maybe I was over thinking things.. I suppose I never noticed.

SMF spam blocked by CleanTalk