Replies: 1 comment
-
That sounds like a useful feature. I was thinking about adding sort of a "chain movement" which is a bit like That being said, if you need that functionality now, I think you should be able to pull that off using isPositionAllowedFn for moving along a path (also see this example). You can construct that path using https://annoraaq.github.io/grid-engine/api/classes/GridEngine.html#positionChangeStarted on the character to be imitated. It not as neat as calling |
Beta Was this translation helpful? Give feedback.
-
Not sure if this already exists, if yes, you don't need to read all of this.
I've used grid-engine for about a week now and it has really saved me a lot of pain and trouble. I've browsed through the documentation a bit and I've taken notice of all the options with the pathfinding, if it is a
moveTo
or afollow
or whatever.But, I think a good and (hopefully not so hard to implement) mechanic to also include out of the box is a function where an npc imitates the exact path of the player, similar to how they did it in Celeste.
This could also be added as an extra parameter in the follow function, so it would look like
this.gridEngine.follow('npc0', 'player', -1, true, true);
with the last
true
indicating that you want the npc to imitate the player's path 1:1.Edit: I think it's better to add it as it's own thing, because stuff such as how far behind you want the npc to be etc. would be easier to manage. So at the end, it would look something like
this.gridEngine.imitate(charId: string, charIdToFollow: string, distance: number, delay (in milliseconds): int
Beta Was this translation helpful? Give feedback.
All reactions