All Projects → hecrj → Coffee

hecrj / Coffee

Licence: mit
An opinionated 2D game engine for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Coffee

Gamedev Resources
🎮 🎲 A wonderful list of Game Development resources.
Stars: ✭ 2,054 (+166.41%)
Mutual labels:  game, game-development, game-engine, gamedev, engine, 2d-game-engine
Awesome Haxe Gamedev
Resources for game development on haxe
Stars: ✭ 213 (-72.37%)
Mutual labels:  game, game-development, game-engine, gamedev, engine
Gdevelop
🎮 GDevelop is an open-source, cross-platform game engine designed to be used by everyone.
Stars: ✭ 3,221 (+317.77%)
Mutual labels:  game, game-development, game-engine, gamedev, 2d-game-engine
Fxgl
Stars: ✭ 2,378 (+208.43%)
Mutual labels:  game, game-development, game-engine, gamedev, 2d-game-engine
Novelrt
A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
Stars: ✭ 81 (-89.49%)
Mutual labels:  game, game-development, game-engine, engine, 2d-game-engine
Obengine
2D Game Engine with Lua Scripting made on top of SFML !
Stars: ✭ 335 (-56.55%)
Mutual labels:  game-development, game-engine, gamedev, engine, 2d-game-engine
Ggez
Rust library to create a Good Game Easily
Stars: ✭ 3,120 (+304.67%)
Mutual labels:  game, game-development, game-engine, engine
Noahgameframe
A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
Stars: ✭ 3,258 (+322.57%)
Mutual labels:  game, game-development, game-engine, gamedev
Defaultecs
Entity Component System framework aiming for syntax and usage simplicity with maximum performance for game development.
Stars: ✭ 286 (-62.91%)
Mutual labels:  game, game-development, game-engine, gamedev
Anything about game
A wonderful list of Game Development resources.
Stars: ✭ 541 (-29.83%)
Mutual labels:  game, game-development, game-engine, gamedev
Pydark
PyDark is a 2D and Online Multiplayer video game framework written on-top of Python and PyGame.
Stars: ✭ 201 (-73.93%)
Mutual labels:  game, game-development, game-engine, engine
Terasology
Terasology - open source voxel world
Stars: ✭ 3,247 (+321.14%)
Mutual labels:  game, game-development, game-engine, gamedev
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+599.48%)
Mutual labels:  game, game-development, game-engine, gamedev
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (-70.3%)
Mutual labels:  game, game-development, game-engine, gamedev
Gameproject3
游戏服务器框架,网络层分别用SocketAPI、Boost Asio、Libuv三种方式实现, 框架内使用共享内存,无锁队列,对象池,内存池来提高服务器性能。还包含一个不断完善的Unity 3D客户端,客户端含大量完整资源,坐骑,宠物,伙伴,装备, 这些均己实现上阵和穿戴, 并可进入副本战斗,多人玩法也己实现, 持续开发中。
Stars: ✭ 655 (-15.05%)
Mutual labels:  game, game-development, game-engine, gamedev
Games
🎮 A list of popular/awesome video games, add-ons, maps, etc. hosted on GitHub. Any genre. Any platform. Any engine.
Stars: ✭ 18,676 (+2322.31%)
Mutual labels:  game, game-development, game-engine, gamedev
Game
⚔️ An online JavaScript 2D Medieval RPG.
Stars: ✭ 388 (-49.68%)
Mutual labels:  game, game-development, game-engine, gamedev
Glide
Game engine for making 2d games on iOS, macOS and tvOS, with practical examples and tutorials
Stars: ✭ 353 (-54.22%)
Mutual labels:  game-development, game-engine, gamedev, 2d-game-engine
Quadplay
The quadplay✜ fantasy console
Stars: ✭ 563 (-26.98%)
Mutual labels:  game, game-development, game-engine, 2d-game-engine
Kaetram Open
An open-source 2D HTML5 adventure based off BrowserQuest (BQ).
Stars: ✭ 138 (-82.1%)
Mutual labels:  game, game-development, game-engine, gamedev

Coffee

Integration status Documentation Crates.io License Gitter chat

An opinionated 2D game engine for Rust focused on simplicity, explicitness, and type-safety.

Coffee is in a very early stage of development. Many basic features are still missing, some dependencies are experimental, and there are probably many bugs. Feel free to contribute!

Features

And more! Check out the examples to see them in action.

Usage

Add coffee as a dependency in your Cargo.toml and enable a graphics backend feature (opengl, vulkan, metal, dx11, or dx12):

coffee = { version = "0.4", features = ["opengl"] }

Rust is quite slow in debug mode. If you experience performance issues when drawing hundreds of sprites, enable compiler optimizations in your Cargo.toml. I recommend level 2 optimizations in order to stay closer to --release performance:

[profile.dev]
opt-level = 2

Coffee moves fast and the master branch can contain breaking changes! If you want to learn about a specific release, check out the release list.

Overview

Here is a minimal example that will open a window:

use coffee::graphics::{Color, Frame, Window, WindowSettings};
use coffee::load::Task;
use coffee::{Game, Result, Timer};

fn main() -> Result<()> {
    MyGame::run(WindowSettings {
        title: String::from("A caffeinated game"),
        size: (1280, 1024),
        resizable: true,
        fullscreen: false,
        maximized: false,
    })
}

struct MyGame {
    // Your game state and assets go here...
}

impl Game for MyGame {
    type Input = (); // No input data
    type LoadingScreen = (); // No loading screen

    fn load(_window: &Window) -> Task<MyGame> {
        // Load your game assets here. Check out the `load` module!
        Task::succeed(|| MyGame { /* ... */ })
    }

    fn draw(&mut self, frame: &mut Frame, _timer: &Timer) {
        // Clear the current frame
        frame.clear(Color::BLACK);

        // Draw your game here. Check out the `graphics` module!
    }
}

Browse the documentation and the examples to learn more!

Implementation details

Coffee builds upon

  • winit for windowing and mouse/keyboard events.
  • gfx pre-ll for OpenGL support, based heavily on the ggez codebase.
  • wgpu for experimental Vulkan, Metal, D3D11 and D3D12 support.
  • stretch for responsive GUI layouting based on Flexbox.
  • glyph_brush for TrueType font rendering.
  • gilrs for gamepad support.
  • nalgebra for the Point, Vector, and Transformation types.
  • image for image loading and texture array building.

Contributing / Feedback

I am quite new to Rust, systems programming, and computer graphics. I am learning along the way as I build the engine for a game I am currently developing. I am always glad to to learn from anyone.

If you want to contribute, you are more than welcome to be a part of the project! Check out the current issues if you want to find something to work on. Try to share you thoughts first! Feel free to open a new issue if you want to discuss new ideas.

Any kind of feedback is welcome! You can open an issue or, if you want to talk, you can find me (and a bunch of awesome folks) over the #games-and-graphics channel in the Rust Community Discord. I go by @lone_scientist there.

Credits / Thank you

  • ggez, an awesome, easy-to-use, good game engine that introduced me to Rust. Its graphics implementation served me as a guide to implement OpenGL support for Coffee.
  • Kenney, creators of amazing free game assets with no strings attached. The built-in GUI renderer in Coffee uses a modified version of their UI sprites.
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].