An interactive, animated puzzle game built with Next.js, React, TypeScript, Tailwind CSS, and Framer Motion.
A classic river crossing puzzle where you must safely transport 3 sheep and 3 lions across a river using a boat.
- Starting Position: All animals start on the LEFT side
- Goal: Move all 6 animals to the RIGHT side
- Boat Capacity: The boat can carry 1-2 animals at a time
- Critical Rule: Lions must NEVER outnumber sheep on either side of the river (unless there are no sheep on that side)
- Win Condition: Successfully move all 6 animals to the RIGHT side
- Lose Condition: If lions outnumber sheep on either side, the sheep get eaten - Game Over!
- Drag & Drop: Drag animals from land into the boat
- Load Boat: Add 1-2 animals to the boat (from the side where the boat is located)
- Move Boat: Click "Move Boat" button to cross the river
- Unload: Boat automatically unloads animals when it reaches the other side
- Plan Ahead: Think carefully about each move to avoid the sheep being eaten!
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- Animations: Framer Motion
- Icons: Custom SVG components
- Real-time drag & drop gameplay
- Smooth animations with Framer Motion
- Mobile responsive design
- Visual feedback for invalid moves
- Win/Loss modal animations
- Animated river waves
- Floating boat animation
- Custom SVG animal icons
src/
├── app/
│ └── page.tsx # Main game component
├── components/
│ ├── SheepIcon.tsx # Sheep SVG component
│ ├── LionIcon.tsx # Lion SVG component
│ └── BoatIcon.tsx # Boat SVG component
├── types/
│ └── game.ts # TypeScript type definitions
└── utils/
└── gameLogic.ts # Game logic and validation
# Install dependencies
npm install
# Run development server
npm run dev
# Open browser
# Navigate to http://localhost:3000npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
npm run format:check # Check code formatting- Start by moving 2 lions to the left
- Bring 1 lion back to the right
- Move 2 sheep to the left
- Continue alternating to maintain balance
- Never leave more lions than sheep on either side!
- Modern browsers with HTML5 Drag & Drop support
- Mobile browsers (touch events supported)
MIT
Built with ❤️ using Next.js and Framer Motion