andreasnrb Posted April 9, 2014 Share Posted April 9, 2014 HowdyDecided to venture out into the html5 game dev world after a decade of websites. This is my attempt on making a NPC follower for a player. It uses the Arcade physics. No tween etc used. My approach is similar to that of a drivelog. He follows the path the player walks and matches the players speed. Always keeping a specific distance. The higher the velocity of the player the more error prone it gets though. So to compensate for that one need to adjust the distance to target coordinates when checking if the NPC has reached correct coordinate. Work in progress to get a better detection for reaching proper coordinates. But works for my purposes. Anyone know of any examples one can check for similar behavior? Next up for me is making a hunter. An enemy is gonna hunt you down when you get to close. Have simple path instructions for enemy guarding down. So now just need to add some basic AI to them so they can hunt you. Link to comment Share on other sites More sharing options...
codevinsky Posted April 9, 2014 Share Posted April 9, 2014 I'm confused. Your question doesn't seem to be very obvious. Can you ask again in a different way? Link to comment Share on other sites More sharing options...
Luis Felipe Posted April 9, 2014 Share Posted April 9, 2014 Have a look at: http://www.easystarjs.com/ Link to comment Share on other sites More sharing options...
andreasnrb Posted April 10, 2014 Author Share Posted April 10, 2014 I'm confused. Your question doesn't seem to be very obvious. Can you ask again in a different way? Just if there any implementation of having a character follow a player implemented in Phaser. There are snake games but they use move to XY according to list of points. Have a look at: http://www.easystarjs.com/That looks good. Thx for tip. Think would work good for the hunter behavior. Found a Phaser plugin based on it: https://github.com/appsbu-de/phaser_plugin_pathfinding Link to comment Share on other sites More sharing options...
Recommended Posts