An interactive, visually stunning bee hive simulation powered by artificial intelligence. Watch as intelligent bees forage for resources, communicate through waggle dances, and grow their colony.
- Four Bee Roles: Queen, Foragers, Scouts, and Nurses with unique AI behaviors
- Smart Foraging: Bees use memory to remember flower locations
- Waggle Dance Communication: Bees perform figure-8 dances to share flower locations with the colony
- Pheromone Trails: Visual pheromone trails guide bees to resources
- Energy Management: Bees consume energy and must return to the hive to refuel
- Dynamic Day/Night Cycle: Background and lighting change throughout the day
- Honeycomb Pattern: Subtle hexagonal background pattern
- Particle Effects: Colorful trails follow bees as they move
- Animated Flowers: Flowers sway gently and regenerate resources
- Glowing Hive: Central hive with atmospheric glow effect
- Role-Based Colors: Each bee role has a distinct color scheme
- Click to Plant Flowers: Add flowers anywhere by clicking
- Speed Control: Adjust simulation speed from 0.1x to 3.0x
- Spawn Bees: Manually add worker bees to the colony
- Pause/Resume: Control the simulation flow
- Real-Time Stats: Track colony population, resources, and activity
- Autonomous Exploration: Scout bees explore the environment for new resources
- Knowledge Sharing: Bees learn flower locations from watching waggle dances
- Resource Optimization: Foragers prioritize high-value flowers
- Colony Growth: Colony automatically expands when resources are abundant
- Role Distribution: Balanced distribution of worker roles for efficiency
- Open
index.htmlin any modern web browser - Watch the bees come to life!
- Click anywhere on canvas: Plant a flower
- Add Random Flower button: Spawn flowers at random locations
- Spawn Worker Bee button: Add a new bee (costs 50 food storage)
- Pause/Resume button: Control simulation
- Simulation Speed slider: Adjust speed (0.1x - 3.0x)
- Flower Spawn Rate slider: Control automatic flower generation
- ๐ Queen (Pink): Stays near the hive, essential for colony
- ๐ Foragers (Gold): Collect pollen and nectar from flowers
- ๐ Scouts (Blue): Explore and discover new flower locations
- ๐ Nurses (Green): Tend to the hive and maintain it
- Foraging: Bees fly to flowers and collect resources
- Returning: Laden bees return to the hive to deposit resources
- Dancing: After a successful foraging trip, bees may perform a waggle dance
- Watching: Other bees watch dances to learn flower locations
- Exploring: Scouts venture out to find new resources
- Honey: Converted from nectar
- Pollen: Collected from flowers
- Food Storage: Combined resources used for colony growth
- Bees consume energy and must return to refuel
- Colony grows automatically when storage exceeds 100 units
- Pink: Queen bee
- Gold: Forager bees
- Blue: Scout bees
- Green: Nurse bees
- Various colors: Flowers
- Particle trails behind flying bees
- Pheromone heat map showing resource trails
- Animated waggle dances with figure-8 patterns
- Dynamic lighting based on time of day
- Hexagonal honeycomb background pattern
Each bee uses a state machine with the following states:
idle: Resting or waiting for informationseeking: Flying to a known flower locationforaging: Collecting resources from a flowerreturning: Flying back to the hivedancing: Performing waggle dancewatching: Learning from another bee's danceexploring: Searching for new resources (scouts only)
- Bees maintain a memory array of known flower locations
- Scouts share discoveries with foragers through waggle dances
- Memory is updated as flowers are depleted
- Bees prioritize recently discovered, high-value flowers
The waggle dance is a realistic simulation of bee communication:
- Duration indicates distance to flower
- Angle indicates direction
- Watching bees learn the flower location
- Multiple bees can watch the same dance
- Pure JavaScript (ES6+)
- HTML5 Canvas for rendering
- CSS3 for UI styling
- No external dependencies
- Optimized for smooth 60 FPS
- Efficient particle system
- Supports 200+ bees simultaneously
- Dynamic entity cleanup
- Chrome/Edge (recommended)
- Firefox
- Safari
- Any modern browser with Canvas support
- Total Bees: Current colony population
- Honey: Total honey collected
- Pollen: Total pollen collected
- Flowers: Active flowers in the environment
- Active Dances: Ongoing waggle dances
- Time: Current time of day
- Food Storage: Available resources (shown as percentage)
- Start Small: Let the initial colony establish before adding too many bees
- Plant Strategically: Cluster flowers in areas for more efficient foraging
- Watch the Dances: Observe how bees share information
- Adjust Speed: Slow down to see details, speed up for colony growth
- Manage Resources: Balance bee spawning with food storage
Potential additions:
- Predators and threats
- Seasonal changes
- Multiple hives with competition
- Bee genetics and evolution
- Sound effects and music
- Save/load simulation state
- Advanced statistics and graphs
- Mobile touch controls
MIT License - Feel free to use and modify!
Inspired by real bee behavior and collective intelligence systems.
Enjoy watching your bee colony thrive! ๐๐ธ