Ok let me explain the question . Lets say I have a charactor and it moves on its own . Lets say the code is
x+=5;
Now lets say when the actor collides with an object , how can I make it stop. I can do it now but I know thier is an easier way.
if(moveVar==1)
{
x+=5;
}
// or if you don't like the if
x+=moveVar*5;
// moveVar = 1 is move right
// moveVar= 0 don't move
// moveVar = -1 is move left
Users browsing this forum: No registered users and 1 guest