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.
Parameters: | 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.
Parameters: | addend – The number of points to add to the score. |
---|
Add a wall to the skool.
Parameters: |
|
---|
Add a window to the skool.
Parameters: |
|
---|
Shut any automatically shutting doors that are due to be and can be shut.
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.
Parameters: | 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
Chain the bike to the tree.
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.
Parameters: | character (Character) – The character. |
---|---|
Returns: | The desk, or None if the character is not sitting at a desk. |
Draw the skool.
Parameters: | 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.
Parameters: | 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.
Parameters: | 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.
Parameters: | command_list_id – The ID of the command list the expeller should switch to. |
---|
Fill a cup with water, sherry, or nothing.
Parameters: |
|
---|
Hide the water pistol and stinkbombs in randomly chosen desks.
Return the floor that a character or thing is in direct contact with.
Parameters: | 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.
Parameters: | character (Character) – The character. |
---|
Return a message to deliver during assembly (with verb and noun randomly chosen).
Return the door or window with a given ID.
Parameters: | door_id – The ID of the door or window. |
---|
Return the height of the play area (in pixels).
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.
Parameters: | item_ids – The IDs of the inventory items. |
---|
Return the name of the teacher and the room for this period (for display in the lesson box). The name of the teacher will be blank if it’s Playtime or Revision Library.
Return a lines message containing the number of lines being given and the recipient’s name.
Parameters: |
|
---|
Return an image of a captured mouse (as it appears in the mouse inventory).
Return the room with a given ID.
Parameters: | 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 the width of the play area (in pixels).
Return whether the bike combination is written on a blackboard.
Parameters: | blackboard (Blackboard) – The blackboard to check. |
---|
Return whether the safe combination is written on any of the blackboards in the skool.
Return whether a signal has been raised.
Parameters: | signal – The signal to check. |
---|
Return whether the storeroom combination is written on a blackboard.
Parameters: | blackboard (Blackboard) – The blackboard to check. |
---|
Hide an item (stinkbombs or a water pistol) in a desk.
Parameters: | 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.
Parameters: | character (Character) – The character to check. |
---|
Initialise the bike combination.
Initialise the cast and the safe, bike and storeroom combinations.
Parameters: | keyboard (Keyboard) – The keyboard for Eric to use. |
---|
Initialise the safe combination.
Initialise the storeroom combination.
Return whether it’s Assembly.
Return whether a door or window is shut.
Parameters: | barrier_id – The ID of the door or window. |
---|
Return whether it’s Playtime.
Return whether a character is teaching Eric’s class this period.
Parameters: | 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.
Parameters: | ticks – The number of ticks. |
---|
Return whether enough time has passed to start the lesson. This is used, for example, to check whether a teacher should tell the kids to sit down, or continue pacing up and down outside the classroom doorway.
Return whether there is a clear line of sight between two points (that is, there are no walls between them).
Play a sitting sound effect. This will be a walking sound effect, chosen at random from those available.
Play a walking sound effect.
Parameters: | index – The index of the walking sound effect. |
---|
Move the bike away from a door if necessary (so that it may be closed).
Parameters: | 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.
Parameters: | character (Character) – The character. |
---|---|
Returns: | The window, or None if there is no window nearby. |
Proceed to the next lesson in the timetable.
Parameters: | 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.
Parameters: | character (Character) – The character. |
---|
Return whether a character is on a step of any of the staircases in the skool.
Parameters: | 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: |
|
---|
Print the lesson description in the lesson box.
Reinitialise the skool in preparation for a new game.
Resolve a location ID into a pair of coordinates.
Parameters: | 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.
Parameters: | ticks – The number of ticks. |
---|
Return the room a character is in (or None if he is not in a room).
Parameters: | character (Character) – The character to check. |
---|
Scroll the skool left or right across the screen.
Parameters: |
|
---|
Scroll the skool into view across the screen.
Parameters: | clock – The clock to use to time the scrolling. |
---|
Set Eric’s home room for the current period. The home room is the place Eric should be in by now; if he’s not, and he’s spotted by a teacher, he will be given lines.
Return whether Eric is somewhere other than he should be.
Raise a signal.
Parameters: | 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.
Parameters: | ticks – The number of ticks. |
---|
Stop the skool clock.
Advance the skool clock by one tick.
Unchain the bike from the tree.
Make a flashing object stop flashing.
Parameters: | flashable – The flashing object. |
---|
Unset Eric’s home room for the current period. This is used when assembly is finished (so that Eric is not told off for being outside the assembly hall after Mr Wacker has finished speaking).
Lower a signal.
Parameters: | signal – The signal to lower. |
---|
Print the score, lines total and hi-score.
Return the blackboard that is in a character’s line of sight, or None if there is none.
Parameters: | character (Character) – The character to check. |
---|
Return the window that is in front of a character.
Parameters: | 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. |