obstacleX = (int) (obstacleX - 0.1);
if(obstacleX <= 0){
obstacleX = 600;
}
repaint();
Thats my code, and the rectangle (ObstacleX is the X cordinate for the rectangle) goes fine on the first few times across the screen, then starts to go hyperspeed....Please help!