All Projects → ggez → Ggez

ggez / Ggez

Licence: mit
Rust library to create a Good Game Easily

Programming Languages

rust
11053 projects
GLSL
2045 projects

Projects that are alternatives of or similar to Ggez

Pydark
PyDark is a 2D and Online Multiplayer video game framework written on-top of Python and PyGame.
Stars: ✭ 201 (-93.56%)
Mutual labels:  game, game-development, game-engine, engine
Gamedev Resources
🎮 🎲 A wonderful list of Game Development resources.
Stars: ✭ 2,054 (-34.17%)
Mutual labels:  game, game-development, game-engine, engine
Coffee
An opinionated 2D game engine for Rust
Stars: ✭ 771 (-75.29%)
Mutual labels:  game, game-development, game-engine, engine
Openage
Free (as in freedom) open source clone of the Age of Empires II engine 🚀
Stars: ✭ 10,712 (+243.33%)
Mutual labels:  game, game-development, game-engine, engine
Kengine
Entity-Component-System (ECS) with a focus on ease-of-use, runtime extensibility and compile-time type safety and clarity.
Stars: ✭ 417 (-86.63%)
Mutual labels:  game, game-development, game-engine, engine
Awesome Haxe Gamedev
Resources for game development on haxe
Stars: ✭ 213 (-93.17%)
Mutual labels:  game, game-development, game-engine, engine
Novelrt
A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
Stars: ✭ 81 (-97.4%)
Mutual labels:  game, game-development, game-engine, engine
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (-92.66%)
Mutual labels:  game, game-development, game-engine
Openjk
Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
Stars: ✭ 1,641 (-47.4%)
Mutual labels:  game, game-development, game-engine
Kaetram Open
An open-source 2D HTML5 adventure based off BrowserQuest (BQ).
Stars: ✭ 138 (-95.58%)
Mutual labels:  game, game-development, game-engine
Gdevelop
🎮 GDevelop is an open-source, cross-platform game engine designed to be used by everyone.
Stars: ✭ 3,221 (+3.24%)
Mutual labels:  game, game-development, game-engine
Chronoshift
An open source re-implementation of Red Alert written in C++.
Stars: ✭ 144 (-95.38%)
Mutual labels:  game, game-development, game-engine
Rubeus
A cross platform 2D game engine written in C++ for beginners
Stars: ✭ 159 (-94.9%)
Mutual labels:  game, game-development, engine
Simplexrpgengine
Modular game engine built with MonoGame, with GMS2-like workflow and advanced level editor
Stars: ✭ 122 (-96.09%)
Mutual labels:  game, game-engine, engine
Lambda Lantern
🧙 ‎‎ A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.
Stars: ✭ 122 (-96.09%)
Mutual labels:  game, game-development, game-engine
Gamedev4noobs
Olá, sejam bem-vindos ao repositório _gamedev4noobs_ do Estúdio Vaca Roxa. O propósito desse repositório, além de contribuir para o projeto 4noobs, é ensinar o básico do desenvolvimento de jogos para iniciantes. Apresentando boas práticas e insumos para criar games incríveis.
Stars: ✭ 122 (-96.09%)
Mutual labels:  game, game-development, game-engine
Fxgl
Stars: ✭ 2,378 (-23.78%)
Mutual labels:  game, game-development, game-engine
Expo Voxel
🎮🌳 Voxel Terrain made in React Native. ∛
Stars: ✭ 169 (-94.58%)
Mutual labels:  game, game-development, game-engine
Engine
A basic cross-platform 3D game engine
Stars: ✭ 208 (-93.33%)
Mutual labels:  game, game-engine, engine
Voxelman
Plugin-based client-server voxel game engine written in D language
Stars: ✭ 105 (-96.63%)
Mutual labels:  game, game-engine, engine

ggez

ggez logo

What is this?

Build status Docs Status license Crates.io Crates.io Maintenance

ggez is a Rust library to create a Good Game Easily.

More specifically, ggez is a lightweight cross-platform game framework for making 2D games with minimum friction. It aims to implement an API based on (a Rustified version of) the LÖVE game framework. This means it contains basic and portable 2D drawing, sound, resource loading and event handling, but finer details and performance characteristics may be different than LÖVE.

