Path Movement Behavior

New releases and general discussions.

Post » Mon Feb 08, 2010 10:42 pm

I still don't know who that is and furthermore...













...I don't care :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 08, 2010 11:52 pm

I agree.

She's just a bit too Katie Price for me.
You know, how much is real, how much is bought, etc. :lol:

Have we drifted off-topic?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Tue Feb 09, 2010 2:45 am

[quote="deadeye":1l3rtvpb]Ah, I just realized that you have to create the path first with actions. Never mind on that part.

I still think an actual visual editor would be best for this sort of thing. It would make it much more user friendly and remove the need for .path files. Still, I suppose it's no big deal to set a path with small "waypoint" sprites in the editor and use a loop to designate your path with the path object.[/quote:1l3rtvpb]

You could make your own and use an image to create the path.
Using the image manipulator object all you have to do is test if there is a pixel at a particular point.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Feb 09, 2010 5:07 am

I can think of several ways to make my own but I have to say I never considered using the Image Manipulator. Seems rather a complicated solution compared to some other methods you could use. Such as:

[code:2jovgvy5]
+ For each sprite ordered by sprite.value('node')
-> Set waypoint at sprite.x, sprite.y
[/code:2jovgvy5]

Not to mention the problem of telling which direction you intend for the path to go based on where the next pixel is.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 09, 2010 6:02 am

[size=150:xk29z7od]New Version 1.1: updated download in first post[/size:xk29z7od]




...and there it is: a path editor at edit time. Made from a gutted physics behavior.
B
79
S
24
G
54
Posts: 4,751
Reputation: 40,765

Post » Tue Feb 09, 2010 7:05 am

[quote="R0J0hound":1myio7uz]
...and there it is: a path editor at edit time. Made from a gutted physics behavior.[/quote:1myio7uz]

This is the future of of enemies for 2d games.
Nicely done, I have to try this!
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Feb 09, 2010 7:06 am

Holy crap, that's amazing! :D

You've really outdone yourself R0J0hound. Awesome work.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 09, 2010 7:16 am

[quote="R0J0hound":2jqxzl36][size=150:2jqxzl36]New Version 1.1: updated download in first post[/size:2jqxzl36]

...and there it is: a path editor at edit time. Made from a gutted physics behavior.[/quote:2jqxzl36]

Well there ya go. :D

[quote="deadeye":2jqxzl36]I can think of several ways to make my own but I have to say I never considered using the Image Manipulator. Seems rather a complicated solution compared to some other methods you could use. Such as:

[code:2jqxzl36]
+ For each sprite ordered by sprite.value('node')
-> Set waypoint at sprite.x, sprite.y
[/code:2jqxzl36]

Not to mention the problem of telling which direction you intend for the path to go based on where the next pixel is.[/quote:2jqxzl36]

You can also test for more than one different color.
Plus there's all the nifty things you have access to in the better image manipulation programs, bezier curves for example. All much easier to set up than a clicking one x,y at a time.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Feb 09, 2010 7:54 am

Or use system expressions - lerp is linear path, cosp is cosine interpolation, then there is cubic and quadratic, which are essentially bezier curves.

cosp(P1,P2,t) interpolates between the two points - P1 and P2 - based on t, which represents the fraction of distance between the points (0..1). You can simply calculate a distance between the points, then iterate from 0 to 1 using timetelda (and a speed modifier). Then when you reach a waypoint, you move onward to next waypoint.

Cubic and quadratic require more than two points, but you can always take another waypoint for reference (you get smooth turns that way).
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Feb 09, 2010 10:08 am

[quote="R0J0hound":3gcbla58][size=150:3gcbla58]New Version 1.1: updated download in first post[/size:3gcbla58]




...and there it is: a path editor at edit time. Made from a gutted physics behavior.[/quote:3gcbla58]

YOU ROCK!!!
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests