
- Code: Select all
char *key = GetKeyState();
if(key[KEY_LEFT] == 1)
{
if(switchdiretion==1)
{
ChangeAnimation("Event Actor", "right-to-left", FORWARD);
switchdiretion=-1;
anifinishright=0;
}
if(anifinishright==1)
{
x = x - 2;
}
}
if(key[KEY_RIGHT] == 1)
{
if(switchdiretion==-1)
{
ChangeAnimation("Event Actor", "left-to-right", FORWARD);
switchdiretion=1;
anifinishleft=0;
}
if(anifinishleft==1)
{
x = x + 2;
}
}