mini_arcade_core

Entry point for the mini_arcade_core package. Provides access to core classes and a convenience function to run a game.

get_version method needs to be removed

Submodules

Classes

EngineConfig

Configuration options for the Engine.

SceneConfig

Scene bootstrap configuration.

Engine

Core engine object responsible for the main loop and active scene.

EngineDependencies

Runtime dependencies required by the Engine.

Functions

run_game([engine_config, backend, scene_config, ...])

Convenience helper to bootstrap and run a game with a single scene.

Package Contents

class mini_arcade_core.EngineConfig

Configuration options for the Engine.

Variables:
  • (int) (fps) – Target frames per second.

  • int]) (virtual_resolution (tuple[int,) – Virtual render resolution.

  • (PostFXConfig) (postfx) – Configuration for post-processing effects.

fps: int = 60
virtual_resolution: tuple[int, int] = (800, 600)
postfx: PostFXConfig
enable_profiler: bool = False
classmethod from_dict(data: dict[str, Any]) EngineConfig

Create an EngineConfig instance from a dictionary.

Parameters:

data (dict) – Dictionary containing configuration values.

Returns:

An EngineConfig instance populated with the provided data.

Return type:

EngineConfig

class mini_arcade_core.SceneConfig

Scene bootstrap configuration.

Variables:
  • initial_scene – Identifier of the initial scene to load.

  • discover_packages – Packages used for scene auto-discovery.

initial_scene: str = 'main'
discover_packages: list[str] = []
classmethod from_dict(data: dict[str, Any] | None) SceneConfig

Construct scene config from a dict, typically parsed from a game config file.

Parameters:

data (dict or None) – The input data to parse.

Returns:

A SceneConfig instance populated with the parsed data.

Return type:

SceneConfig

class mini_arcade_core.Engine(config: mini_arcade_core.engine.engine_config.EngineConfig, dependencies: EngineDependencies)

Core engine object responsible for the main loop and active scene.

config
backend
managers
services
property running: bool

Check if the game is currently running.

quit()

Request that the main loop stops.

run(initial_scene: str | None = None)

Run the main loop starting with the given scene.

This is intentionally left abstract so you can plug pygame, pyglet, or another backend.

Parameters:

initial_scene (str | None) – Optional scene id to start with.

resolve_world() object | None

Resolve and return the current gameplay world.

Returns:

The current gameplay world, or None if not found.

Return type:

object | None

class mini_arcade_core.EngineDependencies

Runtime dependencies required by the Engine.

Variables:
  • backend – Backend implementation used by the runtime.

  • scene_registry – Scene registry available to the scene adapter.

  • gameplay_settings – Optional gameplay settings payload.

backend: mini_arcade_core.backend.Backend
scene_registry: mini_arcade_core.scenes.registry.SceneRegistry
gameplay_settings: mini_arcade_core.engine.gameplay_settings.GamePlaySettings | dict[str, Any] | None = None
mini_arcade_core.run_game(engine_config: engine.engine_config.EngineConfig | dict[str, Any] | None = None, backend: backend.Backend | None = None, scene_config: engine.engine_config.SceneConfig | dict[str, Any] | None = None, gameplay_config: dict[str, Any] | None = None)

Convenience helper to bootstrap and run a game with a single scene.

Parameters:
  • engine_config (EngineConfig | dict[str, Any] | None) – Optional EngineConfig payload.

  • backend (Backend | None) – Optional Backend instance to use for the game.

  • scene_config (SceneConfig | dict[str, Any] | None) – Optional SceneConfig payload.

  • gameplay_config (dict[str, Any] | None) – Optional gameplay settings payload.

Raises:

ValueError – If backend is missing.