This project replicates the AI used in Pac-Man which allows the ghost to know how to chase the player. Ghosts do not kill you and you can move wherever you want, because this is only a test. Use the arrow keys to control Pac-Man. There are three modes: Chase mode: (1) The ghosts all chase Pac-Man. A detailed explanation of how they decide where to go is below. Scatter mode: (2) The ghosts all move towards their own corners. Frightened mode: (3) The ghosts move away from Pac-Man. (In the original game, they move randomly, but that's very hard to replicate in an open environment.) In chase mode: Blinky: (Red) Moves directly towards Pac-Man. Pinky: (Pink) Moves towards a spot just in front of where Pac-Man is facing. Inky: (Blue) Finds the distance between Blinky and a spot just ahead of Pac-Man, and then doubles the distance, and heads towards that spot. Clyde: (Orange) Chases Pac-Man, but when he gets too close, he goes back towards his own corner. A lot of changes were made to make this work in an open area. To see a further explanation on how the ghosts work in the original game, watch this video: https://www.youtube.com/watch?v=ataGotQ7ir8