Agar.io - The Original Cell Growing Game

Seele01-Flash
By
Agar.io is the original and most famous .io game that started the entire genre. Control a tiny cell, eat smaller opponents, avoid larger predators, and grow to dominate the multiplayer arena.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Agar.io Clone (Cell Evolution)". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Minimalist, flat 2D aesthetic rendered in a 3D engine (2.5D). Clean, bright, high-saturation pastel colors against a light grid background. * **Camera:** Orthographic Camera looking top-down (`0, 100, 0`). The camera must smoothly follow the player's cell, zooming out slightly as the player grows larger to maintain situational awareness. * **Player & Enemies:** Simple `CircleGeometry` or `CylinderGeometry` (flattened). Players should have a distinct solid color with a slightly darker outline (Stroke). Display the player's name and mass number in the center of the cell using a 2D canvas texture overlay. * **Food (Pellets):** Use small, colorful hexagons. **Crucial for Performance:** Use `THREE.InstancedMesh` for the background food pellets to render hundreds of items efficiently on mobile devices without dropping frame rates. * **Viruses:** Green, spiky circles (cog-like appearance). * **Environment:** A large, white map with a light grey grid pattern. Boundaries should be clearly marked with a thick red border. ### 2. Audio Requirements * **BGM:** A looping, minimal ambient electronic track (upbeat but not distracting). Think "science lab" or "arcade abstract" style. * **Sound Effects (SFX):** * **Eating Pellets:** A soft, high-pitched "pop" or "blip" sound (frequent, so keep it short and not ear-piercing). * **Eating Players:** A satisfying, deeper "gulp" or "squish" sound. * **Splitting:** A "whoosh" or spring-loaded projection sound. * **Ejecting Mass:** A rapid-fire "pue-pue" shooting sound. * **Hittiing Virus:** A "shatter" or glass-breaking sound indicating the cell has exploded. ### 3. Gameplay Loop * **Core Mechanic:** The player starts as a small cell. Movement speed is fast when small and decreases logarithmically as mass increases (`speed = baseSpeed / mass^0.4`). * **Consumption Logic:** * Collision with pellets adds small mass (+1). * Collision with other players: If `PlayerRadius > TargetRadius * 1.1`, the smaller cell is consumed. The larger cell gains the smaller cell's mass. * **Virus Mechanic:** If a player larger than the virus touches it, the player explodes into many small cells. Small players can hide behind viruses safely. * **Split Mechanic:** Triggering "Split" divides the player into two cells of equal mass. The new cell launches forward in the direction of movement. Cells merge back together after a cooldown period (e.g., 30 seconds). * **Bot AI:** Implement simple AI bots that wander randomly, seek food, and flee if a larger object (the player) approaches. ### 4. Mobile Controls & Interaction * **Movement Control:** A **Virtual Joystick** anchored to the bottom-left area of the screen. The cell moves relative to the angle of the joystick from its center. * **Action Buttons:** Two distinct, circular buttons on the bottom-right: * **Split Button:** Large icon (two overlapping circles). * **Eject Mass Button:** Slightly smaller icon (an arrow or dot). * **Orientation:** Force **Landscape Mode** for a wider field of view. * **UI Layout:** * **Leaderboard:** Top-right corner (semi-transparent list of top 5 names). * **Score/Mass:** Bottom-left corner (large, readable font). * **Feedback:** * **Haptic Feedback:** Trigger a short vibration (using `navigator.vibrate`) when the player eats another player or gets eaten. * **Visual Feedback:** A slight scaling "bounce" animation when gaining mass. ### 5. Technical Implementation Note * Ensure the code handles window resizing logic. * Use a simple spatial hashing or grid-based collision detection system to avoid checking collisions between every object every frame (O(n^2) problem), which is critical for mobile battery life and performance. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Agar.io is the legendary cell survival game that revolutionized online multiplayer gaming and spawned an entire genre of .io games. In this deceptively simple yet deeply strategic game, you start as a microscopic cell in a vast arena filled with colorful pellets and other players from around the world. Your mission is straightforward: survive, grow, and become the largest cell in the arena.

