An opinionated 2D game engine for Rust

Overview

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.
Comments
  • Exporting as Image

    Exporting as Image

    This is probably outside of the scope of the game engine, but is it possible to use the current target or frame as an image type from the Image crate? My goal is essentially to save the frame as an image file. Thanks

    bug feature 
    opened by vinceniko 10
  • Max Number of Shapes Renderable with Mesh

    Max Number of Shapes Renderable with Mesh

    When rendering over 1k PolyLines on a single mesh, as the number of lines increased, I saw other lines disappear and a gradient streak appear, stretching from the top-left corner towards the middle where some line was rendered. See the below image:

    Screen Shot 2019-08-31 at 11 16 15 PM

    Given that my code works for a lower number of lines perfectly, I tried to allocate more than 1 mesh for drawing all the lines. Distributing the total number of lines among several meshes seems to have fixed the bug. I assume that this bug relates to some max bound for how many shapes a mesh can hold, but have not been able to find evidence of that in the documentation. If this bound does exist, it should be documented.

    bug 
    opened by vinceniko 10
  • Controller events

    Controller events

    I've made some changes to essentially inject GilRs gamepad events as input events and added GilRs as a dependency.

    Currently, there's no way to poll the gamepad directly as everything is event-based. This was a blocker for me to add a nice example but the basics are there and should suffice for handling simple events and button presses.

    A catch I encountered is that if an axis event occurs there won't be the following event to "zero" that same axis out, so caching the state of an axis won't work.

    This PR, or future PR's could expose more of the GilRs API such as querying the power state and allowing the use of the force-feedback module.

    Edit: Currently, these changes expose two GilRs types (GamepadId and EventType) which may not be preferable.

    feature 
    opened by JohnDoneth 10
  • Expose control over cursor visibility and icon of `winit::Window`

    Expose control over cursor visibility and icon of `winit::Window`

    It'd be good if we could get access to set_cursor_visible and set_cursor_icon of winit::Window. This should be fairly simple to do once #62 is merged in.

    @hecrj I'd be happy to work on this if you are OK with this addition. I was thinking we could just add these two methods in graphics::Window, which would just call the winit::Window methods. For the CursorIcon enum, I am guessing we'd want to have an enum in coffee that maps one to one with the winit::window::CursorIcon since it doesn't look like winit is exposed to the consumers of this crate at all. If you have other ideas, I am happy to follow them as well, just let me know if you're interested.

    For context, the reason I am interested in these methods is to be able to show a different icon in specific cases. Although set_cursor_icon would be enough to show the standard cursor icons, I believe set_cursor_visible is necessary to completely hide it to show a custom icon. I don't know which one I'll go with yet, but I think someone else might also find use for one or the other. Furthermore, a lot of games do hide the mouse icon completely, so the visibility control would be necessary for that as well.

    feature 
    opened by oguzkocer 7
  • Basic GUI support

    Basic GUI support

    Demo Watch in higher quality / Code

    This PR implements a basic UI runtime and integrates it with Coffee.

    Features / Goals

    • Responsive UI layout based on flexbox, built on top of stretch.
    • Generic Widget trait with a Renderer associated type, allowing users to build their own custom widgets and UI renderers.
    • Type-safety. No weak references.
    • Simple design, heavily inspired by Elm and elm-ui. Users define a function describing their UI layout. The resulting UI produces messages on user interaction. Produced messages are processed by another user-defined function, changing state as desired.
    • Simple integration. GUI can easily be added by simply extending your Game with the UserInterface trait.

    Built-in widgets

    • [x] Column
    • [x] Row
    • [x] Text
    • [x] Button
    • [x] Checkbox
    • [x] Radio button
    • [x] Slider
    • [x] ~Progress bar~ #45

    Example

    This branch includes an example that showcases all the built-in widgets so far (code). If you want to check it out simply run:

    cargo run --example ui --features opengl,debug --release
    

    Limitations

    This is a first iteration. The current implementation is still missing some basic features like:

    • Text input widget. This is a pretty complex widget if we want to do it well. We may need to contribute to glyph_brush a bit more. #46
    • Clipping (no scrollables yet). I have a mental roadmap for this. It involves changing Target and the rendering pipelines a bit. I need to further investigate, but it should be doable. #47
    • Global scaling. I have some ideas for this too (somewhat related to #6), but I think we should probably focus on other stuff first.

    Also, there is no way to overlay elements as of now and there are probably many performance optimizations that we could make. However, I would like to wait a bit and gather use cases before implementing these.

    Breaking changes

    This PR contains breaking changes that affect the architecture of the engine for the better:

    • The View associated type has been removed. Thus, implementors of the Game trait are also meant to hold the game assets. This simplifies the API considerably, and it helps model your game state-view relationship with precision, avoiding inconsistencies.
    • The Game::Input associated type now has to implement the new Input trait. This splits code quite nicely, as the on_input method moves away from Game. It also makes Input implementors reusable. For instance, a KeyboardAndMouse type has been implemented that can be used out of the box!
    • The Game::LoadingScreen associated type has been introduced. Given that all the Game associated types implement a trait with a load method, wiring a loading screen now is as simple as writing its name. Because of this, the Game::new method is no longer necessary and it is dropped.

    Additional implemented features

    • Text alignment, using HorizontalAlignment and VerticalAlignment
    • Font::measure, which allows to measure any Text
    • Rectangle::contains, returns whether or not it contains the given Point
    • Sprite::scale
    • Default implementation for Sprite

    Pending work

    • [x] Rename UserInterface::Event to UserInterface::Message
    • [x] Move runtime concepts and customization into a (public) module inside ui
    • [x] Expose simple concepts using the basic renderer directly on the ui module
    • [x] ~Implement ProgressBar~ widget #45
    • [x] ~Debug some weird stretch behavior (maybe contact maintainers and/or open an issue)~ #44
    • [x] ~Debug glyph_brush measuring functions (they seem to be off)~ #43
    • [x] Rethink alignment API
    • [x] Support renderer configuration
    • [x] Control event propagation
    • [x] Remove debug code (maybe split it into another renderer)
    • [x] Update examples
    • [x] Review API consistency
    • [x] Give proper credits (Kenney and stretch)
    • [x] Update documentation
    • [x] Update README
    • [x] Update CHANGELOG
    feature 
    opened by hecrj 7
  • Add project/unproject methods to `Transformation`.

    Add project/unproject methods to `Transformation`.

    Motivation

    I needed a way to project camera coordinates to world coordinates to be able to "pick" tiles using the mouse in a tile based game with a moving camera; In order to do so I needed to project the screen space coordinates into the world using the current Transformation.

    Solution

    Add the following methods to coffee::graphics::Transformation.

    pub fn project(&self, point: Point) -> Point;
    
    pub fn unproject(&self, point: Point) -> Point;
    

    Further Work / Possible Improvements

    • [x] ~~Get the inverse matrix in an infallible way?~~
    let inverse_mat = self.0.try_inverse().unwrap();
    
    feature 
    opened by JohnDoneth 5
  • Cursor icon support through Game trait

    Cursor icon support through Game trait

    @hecrj I got stuck on some implementation details & decisions to make for #111, so I thought I'd open a draft PR to make it easier to discuss. The main problem revolves around the following:

    When we control the cursor icon through the game trait by updating it every frame, we prevent the system taking over the icon. As an example, if I set the icon to Default and then try to Move the window in Windows 10, the Move icon goes away immediately. That might be what some clients want, but I don't think we should force them into specifying an icon at all times unless they want to.

    There are several ways to get around the issue, most of which I think will require us keeping state of the cursor, because as far as I can tell, there is no way to get the current cursor icon from winit.

    1. In Game instead of fn cursor_icon(&self) -> CursorIcon we could have fn cursor_icon(&self, current_icon: CursorIcon) -> CursorIcon which would let the client decide when and how to update the cursor. It'd provide the knowledge of the current cursor_icon which might come in handy in some cases, although I am not sure if it'd be anything common.
    2. We could have an Unchanged variant or something similar in the CursorIcon enum and don't update the icon in this case. I am afraid that this might be a bit more confusing then the first option, but it's hard to say.
    3. In Game instead of fn cursor_icon(&self) -> CursorIcon we could have fn cursor_icon(&self) -> Option<CursorIcon>. None could mean that don't set the cursor_icon manually. It'd result in the last cursor icon to remain as is, but would also let the system take over. Without checking the docs, it might be interpreted as Hidden which would be bad.

    I don't even know how this all connects to UserInterface and how the cursor is updated from there. I might be thinking too much over this and just a simple implementation might be fine too, I am not sure. Either way, I'd really appreciate your input on what you think is the best course of action.


    Notes about the other parts of this WIP PR:

    • I don't know if we want to add all the cursor icons from winit or not. I was thinking I'd add only a few of them just to get the implementation out and then separately the different variants could be decided. I am totally fine with implementing the variants you might already have in mind.
    • Setting cursor icon and visibility separately makes me a little sad 😬
    • CursorIcon::Hidden being mapped to the Default icon makes me even sadder. If we don't end up keeping track of the state, I think it might be best to use TryFrom trait or have a custom function that returns Option<CursorIcon> and don't update the cursor if an icon variant doesn't make sense. I also played with having an enum like below, but I am not sure if added complexity is worth it.
    pub enum CursorIconState {
        Visible(CursorIcon),
        Unchanged,
        Hidden
    }
    
    • I am leaving the documentation until after the implementation is done to avoid duplicating effort.

    @hecrj Sorry for the long PR description. I'd appreciate any feedback you might have. (for the code or the questions) Feel free to ignore the notes for now if you want to focus on the main issue.

    feature 
    opened by oguzkocer 5
  • Expose additional `winit` input events

    Expose additional `winit` input events

    Right now, Coffee only exposes three input events (keyboard input, mouse input, and mouse movement).

    We should probably expose additional useful events like CursorLeft, CursorEntered, MouseWheel, etc.

    feature help wanted good first issue 
    opened by hecrj 5
  • Key repeat behavior on macOS

    Key repeat behavior on macOS

    I have a small example that moves a circle across the screen based on WASD input.

    From experimenting on macOS, it appears that Coffee respects macOS's key repeat preferences:

    image

    On the one hand, this is obviously a nice thing to have, as it gives the player control over the behaviour. On the other hand, this is unexpected behaviour for games.

    Specifically, even with my preferences set to fast/short, there is still a noticeable delay from the "Delay Until Repeat" option. This means that if I press and hold A to move the circle to the left, it will move to the left once on press down, it will then stop moving for a moment even though A is still held down, and then start moving again as soon as the "repeat" kicks in, until I release the A key.

    I've experimented with ggez as well, and that game engine behaves as "expected" on macOS (quotations here because the game behaviour differs from default operating system behaviour, but I believe ggez' behaviour is what people expect in a game).


    Given that both engines use winit as a dependency, but ggez is still using 0.19 and Coffee uses 0.22, I suspect it's actually a change in behaviour between winit versions, and I would also suspect that change in behaviour is considered to be a fix, since regular macOS windows are expected to behave this way, but I don't think this is expected for games.


    Alternatively, Coffee shouldn't treat key input as "text input". There's some investigation for Piston I found here: https://github.com/PistonDevelopers/piston/issues/1220#issuecomment-569185277.


    Another reference is to a long-standing issue for Winit to discuss a better input model, see: https://github.com/rust-windowing/winit/issues/753


    And finally, looking at ggez, it appears that they've implemented this behavior themselves by tracking is_key_repeated.

    Although I'm not quite sure (yet) how that works, as that still doesn't explain why ggez doesn't have a delay between the first key and the repeat, whereas Coffee does.

    opened by JeanMertz 4
  • Error: WindowCreation(

    Error: WindowCreation("Couldn\'t find any pixel format that matches the criteria.")

    Hello, I'm trying to use coffee for learning purposes but I'm unfortunately not able to run the example provided by the documentation. The compiler complains with the following error:

    Error: WindowCreation("Couldn\'t find any pixel format that matches the criteria.")
    error: process didn't exit successfully:
    `C:\Users\_\Desktop\Programming\Rust_Projects\target\debug\coffe_sketch.exe` (exit code: 1)      
    

    This is how my Cargo.toml file looks like:

    [package]
    name = "coffe_sketch"
    version = "0.1.0"
    authors = ["_"]
    edition = "2018"
    
    # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
    
    [dependencies]
    coffee = { version = "0.4", features = ["opengl"] }
    

    Further details:

    OS: Windows 10 x64
    rustc 1.43.0-nightly (58b834344 2020-02-05)  
    

    How can I solve this issue? Any help and guidance would be truly appreciated. Thanks in advance.

    bug 
    opened by luisvgs 4
  • Padding around a widget

    Padding around a widget

    Is there a way to set padding around a widget like ui::Image or ui::Text? I see that examples/image.rs, Text::height is used to set the height in pixels (and, since this was in a column, this results in some padding if the height is larger than the computed height of the text). In the same example, Column::spacing is used to set a constant amount of spacing between the itens of the column (but not before the first and after the last).

    Both aren't what I'm looking for; there's also ui::core::Style::padding but I'm unsure how to use this with the current widgets (is it necessary to add a padding method to the widgets, like they have a height method? Shouldn't those methods be added to a trait?).

    (ps: since the ui code is being moved to iced perhaps this issue belongs there, but coffee doesn't used iced yet)

    question 
    opened by dlight 4
  • Anti-Aliasing

    Anti-Aliasing

    Add support for some kind of anti-aliasing to meshes.

    Some methods would be:

    • MSAA which would bring about the problem of wgpu only supported 4xMSAA or none.
    • SSAA expensive but would work irrelevant of backend but requires a whole new render pass to achieve.
    • FXAA same as SSAA in that it would require a new render pass however is much more lightweight but can produce less than stellar results at times.
    • Custom shader for meshes that smooths the edges, this could be done in the fragment shader not requiring an additional pass but will need a new pipeline if it gets used at the same time as any non-anti-aliased things.
    opened by MrDiamondGold 0
  • Security updates for rand, image, nalgebra versions in Cargo.toml

    Security updates for rand, image, nalgebra versions in Cargo.toml

    Updated rand version to avoid vulnerability discovered here among others Updated image version to correct vulnerability found here Updated nalgebra to remove this vulnerability Updated glutin to avoid several dependent vulnerabilities

    opened by PrimalSystemStudio 1
  • Can coffee run truly headless?

    Can coffee run truly headless?

    We currently have a project in ggez, but want our system to run headless with a cloud based GPU machine.

    ggez does not allow us to run without creating a window, even though we can render to an off-screen canvas. The window is basically blank, but displayed.

    Can coffee do what we desire?

    Our application does real time video encoding with effects and when deployed, does not require a window, which would require x11 contexts vs just the GPU drivers.

    The idea of leveraging wgpu backends vs only opengl is also enticing.

    Ideally we'd code our system to utilize a window for feedback when debugging (we'd copy the off screen canvas to the window), but when deployed we'd disable it entirely.

    We did not see an example in coffee that would demonstrate a simple headless setup, ie, just draw to a canvas and save out the canvas as an image file as a simple demonstration.

    Any insights would be appreciated. We think the port to coffee would be pretty easy if it supports this capability.

    opened by fairbairn 0
  • Fedora - Examples not working

    Fedora - Examples not working

    Hello!

    I'm struggling to get the examples running, I'm using Fedora 31, Coffee 0.4.1. The first frame is rendered, the draw function seems to be called once, and the window has no title or receives events. This locks up and I have to force close it.

    I want to try and fix the problem myself, sadly I don't know where to start... Any suggestions would be greatly appreciated!

    opened by proximalf 0
  • Rendering error

    Rendering error

    Hello,

    One of my player have a graphic rendering problem:

    ezgif-5-6a6d8759e522

    I'm not sure about which operating system he use but it is probably Windows. What kind of error it can be ?

    opened by buxx 1
Releases(0.4.1)
  • 0.4.1(May 10, 2020)

  • 0.4.0(Apr 25, 2020)

    Added

    • Task::succeed, which replaces the old Task::new. #66
    • Default implementation for ui::widget::slider::State.
    • Default, Clone, Copy, PartialEq, and Eq implementations for ui::widget::button::State.
    • Additional color constants: Color::RED, Color::GREEN, and Color::BLUE. #77
    • Color::from_rgb_u32, which allows to constructs a Color using an hexadecimal literal (0xRRGGBB). #77
    • From<nalgebra::Matrix3> and Into<nalgebra::Matrix3> implementations for Transformation. #78
    • Game::is_finished, which allows to gracefully quit the game on demand. #79
    • Canvas::read_pixels, a method to read the contents of a Canvas as a DynamicImage from the image crate.
    • ui::Panel, a dark box that can be used to wrap a widget.
    • ui::ProgressBar, a progress bar to give visual feedback to your users when performing a slow task.
    • ui::Image, a simple widget to display a graphics::Image in your user interface.
    • Mesh::new_with_tolerance, which allows to control the tolerance of line segment approximations. #100
    • Game::cursor_icon, which allows customization of the mouse cursor icon.

    Changed

    • Mesh::stroke now takes an f32 as line_width instead of a u16.
    • Task::new now supports a lazy operation that can fail. #66
    • Face culling has been disabled for Vulkan, Metal, D3D11, and D3D12 backends. In OpenGL, face culling was already disabled.
    • Transformation::nonuniform_scale now takes a Vector. #78
    • The logic of KeyboardAndMouse has been split into the new Keyboard and Mouse input trackers. The new mouse and keyboard methods can be used to obtain them, respectively. #69
    • The Mouse type can now track additional input:
      • any button click #67
      • wheel movements #67
      • the cursor leaving/entering the game window #67
    • The mesh example now has a slider to control the tolerance. #100

    Fixed

    • Hang when Game::TICKS_PER_SECOND is set as 0. #99
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Sep 1, 2019)

  • 0.3.1(Jun 20, 2019)

    Added

    • Documentation about the default coordinate system of a Target.

    Changed

    • The built-in Debug view now uses µ instead of u for microseconds.

    Fixed

    • Resizing in Wayland. #58
    • Outdated documentation comment in graphics module.
    • Documentation typos.
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jun 15, 2019)

    Added

    • Responsive GUI support! The new ui module can be used to extend a Game and build a user interface. #35
      • GUI runtime based on Elm and The Elm Architecture.
      • Layouting based on Flexbox and powered by stretch.
      • Built-in GUI widgets. Specifically: buttons, sliders, checkboxes, radio buttons, rows, and columns.
      • Built-in GUI renderer. It is capable of rendering all the built-in GUI widgets.
      • Customization. The ui::core module can be used to implement custom widgets and renderers.
    • Gamepad support. The input::Event enum now has a Gamepad variant. #29
    • Mesh support. The types Shape and Mesh have been introduced. Rectangles, circles, ellipses, and polylines can now be drawn with ease using fill or stroke modes. #50
    • The Game::LoadingScreen associated type. Given that all the Game associated types implement a trait with a load method, wiring a loading screen now is as simple as writing its name. Because of this, the Game::new method is no longer necessary and it is dropped. #35
    • Input trait. It allows to implement reusable input handlers. #35
    • KeyboardAndMouse input handler. Useful to quickstart development and have easy access to the keyboard and the mouse from the get-go. #35
    • CursorTaken and CursorReturned mouse input events. They are fired when the cursor is used/freed by the user interface. #35
    • Off-screen text rendering support. Font::draw now supports any Target instead of a window Frame. #25
    • Game::debug performance tracking. Time spent on this method is now shown in the built-in debug view. #26
    • Implementation of Default trait for Text. #25
    • Transformation::rotate. Creates a transformation representing a rotation. #28
    • Batch::clear. Clears the batch contents, useful to reuse batches in different frames.
    • Implementation of Extend for Batch. #37
    • Implementation of ParallelExtend for Batch. A Batch can now be populated using multiple threads, useful to improve performance when dealing with many thousands of quads. #37
    • Text alignment. It can be defined using the new HorizontalAlignment and VerticalAlignment types in the graphics module. #35
    • Font::measure. It allows to measure the dimensions of any Text. #35
    • Rectangle::contains. It returns whether or not a Rectangle contains a given Point. #35
    • Sprite::scale. It can be used to change the Sprite size when drawed.
    • Default implementation for Sprite. #35
    • Debug::ui_duration. It returns the average time spent running the UI runtime.
    • A counter example as an introduction to the new UI architecture. #35
    • A user interface example that introduces the different built-in widgets. #35
    • A gamepad example that displays the last gamepad event. #29
    • A mesh example that showcases the different ways to use the new Mesh and Shape types. #50
    • Multiple gravity centers based on mouse clicks in the particles example. #30

    Changed

    • The Game::Input associated type now has to implement the new Input trait. This splits code quite nicely, as the on_input method moves away from Game. It also makes Input implementors reusable. For instance, a KeyboardAndMouse type has been implemented that can be used out of the box! #35
    • Game::draw now takes a Frame directly instead of a Window. #35
    • LoadingScreen::on_progress has been renamed to LoadingScreen::draw and it now receives a Frame instead of a Window. #35
    • input::Event is now split into four different variants representing input sources: Keyboard, Mouse, Gamepad, and Window. Each one of these sources has its own module inside input with an Event type where the old variants can be found. #29
    • input::KeyCode has been moved to input::keyboard::KeyCode. #29
    • input::MouseButton has been moved to input::mouse::Button. #29
    • Batch::draw and texture_array::Batch::draw do not take a position argument anymore. Using Target::transform before drawing is preferred. #53
    • Font::load has been renamed to Font::load_from_bytes for consistency. #55
    • The performance of the particles example has been improved considerably on all platforms. #37
    • The input example uses the new ui module now.

    Removed

    • The Game::View associated type. Implementors of the Game trait are also meant to hold the game assets now. This simplifies the API considerably, and it helps model your game state-view relationship with precision, avoiding inconsistencies. #35
    • Game::new. Game::load should be used instead. #35
    • Game::on_input. Input handlers now must be implemented using the new Input trait. #35
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Apr 28, 2019)

    Added

    • Game::on_close_request to control whether the game should be closed when the window receives a close request by the OS. #14
    • input::Event::TextInput event, which triggers on text entry. Contains the character typed as a char. #15
    • input::Event::CursorEntered and input::Event::CursorLeft events, which trigger when the mouse cursor enters or leaves the game window, respectively. #15
    • input::Event::MouseWheel, which triggers when the mouse wheel is scrolled. Contains the number of horizontal and vertical lines scrolled as f32. #15
    • input::Event::WindowFocused and input::Event::WindowUnfocused, which trigger when the game window gains or loses focus, respectively. #15
    • input::Event::WindowMoved, which triggers when the game window is moved. Contains the new X and Y coordinates of the window as f32. #15
    • Text rendering for the wgpu graphics backend. Vulkan, Metal, D3D11 and D3D12 now support text rendering. OpenGL already supported text rendering. #18
    • A changelog. #20
    • Example to showcase input handling. #15
    • Example to showcase proper colors and gamma correction. #19

    Changed

    • The debug view is now shown by default when the debug feature is enabled.

    Fixed

    • Gamma correction in the wgpu graphics backend. Clear colors, font colors, and blending should work as expected in Vulkan, Metal, D3D11 and D3D12. OpenGL was already working properly. #19
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Apr 28, 2019)

    Changed

    • The wording in the README has been improved.

    Fixed

    • Compilation failing when debug_assertions and the debug feature were disabled.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Apr 24, 2019)

