gameloop

Crates.iogameloop
lib.rsgameloop
version0.2.0
sourcesrc
created_at2020-06-08 16:16:52.707293
updated_at2020-06-30 05:19:12.545397
descriptiondeWiTTERS game loop.
homepagehttps://github.com/DomWilliams0/gameloop-rs
repositoryhttps://github.com/DomWilliams0/gameloop-rs
max_upload_size
id251415
size11,459
Dom Williams (DomWilliams0)

documentation

README

gameloop-rs

Build Status Documentation Version License

An implementation of deWiTTERS game loop.

Usage

// run at 20 ticks per second, with max frame skip of 5
let game_loop = GameLoop::new(20, 5).unwrap();

// begin core game loop
loop {
    // ... handle window events ...

    for action in game_loop.actions() {
        match action {
            FrameAction::Tick => /* simulate 1 game tick */
            FrameAction::Render { interpolation } => /* render the game state interpolated
                                                        between previous and next tick */
        }
    }
}
Commit count: 11

cargo fmt