JayJay Posted February 5, 2018 Share Posted February 5, 2018 I'm considering using Behaviors (Phaser.Plugin.Behavior) for my game, so I'm trying to understand if player movement could/should be modeled as a behavior, even if entity movement is accomplished via pathfinding (say EasyStar.js). There's no physics, btw. So the basic idea is to use the the behavior's onUpdate method to do one of 3 things: 1) If path is not yet calculated, it will call the .calculate() method of EasyStar to advance the calculation processing 2) If the calculation is done, move the entity futher along the path, if not yet reached the target point 3) do nothing (or maybe remove the behavior?) if already arrived at target location. Let me know if this looks like it could work or otherwise how Phaser.Plugin.Behavior and PathFinding could co-exist on a game. Link to comment Share on other sites More sharing options...
JayJay Posted February 10, 2018 Author Share Posted February 10, 2018 up! No love for my question so far Link to comment Share on other sites More sharing options...
Recommended Posts