Defines the Skool class.
Represents the play area and its features and fixtures.
Parameters: |
---|
Add a bike to the skool and the cast.
Parameters: |
|
---|
Add a blackboard to a room in the skool.
Parameters: |
|
---|
Add a chair to a classroom in the skool.
Parameters: |
|
---|
Add a cup to the skool.
Parameters: |
|
---|
Add a desk to a classroom in the skool.
Parameters: |
|
---|
Add a door to the skool.
Parameters: |
|
---|
Add a floor to the skool.
Parameters: |
|
---|
Define the location and width of a font character bitmap in the font image.
Parameters: |
|
---|
Add an inventory item.
Parameters: |
|
---|
Add some lines to Eric’s total. If, as a result, Eric has exceeded the lines limit, appropriate action is taken.
Parameter: | addend – The number of lines to add. |
---|
Add a named location. Named locations can be used by the GoTo command.
Parameters: |
|
---|
Add a no-go zone to the skool.
Parameters: |
|
---|
Add a plant pot to the skool, and a plant to the cast.
Parameters: |
|
---|
Add a room to the skool.
Parameters: |
|
---|
Add routes from one floor (the home floor) to other floors.
Parameters: |
|
---|
Add a safe to the skool.
Parameters: |
|
---|
Add a shield to the skool.
Parameters: |
|
---|
Add a staircase to the skool.
Parameters: |
|
---|
Award some points.
Parameter: | addend – The number of points to add to the score. |
---|
Add a wall to the skool.
Parameters: |
|
---|
Add a window to the skool.
Parameters: |
|
---|
Return the barrier (wall, window or door) that is in front of a character.
Parameters: |
|
---|---|
Returns: | The wall, window or door in front of the character, or None if there is none. |
Return whether a character is beside a blackboard.
Parameter: | character (Character) – The character to check. |
---|
Return whether safe combination letters can be revealed now. This will be True only if the following conditions are met:
- the safe has not been opened yet
- all the shields are flashing, or flashing is False
Return the chair that is beside a character.
Parameters: |
|
---|---|
Returns: | The chair, or None if there is none. |
Return whether the drinks cabinet is at a given location and is open.
Parameters: |
|
---|
Check whether there is a safe that can be opened at a given location. The safe will be opened if Eric either has the safe key, or has written the safe combination on a blackboard while all the shields are flashing.
Parameters: |
|
---|
Return the cup at a given location.
Parameters: |
|
---|---|
Returns: | The cup, or None if there is no cup at the given location. |
Return the desk that a character is sitting at.
Parameter: | character (Character) – The character. |
---|---|
Returns: | The desk, or None if the character is not sitting at a desk. |
Draw the skool.
Parameter: | update – Whether to update the screen after drawing. |
---|
Draw a mutable object (a door, window, cup, or bike-on-a-tree).
Parameters: |
|
---|
Indicate that the game should restart. The score will be cleared if Eric was expelled, or retained if he went up a year.
Parameter: | up_a_year – Whether Eric has gone up a year. |
---|
Return a message with character name and newline macros expanded. A character name macro takes the form $WACKER (for example), which expands to the name of the character whose ID is WACKER.
Parameter: | message – The message that may contain unexpanded name macros. |
---|---|
Returns: | A list of the lines in the expanded message. |
Set whoever is responsible for expelling Eric on his way.
Parameter: | command_list_id – The ID of the command list the expeller should switch to. |
---|
Fill a cup with water, sherry, or nothing.
Parameters: |
|
---|
Return the floor that a character or thing is in direct contact with.
Parameter: | thing – The character or thing. |
---|---|
Returns: | The floor, or None is the character is not on a floor. |
Return the floor at a given location.
Parameters: |
|
---|
Return the highest floor that is below a character.
Parameter: | character (Character) – The character. |
---|
Return the door or window with a given ID.
Parameter: | door_id – The ID of the door or window. |
---|
Return the room Eric’s supposed to be in at the moment.
Returns: | The room, or None if it’s an unsupervised period or Eric still has time to reach the room in which the class will be taking place. |
---|
Return a list of images of inventory items.
Parameter: | item_ids – The IDs of the inventory items. |
---|
Return a lines message containing the number of lines being given and the recipient’s name.
Parameters: |
|
---|
Return the room with a given ID.
Parameter: | room_id – The ID of the room. |
---|
Return Eric’s teacher for this period.
Returns: | Eric’s teacher, or None if it’s an unsupervised period. |
---|
Return whether the bike combination is written on a blackboard.
Parameter: | blackboard (Blackboard) – The blackboard to check. |
---|
Return whether a signal has been raised.
Parameter: | signal – The signal to check. |
---|
Return whether the storeroom combination is written on a blackboard.
Parameter: | blackboard (Blackboard) – The blackboard to check. |
---|
Hide an item (stinkbombs or a water pistol) in a desk.
Parameter: | item – The item to hide. |
---|
Check whether there is a shield that can be hit at a given location, and make it flash or unflash if required. If the last shield was made to flash or unflash, appropriate sound effects are played, points are awarded, and other required actions are taken.
Parameters: |
|
---|---|
Returns: | True if a shield was hit, False otherwise. |
Return whether a given location is in a no-go zone.
Parameters: |
|
---|
Return whether a character is in the playground.
Parameter: | character (Character) – The character to check. |
---|
Initialise the cast and the safe, bike and storeroom combinations.
Parameter: | keyboard (Keyboard) – The keyboard for Eric to use. |
---|
Return whether a door or window is shut.
Parameter: | barrier_id – The ID of the door or window. |
---|
Return whether a character is teaching Eric’s class this period.
Parameter: | character (Character) – The character to check. |
---|
Return whether there is no more than a certain number of skool clock ticks remaining before the bell rings.
Parameter: | ticks – The number of ticks. |
---|
Play a walking sound effect.
Parameter: | index – The index of the walking sound effect. |
---|
Move the bike away from a door if necessary (so that it may be closed).
Parameter: | barrier_id – The ID of the door. |
---|
Move the characters.
Returns: | -1 if the screen should scroll right, 1 if it should scroll left, or 0 if it should not scroll (after moving Eric). |
---|
Open or close a door or window.
Parameters: |
|
---|
Return a window that is close to a character.
Parameter: | character (Character) – The character. |
---|---|
Returns: | The window, or None if there is no window nearby. |
Proceed to the next lesson in the timetable.
Parameter: | ring_bell – Whether to ring the bell. |
---|
Return the next staircase that any character on one floor (the home floor) should ascend or descend next to reach another floor (the destination floor).
Parameters: |
|
---|
Return whether a character is in direct contact with a floor.
Parameter: | character (Character) – The character. |
---|
Return whether a character is on a step of any of the staircases in the skool.
Parameter: | character (Character) – The character. |
---|
Return the plant pot at a given location.
Parameters: |
|
---|---|
Returns: | The plant pot, or None if there is no plant pot at the given location. |
Play a sound effect.
Parameters: |
|
---|
Resolve a location ID into a pair of coordinates.
Parameter: | location_id – The ID of the location. |
---|---|
Returns: | The coordinates of the location. |
Perform tasks required immediately after rescaling or loading a saved game. The tasks are:
- set the screen size and background colour
- set the window icon and title
- print the logo, score box, lesson box and inventories
- restore the blackboard images
- redraw the bike, cups, doors, and windows
Rewind the skool clock by a number of ticks.
Parameter: | ticks – The number of ticks. |
---|
Return the room a character is in (or None if he is not in a room).
Parameter: | character (Character) – The character to check. |
---|
Scroll the skool left or right across the screen.
Parameters: |
|
---|
Scroll the skool into view across the screen.
Parameter: | clock – The clock to use to time the scrolling. |
---|
Raise a signal.
Parameter: | signal – The signal to raise. |
---|
Return the staircase that a character is on or close to.
Parameters: |
|
---|---|
Returns: | The staircase, or None if there is none. |
Start the skool clock with a certain number of ticks remaining till the bell rings.
Parameter: | ticks – The number of ticks. |
---|
Make a flashing object stop flashing.
Parameter: | flashable – The flashing object. |
---|
Lower a signal.
Parameter: | signal – The signal to lower. |
---|
Return the blackboard that is in a character’s line of sight, or None if there is none.
Parameter: | character (Character) – The character to check. |
---|
Return the window that is in front of a character.
Parameter: | character (Character) – The character. |
---|---|
Returns: | The window, or None if there is no window. |
Wipe a bit of a blackboard clean.
Parameters: |
|
---|
Write the next character of a message on a blackboard.
Parameters: |
|
---|---|
Returns: | True if the entire message has been written, False otherwise. |