How to create a path with sharp curves? (Pathfinding)

Get help using Construct 2

Post » Wed May 21, 2014 7:50 pm

Hi, do you know how to set the Pathfinding so that the ball doesn't take the first way but the second way? I need the ball to move exactly on the Pathnodes vertically or horizontally, without turning to sides.

Ugly way:
Image

Pretty way:
Image
B
24
S
3
G
1
Posts: 42
Reputation: 1,543

Post » Wed May 21, 2014 9:29 pm

You'll have to implement your own movement. You can use the expressions Sprite.Pathfinding.NodeXAt(Index) and Sprite.Pathfinding.NodeYAt(Index) to get the next x,y coordinates to move to. And Sprite.Pathfinding.NodeCount will give you the number of nodes in the path.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Thu May 22, 2014 11:25 am

I'll try it. Thanx for advice.
B
24
S
3
G
1
Posts: 42
Reputation: 1,543

Post » Thu May 22, 2014 12:43 pm

You can disable diagonal movements in the pathfinding properties. You you set the cell size properties to the same size as your graphics, you should get the result you want
B
12
S
5
G
2
Posts: 132
Reputation: 2,637


Return to How do I....?

Who is online

Users browsing this forum: Christmas, Yahoo [Bot] and 52 guests