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

后端 未结 22 2278
南方客
南方客 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:07

    How about each square having a value of distance to the center? This way for each given square you can get values of immediate neighbor squares in all possible directions. You pick the square with the lowest value and move to that square.

    Values would be pre-calculated using any available algorithm.

提交回复
热议问题