How do I make an obstacle passable from one side ?

Get help using Construct 2

Post » Sat Dec 17, 2016 4:32 pm

I'm using Pathfinding to create a top down game. Some obstacle on my layout are cliffs (sprite is a rectangle) . I need them to be an obstacle when you abord them from on side (base of the cliff) but can be crossed from the opposite side (you can jump from the top of the cliff). Any idea on how to do that ?
B
33
S
14
G
5
Posts: 232
Reputation: 5,557

Post » Sat Dec 17, 2016 8:50 pm

Adjust the collision box so that it only covers half of the rectangle.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Dec 18, 2016 1:09 am

Well, I see what you mean. It won't give the expected result. Rectangle will be hidden and used just used to delimitate obstacles. What I mean is that :
- Imagine a vertical rectangle
- rectangle should be passable from left to right but not from right to left
B
33
S
14
G
5
Posts: 232
Reputation: 5,557

Post » Sun Dec 18, 2016 2:13 am

The pathfinding behavior can't do one way obstacles like that. A solution that comes to mind would've to do pathfinding with events using the "a star" algorithm. That would give more control so you could do one way obstacles.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Sun Dec 18, 2016 11:51 am

Tanks R0J0
I'm not good enough to recreate a complete pathfinding tool. I'll try a different approach.
B
33
S
14
G
5
Posts: 232
Reputation: 5,557


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi and 14 guests