wwc's sandbox game
  • C 71.3%
  • Zig 14.7%
  • C++ 13.1%
  • Assembly 0.3%
  • GLSL 0.2%
  • Other 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-07 21:28:49 -04:00
.gitea/workflows fully fixed and skips windows because we dont have a windows runner 2026-06-26 23:55:04 -04:00
.tmp_zig added multi-compiling stuff (only works on my mac for now) 2026-06-28 16:40:20 -04:00
.zig-cache fixed a lot of stuff 2026-08-07 21:28:49 -04:00
build fixed a lot of stuff 2026-08-07 21:28:49 -04:00
build_resources build update(mostly ai) 2026-06-28 17:36:09 -04:00
docs Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
include very bad collision(work in progress) 2026-06-22 01:29:58 -04:00
OLD very bad collision(work in progress) 2026-06-22 01:29:58 -04:00
raylib_src added multi-compiling stuff (only works on my mac for now) 2026-06-28 16:40:20 -04:00
src fixed a lot of stuff 2026-08-07 21:28:49 -04:00
.gitignore very bad collision(work in progress) 2026-06-22 01:29:58 -04:00
build.sh Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
build.zig Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
Makefile Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
MakefileMacOS Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
README.md Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
wrldbox Added dynamic scene system, plus more fun sample code. Press tilde for the old devtest. Added docs in /docs. MAJOR update. 2026-07-11 15:44:46 -04:00
wrldboxMacOS fixed a lot of stuff 2026-08-07 21:28:49 -04:00

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, the Scene interface and SceneMgr (stack-based, deferred transitions, name-based registry). See docs/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 / ESC opens the pause overlay.
  • src/scenes/pause.h / pause.c, Scene_Pause — overlay scene (dim layer, Resume + Quit-To-Title buttons). ESC / P resumes.
  • src/scenes/devtest.h / devtest.c, Scene_DevTest — the original physics sandbox; ESC returns 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, owns entities[], player, simTime, isSimulating, SpawnEntity / InitWorld / ClearWorld.

  • src/physics.h / physics.c, F = ma integration, drag, friction, ground bounce (exposes UpdateEntities).

  • src/render.h / render.c, entity rectangles + velocity debug line (exposes DrawEntities).

  • src/player.h / player.c, A/D movement, SPACE jump (exposes UpdatePlayerControls).

  • 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:

  • make on linux (compiles src/main.c, src/scene.c, all src/scenes/*.c, the sandbox modules, and the bundled raylib sources into ./wrldbox)
  • copy in the command in MakefileMacOS for 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.