simvx.core.testing.scene_runner¶
SceneRunner – headless scene runner for testing game logic.
Module Contents¶
Classes¶
Headless scene runner for testing game logic without rendering. |
Data¶
API¶
- simvx.core.testing.scene_runner.__all__¶
[‘SceneRunner’]
- class simvx.core.testing.scene_runner.SceneRunner(screen_size: tuple[float, float] = (800, 600))[source]¶
Headless scene runner for testing game logic without rendering.
Manages a SceneTree, advances frames, and provides query helpers.
Initialization
- load(root_node: simvx.core.node.Node) simvx.core.testing.scene_runner.SceneRunner[source]¶
Load a scene by setting the root node.
- advance_frames(count: int = 1, dt: float | None = None, draw: bool = False) simvx.core.testing.scene_runner.SceneRunner[source]¶
Advance the scene by N frames (process + physics_process each).
If draw is True, also calls
tree.draw()with a mock renderer each frame. This exercises draw() methods and catches errors that would otherwise only surface with a real Vulkan renderer.
- advance_time(seconds: float, dt: float | None = None) simvx.core.testing.scene_runner.SceneRunner[source]¶
Advance the scene by approximately N seconds worth of frames.
- find(name_or_type, recursive: bool = True) simvx.core.node.Node | None[source]¶
Find a node by name (str) or by type in the scene tree.
- find_all(node_type: type) list[simvx.core.node.Node][source]¶
Find all nodes of a given type in the scene.
- property root: simvx.core.node.Node | None¶
- property frame_count: int¶
- property elapsed_time: float¶