I am working on a Frogger project and am trying to get my frog to follow the liliypad when he jumps on it. Here is the code for when he is on an car or lobster to reset to the starting point.
I tried this to make the frog follow the lilypad, but it didn't work and I'm not sure how to make it work.
How would I code this correctly?
1 2 3 4 5 6 7 8 | if (canSee(Cars. class )) { setLocation( 414 , 584 ); } if (canSee(lobster. class )) { setLocation( 414 , 584 ); } |
1 2 3 4 | if (canSee(lilypad. class )) { setLocation(getX(lilypad. class ),getY(lilypad. class )); } |