Trait let_engine::Game

source ·
pub trait Game {
    // Required method
    fn exit(&self) -> bool;

    // Provided methods
    fn start(&mut self) { ... }
    fn update(&mut self) { ... }
    fn frame_update(&mut self) { ... }
    fn tick(&mut self) { ... }
    fn event(&mut self, event: Event) { ... }
}
Expand description

Represents the game application with essential methods for a game’s lifetime.

Required Methods§

source

fn exit(&self) -> bool

If true exits the program, stopping the loop and closing the window, when true.

Provided Methods§

source

fn start(&mut self)

Runs right before the first frame is drawn and the window gets displayed, initializing the instance.

source

fn update(&mut self)

Runs before the frame is drawn.

source

fn frame_update(&mut self)

Runs after the frame is drawn.

source

fn tick(&mut self)

Runs based on the configured tick settings of the engine.

source

fn event(&mut self, event: Event)

Handles engine and window events.

Implementors§