Setting Animation for Actor(Experimenting with State Method)
Posted: Sun Feb 16, 2014 8:47 am
Hi all
This time I'm not trying to Accelerate, I would like to allow the players animation to have a Right & Left Jump animation & a Right & Left Shoot Animation. I thought that I could perhaps get the desired results by modifying some of the code from the last topic, However Game Editor can't except my code and I dont know quite whats wrong with it.
-EDIT-
all of the earlier posts in this topic are irreverent to the current issue, please search the latest posts.
This time I'm not trying to Accelerate, I would like to allow the players animation to have a Right & Left Jump animation & a Right & Left Shoot Animation. I thought that I could perhaps get the desired results by modifying some of the code from the last topic, However Game Editor can't except my code and I dont know quite whats wrong with it.
- Code: Select all
char* key = GetKeyState();
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0)
{
// IF KEY RIGHT IS PRESSED AND NOT LEFT
if(key[KEY_x]==1 && key[KEY_z]==1) (
// AND THEN IF X IS ALSO PRESSED
ChangeAnimation("Event Actor", "PlayerJumpRight", NO_CHANGE);
}
else
{
//IF Z IS PRESSED AND NOT X
ChangeAnimation("Event Actor", "PlayerShootRight", NO_CHANGE);
}
else
{
// BUT IF X ISN'T PRESSED
x+=3;
ChangeAnimation("Event Actor", "PlayerMoveRight", NO_CHANGE);
}
if (key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
// IF KEY LEFT IS PRESSED AND NOT RIGHT
if(key[KEY_x]==1 && key[KEY_z]==1) (
// AND THEN IF X IS ALSO PRESSED
ChangeAnimation("Event Actor", "PlayerJumpLeft", NO_CHANGE);
}
else
{
// IF Z IS PRESSED AND X
ChangeAnimation("Event Actor", "PlayerShootLeft", NO_CHANGE);
}
else
{
// BUT IF X ISN'T PRESSED
x-=3;
ChangeAnimation("Event Actor", "PlayerMoveLeft", NO_CHANGE);
}
}
-EDIT-
all of the earlier posts in this topic are irreverent to the current issue, please search the latest posts.