Original Post
Well, I know i know that pacman is a cliche, but the last few days was the first time I actually bothered learning linked lists and trees... and it also lead me thinking to the A* path finding algorythm. So what I'm thinking is this:
Each ghost has a focus point on the map that "activates" them. After activated, each ghost follows a "path".
Red finds the shortest path to the top-right "power pill", after that, the bottom-left, top-left, bottom right, ETC.. UNLESS! pacman passes Red's line of site, then red keeps on calculating the shortest path to pac.
Blue is similar, but finds the longest path to a different sequence of "power pills", unless pac passes line of site, then he searches for the longest path to catch pac.
Green? Well.. if it is green
.. he calculates a path somewhere inbetween. And the same applies.
Now for Pink, he is a little "slow" and "random" and needs a leader. So I rate he finds the longest path to Red. ALWAYS! It doesnt change if pac passes his line of sight. If he does find red he changes his state, finds his "activation point" and then searches for Red again.
This is just some random method that crossed my mind while playing with binary trees, dunno why, but it did.
So NOW...
Any comments on this method?
[edited by - o_Silver_Serpent_o on September 24, 2002 2:51:18 PM]
[edited by - o_Silver_Serpent_o on September 24, 2002 2:51:18 PM]