Jump to content

first attempt on Phaser programming. NPC follower for a player.


andreasnrb
 Share

Recommended Posts

Howdy
Decided 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

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.

 

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...