Skip to main content

Module integration

Module integration 

Source
Expand description

ProofGame integration trait — the contract between proof-engine and chaos-rpg-core.

Any game that wants to drive the Proof Engine implements ProofGame. The engine calls update() each frame with mutable access to the engine state, allowing game logic to spawn entities, emit particles, trigger audio, and more.

§Example

use proof_engine::prelude::*;
use proof_engine::integration::ProofGame;

struct MyChaosRpg { tick: u64 }

impl ProofGame for MyChaosRpg {
    fn title(&self) -> &str { "CHAOS RPG" }
    fn update(&mut self, engine: &mut ProofEngine, dt: f32) {
        self.tick += 1;
    }
}

Enums§

GameEvent
Events that chaos-rpg-core can send to the proof-engine renderer.

Traits§

ProofGame
The integration contract between a game and the Proof Engine.