Pacman: how do the eyes find their way back to the monster hole?

后端 未结 22 1787
南方客
南方客 2021-01-29 17:53

I found a lot of references to the AI of the ghosts in Pacman, but none of them mentioned how the eyes find their way back to the central ghost hole after a ghost is eaten by Pa

22条回答
  •  醉梦人生
    2021-01-29 18:00

    For an alternative to more traditional pathfinding algorithms, you could take a look at the (appropriately-named!) Pac-Man Scent Antiobject pattern.

    You could diffuse monster-hole-scent around the maze at startup and have the eyes follow it home.

    Once the smell is set up, runtime cost is very low.


    Edit: sadly the wikipedia article has been deleted, so WayBack Machine to the rescue...

提交回复
热议问题