Livl-Corporation / livl-pacman

Insane Pac-Man clone from © Livl Corporation 🕹️
MIT License
0 stars 1 forks source link

🔴 Blinky CHASE #90

Closed FranckG28 closed 1 year ago

FranckG28 commented 1 year ago

In the last chapter, we learned how a ghost follows a target tile through the maze. Now we will take a closer look at Blinky, Pinky, Inky, and Clyde to better understand why they behave so differently when in chase mode. They all share the same pathfinding logic for chasing a target tile, so how is it each one behaves differently when following Pac-Man?

The answer is delightfully simple: Pac-Man's tile is not always the target. Every ghost has a distinct method for calculating its target tile in chase mode, resulting in their unique personalities. Some of the ghosts use Pac-Man's actual tile as the target; others only use it as an intermediate step to find another tile.

Sometimes a ghost is targeting a tile that has absolutely nothing to do with Pac-Man at all! Regardless of where a ghost's target tile is at the time, Pac-Man will still be killed if he gets in that ghost's way.

Image

Blinky: The red ghost's character is aptly described as that of a shadow and is best-known as "Blinky". In Japan, his character is represented by the word oikake, which means "to run down or pursue". Blinky seems to always be the first of the ghosts to track Pac-Man down in the maze. He is by far the most aggressive of the four and will doggedly pursue Pac-Man once behind him.

Of all the ghosts' targeting schemes for chase mode, Blinky's is the most simple and direct, using Pac-Man's current tile as his target. In the pictures above, we can see Blinky's target tile is the same as Pac-Man's currently occupied tile. Targeting Pac-Man directly in this way results in a very determined and tenacious ghost who is tough to shake when he's right behind you.

Image

All ghosts move at the same rate of speed when a level begins, but Blinky will increase his rate of speed twice each round based on the number of dots remaining in the maze. While in this accelerated state, Blinky is commonly called "Cruise Elroy", yet no one seems to know where this custom was originated or what it means.

On the first level, for example, Blinky becomes Elroy when there are 20 dots remaining in the maze, accelerating to be at least as fast as Pac-Man. More importantly, his scatter mode behavior is also modified to target Pac-Man's tile in lieu of his typical fixed target tile for any remaining scatter periods in the level.

This causes Elroy to chase Pac-Man while the other three ghosts continue to scatter as normal. As if that weren't bad enough, when only 10 dots remain, Elroy speeds up again to the point where he is now perceptibly faster than Pac-Man.

If a life is lost any time after Blinky has become Elroy, he will revert back to his normal behavior and speed when play resumes, heading for his home corner during the initial scatter period. But once the last ghost (Clyde) has left the ghost house in the middle of the board, he will turn back into Elroy again.

Keep in mind: he is still in scatter mode the entire time. All that has changed is the target tile-he will still reverse direction when entering and exiting scatter mode as before. As the levels progress, Blinky will turn into Elroy with more dots remaining in the maze than in previous rounds. Refer to Table A.1 in the appendices for dot counts and speeds for both Elroy changes, per level.