1. Try to escape (arrow keys / buttons below)
2. Target rules for the 4 ghosts
3. Automatic escape from 20 starting points (measured the same way as in the video)
| Rules | Waves | Until caught (median) | Ghosts in front and behind |
|---|
This is the calculation from the video "How do Pac-Man’s ghosts chase you?", ready to run. Each ghost picks one "target square". Every time it reaches the centre of a square, it turns toward whichever open path makes the straight-line distance to the target shortest (it never turns back, and on a tie the order is up → left → down → right). The maze and the visuals are our own, not the original game screen.
| Rules | Waves | Until caught (median) | Ghosts in front and behind |
|---|
The rules: Current square = the square the player is on. 4 ahead = 4 squares ahead in the direction the player is facing. Double the line = draw a line from ghost 1 (red) to the square 2 ahead of the player, and double its length. 8 squares = if more than 8 squares from the player, the current square; if closer, its own corner (outside the maze). During scatter time, each of the 4 ghosts targets a different corner outside the maze (it can never reach it, so it circles near the corner). When chase ⇔ scatter switches, all ghosts reverse direction at once.
These patterns are taken from sources that analysed the 1980 game "Pac-Man" (Jamey Pittman, "The Pac-Man Dossier"; Chad Birch, "Understanding Pac-Man Ghost Behavior") and run in our own maze (they are not an official explanation from the company that made the game). Speeds: the square moves 6 squares a second, the ghosts 5.4 squares a second. Calculated in fixed steps of 1/60 s.
Sources and production: same as the video description (AI was used to make the diagrams and script. No game footage or characters are used).