Owner
Héctor Ramón
I play code and write games.
Héctor Ramón
Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust

Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust Slow down, upon the teeth of Orange Heav

Shea Leffler 12 Mar 18, 2022
Work-in-Progress, opinionated game framework built on Bevy.

Bones A work-in-progress, opinionated game meta-engine built on Bevy. Under development for future use in the Jumpy game, and possibly other FishFolk

Fish Folk 9 Jan 3, 2023
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Petros 3 Oct 25, 2021
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

JoaoMarinho 2 Jul 15, 2022
A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

mike 20 Dec 23, 2022
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Gilles Henaux 65 Feb 20, 2023
Solana Game Server is a decentralized game server running on Solana, designed for game developers

Solana Game Server* is the first decentralized Game Server (aka web3 game server) designed for game devs. (Think web3 SDK for game developers as a ser

Tardigrade Life Sciences, Inc 16 Dec 1, 2022
An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform deployment.

??️ Bevy Shell - Template An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform

Kurbos 218 Dec 30, 2022
An opinionated 2D sparse grid made for use with Bevy. For storing and querying entities

bevy_sparse_grid_2d An opinionated 2D sparse grid made for use with Bevy. For storing and querying entities. Personally, I'm using it for simple stupi

Johan Klokkhammer Helsing 5 Feb 26, 2023
A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Bevy Engine 21.1k Jan 4, 2023
RTS game/engine in Rust and WebGPU

What is this? A real time strategy game/engine written with Rust and WebGPU. Eventually it will be able to run in a web browser thanks to WebGPU. This

Thomas SIMON 258 Dec 25, 2022
unrust - A pure rust based (webgl 2.0 / native) game engine

unrust A pure rust based (webgl 2.0 / native) game engine Current Version : 0.1.1 This project is under heavily development, all api are very unstable

null 368 Jan 3, 2023
A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.

rustris A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music. (C) 2020 Ben Cantrick. This code is distri

Ben Cantrick 17 Aug 18, 2022
Rust implementation of Another World (aka Out of this world) game engine

RustyWorld Rust implementation of Another World (aka Out of this world) game engine. I wanted a fun project to challenge myself while learning Rust, a

Francesco Degrassi 3 Jul 1, 2021
Simple RUST game with the Bevy Engine

Simple RUST Game using the Bevy Engine YouTube videos for this code base: Episode 1 - Rust Game Development tutorial from Scratch with Bevy Engine Epi

null 150 Jan 7, 2023
Rust Game engine 3D (and 2D)

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

rg3d engine 5.4k Jan 9, 2023
A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

rg3d engine 5.4k Jan 4, 2023