core.components.event package

core.components.event.Action

alias of action

core.components.event.Condition

alias of condition

class core.components.event.EventEngine[source]

Bases: object

A class for the event engine. The event engine checks to see if a group of conditions have been met and then executes a set of actions.

check_conditions(game, dt)[source]

Checks a list of conditions to see if any of them have been met.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • game.event_conditions (List) – The multi-dimensional list of conditions to check for. See core.components.map.Map.loadevents() to see the format of the list.
  • dt (Float) – Amount of time passed in seconds since last frame.
Return type:

None

Returns:

None

execute_action(action_list, game)[source]

Executes a particular action in a list of actions.

Parameters:
  • action_list (List) – A list of actions fetched from the database.
  • game (core.control.Control) – The main game object that contains all the game’s variables.

Here is an example of what an action list might look like:

>>> action_list
[<class 'core.components.map.action'>, <class 'core.components.map.action'>]
Return type:None
Returns:None
process_event(event)[source]