Hi, I am trying to create a simple system that imitates gravity where the Guy actor is always going down unless touching the ground actor, which then he stops going down, kind of like gravity. The going down part works, what doesn't work is that he does not stop going down after touching the ground.
disregard airtime, it will be used in a separate thing. Everything compiles correctly, and I don't fully understand why this doesn't work. I've tried creating another if statement saying that when inAir is false, to stop all movement, but that doesn't work either.
public class Guy extends Characters
{
boolean inAir = true;
int airTime = 0;
public void act()
{
if(isTouching(Ground.class)){
inAir = false;
}
if(inAir = true){
setLocation(getX(), getY()+3);
}
}
}
