core.components.event.actions.map module

class core.components.event.actions.map.Map[source]

Bases: object

play_map_animation(game, action)[source]

Plays a map animation at a given position in the world map.

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: animation_name,duration,loop,pos_x,pos_y

  • animation_name - The name of the animation stored under resources/animations/tileset.

    For example, an animation called “grass” will load frames called “grass.xxx.png”.

  • duration - The duration of each frame of the animation in seconds.

  • loop - Can be either “loop” or “noloop” to loop the animation.

  • position - Can be either an x,y coordinate or “player” to draw the animation at the

    player’s location.

preload_map(game, action)[source]

Preloads a map into memory for quick map switching

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: map_name

Examples:

>>> action.__dict__
{
    "type": "preload_map",
    "parameters": [
        "map1.tmx"
    ]
}
screen_transition(game, action)[source]

Initiates a screen transition

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: transition_time_in_seconds

Examples:

>>> action.__dict__
{
    "type": "screen_transition",
    "parameters": [
        "1"
    ]
}
start_cinema_mode(game, action)[source]

Starts cinema mode by animating moving black bars to narrow the aspect ratio.

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

stop_cinema_mode(game, action)[source]

Stops cinema mode by animating moving black bars to back to the normal aspect ratio.

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