An open API service indexing awesome lists of open source software.

https://github.com/deadronos/planet-life-3d

A 3D Conway-style cellular automaton that runs on a lat/lon grid wrapped onto a planet. Click the planet to shoot a meteor. On impact it seeds the grid using a configurable pattern.
https://github.com/deadronos/planet-life-3d

Last synced: 3 months ago
JSON representation

A 3D Conway-style cellular automaton that runs on a lat/lon grid wrapped onto a planet. Click the planet to shoot a meteor. On impact it seeds the grid using a configurable pattern.

Awesome Lists containing this project

README

          

# Planet Life 3D (Conway on a Sphere)

A 3D Conway-style cellular automaton that runs on a lat/lon grid wrapped onto a planet.
Click the planet to shoot a meteor. On impact it seeds the grid using a configurable pattern.

## Demo Screenshot

![screenshot](image.png)

## Run

```bash
npm install
npm run dev
```

## Controls

- Orbit with mouse (right drag to pan, wheel zoom).
- Click the planet to fire a meteor at the clicked spot.
- Tune grid/rules/speed/meteor + seeding parameters via the Leva UI.

## Testing

- Run the test suite: `npm run test`
- Run in watch mode: `npm run test:watch`
- Open the Vitest UI: `npm run test:ui`

## Pre-commit hook (automatic formatting)

This repo uses lint-staged to automatically format and lint staged files before commit. A lightweight git hook lives in `.githooks/pre-commit` and runs `npm run format:staged` for JS/TS and other file types.

- Run `npm install` to install dependencies and configure the hook (the `postinstall` script runs `npm run install:hooks`).
- To install hooks manually, run `npm run install:hooks`.
- To format staged files manually, run `npm run format:staged`.

If you prefer not to use the hook, unset your local git hooks path with `git config --unset core.hooksPath`.

## Deployment

The site is deployed to GitHub Pages when a new tag starting with `v` is pushed (for example `v1.0.0`). The Actions workflow `\.github/workflows/deploy-pages.yml` builds the project and deploys the `dist` output using Node.js 20.x and the official GitHub Actions for Pages (`actions/configure-pages@v5`, `actions/upload-pages-artifact@v4`, `actions/deploy-pages@v4`).

To test the build locally before tagging, run:

```bash
npm install
npm run build
```