Sprite/npc wandering help

Hello, Im working on my first game through Pulp. I have built all the art and assets. Im trying to get a sprite/villager to wander around the village. Only things I could find were chaser enemys and such. Any help is greatly appreciated, please note I am very new to code, and explanation is helpful as well.

I don't think that starting with the chaser enemy examples is such a bad idea. You could take those and then modify the behavior.

Logically, how I would do it is

  1. Determine randomly which cardinal direction to move (random function)
  2. Check if destination is out of bounds or not
  3. Check if destination is walkable and not a tree or wall etc (solid function)4
  4. Check if player is in the same tile
  5. Move the NPC
1 Like