Best way object follow predefined route

Get help using Construct 2

Post » Thu Mar 06, 2014 10:04 pm

Hi guys,

i want that objects follow a predefined route in a loop like cars on a race track.
What is the best approach to do that?

The objects should follow the path pixel-precise every round with different speed depending on object and track state.
How could i describe the route, maybe more than one possible racing line?

I've got no idea where to start.
Any suggestions?

Thx in advance
Posts: 2
Reputation: 184

Post » Fri Mar 07, 2014 12:32 am

I usually use the MoveTo (3rd party behavior by rex) viewtopic.php?t=63156&start=0

Then put invisible sprite blocks around. MoveTo block 1 and on collision, move to the next block.
Posts: 1,549
Reputation: 22,103

Post » Fri Mar 07, 2014 10:05 am

If you don't want to use a 3rd party Plugin, I'd use the Pathfinder behaviour, and plot a bunch on 8x8 sprites with a numeric variable, that goes from sprite instance 1, to sprite instance 2 etc. That way it's organic looking, and you can use it on any PC without having to install the plugin each time.
Using R248 for all examples
Posts: 382
Reputation: 9,812

Post » Fri Mar 07, 2014 8:09 pm

I'll have a look at the pathfinding behavior, thanks.
I think problem could be that the pathfinding don't provide exact results in respect of reproduceable "round time" of an object with given speed.

In the end i want that the object with a given speed produce every round the same time (exact to the thousand of a second) until speed changes.

By the way, how could i set a "next_waypoint" instance variable of a waypoint-sprite (maybe the UID of the next) like a singly-linked list at startup?
Can i loop through a ordered (UID) list of all instances (created with the editor, not programatically) and assign every instance the proper value?

Thx in advance!
Posts: 2
Reputation: 184

Return to How do I....?

Who is online

Users browsing this forum: Invidel and 1 guest