Expand description

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).

Getting Started

Wolf Engine ships with sensible defaults to help jump-start projects as quickly as possible. You can get started with the default settings by calling Engine::new(), or alternatively Engine::default().

Engine::new()
    .run(Box::from(my_game_state));

The defaults are probably fine for simple projects, or when you’re just getting started. You can reference the Engine’s documentation if you want to customize the engine.

Game States

Wolf Engine games are organized into one or more game States. These game States bundle your game’s data and logic into a single package that’s easy to pass to the Engine. You will need to implement your game as a State.

pub struct MyGame;

impl State for MyGame {
    fn update(&mut self, _context: &mut Context) -> OptionalTransition {
        // Update your game here.
        None
    }

    fn render(&mut self, _context: &mut Context) -> RenderResult {
        // Render your game here.
    }
}

Refer to the examples folder for more complete examples of how to use Wolf Engine. The Quick-start Example is a good starting place.

Modules

Provides built-in Subcontext implementations.

Provides built-in Scheduler implementations.

Structs

Provides a dynamic storage container for global Engine state.

Indicates a Subcontext has already been added to the Context.

Provides the core functionality of the engine.

Build and customize an instance of the Engine.

Provides a stack for storing, managing, and running multiple State objects.

Enums

Indicates the type of Transition the StateStack should perform.

Traits

Controls how the game is run.

Provides a common mechanism for getting game logic / data to the engine.

A marker trait which allows types to be added to the Context.

Functions

Run the Engine until the StateStack is empty.

Type Definitions

Defines which functions can be used as an Engine core.

Represents the number of frames the engine has rendered.

Indicates if a Transition should be performed.

A currently unused return type for State’s render method.

Represents the number of ticks the engine has run.