How meghana-m-revankar/piggy-bank-toy works
Piggy Bank Toy is a small browser-based interactive game: the player drops coins into a piggy bank, fills it to 20, watches the hammer smash it, then restarts. The React app owns input handling, game state, animation, and canvas drawing; it invokes a small synthesized-sound module for interaction and impact effects. The README documents the fill limit, smash, and restart; the sampled code shows those behaviors within one app module, so they are not represented as separate cooperating modules.
Main entry points: App.tsx Piggy bank toy · audio.ts Synthesized sounds · main.tsx React bootstrap
Components 5
Toy application
- React bootstrap
src/main.tsx - Piggy bank toy
src/App.tsx
Audio effects
- Synthesized sounds
src/audio.ts
Other components
- Player
- Browser APIs
Connections 5
- React bootstrap → Piggy bank toy: renders
src/main.tsx - Player → Piggy bank toy: interacts
src/App.tsx - Piggy bank toy → Synthesized sounds: triggers effects
src/App.tsx - Piggy bank toy → Browser APIs: uses canvas and events
src/App.tsx - Synthesized sounds → Browser APIs: uses Web Audio
src/audio.ts