A character who approaches the player, then follows him from room to room.

Suppose we want to write a character who tries to be in the same room as the player. We will do this by testing every turn whether the character's location and the player's location are the same; if the answer is no, the character will look for a path to the player's location, then try to move along that path. (We will learn more about finding paths and giving characters instructions later.)

The result will be that if the player ever moves to another location, the character will automatically pursue him.

"Van Helsing"
The Drawbridge is a room. North of the Drawbridge is the Immensely Enormous Entry Hall. West of the Entry Hall is the Vast Dining Area. North of the Vast Dining Area is the Colossal Kitchen. The Spooky Guano-filled Attic is above the Entry Hall.
Count Dracula is a man in the Attic.

In the following condition, we could also have written "if the location of Count Dracula is not the location", because "location" by itself is always understood to be the player's location. But it seemed better for clarity to write it this way:

Every turn:
   if the location of Count Dracula is not the location of the player:
      let the way be the best route from the location of Count Dracula to the location of the player, using doors;
      try Count Dracula going the way;
   otherwise:
      say "'Muhahaha,' says Count Dracula."
Test me with "z / z / n / w / e / u / z / d".
Test me with "z / z / n / w / e / u / z / d".
Drawbridge

>(Testing.)

>[1] z
Time passes.

>[2] z
Time passes.

Count Dracula arrives from the north.

>[3] n

Immensely Enormous Entry Hall
Count Dracula arrives from the south.

>[4] w

Vast Dining Area
Count Dracula arrives from the east.

>[5] e

Immensely Enormous Entry Hall
Count Dracula arrives from the west.

>[6] u

Spooky Guano-filled Attic
Count Dracula arrives from below.

>[7] z
Time passes.

"Muhahaha," says Count Dracula.

>[8] d

Immensely Enormous Entry Hall
Count Dracula arrives from above.