droppable
Classes for things in the skool that fall from a height onto the floor or
someone’s head.
-
class pyskool.droppable.Conker(object_id, command_list_id, min_x, max_x, min_y, max_y, hit_xy)
A conker (as knocked out of a tree by a catapult pellet).
Parameters: |
- object_id – The ID of the conker.
- command_list_id – The ID of the command list the conker will use.
- min_x – The minimum x-coordinate a pellet must reach to knock the
conker out of the tree.
- max_x – The maximum x-coordinate a pellet must reach to knock the
conker out of the tree.
- min_y – The minimum y-coordinate a pellet must fly at to knock the
conker out of the tree.
- max_y – The maximum y-coordinate a pellet must fly at to knock the
conker out of the tree.
- hit_xy – The coordinates of the conker within its sprite (used for
collision detection).
|
-
hit_by(pellet)
Return whether the conker was hit by a catapult pellet.
Parameters: | pellet (Pellet) – The catapult pellet to check. |
-
hit_victim()
Knock anyone over or out who was unfortunate enough to be struck by
the conker.
Returns: | True if someone was struck, False otherwise. |
-
class pyskool.droppable.Drop(object_id, command_list_id, hit_xy, animatory_state, direction)
Abstract superclass for a drop of liquid (water or sherry).
-
hit_victim()
Knock anyone over who was unfortunate enough to be struck by the
drop of liquid, and make them reveal a secret.
Returns: | True if someone was struck, False otherwise. |
-
class pyskool.droppable.Droppable(object_id, command_list_id, hit_xy, animatory_state, direction)
Abstract superclass for objects that fall from a height.
Parameters: |
- object_id – The ID of the object.
- command_list_id – The ID of the command list the object will use.
- hit_xy – The coordinates of the object within its sprite (used for
collision detection).
- animatory_state – The object’s animatory state.
- direction – The direction the object faces (this is used to orient
the object’s animatory state).
|
-
fall(x, y)
Make the object begin its descent from a specified location.
Parameters: |
- x – The x-coordinate of the location.
- y – The y-coordinate of the location.
|
-
get_command_list_id(lesson_id)
Return the ID of the command list used by this object.
Parameters: | lesson_id – The ID of the current lesson (ignored - this object
does not follow a timetable). |
-
class pyskool.droppable.SherryDrop(object_id, command_list_id, hit_xy)
A drop of sherry (as knocked from a cup by a catapult pellet).
Parameters: |
- object_id – The ID of the sherry drop.
- command_list_id – The ID of the command list the drop will use.
- hit_xy – The coordinates of the sherry drop within its sprite (used
for collision detection).
|
-
class pyskool.droppable.WaterDrop(object_id, command_list_id, hit_xy)
A drop of water (as knocked from a cup by a catapult pellet).
Parameters: |
- object_id – The ID of the water drop.
- command_list_id – The ID of the command list the drop will use.
- hit_xy – The coordinates of the water drop within its sprite (used
for collision detection).
|