codingteam / pacmacs.el

Pacman for Emacs
Other
91 stars 9 forks source link

Terrified ghosts #153

Closed rexim closed 8 years ago

rexim commented 8 years ago

We started to implement this as state-based thing. But, probably it could be easier to do a object based approach.

What I mean is that instead of a ghost being in different states, we could introduce a new game object called Terrified Ghost. When Pacman eats a Big Pill, we remove all the regular ghosts and replace them with the terrified ghosts (completely different game objects with their own behavior and state). The terrified ghosts have a timer that is being counted down until zero. On each frame we check the timers of all the terrified ghosts, and replace all the zero timed terrified ghosts with the regular ghosts.

Hope it makes sense...

rexim commented 8 years ago

In 25193bcdbfe4e934be7b3a3a31bc5ea65a46be55 we introduced line distance based escaping algorithm.

I think it would be better to do the BFS distance approach. So, we should store distances in the track board instead of directions. With that approach the same track board could be easily reused for both regular ghosts and terrified ghosts.

Don't think we should waste our time on implementing this in the scope of this issue. I better create a separate issue for that. For now dumb line distances approach is ok, I think.