Hello David,
Since you have the animation, all you need to do for a custom trajectory is apply a mathematical equation to giving you a value x and y.
For example:
CanvasDrawBitmap (panelHandle, PANEL_CANVAS, bitmapIDa,
MakeRect(0, 0, CARHEIGHT, CARWIDTH),
MakeRect((canvasHeight/2)-(CARHEIGHT/2)+j, i, CARHEIGHT, CARWIDTH));
ProcessDrawEvents ();
Delay (0.01);
CanvasDrawBitmap (panelHandle, PANEL_CANVAS, bitmapID,
MakeRect((canvasHeight/2)-(CARHEIGHT/2)+j, i, CARHEIGHT, CARWIDTH),
MakeRect((canvasHeight/2)-(CARHEIGHT/2)+j, i, CARHEIGHT, CARWIDTH));
if (flag == 0)
{
if (j<30) {j=j+2;}
else {flag=1;}
}
else
{
if (j>-30) {j=j-2;}
else {flag=0;}
}
The above code (a modification of the previous code) creates a triangular wave motion of the car. I am sure that you can create the mathematical equation of the motion and use it for the animation you are looking for.
Rajiv