I ran into a problem last night and I can't solve it since. I'm making an isometric game based on tiles with equal rows and columns. Now I made moving entities which should turn whenever they reach the boundaries of the world. As I illustrated on the picture they are turning back on the upper boundaries (green) , but not on the lower ones (red). I tried various equations on the lower part, but i cannot figure out for the life of me what is the lower parts code. What would be an appropriate solution for the shrinking lines?
boolean checkBounds(){
float absX = Math.abs(getX());
float absY = Math.abs(getY());
if(absY*2-absX<0 || ??? ) return false
else return true;
}