why don't this work?
it works fine on the top and bottom walls but not the sides.
1 2 3 4 5 6 7 8 9 10 | if (getY() <= 5 || getY() >= getWorld().getHeight() - 5 ) { setRotation( 360 -getRotation()); } if (getX() <= 5 || getX() >= getWorld().getWidth() - 5 ) { setRotation( 360 -getRotation()); } |