oben in die klasse diese attribute einfügen: private int richtung = 1; private int direction = 1; private boolean stoesstAnWandAn = false; private static final int EAST = 0; private static final int WEST = 1; private static final int NORTH = 2; private static final int SOUTH = 3; dann irgendwo in der klasse diese methode einfügen: public boolean canMove() { World myWorld = getWorld(); int x = getX(); int y = getY(); stoesstAnWandAn = false; if((getRotation() > 315 && getRotation() <= 359) || (getRotation() >= 0 && getRotation() <= 45)) {richtung = EAST; if(x+20 >= myWorld.getWidth()) { stoesstAnWandAn = true; } } else if(getRotation() > 45 && getRotation() <= 135) { richtung = SOUTH; if(y+20 >= myWorld.getHeight()) { stoesstAnWandAn = true; } } else if(getRotation() > 135 && getRotation() <= 225) { richtung = WEST; if(x-20 < 0) { stoesstAnWandAn = true; } } else if(getRotation() > 225 && getRotation() <= 315) { richtung = NORTH; if(y-20 < 0 ) { stoesstAnWandAn = true; } } else {System.out.println("da geht etwas schief!!!"); System.out.println(getRotation()) ; } return !stoesstAnWandAn; }