No description
  • TypeScript 79.3%
  • CSS 11.6%
  • HTML 5.3%
  • JavaScript 3.3%
  • Dockerfile 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Grok Bot 74c98b5813
All checks were successful
build / image (push) Successful in 24s
Let shots hit any cube in sight and pack the levels tighter
Cubes share faces, the camera can orbit underneath, and each level has at least a thousand cubes. The tray shows only the front two shooters. Front fire explains itself on hover or tap. Side and back cubes you can see are shootable; buried cubes stay grey until a path opens.
2026-11-29 09:29:10 -05:00
.forgejo/workflows Workflow: registry push is optional (needs REGISTRY_TOKEN secret) 2026-11-28 21:37:03 -05:00
docs Let shots hit any cube in sight and pack the levels tighter 2026-11-29 09:29:10 -05:00
e2e Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
levels Let shots hit any cube in sight and pack the levels tighter 2026-11-29 09:29:10 -05:00
public Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
scripts Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
src Let shots hit any cube in sight and pack the levels tighter 2026-11-29 09:29:10 -05:00
tests Let shots hit any cube in sight and pack the levels tighter 2026-11-29 09:29:10 -05:00
.dockerignore Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
.gitignore Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
AGENTS.md Let shots hit any cube in sight and pack the levels tighter 2026-11-29 09:29:10 -05:00
docker-compose.yml Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
Dockerfile Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
editor.html Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
index.html Let shots hit any cube in sight and pack the levels tighter 2026-11-29 09:29:10 -05:00
LICENSE Add the MIT License from the Forgejo repo creation 2026-11-28 21:29:18 -05:00
nginx.conf Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
package-lock.json Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
package.json Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
README.md Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
tsconfig.json Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00
vite.config.ts Cube Smash: three.js voxel puzzle with levels, endless mode and level editor 2026-11-28 18:59:13 -05:00

Cube Smash

A browser take on the "Cube Smash" voxel colour-matching puzzle, minus the pay-to-win parts: no ads, no coins, no lives, no shop, no paid slots, no timer.

Tap the front shooter of a column. It flies into one of 5 slots and fires at exposed cubes of its colour until its count runs out. If every slot fills up with shooters that have nothing to hit, you lose. Clear the model to win.

  • Three.js 3D voxel models: drag to rotate, pinch or scroll to zoom
  • 13 hand-made levels, ramping from tutorial to hard (hidden shooters, front-only exposure, buried colours)
  • Endless mode: procedural waves that get bigger and harder, every one checked solvable as it's generated
  • Synth sound effects (WebAudio) with a mute toggle that persists; progress is saved in localStorage
  • Works on iPhone Safari in portrait and on desktop (keys 1–6 tap columns, R restarts)
  • Level editor at /editor.html, plus JSON level files, a validator and a tuner. See docs/LEVELS.md

Run it

npm ci
npm run dev            # http://localhost:5173  (editor: /editor.html)
npm run build          # static site in dist/
npm run preview        # serve dist/

Handy URLs: ?level=7 or ?level=penguin, ?mode=endless&seed=42&wave=5, ?speed=4 (faster animations, for testing).

Checks

npm run typecheck
npm test                       # vitest: exposure rules, engine, solver, generator, every level
npm run validate-levels        # every level: schema, counts, solvable, difficulty
npm run validate-levels -- --endless 20   # also endless waves 1..20
npm run e2e                    # after build: headless Chrome plays levels to a win and takes screenshots

e2e uses playwright-core with a system Chrome (CHROME=/path/to/chrome, by default /usr/bin/google-chrome). Screenshots go to e2e/screenshots/.

Docker

docker build -t cube-smash .
docker run --rm -p 8080:80 cube-smash      # http://localhost:8080
# or
docker compose up -d --build

Multi-stage: node:lts-alpine installs, validates the levels, runs the tests and builds; nginx:alpine serves dist/ on port 80 with long-cache hashed assets, a /healthz endpoint and a container healthcheck.

CI: Forgejo

.forgejo/workflows/build.yml runs on the docker runner (container node:lts) and talks to the forgejo-dnd Docker-in-Docker daemon at tcp://10.10.10.3:2375, like zone-planner's release workflow. On every push to main and every v* tag it builds:

  • cube-smash:sha-<short sha> (or cube-smash:<tag> for tags)
  • cube-smash:latest

It then runs the image once to smoke-test it. Images stay on the DinD daemon. There's no registry push, no deploy step and no secrets. Add those when you want them.

Layout

src/core/      engine (rules, exposure), solver, shooter generator, level parsing, .vox, procedural endless
src/game/      the game: renderer (three.js), UI controller, audio, storage
src/editor/    level editor
levels/        level JSON files + index.json (order)
scripts/       validate-levels, tune-level, format-levels
tests/         vitest unit tests
e2e/           headless playthrough + screenshots
docs/LEVELS.md how to make levels

Fonts: Fredoka and Nunito (SIL OFL, see src/assets/fonts/LICENSE.txt).