# πŸ• Animal System & Emotional Memories Created: January 20, 2026 ## Overview Emotional storytelling system where proximity to domestic animals triggers Kai's memories of his family, displayed through a pulsating heart UI element. ## Structure ``` assets/slike/animals/ β”œβ”€β”€ wild/ # Wild animals (hostile/neutral) β”œβ”€β”€ domestic/ # Domestic animals (trigger memories) └── infected/ # Infected animals (hostile) ``` ## Components ### 1. Animal Entity (`src/entities/Animal.js`) - Proximity detection (150px for domestic, 100px for others) - Type system: wild, domestic, infected - Memory trigger system - Event emission for UI ### 2. Memory Heart UI (`src/ui/MemoryHeartUI.js`) - Pulsating heart icon animation - Slovenian text: "SpominjaΕ‘ se..." - Heartbeat sound effect (optional) - Smooth fade in/out transitions ### 3. GameScene Integration - Auto-loads heart icon and heartbeat sound - Creates MemoryHeartUI instance - Updates all animals each frame - Example domestic dog at (600, 600) ## How It Works 1. **Player approaches domestic animal** (within 150px) 2. **Animal.js emits** `animal:memory_triggered` event 3. **MemoryHeartUI** receives event and shows pulsating heart 4. **Heart animation** plays with scale + alpha tweens 5. **Optional heartbeat sound** plays in loop 6. **Player moves away**, heart fades out ## Emotional Impact When Kai sees a domestic dog, he remembers: - His family's pet before the outbreak - Happier times - What he lost This creates a powerful emotional moment without dialogue. ## Usage ### Add a new animal: ```javascript const dog = new Animal(this, x, y, 'dog_sprite', 'domestic'); dog.animalName = 'Rex'; this.animals.push(dog); ``` ### Event listening: ```javascript this.events.on('animal:memory_triggered', (data) => { console.log(`Memory triggered by: ${data.animal.animalName}`); }); ``` ## Assets Needed - βœ… Heart icon: `assets/slike/items/ui/*heart*.png` - βœ… Heartbeat sound: `assets/audio/_NEW/369017__patobottos__heartbeats-61.wav` - ⏳ Dog sprites: Add to `assets/slike/animals/domestic/` - ⏳ Wild animal sprites: Add to `assets/slike/animals/wild/` - ⏳ Infected animal sprites: Add to `assets/slike/animals/infected/` ## Future Enhancements - Different memory types (family, friends, places) - Memory flashbacks (cutscenes) - Animal interaction system (pet, feed, etc.) - Memory collection/journal system