Ok the code will cap the number to the nearest -1 to 1, but the code will cause the object to move in zigzag form. Thats why my method is important to me. Well i have to have some sort of a divider variable to make sure the object moves in a strait line. I must have something that holds the number of increments it will take to get to the desired destination.I already have it working just wanted to see other approaches, not silliness.
Your code is crap, you have no speed component (except 1 pixel per frame). The object's actual speed, in your code, is dependent on the speed of the computer it is running on, unless you're capping the framerate of your game.
You should have something like one of these methods (general methods, to get point across),
// variables are floats, CurrentLocation and DestinationLocation are points (with an x and y component)
// Get the distance between 2 points
Distance = GetDistance(CurrentLocation, DestinationLocation);
// compute the time it would take the object to get there based on it's current speed (in pixel's per second)
Time = Distance/Speed;
SpeedX = (DestinationLocation.x - CurrentLocation.x)/Time;
SpeedY = (DestinationLocation.y - CurrentLocation.y)/Time;
// move my current location
CurrentLocation.x += SpeedX;
CurrentLocation.y += SpeedY;
That's the easy, conceptual, way. The proper way is to use trig functions:
Angle = atan2((DestinationLocation.y - CurrentLocation.y), (DestinationLocation.x - CurrentLocation.x)) * 180 / PI;
CurrentLocation.x += cos(Angle) * Speed;
CurrentLocation.y += sin(Angle) * Speed;
But, this is just silliness. Continue using what you know is the right way.