Updated sprites and pet logic
This commit is contained in:
37
README.md
37
README.md
@@ -8,7 +8,7 @@ The first pass includes:
|
||||
- idle, wander, sleep, cursor-chase, and toy-chase behavior
|
||||
- bounded toy spawning with cooldowns
|
||||
- lightweight per-pane overlay rendering
|
||||
- external cat sprite frames with state transitions between major behaviors
|
||||
- external cat sprite assets with state transitions between major behaviors
|
||||
|
||||
## Install locally during development
|
||||
|
||||
@@ -24,7 +24,11 @@ module.exports = {
|
||||
maxToys: 1,
|
||||
toyCooldownMs: 20000,
|
||||
successToyChance: 0.35,
|
||||
walkSpeed: 0.65
|
||||
walkSpeed: 0.45,
|
||||
animationSpeed: 0.5,
|
||||
sleepMinDurationMs: 30000,
|
||||
sleepMaxDurationMs: 180000,
|
||||
debugFrames: false
|
||||
}
|
||||
},
|
||||
localPlugins: [
|
||||
@@ -50,7 +54,11 @@ hyperPets: {
|
||||
toyCooldownMs: 20000,
|
||||
successToyChance: 0.35,
|
||||
chaseCursorChance: 0.04,
|
||||
walkSpeed: 0.65,
|
||||
walkSpeed: 0.45,
|
||||
animationSpeed: 0.5,
|
||||
sleepMinDurationMs: 30000,
|
||||
sleepMaxDurationMs: 180000,
|
||||
debugFrames: false,
|
||||
reducedMotion: false,
|
||||
onlyActivePane: true
|
||||
}
|
||||
@@ -60,11 +68,30 @@ hyperPets: {
|
||||
|
||||
- Command-success toy spawning currently uses a prompt-return heuristic from terminal output, not shell integration.
|
||||
- The plugin is intentionally conservative so it does not flood panes with toys or constant motion.
|
||||
- The current animation system uses asset manifests under `assets/pets/`, with only `cat` shipped right now. The loader is generic so additional pet types can be added later without changing behavior logic.
|
||||
- The current animation system uses asset manifests under `assets/pets/`. `cat` is currently aliased to the Maple sprite sheet so existing configs keep working.
|
||||
|
||||
## Asset Pipeline
|
||||
|
||||
- Cat frames live in `assets/pets/cat/frames/*.svg`.
|
||||
- The cat manifest in `assets/pets/cat.js` maps clips and transitions to those frame files.
|
||||
- The renderer reads the SVG files once at startup and swaps them by animation clip at runtime.
|
||||
- Maple lives in `assets/pets/maple/` and is wired as a sprite-sheet asset through `assets/pets/maple.js`.
|
||||
- The renderer supports both individual SVG frames and sprite-sheet cells behind the same clip API.
|
||||
- To add a new pet type later, create another manifest under `assets/pets/` plus a matching frame directory, then register it in `assets/pets/index.js`.
|
||||
|
||||
## Sheet Tools
|
||||
|
||||
- Split a uniform sheet into per-frame PNGs:
|
||||
|
||||
```bash
|
||||
bash scripts/split_sprite_sheet.sh assets/pets/maple/spritesheet.webp 192 208 assets/pets/maple/frames maple
|
||||
```
|
||||
|
||||
- Stitch a frame directory back into a sheet:
|
||||
|
||||
```bash
|
||||
bash scripts/stitch_sprite_sheet.sh assets/pets/maple/frames 8 9 /tmp/maple-sheet.png maple
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
- Set `hyperPets.debugFrames` to `true` to show the active clip, frame number, facing direction, sprite-sheet row/column, and a rolling history of the last 5 displayed frames beside each pet.
|
||||
|
||||
Reference in New Issue
Block a user