I'm currently working on Uniform cost algorithm "Calculates the shortest path". Why i've mentioned this because it gives me a series of locations on map "GUI"
For example: running UCA(V1,V4)
would return an array of locations'
let's suppose it returns V1 V2 V3 V4
shortest path from V1 to V4.
& let's suppose V1,V2,V3, and V4 located at
V1.setBounds(10, 10, 50, 50);
V2.setBounds(20, 10, 50, 50);
V3.setBounds(30, 10, 50, 50);
V4.setBounds(40, 10, 50, 50);
What i'm trying to do, let's suppose i have another object let's assume it's a truck object.
This truck is going to visit V1 then go to V2 up to v4 according to UCA
function, but setting truck.setBounds(10,10,50,50)
then up to V4 truck.setBounds(40,10,50,50)
the truck would move to V1
and etc... but it will only appear on V4, it will never appears on screen that it has visited V1, V2, nor V3.
I could have use timers i mean when it visits V1 sleep <- 3 seconds
and so on.
But this is an inefficient way.
Is there some kind of animation that i can use to move truck object from one location to various locations ?