Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Paths with Waypoints
Started by gamedeveloper Oct 07 2016 12:17 PM

2 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

gamedeveloper

[GLOBAL: userInfoPane.html]
gamedeveloper
  • Enthusiast

  • 38 posts
  • Corona SDK

Hi,

 

(Caveat) Just starting out with Level Director X.

 

I was wondering the best method (using the editor) to create a follow path with behavior at waypoints... 

 

Would it be to:

 

(a)

- create multiple short path segments (path1, path2, path3)

- attach the object to each path segment individually,

- somehow manage the object's use of each path segment within the editor (assume the paths are connected)

 

(B)

- create a single, longer and more complex path

- drop markers along the path

- test in code when the object is at a marker

- stop start the object's movement on the path in code (don't see those functions listed in the docs)

 

Obviously I'd love to do as much as possible within the editor.  The simplest example would be having an object delay at a waypoint.  Even more worthwhile would be condition tests at a waypoint, but that would likely be beyond the scope of LDX in-editor functions.

 

Is there a sample project that shows advanced follow path usage with simple delay and conditional tests at waypoints?

 

And is there a way to set the speed an object moves along the path, other than an incremental delay at the start?

 

Thanks!

 

 



[TOPIC: post.html]
#2

retrofitProductions

[GLOBAL: userInfoPane.html]
retrofitProductions
  • Contributor

  • 321 posts
  • Corona SDK

You can add an event when following a path to trigger when a point on the path has been reached, you could then add some logic to decide what to do. Take a look at the Metal Slug example I sent you, this uses a combination of path events and multiple paths to control the helicopter.

[TOPIC: post.html]
#3

gamedeveloper

[GLOBAL: userInfoPane.html]
gamedeveloper
  • Enthusiast

  • 38 posts
  • Corona SDK

Thanks!

 

I can see in the Metal Slug example how to detect when the path has been completed and change the follow path.  So I can use this technique to build a complex path out of many small segments and perform various tests at the end/beginning of each segment.

 

I can also see that the FollowPath Delay value is not a startDelay, but a delay in the timing loop to determine the speed of the object moving down the path (obj.pathParams.delay).




[topic_controls]
[/topic_controls]