Game Development Community

Paths - starting sprite at arbitrary position on path

by Jacob Vann · in Torque Game Builder · 03/14/2008 (1:16 pm) · 1 replies

Hi,

For my game's main level select map, I'm building a solar system out of animated sprites attached to t2dpath objects. The paths have 2 nodes and are of type SPLINE to make a nice smooth oval.

As you know, when you mount the sprite it starts on one of the two nodes in the path. My question is, can I tell the sprite to start further down the path, like a setPathPosition() function? When I start my scene, all of the planets start out in a nice straight line, which just looks bad. I'd like to start them all out at various positions on their paths.

Also, is there a way to get the percentage of a path the sprite has travelled? So I can check to see if it's more than halfway down its path, etc?

#1
03/16/2008 (5:02 pm)
UPDATE: I sort of got around this issue by setting my paths to CATMULL and adding more nodes (8 per orbit), so I can start the planet on any one of hte 8 nodes and sort give the illusion of it being more random.