Jumping
Posted: Mon Jul 19, 2010 12:34 am
When i Jump and go left or right the player Walks?
How to solve this
How to solve this
if(canjump==1) //variable to define his jumping status
{
ChangeAnimation("Event Actor", "WalkRight", NO_CHANGE);
}
if(canjump==0) //when in air
{
ChangeAnimation("Event Actor", "JumpRight", NO_CHANGE);
}
x+=3;
if(canjump==1) //variable to define his jumping status
{
ChangeAnimation("Event Actor", "WalkLeft", NO_CHANGE);
}
if(canjump==0) //when in air
{
ChangeAnimation("Event Actor", "JumpLeft", NO_CHANGE);
}
x-=3;
if(canjump==1)
{
yvelocity=-15;
if(right==1) //facing right
{
ChangeAnimation("Event Actor", "JumpRight", FORWARD);
}
if(right==0) //facing left
{
ChangeAnimation("Event Actor", "JumpLeft", FORWARD);
}
canjump=0;
}
if(canjump==0)
{
if(right==1) //facing right
{
ChangeAnimation("Event Actor", "StopRight", FORWARD);
}
if(right==0) //facing left
{
ChangeAnimation("Event Actor", "StopLeft", FORWARD);
}
canjump=1;
}
if(yvelocity<=-3||yvelocity>=3)
{
if(right==1) //facing right
{
ChangeAnimation("Event Actor", "JumpRight", NO_CHANGE);
}
if(right==0) //facing left
{
ChangeAnimation("Event Actor", "JumpLeft", NO_CHANGE);
}
canjump=0;
}