Hi, I am making a game on greenfoot. I would like to when an object is under another object he stops falling. this is my code right now but its not working.
int xwaarde=getX();
int ywaarde=getY();
ywaarde++;
if (getOneObjectAtOffset( xwaarde, ywaarde / Actor.class )) {}
else {
setLocation(xwaarde, ywaarde);
}
can someone help me?

