game3d

command
v1.17.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: BSD-3-Clause Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command game3d is a small 3D game that uses the games work of Glutter 1.10 and 1.11 together (SPEC §27, §28): Coin Run. A character (a skinned glTF model, made with its skeleton and four animations by internal/genassets) runs and jumps through a small level (a glTF file too) in a viewport3d.View with PBR materials and a shadow, collects its twelve coins and keeps out of the lava. A pad (package gamepad: the left stick moves, the right stick looks, A jumps, Start pauses, and the D-pad and A drive the pause menu through the key events that pads make), the keyboard (WASD or the arrows, Space, Esc) and a locked mouse (a click in the view locks it; package widgets' PointerLock) all play it, and on a phone the touch does: drag on the left half to move, on the right half to look, and the round button jumps. The music and the sound effects are package audio streams, a hit makes the pad rumble, and the pause menu is Material. The view draws at every frame (Continuous).

Run it with: go run ./examples/game3d

It needs a GPU renderer (Vulkan, Direct3D 12 or WebGPU); with another one the view shows its fallback, a line of text.

On Windows: go run ./cmd/glutter-windows run ./examples/game3d. On the web: go run ./cmd/glutter-web serve ./examples/game3d. On Android: go run ./cmd/glutter-android run ./examples/game3d.

Environment: GLUTTER_BACKEND=x11|wayland (Linux) or win32 (Windows), GLUTTER_RENDERER=vulkan|d3d12|webgpu, GLUTTER_SCREENSHOT=<file.png>, GLUTTER_SCREENSHOT_AFTER=<duration>. In debug builds GLUTTER_DEV_GAME3D=proof puts the character on the second stepping stone with four coins picked up and the camera turned towards the level (the state of the proof pictures), and =paused shows the pause menu.

Directories

Path Synopsis
internal
genassets command
Command genassets writes the assets of examples/game3d: the character and the level as glTF binary files (.glb) and the music and the sound effects as WAV files.
Command genassets writes the assets of examples/game3d: the character and the level as glTF binary files (.glb) and the music and the sound effects as WAV files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL