hecrj / coffee

An opinionated 2D game engine for Rust
https://docs.rs/coffee
MIT License
1.08k stars 55 forks source link

Allow to gracefully quit the game on demand #59

Closed hecrj closed 5 years ago

hecrj commented 5 years ago

As of now, the only way to gracefully quit a Game after Game::run is to implement Game::on_close_request and wait for a close request.

However, it is very common in games to have a UI option to "Quit the game". While we can use std::process::exit, it's not ideal as it doesn't gracefully stop the execution.

Therefore, I think we need to rethink the Game API a bit to allow graceful quits on demand.

hecrj commented 5 years ago

This should probably be tackled once #62 is merged.