pub trait Game {
// Required methods
fn init(&mut self, width: u16, height: u16);
fn update(&mut self, input_state: InputState, delta_time: u32) -> bool;
fn render(&mut self, display: &mut impl Display, delta_time: u32);
}Expand description
Game engine trait - implement this for your game
Required Methods§
Sourcefn update(&mut self, input_state: InputState, delta_time: u32) -> bool
fn update(&mut self, input_state: InputState, delta_time: u32) -> bool
Called every frame - return false to exit
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.