Hi everyone, I have a problem. When i push the down arrow, the actor is supposed to fall all the way down the world, unless there is another actor, then the actor falls on the other actor. My code does not work as how i want it to work because sometimes the actor falls in another actor, so the other actor is underneath the actor which has fallen. Does anybody know what i did wrong in my code?
//fall down
while (!isTouching(Bal.class) && getY() < getWorld().getHeight() - 1) // Werkt niet, moet while one.class, two.class enzo ook zijn
{
setLocation(getX(), getY()+1);
}
setLocation(getX(), getY()-1);
active = false;
((SpeelVeld) getWorld()).spawnNewBal();
}
}
}
