Ask your agent
What it does
You get plain steps for installing, running, tuning, building, and deploying Papertrails. It points to the right files and URL settings, and includes checks for common problems.
SKILL.md
--- name: "papertrails" description: "Use when setting up, running, building, tweaking or deploying Papertrails, the Three.js pop-up-book walking game from github.com/xikhar/papertrails." --- # Papertrails Papertrails is a browser walking toy: a paper traveller walks across an endless pop-up book world. It is plain JavaScript (ES modules) with Three.js for 3D and Vite for dev/build. No framework, no backend. Repo: https://github.com/xikhar/papertrails (single branch: main) Live build: https://xikhar.github.io/papertrails/ The user is not a developer. Explain steps in plain words, run commands for them where possible, and keep changes small and testable. ## Set up and run 1. Get the code: `git clone https://github.com/xikhar/papertrails.git` (or unzip a copy). 2. `cd papertrails && npm install` (needs Node 20+). 3. `npm run dev` then open http://127.0.0.1:5273 4. Production build: `npm run build` (outputs to `dist/`), then `npm run preview` to check it at http://127.0.0.1:4273 Ports and build settings live in `vite.config.js`. `base: './'` keeps the build working from any subfolder (needed for GitHub Pages). ## URL parameters (no code changes needed) Add these to the address bar, e.g. `http://127.0.0.1:5273/?seed=42&night=1` - `seed=N` different world layout (default 7) - `quality=low|med|high` graphics level (default high; use low on weak laptops) - `mute=1` start muted - `hint=0` hide the controls hint - `night=1` start at night - `life=0` turn off ambient life and weather (leaves, snow, birds, smoke, fireflies) - `animals=0` turn off animals ## Keyboard The controls live in `src/player/controls.js`. Keys handled there include V (cycle camera views), M, N, E, Tab, Escape, +/- (zoom), Shift and Control. Read that file before telling the user what a key does, since bindings can change. ## Where things live - `src/main.js` composition root: reads URL params and wires every system together - `src/core/config.js` aggregates all tunables from `src/core/config/*.js` - `shared.js` tile size, reveal radius, default seed and quality - `world.js` world and book layout - `wfc.js` wave-function-collapse tile generation rules - `fold.js` pop-up fold spring physics - `player.js` traveller speed and camera - `render.js` palette, lights, depth of field, post effects, QUALITY presets - `audio.js` sound and music - `life.js`, `animals.js` ambient life and animals - `game.js` collectibles and progress (scraps, lanterns) - `assets.js` model and texture loading - `src/world/` world generation (`wfc.js`, `world.js`, `book.js`, `fold.js`, `tiles.js`) - `src/player/` traveller and controls - `src/camera/` follow camera and views - `src/render/` renderer, materials, lights, water, post-processing, day/night - `src/audio/` paper sound effects and music - `src/life/` ambient life and animals - `src/game/` scraps, lanterns, atlas map, progress - `public/models/` `tiles.glb`, `traveller.glb`, `assets_meta.json` - `public/textures/` `paper/`, `art/`, `manifest.json` ## Making changes - For tuning (speed, colours, fog, how far the world reveals, animal counts), edit the matching file in `src/core/config/` first. It is the safest place and needs no logic changes. - Keep `npm run dev` running: Vite hot-reloads on save. After each change, check the browser and its console for errors. - For bigger changes, read the relevant module first and change one system at a time. - Before calling a change done, run `npm run build` to be sure it compiles. ## Deploying `.github/workflows/pages.yml` builds and publishes to GitHub Pages on every push to `main` (`npm ci`, `npm run build`, upload `dist`). To publish your own copy, fork the repo, enable Pages with "GitHub Actions" as the source in the fork's settings, and push to main. ## Troubleshooting - Blank screen: open the browser console. It is usually a missing asset path or a JS error after an edit. - Slow or laggy: use `?quality=low`, or lower settings in the QUALITY presets in `config/render.js`. - Port in use: change the port in `vite.config.js`. - `npm install` fails: check the Node version (`node -v`).
1 file
- SKILL.md4.0 KB