example-signal-garden

Signal Garden

Fly a small survey rover around a floating field station and recover three lost signals. Drag anywhere in the garden to steer. Fly close to a crystal or release the drag and tap Pulse to collect it from farther away. The radar marks the active signal in amber and the rover in white. Camera switches between perspective and orthographic views. Settings controls the beacon light and console theme and can reset the run.

The game is two world plugins on one World. Station (station.cr) owns the 3D hierarchy: a skinned glTF rover with a Rover component, procedural and instanced geometry, the billboard companion and the captured display on the arch. Its fixed-step systems take Pulse, ToggleProjection, ToggleBeacon and Reset requests. Console (console.cr) is the UI::Plugin HUD. It embeds the station through View3D and uses styled controls with animated paint, a modal, toasts and semantic roles. On iOS, ios.cr is World.new + App::IOS + world.run on the shared UIKit host, and Garnet::Text::SystemFont (text-system) shapes the system font through Core Text. desktop.cr runs the same plugins in an AppKit Metal window (desktop-metal) or a GLFW window on OpenGL (desktop-gl) or Vulkan (desktop-vulkan).

Build on Windows

From a Visual Studio 2022 Developer prompt with Crystal 1.19.1, GNU make, GLFW 3.4 (lib-vc2022 on CRYSTAL_LIBRARY_PATH) and the vcpkg ports harfbuzz[core], fribidi and libunibreak (x64-windows; lib on CRYSTAL_LIBRARY_PATH, bin on PATH). Text uses Segoe UI from %WINDIR%\Fonts.

garnet build --target desktop-gl       # or desktop-vulkan, with the Vulkan SDK
.garnet/build/desktop-gl-debug/SignalGarden.exe

The windows CI job builds both targets and renders them on Mesa's llvmpipe and lavapipe.

Build for an arm64 iPhone

Install Xcode, CMake and Crystal. Point the build at an extracted bdwgc source tree and run it from the workspace root.

GARNET_IOS_GC_SOURCE=/path/to/bdwgc scripts/build-ios-example signal_garden /tmp/signal-garden

The app targets iOS 18 or later. The first build downloads FriBidi 1.0.16, libunibreak 6.1 and PCRE2 10.44 (each checked against a recorded SHA-256), and cross-compiles them and Yoga into the output directory. To use your own FriBidi or libunibreak trees, set GARNET_IOS_FRIBIDI_SOURCE or GARNET_IOS_UNIBREAK_SOURCE. The Yoga, FriBidi and libunibreak archives go in the output's ui-libs directory. To reuse those archives, pass their directory as GARNET_IOS_UI_LIBS on later builds. Sign the app with a development certificate and a provisioning profile for the device.

The --smoke launch argument runs a scripted session through App::Capture. It drags on the stage and taps the buttons through Input::Devices, then checks collection, pulse, the camera switch and the settings modal. It reads back the presented frame and saves it as Documents/frame-00090.png in the app container. crystal spec engine/spec/signal_garden_spec.cr runs the same session headlessly.

Repository

example-signal-garden

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • about 1 hour ago
  • November 30, 2026
License

Links
Synced at

Fri, 04 Dec 2026 02:42:23 GMT

Languages