earwax.cmd.game_level module¶
Provides the GameLevel class.
-
class
earwax.cmd.game_level.BoxLevelData(bearing: int = NOTHING)¶ Bases:
earwax.mixins.DumpLoadMixinA box level.
An instance of this class can be used to build a
earwax.BoxLevelinstance.
-
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.DumpLoadMixinA 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.DumpLoadMixinA script which is attached to a game level.
-
code¶ Return the code of this script.
If
script_pathdoes 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_pathattribute.
-
script_path¶ Return the path where code for this script resides.
If you want the filename, use the
script_nameattribute.
-
-
class
earwax.cmd.game_level.LevelData¶ Bases:
earwax.mixins.DumpLoadMixinA standard earwax level.
An instance of this class can be used to build a
earwax.Levelinstance.
-
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.DumpLoadMixinA trigger that can activate a function in a game.