Struct ggez::game::Game [] [src]

pub struct Game<'a, S: GameState> { /* fields omitted */ }

The Game struct takes a GameState you define and does the actual work of running a gameloop, passing events to your handlers, and all that stuff.

Methods

impl<'a, S: GameState + 'static> Game<'a, S>
[src]

Creates a new Game with the given default config (which will be used if there is no config file). It will initialize a hardware context and call the load() method of the given GameState type to create a new GameState.

Re-creates a fresh GameState using the type's ::load() method.

Calls the given function to create a new gamestate, and replaces the current one with it.

Replaces the gamestate with the given one without having to re-initialize the hardware context.

Runs the game's mainloop.

Trait Implementations

impl<'a, S: Debug + GameState> Debug for Game<'a, S>
[src]

Formats the value using the given formatter.