qilin 0.3.2

Lightweight Game Engine for making fun 2d Games in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::game::context::GameContext;

use crate::render::canvas::Canvas;

/// Trait to represent a scene in the `Game`.
pub trait Scene {
    fn new() -> Self
    where
        Self: Sized;

    fn enter(&mut self);

    fn update(&mut self, canvas: &mut Canvas, ctx: &mut GameContext);

    fn fixed_update(&mut self, canvas: &mut Canvas, ctx: &mut GameContext);

    fn exit(&mut self);
}