version 12 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter: Limiting a patroller's movement
    Section: Default position
    The patrollers extension allows a patroller to enter any room unless there is a closed door that the patroller cannot open. In real life we may want to place restrictions on the patroller's freedom of movement, particularly where the patroller is aimless or following. The extension allows us to place rooms off-limits to the patroller by providing a hook to add our own restrictions.
    The default hook is the decision:
        To decide if (R - a Room) is off-limits to (P - a Patroller):
            decide no.
    By creating our own decision code using the same syntax, we can override the default hook.