1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public void bewegung() { move(x); setLocation(getX(), getY()+ 2 ); Actor platform = getOneIntersectingObject(Plattform. class ); setLocation(getX(), getY()- 2 ); int pX = platform.getX(); int pW = platform.getImage().getWidth(); if ((x < 0 && pX-pW/ 2 >= getX()) || (x > 0 && pX+pW/ 2 <= getX())) { x = -x; } } |

