jawad

jawad

  • NA
  • 9
  • 8.6k

Car on a track

Aug 18 2011 8:28 PM
Hello everyone,
i was searching in a lot of places and pages for how to make a texture follow a track in XNA gaming studio, i found some articles about making points on the screen and make the texture pass between them using the "Vector2.lerp(start, end, speed)" ;
i made those points, wrote down the functions, and putted nested loop.
i.e.

player.lerp(pointA,pointB,speed);
if(//player get to the pointB)
// set pointB as starting point and pointC as end point
// and so on...

but the result that i got is that the texture doesn't stop moving or change direction, it continue moving according to the first given values, in another words, if in the first outer loop i was incrementing the value of "Y" and incrementing the value of "X" in the second loop, the texture's "Y" keep changing but nothing for the "X".

if somebody can help me with that, i would be more than thankful and happy

thanks in advance 

Answers (2)