I am making a frogger game and have come to a bit of a stand still, I am trying to get the lilypads to go in different directions, not all the same way across the screen, and also in different speeds, this is what I have so far, but it is glitchy and everytime it moves it visibly looks bad, here is my code for it so far...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public static int direction; public void act() { if (atWorldEdge()) { if (direction < 0 ) { setLocation( 605 , getY()); } else { setLocation( 20 , getY()); } } move(Greenfoot.getRandomNumber( 15 )); } |