Wolf Engine is a game framework for Rust with a focus on flexibility and ease of use. It aims to provide sensible default workflows to those who just want to build a game while allowing custom options for those who don't want to be forced to do things The Wolf Engine Way (TM).
The main motivations for building Wolf Engine was to learn about how games / game engines work under the hood and to provide a production-ready system for future game projects.
Note Wolf Engine is still very much a W.I.P, so you should expect missing features, bugs, changing APIs, and other spooky stuff until release 1.0.
These are the currently planned features for Wolf Engine. Not all of them are ready just yet, so this is more of a road-map, than a feature list for now. Features will be checked off as they are implemented.
Add Wolf Engine to your dependencies in Cargo.toml
:
TOML
[dependencies]
wolf_engine = "0.1"
``` Rust use log::; use wolf_engine::;
pub fn main() { // Wolf Engine includes a default logger for convenience, but using it is optional. // Feel free to bring your own logger. initialize_logging(LevelFilter::Debug);
// Start by initializing the Context object.
let context = ContextBuilder::new()
// Custom settings go here.
.build();
// Then build an instance of the engine.
let engine = WolfEngineBuilder::with_default_game_loop()
// Custom settings go here.
.build(context);
// Initialize your game state.
let game = FizzBuzzState::new();
// Then pass your game state to the engine on startup. Have fun!
engine.run(Box::from(game));
}
pub struct FizzBuzzState { number: u64, }
impl FizzBuzzState { pub fn new() -> Self { Self { number: 0, } }
fn fizz_buzz(number: u64) -> String {
if number % 15 == 0 {
"fizz-buzz".to_string()
} else if number % 5 == 0 {
"buzz".to_string()
} else if number % 3 == 0 {
"fizz".to_string()
} else {
number.to_string()
}
}
}
impl State for FizzBuzzState { fn update(&mut self, context: &mut Context) -> OptionalTransition { if self.number == 100 { info!("Goodbye!"); Some(Transition::Quit) // Tell the engine we want to quit. } else { self.number += 1; info!("{}", Self::fizzbuzz(self.number)); None // Tell the engine we want to continue running this state. } }
fn render(&mut self, _context: &mut Context) -> RenderResult {
// Nothing to render for this example.
}
} ```
Refer to the documentation, and examples folder for more detailed information.
Wolf Engine is licensed under either
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without additional terms or conditions.