https://github.com/brianruggieri/dog-playground
Interactive dog playground with pan/zoom canvas, throw-toy physics, and autonomous dog behavior.
https://github.com/brianruggieri/dog-playground
browser-game casual-game css dog dog-playground game-development html5 html5-canvas javascript physics playground simulation vanilla-javascript web-game
Last synced: 4 months ago
JSON representation
Interactive dog playground with pan/zoom canvas, throw-toy physics, and autonomous dog behavior.
- Host: GitHub
- URL: https://github.com/brianruggieri/dog-playground
- Owner: brianruggieri
- License: mit
- Created: 2026-02-23T15:49:40.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-05T20:30:36.000Z (4 months ago)
- Last Synced: 2026-03-05T21:46:28.759Z (4 months ago)
- Topics: browser-game, casual-game, css, dog, dog-playground, game-development, html5, html5-canvas, javascript, physics, playground, simulation, vanilla-javascript, web-game
- Language: JavaScript
- Homepage: https://brianruggieri.github.io/dog-playground/
- Size: 21.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dog Playground

A standalone extraction of the GardenCraft dog wander + throw-toy interaction.
## Scope
This project intentionally keeps only:
- Large pan/zoom canvas using the original world dimensions.
- Background texture selector and textured grid rendering.
- Dog wandering/chasing behavior.
- Drag-to-throw toy physics (ball, frisbee, bone).
- Small control panel.
Everything unrelated to this interaction (garden beds, plants, AI providers, layout generation) is removed.
## Screenshots
Desktop drag line (sand + frisbee):

Bone chase (tile + bone):

### Mobile
Touch drag (dirt + ball):

## Architecture
The code is organized so dogs and toys are easy to extend:
- `src/catalog/dogs.js`: dog registry with `registerDog`.
- `src/catalog/toys.js`: toy registry with `registerToy`.
- `src/engine/physics.js`: pure toy launch and toy motion physics.
- `src/engine/dogBehavior.js`: dog target selection and frame/orientation logic.
- `src/main.js`: UI wiring, render loop, and controls.
## Run
```bash
source ~/.nvm/nvm.sh && nvm use
npm test
npm run dev
# fallback when portless is unavailable
npm run dev:plain
```
## Controls
- Drag (left mouse / one-finger touch): throw toy.
- Space or middle-mouse drag: pan canvas.
- Wheel: scroll-pan.
- Ctrl/Cmd + wheel: zoom.
- Escape: cancel active throw drag.
## Extending Dogs
Add or register new entries with frame assets and movement settings in `src/catalog/dogs.js`.
## Extending Toys
Add or register new entries with image + launch/physics profiles in `src/catalog/toys.js`.
## Asset Workflow
- Default source policy: assets are AI-generated with ChatGPT image generation tools.
- When adding/updating images in `public/backgrounds`, `public/dogs`, or `public/toys`:
1. Add/update WebP primary files and PNG backup files with matching filenames.
2. Run `npm run assets:manifest`.
3. Run `npm run assets:check`.
- CI enforces this via the `Asset Compliance` workflow.
## Hero Image
The README hero is generated from `public/readme/hero.template.html` + `public/readme/hero.config.json`.
Regenerate:
```bash
source ~/.nvm/nvm.sh && nvm use
npm run hero:render
```
## Future Expansion Notes
- AI-driven dog generation can write new dog definitions + generated sprite references.
- New toy types can be added without changing core physics loop.
- Interactions like petting/commands can attach to the dog behavior module without changing rendering or toy physics.
## Deployment (GitHub Pages)
- `Deploy GitHub Pages` workflow publishes `dist/` on pushes to `main`.
- In repo settings, set **Pages -> Source** to **GitHub Actions**.
## Versioning
- This repo uses Semantic Versioning with tags (`vX.Y.Z`).
- Use the `Release Version` workflow to bump `patch`, `minor`, or `major`.
- Full guide: `VERSIONING.md`.
## Licensing
- Code license: `LICENSE` (MIT).
- Visual asset license: `LICENSE-ASSETS` (CC BY 4.0).
- AI-generated visual asset provenance and per-file manifest:
- `ASSET_PROVENANCE.md`
- `ASSET_MANIFEST.json`