8000 GitHub - zewenn/fyr: Declarative ECS based game engine, written in zig.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

zewenn/fyr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v0.4 | Docs | Demo Project

fyr is a wrapper of Not-Nik's raylib-zig using johan0A's clay-zig-bindings. fyr also contains a fully functional ECS (Entity Component System) and a caching asset handling solution.

Important

The project uses zig version 0.14.0 and the latest version of the bindings.
Still in beta, some docs may be missing or incomplete! Contributions are welcome.

Add the fyr library

You are only a couple of easy steps away fromm building your dream project:

  1. Run the following command to save the dependency:

    zig fetch --save git+https://github.com/zewenn/fyr#stable
  2. Add the following to your build.zig:

    const fyr_module = b.dependency("fyr", .{
        .target = target,
        .optimize = optimize,
    });
    
    const fyr = fyr_module.module("fyr");
    
    exe.root_module.addImport("fyr", fyr);
  3. You are ready to go! Now you can import fyr with a regular zig @import():

    const fyr = @import("fyr");

Project Setup

Setting up a project with fyr is so easy, even your grandma could do it 😄

Note

You can follow the documentation, or take a look at the demo project

const window = fyr.window;

pub fn main() !void {
    fyr.project({
        window.title("fyr-demo");
        window.size.set(fyr.Vec2(1280, 720));
        window.fps.setTarget(256);
        window.resizing.enable();

        // Paths for the assets directory
        fyr.useAssetPaths(.{
            .debug = "./src/demo/assets/",
        });
    })({
        // The default scene will be automatically loaded.
        fyr.scene("default")({
            fyr.entities(.{
                // Add entities here
            });

            fyr.scripts(.{
                // Add scripts here
            });
        });
    });
}

About

Declarative ECS based game engine, written in zig.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0