A fun, nostalgic pixel-art style Tamagotchi-inspired virtual pet game built with React, TypeScript, Tailwind CSS, and Framer Motion.
live: https://pixel-pet-six.vercel.app/
# Install dependencies
npm install
# Start development server (opens on localhost:3000)
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview✨ Core Gameplay
- Adopt one of 4 cute pixel pets (Cat, Dog, Dragon, Robot)
- Keep your pet alive by managing Hunger, Happiness, and Health stats
- Real-time stat decay every 30 seconds
- Stats persist in localStorage (survives page refresh)
🎮 Actions
- Feed: Reduce hunger, boost happiness
- Play: Fight mini-game to increase happiness
- Heal: Restore health when pet is sick
- Sleep: Pet rests and restores health
🌟 Features
- 5 pet states with unique animations (Happy, Hungry, Sick, etc.)
- Level up system based on care quality
- Evolution mechanic at level 3 (evolved pet form)
- Death screen with restart option
- Mini-game: Ball throwing challenge
- Smooth animations with Framer Motion
- Mobile-responsive design
- Dark mode by default with retro pixel aesthetic
- Framework: React 18 + TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Animations: Framer Motion
- Icons: Lucide React
- State: React Hooks (useState, useEffect)
- Storage: Browser localStorage
src/
├── components/
│ ├── AdoptScreen.tsx # Initial pet selection
│ ├── PetDisplay.tsx # Animated pet display
│ ├── StatsBar.tsx # Hunger, Happiness, Health, Level
│ ├── ActionButtons.tsx # Feed, Play, Heal, Sleep actions
│ ├── MiniGame.tsx # Ball throwing mini-game
│ └── DeathScreen.tsx # Game over screen
├── hooks/
│ └── usePet.ts # Core game logic + localStorage persistence
├── App.tsx # Main app component
├── main.tsx # React entry point
└── index.css # Tailwind + custom animations
Config Files:
├── vite.config.ts
├── tailwind.config.ts
├── tsconfig.json
├── postcss.config.js
└── index.html
- First Visit: Choose your pet and give it a name
- Main Screen: Monitor stats and use action buttons
- Keep Alive:
- Act before hunger reaches 100 or health hits 0
- Maintain happiness by playing often
- Click "Sleep" to restore health
- Level Up: With good care, reach level 3 for evolution
- Game Over: Death screen appears if pet dies (can restart)
{
id: "pet_id",
name: "Pet Name",
type: "cat" | "dog" | "dragon" | "robot",
level: 1-5,
hunger: 0-100,
happiness: 0-100,
health: 0-100,
lastUpdated: timestamp,
isSleeping: boolean,
isPlayingGame: boolean,
evolved: boolean
}See VERCEL_DEPLOYMENT.md for complete Vercel deployment instructions.
TL;DR:
- Push to GitHub
- Connect to Vercel
- Deploy (automatic on every push)
- Stats decay every 30 seconds (configurable in
usePet.ts) - Mini-game duration: 10 seconds
- Level up requires well-balanced stats (low hunger + high happiness/health)
- All data is client-side only (no backend needed)
- Works offline after first load
- Chrome/Edge: ✅ Full support
- Firefox: ✅ Full support
- Safari: ✅ Full support
- Mobile browsers: ✅ Mobile-responsive
Free to use and modify!
Enjoy your Pixel Pet! 🎮✨