Skip to main content

Module runtime

Module runtime 

Source
Expand description

The game loop shared by the editor’s Play mode and the standalone player.

A tick runs scripts, environment and procedural systems, then zero or more fixed physics steps and finally refreshes world transforms. The shell supplies input before ticking. Frame input edges remain visible to every fixed step in that frame; scripts should consume one-shot gameplay actions in update.

use kvas_engine::{runtime::Runtime, scene::Scene};
let mut runtime = Runtime::new(Scene::default(), None);
runtime.tick(1.0 / 60.0);
assert_eq!(runtime.time.frame, 1);
runtime.set_paused(true);
runtime.tick(1.0);
assert_eq!(runtime.time.frame, 1);

Structs§

FrameStats
Timing diagnostics for the most recent tick.
Runtime
Owned gameplay state shared by editor Play mode and the standalone player. Dropping the runtime destroys script instances before unloading their library.
RuntimeConfig
Validated timing policy for a Runtime. Defaults retain the 60 Hz loop.