ggez is not meant to be everything to everyone, but rather a good base upon which to build. Thus it takes a fairly batteries-included approach without needing a million additions and plugins for everything imaginable, but also does not dictate higher-level functionality such as physics engine or entity component system. Instead the goal is to allow you to use whichever libraries you want to provide these functions, or build your own libraries atop ggez.

Features

  • Filesystem abstraction that lets you load resources from folders or zip files
  • Hardware-accelerated 2D rendering built on the gfx-rs graphics engine
  • Loading and playing .ogg, .wav and .flac files via the rodio crate
  • TTF font rendering with rusttype and glyph_brush.
  • Interface for handling keyboard and mouse events easily through callbacks
  • Config file for defining engine and game settings
  • Easy timing and FPS measurement functions.
  • Math library integration with mint.
  • Some more advanced graphics options: shaders, sprite batches and render targets

Non-Features (i.e. things to add from elsewhere if needed)

Supported platforms

  • Fully supported: Windows, Linux
  • Not officially supported but might work anyway: Mac

For details, see docs/BuildingForEveryPlatform.md

If you want to run ggez on Android, iOS or the web using WebAssembly take a look at good-web-game.

Who's using ggez?

Check out the projects list!

Usage

ggez requires rustc >= 1.42 and is distributed on crates.io. To include it in your project, just add the dependency line to your Cargo.toml file:

ggez = "0.7"

ggez consists of three main parts: A Context object which contains all the state required to interface with the computer's hardware, an EventHandler trait that the user implements to register callbacks for events, and various sub-modules such as graphics and audio that provide the functionality to actually get stuff done. The general pattern is to create a struct holding your game's data which implements the EventHandler trait. Create a new Context object with default objects from a ContextBuilder or Conf object, and then call event::run() with the Context and an instance of your EventHandler to run your game's main loop.

See the API docs for full documentation, or the examples directory for a number of commented examples of varying complexity. Most examples show off a single feature of ggez, while astroblasto and snake are small but complete games.

Getting started

For a quick tutorial on ggez, see the Hello ggez guide in the docs/ directory.

Examples

See the examples/ directory in the source. Most examples show off a single feature of ggez, while astroblasto is a small but complete Asteroids-like game.

To run the examples, just check out the source and execute cargo run --example in the root directory:

git clone https://github.com/ggez/ggez.git
cd ggez
cargo run --example 05_astroblasto

If this doesn't work, see the FAQ for solutions to common problems.

Basic Project Template

use ggez::{Context, ContextBuilder, GameResult};
use ggez::graphics::{self, Color};
use ggez::event::{self, EventHandler};

fn main() {
    // Make a Context.
    let (mut ctx, event_loop) = ContextBuilder::new("my_game", "Cool Game Author")
        .build()
        .expect("aieee, could not create ggez context!");

    // Create an instance of your event handler.
    // Usually, you should provide it with the Context object to
    // use when setting your game up.
    let my_game = MyGame::new(&mut ctx);

    // Run!
    event::run(ctx, event_loop, my_game);
}

struct MyGame {
    // Your state here...
}

impl MyGame {
    pub fn new(_ctx: &mut Context) -> MyGame {
        // Load/create resources such as images here.
        MyGame {
            // ...
        }
    }
}

impl EventHandler for MyGame {
    fn update(&mut self, _ctx: &mut Context) -> GameResult<()> {
        // Update code here...
        Ok(())
    }

    fn draw(&mut self, ctx: &mut Context) -> GameResult<()> {
        graphics::clear(ctx, Color::WHITE);
        // Draw code here...
        graphics::present(ctx)
    }
}

Implementation details

ggez is built upon winit for windowing and events, rodio for sound, and a 2D drawing engine implemented in gfx using the OpenGL backend (which currently defaults to use OpenGL 3.2). It is entirely thread-safe (though platform constraints mean the event-handling loop and drawing must be done in the main thread), and portable to Windows and Linux.

ggez is pure Rust™.

Help!

Sources of information:

  • The FAQ has answers to common questions and problems.
  • The API docs, a lot of design stuff is explained there.
  • Check out the examples.

If you still have problems or questions, feel free to ask! Easiest ways are:

License: MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].