ggez

Build Status Docs Status license Crates.io Crates.io

A Rust library to create a Good Game Easily.

More specifically, ggez is a lightweight game framework for making 2D games. It is built on SDL2, and aims to implement an API quite similar to (a Rustified version of) the Love2D game engine. This means it will contain basic and portable 2D drawing, sound, resource loading and event handling.

It's not meant to be everything to everyone, but rather a good base upon which to build. However, eventually there is also a ggez-goodies crate that aims to implement higher-level tools atop this, such as a resource cache, basic GUI/debugger, scene manager, and more sophisticated drawing systems such as sprites, layer, tiled maps, etc.

Features

Usage

ggez is built on the latest stable Rust compiler and distributed on crates.io. To include it in your project, just add the dependency line to your Cargo.toml file:

ggez = "0.2.0"

Examples

See the examples. imageview is a simple hello-world-y program that shows off a number of things, badly. astroblasto is a small Asteroids-like game.

To run the examples, you have to copy or symlink the resources directory to a place the running game can find it. Cargo does not have an easy way of doing this itself at the moment, so the procedure is (on Linux):

cargo build --example astroblasto cp -R resources target/debug/ cargo run --example astroblasto

Either way, if it can't find the resources it will give you an error along the lines of ResourceNotFound("'resources' directory not found! Should be in "/home/foo/src/ggez/target/debug/resources"). Just copy or symlink the resources directory to where the error says it's looking.

Extant things to do

Future work

It would be nice to have a full OpenGL-y backend like Love2D does, with things like shaders, render targets, etc. gfx might be the best option there, maaaaaaybe. Right now the API is mostly limited to Love2D 0.7 or so. Using OpenAL (through the ears crate perhaps?) for sound would get us positional audio too.

Useful goodies

Credits