zewenn/fyr
Declarative ECS based game engine, written in zig.
9d66e23e32cd7208d1becb4fd9352f8a27f89551
0de5f8aed0565f2dbd8bc6851499c85df9e73534
582095c4b7c5437f5a4fc9e0cebee289cff9ae47
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.
fyr
libraryYou are only a couple of easy steps away fromm building your dream project:
Run the following command to save the dependency:
zig fetch --save git+https://github.com/zewenn/fyr#stable
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);
You are ready to go! Now you can import fyr with a regular zig @import()
:
const fyr = @import("fyr");
Setting up a project with fyr
is so easy, even your grandma could do it :smile:
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
});
});
});
}