Jill of the Jungle sword or boomerang, working example...

Get help using Construct 2

Post » Wed Mar 08, 2017 7:07 pm

lamar wrote:
Zebbi wrote:
lamar wrote:
Sure pathfinding and on line of sight work fine in real time.

Use the bullet behavior so it detects collisions when you release the boomerang but use on line of sight and pathfinding to bring it back to you.

If it has you locked in on line of sight just have it return to your position. If not find a path and clear obstacles until it has line of sight.

It should always return along the X axis towards you so include that to keep it moving.

I thought pathfinding had to calculated and couldn't work very efficiently on an every tick basis, which is what this would need to be? The solids might not be moving, but the player would be, so wouldn't pathfinding be really heavy on performance? I'm still having trouble working out how to incorporate this in my example :?


Well what I suggested is using the bullet behavior. That is used to keep the boomerang flying back towards the player while on line of sight and pathfinding is used to change the bullets course as needed to get it back to the player so they are checking position every tick but not making adjustments every tick and should't slow down performance.

If I get some time I will try to make a capx with an example of what I mean but I am just going off what I see in your example so it may not work for your game.

Sounds like it could work really nicely, wish I knew where to start! I might have a cack-handed go at trying to figure it out...
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Fri Mar 10, 2017 8:23 am

I wonder if @magistross easystar could be useful here, if we used tiles instead of solid backgrounds, that might be super efficient for the knife to just pathfind itself all the way home?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Mon Mar 13, 2017 8:59 am

Anyone got a pathfinding example I could hack in?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Sun Mar 26, 2017 12:23 pm

I can't figure this out with pathfinding, I've tried finding the path and incorporating it with my example, but it doesn't really work.
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 45 guests