Can someone please explain to me why this code is not animating the bufferedImage
so that it travels to the new target position. note: x2 is the x-coordinate of the bufferedImage
if (answer.equalsIgnoreCase("move")){
target=x2-change;
do{
if (x2>target)
x2=x2-SPEED;
try{Thread.sleep(10);
}catch(Exception exc){}
frame.repaint();
}
while(x2!=target);
}