Help

Game Editor comments and discussion.

Help

Postby CrimsonX » Sat May 27, 2006 2:58 am

I currently have 2 questions. If its not too much please explain step by step.

1. My character has the punch animation enabled, But when i press the punch button it only punches in one direction. How to i create it to where i can punch left when facing left and punch right when facing right with my a button.
CrimsonX
 
Posts: 28
Joined: Wed May 24, 2006 2:38 am
Score: 0 Give a positive score

Postby DilloDude » Sat May 27, 2006 4:18 am

On keydown, check one of two things:
  1. the face direction: if you aare using a variable for facing direction, you can check this
  2. the animindex: if you aren't, you can check the current animation (although it will get annoying if you have lots of animations, like walk, stop, jump etc.)

So you are using the first method:
Code: Select all
switch(facedir)
{
    case RIGHT: //either change this to a number (1) or use #define RGHT 1 in global code
    ChangeAnimation("Event Actor", "Punch_Right", FORWARD);
    break;

    case LEFT: //see for RIGHT
    ChangeAnimation("Event Actor", "Punch_Left", FORWARD);
}
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest