# Mix Park

Mix Park is a browser-based playground editor and play experience built with
SvelteKit and Three.js.

## Development

```sh
npm install
npm run dev
```

Use `npm test`, `npm run check`, and `npm run build` to validate changes.

## Controls

Editing is tap/click driven: pick a tool, tap the ground to place it, drag to
orbit, pinch or use the +/- buttons to zoom. The rotate button (or `R`) turns
the next placement a quarter turn; the eraser removes equipment, trees, or a
layer of land; the land block refills dug ground or stacks land on top.
`Ctrl`/`Cmd`+`Z` undoes and `Escape` leaves the character picker or play mode.

In play mode, use the on-screen joystick or WASD / arrow keys to walk, drag
the world (or enable device tilt) to look around, and walk into equipment to
use it.

## Privacy and browser storage

Mix Park has no accounts and does not send or persist game or user state on the
server. The browser is the only source of truth:

- `localStorage` key `mixpark-data-v2` stores the selected play character and,
  for each map, placed objects, removed trees, and terrain edits.
- Browser Cache Storage holds versioned application assets for PWA/offline use;
  it does not hold game state.
- Editor/play mode, current map, player and camera state, interactions, joystick
  input, and undo history are temporary in-memory state and reset when the page
  reloads. Mix Park currently has no score or separate progress state.
- Clearing a map updates its local save immediately. Clearing site data in the
  browser removes all saved Mix Park state and offline assets.

The retired server sync endpoint returns `410 Gone` without reading or storing
the request, allowing old clients to stop retrying cleanly.

Deployments upgrading from the sync-enabled version should delete any legacy
`.data/sync` directory or attached volume after applying their normal data
retention policy. The application no longer creates, reads, or writes it.

The app shell and built assets are cached by the service worker, allowing the
app and the locally saved maps to continue working without a network connection.

## Production build

```sh
npm run build
npm run preview
```
