Skip to content

Repository files navigation

Pixel World

CI Deploy GitHub Pages

Pixel World is an open-source browser ecology sandbox where frogs and snakes move, hunt, reproduce, inherit traits, remember danger, and sometimes collapse the whole ecosystem.

Play now: hubertlim.github.io/pixel_world

Pixel World running in the browser

Why Star It

  • It is a tiny artificial-life playground you can open instantly in a browser.
  • Simple rules create visible emergent behavior: population booms, starvation, predator pressure, territorial clusters, and lineage survival.
  • The whole project is TypeScript, Vite, Canvas, and local browser storage. No backend, no account, no tracking.
  • The roadmap is intentionally contributor-friendly: scenarios, event logs, family trees, replayable seeds, new species, and better mobile controls.

If you like small simulations, creative coding, open-source browser games, or artificial life experiments, a star helps more people find the project.

Current Highlights

  • Full-viewport pixel world rendered on canvas.
  • Frogs and snakes with energy, aging, reproduction, hunting, starvation, and death.
  • Inherited traits with mutation: speed, sense, boldness, fertility, and metabolism.
  • Agent memory for food, danger, and kill events.
  • Per-agent goals, home cells, generations, and parent lineage.
  • Terrain painting for land, water, rock, and food.
  • Live behavior cards for tuning frog and snake priorities.
  • Population history chart and overlays for population, danger, food, habitat, and territory.
  • Browser save/load plus JSON export and import.
  • Retro CRT presentation layer with compact in-world controls.

Try This First

  1. Open Pixel World.
  2. Click Scenario.
  3. Switch overlays between Risk, Food, and Home.
  4. Inspect a creature and watch its traits, memory, home, and generation.
  5. Copy the URL to share that seeded scenario.
  6. Tune the frog or snake behavior card and see whether the ecosystem survives longer.

Controls

Input Action
1 Frog tool
2 Snake tool
3 Water tool
4 Rock tool
5 Land tool
6 Food tool
I Inspect tool
Space Pause or resume
Left click Paint, place, or inspect
Right click Remove creature or erase terrain

Good First Ideas

These are intentionally small, visible, and fun:

  • Add more starter scenarios: snake invasion, island survival, food collapse, frog boom.
  • Add an event ticker for births, deaths, hunts, mutations, and extinctions.
  • Add named save slots instead of one browser save.
  • Add a family tree view for selected lineages.
  • Improve mobile controls for behavior cards, overlays, and inspection.
  • Add exportable screenshots for sharing a world state.

Open an issue with an idea, or pick something from the roadmap.

Run Locally

npm install
npm run dev

Then open http://localhost:5173.

Docker also works:

docker compose up --build web

Verification

npm run check
npm run build

Project Structure

src/main.ts       simulation logic and UI wiring
src/styles.css    visual identity and layout
index.html        app shell
ROADMAP.md        planned simulation and agent milestones
docs/             launch and community materials

Roadmap

The project roadmap lives in ROADMAP.md. The short version:

  • Make the ecology sandbox more replayable and easier to share.
  • Make individual agents feel more alive through memory, lineages, relationships, and territory.
  • Keep the project small enough that contributors can understand it and safely add weird ideas.

Contributing

Contributions are welcome, especially around simulation behavior, scenarios, UI polish, mobile usability, docs, and issue triage.

Start with CONTRIBUTING.md. For quick community-facing tasks, see docs/LAUNCH_TODAY.md.

Tech Stack

  • TypeScript
  • Vite
  • HTML Canvas
  • Browser localStorage
  • GitHub Actions
  • GitHub Pages

License

MIT. See LICENSE.

About

Open-source pixel ecology sandbox where frogs and snakes evolve, remember danger, mutate traits, and create tiny ecosystem chaos.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages