- C 71.3%
- Zig 14.7%
- C++ 13.1%
- Assembly 0.3%
- GLSL 0.2%
- Other 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitea/workflows | ||
| .tmp_zig | ||
| .zig-cache | ||
| build | ||
| build_resources | ||
| docs | ||
| include | ||
| OLD | ||
| raylib_src | ||
| src | ||
| .gitignore | ||
| build.sh | ||
| build.zig | ||
| Makefile | ||
| MakefileMacOS | ||
| README.md | ||
| wrldbox | ||
| wrldboxMacOS | ||
WrldBox Engine
This project is the next major wholeworldcoding project.
🧊Introduction
WrldBox is a work-in-progress sandbox simulator made by Team wholeworldcoding. It is currently in a pretty developed experimental stage.
It consists of several components:
Engine spine
src/main.c, engine entry point — opens the window, target FPS 60, runs the scene manager every frame.src/scene.h/src/scene.c, theSceneinterface andSceneMgr(stack-based, deferred transitions, name-based registry). Seedocs/SCENE_API.md.src/scene-registry.h/src/scene-registry.c, the single place that knows about every scene. Add new scenes here, nowhere else.
Scenes
src/scenes/title.h/title.c,Scene_Title— title card. Any key / click → Platformer.src/scenes/platformer.h/platformer.c,Scene_Platformer— a simple 2D platformer (A/D + Space, three platforms, GOAL tile).P/ESCopens the pause overlay.src/scenes/pause.h/pause.c,Scene_Pause— overlay scene (dim layer, Resume + Quit-To-Title buttons).ESC/Presumes.src/scenes/devtest.h/devtest.c,Scene_DevTest— the original physics sandbox;ESCreturns to the title.
Changing scenes
Scenes never include each other. Switch by name from anywhere:
SceneMgr_ChangeTo("DevTest"); // swap to a scene
SceneMgr_PushOverlay("Pause"); // open one on top
SceneMgr_PopOverlay(); // close the top
SceneMgr_ResetTo("Title"); // jump straight to Title from anywhere
New to scenes? See
docs/HOW_TO_MAKE_A_SCENE.md for a
beginner-friendly, no-jargon walkthrough with copy-pasteable templates.
Sandbox modules
-
src/world.h/world.c, ownsentities[],player,simTime,isSimulating,SpawnEntity/InitWorld/ClearWorld. -
src/physics.h/physics.c,F = maintegration, drag, friction, ground bounce (exposesUpdateEntities). -
src/render.h/render.c, entity rectangles + velocity debug line (exposesDrawEntities). -
src/player.h/player.c, A/D movement, SPACE jump (exposesUpdatePlayerControls). -
src/collision.h/collision.c, O(n²) AABB collision + ground push. -
OLD contains the original logic this came from.
🛠️ Build and Compile
Clone the repository. Once you have navigated to the folder, you can run:
makeon linux (compilessrc/main.c,src/scene.c, allsrc/scenes/*.c, the sandbox modules, and the bundled raylib sources into./wrldbox)- copy in the command in
MakefileMacOSfor MacOS - And cry if your developing on windows
To make a final build you need to be on a Apple Silicon Mac currently(was written for it for now) run these two things:
-chmod +x build.sh
to make it executable, then:
-./build.sh
build.sh builds every scene linked into the matrix. When you add a new
scene you only need to touch Makefile, MakefileMacOS, build.sh, and
the .files array of build.zig — see
docs/SCENE_API.md.
🎬 Scenes
The engine boots into Scene_Title. From there any key / click transitions
to Scene_Platformer (a simple platformer that uses the pause overlay).
ESC returns to the title. The Scene_DevTest physics sandbox is also
registered and reachable via SceneMgr_ChangeTo("DevTest") from any
scene.
Adding more screens is intentionally painless: write a new
src/scenes/*.c file, register it in src/scene-registry.c, add the
file to the Makefile, and any other scene can reach it with one line —
SceneMgr_ChangeTo("<Name>"). See
docs/HOW_TO_MAKE_A_SCENE.md.
🏅Credits
This project was impossible without the support of all four wholeworldcoding members.