eggy

eggy is a game engine for Zig.

You write your game as a Zig package. It compiles its own editor from source, which you can change with plugins or by editing that source.

curl -fsSL https://raw.githubusercontent.com/eggyengine/eggy/main/scripts/get-started.sh | bash

The script is used because the editor is compiled with the game.

The eggy editor: a Hierarchy panel listing a Player entity, a Scene panel showing an orange cube on a grid with a move gizmo, and an Inspector panel editing the Player's Transform and Mesh components.
The editor with the sun entity selected. Every panel is a weeoui dock tab you can split, float or pop out.

Your game is Zig code

A project has a game in src/main.zig, whose hooks the engine calls each frame, and a plugin in src/root.zig that brings components, systems and editor panels. Keep both, or delete the one you do not need. The editor sets the project up for you.

zig build run
Opens your game in the editor.
zig build run-runtime
Runs it as players see it, on the desktop or the web.
const eggy = @import("eggy");

pub const Game = struct {
    frames: u64 = 0,

    /// Runs once per frame, before drawing.
    pub fn update(self: *Game, app: *eggy.App) !void {
        _ = app;
        self.frames += 1;
    }

    /// Builds the game's HUD.
    pub fn gameUi(self: *Game, app: *eggy.App, ui: *eggy.ui.Context) !void {
        _ = app;
        ui.label("Frames: {d}", .{self.frames});
    }
};

Built on its own libraries

We made our own libraries. Are they so good you wanna use them separately? Go ahead, be our guest...

  • vitellus

    Rendering hardware interface over Vulkan, DirectX 12 and WebGPU.

  • weeoui

    Immediate-mode UI with docking panels and screen-reader support. The editor, and this site's look, come from it.

  • humpty

    WIP physics engine

  • clutch

    Entity component system, inspired by bevy_ecs.

All eggy projects

Working on eggy itself

Clone the repository with its submodules, then run the editor:

git clone --recursive https://github.com/eggyengine/eggy
cd eggy
zig build run

On Linux, install the GTK3, DBus and libunwind headers first: libgtk-3-dev libdbus-1-dev libunwind-dev on Debian. zig build fetches everything else.

Pull requests written with an agent are welcome, as long as you can explain what yours does without looking at the code.