What makes Agar.io truly special is its perfect balance of accessibility and depth. Anyone can start playing within seconds, but mastering the game requires patience, strategy, and split-second decision-making. The game follows two fundamental rules: you can only eat cells smaller than yourself, and larger cells will consume you. This creates an intense ecosystem where every encounter could mean growth or instant death.

Core Features

Agar.io offers an unmatched multiplayer experience with several key features:

  • Completely Free : Play the full game without any cost, directly in your browser
  • Real-time Multiplayer : Compete against thousands of players simultaneously in massive arenas
  • Multiple Game Modes : Choose from Free-for-All, Battle Royale, Teams, and Experimental modes
  • Cross-platform Play : Available on web browsers, iOS, and Android devices
  • Instant Action : No downloads required - click and play immediately
  • Global Leaderboards : Compete for the top spot against players worldwide

Strategic Depth

While the concept seems simple, Agar.io rewards strategic thinking and tactical gameplay. Small cells can hide behind virus obstacles to avoid predators, while larger players can use viruses offensively by feeding them mass to explode enemies. The splitting mechanic adds another layer of strategy - sacrifice size for speed to catch fleeing prey or escape danger.

Community and Cooperation

Despite being a competitive survival game, Agar.io often encourages unexpected cooperation. Players frequently team up, sharing mass to help allies grow, and hunting in coordinated groups. This emergent gameplay creates memorable moments and lasting partnerships in the arena.

Game Modes

Agar.io offers four distinct game modes to keep the experience fresh:

  • Free-for-All (FFA) : The classic mode where every player fights for individual survival and growth
  • Battle Royale : Intense matches in a shrinking arena that forces increasingly aggressive encounters
  • Teams : Cooperative gameplay where you work with teammates to dominate opposing factions
  • Experimental : Special mode with unique mechanics, including the ability to donate mass for multiplied returns

Gameplay Mechanics

Success in Agar.io requires understanding its core mechanics:

Growth Strategy

Start by quietly collecting the small, colorful pellets scattered across the arena. This safe method allows steady growth without attracting attention from larger predators. Patience is crucial in the early game - rushing into conflicts usually leads to being eaten.

Combat System

Once you reach medium size, you can begin hunting other players. Use the split function (Spacebar) strategically to lunge at smaller cells just out of reach. Remember that splitting doubles your cell count but halves individual cell size, so choose targets carefully.

Advanced Tactics

Larger players can manipulate viruses by ejecting mass into them, causing the virus to fire toward enemies and split them into vulnerable fragments. Master players use map edges to trap opponents and position themselves for optimal growth opportunities.

Operation Guide

Controls are intuitive and responsive:

  • Mouse Movement : Navigate your cell around the arena
  • Spacebar : Split your cell to increase speed and catch nearby prey
  • W Key : Eject mass to feed teammates, viruses, or create tactical advantages
  • Zoom : Most browsers allow zooming out for better situational awareness

The key to success is smooth mouse control and timing your splits perfectly. Practice moving efficiently while scanning for opportunities and threats.

Why Play Agar.io

Agar.io remains the definitive .io gaming experience for several compelling reasons:

Instant Accessibility : No registration, downloads, or complex tutorials - jump straight into the action. The game loads quickly in any modern browser and runs smoothly on virtually any device.

Endless Replayability : Every match is unique due to the dynamic player interactions and emergent strategies. Whether you're a cautious survivor or aggressive hunter, there are multiple paths to victory.

Perfect for All Skill Levels : Newcomers can enjoy immediate fun collecting pellets and experiencing small victories, while veterans develop sophisticated strategies involving team coordination and advanced splitting techniques.

Social Gaming : The anonymous multiplayer environment creates hilarious and tense moments. Form temporary alliances, engage in epic chases, or experience the satisfaction of a perfectly executed ambush.

Historical Significance : As the original .io game, Agar.io offers a chance to experience gaming history. This is the title that inspired countless imitators and established an entire genre of browser-based multiplayer games.

Whether you have five minutes or five hours, Agar.io delivers immediate entertainment with surprising depth. It's the perfect game for stress relief, competitive gaming, or casual fun with friends.

Frequently Asked Questions (FAQ)