staircase

Defines the Staircase class.

class pyskool.staircase.Staircase(bottom, top, force=False)

A staircase.

Parameters:
  • bottom – The coordinates of the bottom of the staircase.
  • top – The coordinates of the top of the staircase.
  • force – If True, the staircase must be ascended or descended when approached (like the staircase in Back to Skool that leads up from or down to the stage).
contains(character, distance=0)

Return whether a character is (a) on a step of this staircase, or (b) at the bottom of this staircase facing the top, or (c) at the top of this staircase facing the bottom.

Parameters:
  • character (Character) – The character to check.
  • distance – The maximum distance to check in front of the character.
contains_location(x, y)

Return whether the location (x, y) is at the bottom, or at the top, or on a step of this staircase.

supports(character)

Return whether a character is on a step of this staircase.

Parameters:character (Character) – The character to check.

Previous topic

sound

Next topic

stinkbomb