core.components.event.actions.npc module

class core.components.event.actions.npc.Npc[source]

Bases: object

create_npc(game, action)[source]

Creates an NPC object and adds it to the game’s current list of NPC’s.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: name,tile_pos_x,tile_pos_y,animations,behavior

Examples:

>>> action.__dict__
{
    "type": "create_npc",
    "parameters": [
        "Oak",
        "1",
        "5",
        "oak",
        "wander"
    ]
}
npc_face(game, action)[source]

Makes the NPC face a certain direction.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: npc_name, direction

Action parameter can be: “left”, “right”, “up”, or “down”

pathfind(game, action)[source]

Will move the player / npc to the given location

remove_npc(game, action)[source]

Removes an NPC object from the list of NPCs.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: name

Examples:

>>> action.__dict__
{
    "type": "remove_npc",
    "parameters": [
        "Oak"
    ]
}