earwax.cmd.game_level module

Provides the GameLevel class.

class earwax.cmd.game_level.BoxLevelData(bearing: int = NOTHING)

Bases: earwax.mixins.DumpLoadMixin

A box level.

An instance of this class can be used to build a earwax.BoxLevel instance.

class earwax.cmd.game_level.GameLevel(name: str, data: Union[earwax.cmd.game_level.LevelData, earwax.cmd.game_level.BoxLevelData], scripts: List[earwax.cmd.game_level.GameLevelScript] = NOTHING, id: str = NOTHING)

Bases: earwax.mixins.DumpLoadMixin

A game level.

This class is used in the GUI so that non-programmers can can create levels with no code.

Variables:
  • name – The name of this level.
  • data – The data for this level.
  • scripts – The scripts that are attached to this level.
class earwax.cmd.game_level.GameLevelScript(name: str, trigger: earwax.cmd.game_level.Trigger, id: str = NOTHING)

Bases: earwax.mixins.DumpLoadMixin

A script which is attached to a game level.

code

Return the code of this script.

If script_path does not exist, an empty string will be returned.

script_name

Return the script name (although not the path) for this script.

If you want the path, use the script_path attribute.

script_path

Return the path where code for this script resides.

If you want the filename, use the script_name attribute.

class earwax.cmd.game_level.LevelData

Bases: earwax.mixins.DumpLoadMixin

A standard earwax level.

An instance of this class can be used to build a earwax.Level instance.

class earwax.cmd.game_level.Trigger(symbol: Optional[str] = None, modifiers: List[str] = NOTHING, mouse_button: Optional[str] = None, hat_directions: Optional[str] = None, joystick_button: Optional[int] = None)

Bases: earwax.mixins.DumpLoadMixin

A trigger that can activate a function in a game.