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
- Determine randomly which cardinal direction to move (
random
function) - Check if destination is out of bounds or not
- Check if destination is walkable and not a tree or wall etc (
solid
function)4 - Check if player is in the same tile
- Move the NPC
1 Like