I will start by listing the files in the project to understand the existing structure and what templates or libraries are available.
I will read package.json to see the currently installed dependencies and whether we need icons like lucide-react or other helper packages.
I will install lucide-react for UI icons and canvas-confetti (with its TypeScript types) for celebratory visual effects when species reach new evolutionary milestones and complete eras.
I will now read index.html to check the title, viewport meta tag, and styling setup.
I will now update index.html to set an exciting sci-fi title ("EvoMind: A Sentiência Bio-Digital | Simulador de Evolução e Inteligência Autônoma") and import the 'Orbitron' and 'Inter' Google Fonts for our cyberpunk bio-evolution theme.
I will read src/index.css to inspect the styling and Tailwind CSS configuration.
I will update src/index.css to add custom utility classes for glowing text/borders, custom animations (like pulsing DNA and screen shake effects), and touch-action optimization for mobile gameplay.
I will now create src/types/game.ts to define the data structures for neural networks, genomes, biological specimens, world laws, evolutionary eras, hazards, and UI states.
I will create src/utils/sound.ts with a Web Audio API procedural sound synthesizer. This provides instant sound effects for nutrient collection, neural learning pulses, DNA mutations, structural evolution, hazard lightning, and era celebrations.
I will now create src/utils/aiEngine.ts to implement the neural network forward pass, real-time Hebbian reinforcement learning ("learning to learn" during lifetime), genetic reproduction with weight mutation, and structural genome evolution (splicing traits like flagella, compound eyes, photosynthesis, carnivorism, and neural capacity expansion).
I will remove the unused Specimen import in src/utils/aiEngine.ts.
I will create src/utils/eras.ts containing the 6 evolutionary eras for the Career Mode, each with unique environmental conditions, target milestones, and unlockable structural genetic traits.
I will create src/utils/storage.ts to manage loading and saving local high-score records, species milestones, and game settings using localStorage.
I will now create src/components/StartScreen.tsx to provide a visually stunning start screen with an animated title, game mode selection (Career vs Creator Sandbox), species name generator, tutorial overview, and local high-score leaderboard.
I will create src/components/TopHeader.tsx to display real-time evolutionary metrics (Intelligence Index, Population, Generation, Fitness), current Era goals, and simulation controls (Play/Pause, simulation speed 1x/2x/5x, Mute, Instant Restart).
I will remove the unused FastForward and ShieldAlert imports from src/components/TopHeader.tsx.
I will create src/components/BrainVisualizer.tsx to render an SVG diagram of the selected specimen's neural network, showing sensory inputs, hidden nodes, motor outputs, and synaptic weight connections that adapt and pulse in real time.
I will create src/components/ControlDeck.tsx to serve as the bottom dashboard where players can switch active tools (Laser Beacon, Nutrients, Mutagens, Lightning, Possess), modify world physics sliders, manage structural genetic traits (flagella, compound eyes, photosynthesis, carnivorism), and inspect live neural specimens.
I will create src/components/VictoryModal.tsx to celebrate when players complete an evolutionary era, displaying unlocked structural traits, performance metrics, and options to advance to the next era or switch to endless creator sandbox.
I will create src/components/GameOverModal.tsx to handle game-over and extinction states, presenting a clear scientific breakdown of why the species failed to adapt and offering an instant restart button to try a new evolutionary strategy.
I will now create src/components/GameCanvas.tsx, which implements the 60FPS physics and neural simulation loop on an HTML5 Canvas. This component includes real-time Hebbian neural learning, genetic structural splicing (tails, eyes, spikes, mandibles), juicy visual feedback (particles, screen shake, floating text), and tight responsive controls for keyboard (WASD/Arrows/Space) and mobile touch.
I will read lines 350-375 and 545-570 of src/components/GameCanvas.tsx to inspect the exact TypeScript errors regarding alphaSp and topSp.
I will read lines 550 to 580 of src/components/GameCanvas.tsx to inspect the other type errors.
I will read lines 525 to 555 of src/components/GameCanvas.tsx to see how nearestNut and nearestHz were declared.
I will read lines 510 to 525 of src/components/GameCanvas.tsx to see where nearestNut was initialized.
I will read lines 1-15 of src/components/GameCanvas.tsx to check the exact imports.
I will update the imports and replace the .forEach search loops with for...of loops in src/components/GameCanvas.tsx so TypeScript's control flow analysis correctly tracks variable types across scopes.
I will read lines 70 to 80 of src/components/GameCanvas.tsx to locate touchActive.
I will read lines 370 to 385 of src/components/GameCanvas.tsx to see where setTouchActive is called.
I will read lines 345 to 368 of src/components/GameCanvas.tsx to check the found search loop.
I will replace the .forEach loop for found with a for...of loop and remove the unused touchActive state in src/components/GameCanvas.tsx.
I will now edit handlePointerAction and handleTouchStart to use for...of for finding found and remove setTouchActive.
I will read lines 515 to 555 of src/components/GameCanvas.tsx to check the exact context for nearestNut, nearestHz, and nearestMate.
I will replace the .forEach loops for nearestNut, nearestHz, and nearestMate with for...of loops in src/components/GameCanvas.tsx to fix TypeScript's type narrowing inside the simulation loop.
I will read src/App.tsx to inspect the current template code before replacing it with our full EvoMind application.
I will now replace src/App.tsx with the complete implementation of the EvoMind application, tying together the start screen, simulation canvas, control deck, real-time neural network inspector, victory/game-over states, local high scores, and sound synthesis.
I will remove the unused React default import from src/App.tsx.
I will now run build_project to test TypeScript compilation and confirm that the entire game application builds without any errors.
O jogo EvoMind: A Sentiência Bio-Digital foi criado e estruturado para cumprir todas as especificações do simulador de inteligência e evolução biológica. O projeto foi compilado e verificado com sucesso.
🧬 Principais Destaques do Desenvolvimento:
-
Inteligência Não-Programada & Reforço Hebbian ("Aprender a Aprender"):
- Cada criatura nasce sem regras codificadas de movimento. Elas possuem uma Rede Neural autônoma de pesos aleatórios conectando 8 sensores (distância e ângulo de nutrientes, perigo, vizinhos, energia e feixe de treino) a 6 motores corporais (aceleração, giro, alimentação, reprodução, ataque e sinalização).
- Plasticidade Neural ao Vivo: Durante a vida, sempre que uma ação resulta em ganho de energia ou aproximação do feixe de treino, o algoritmo de aprendizado Hebbian reforça as sinapses que dispararam em tempo real.
-
Evolução Genética Estrutural & Mutações:
- Ao reproduzir-se ou ao absorver cápsulas mutagênicas, o DNA sofre mutação nos pesos neurais e realiza saltos genéticos estruturais:
- Flagelos Motorizados (Caudas): Concedem impulso natatório e agilidade nas curvas.
- Olhos Compostos: Expandem o campo de visão sensorial para detectar perigos e recursos de longe.
- Pele Fotossintética: Gera energia solar passivamente no ecossistema.
- Mandíbulas Carnívoras: Permitem caçar drones predadores invasores.
- Espinhos de Defesa: Reduzem danos térmicos de nevascas e tempestades gravitacionais.
- Nó Telepático de Enxame: Compartilha alertas de perigo instantaneamente com os vizinhos.
-
Fun Loop nos Primeiros 10 Segundos & Feedback Tátil/Visual ("Juicy Feedback"):
- Controles Responsivos (Teclado & Toque/Mouse): Use
WASD ou Setas para mover o feixe guia de treino ou assumir o controle direto do Espécime Alfa. Pressione Espaço ou use a tela de toque para lançar pulsos de nutrientes, cápsulas mutagênicas, raios divinos ou vórtices gravitacionais.
- Efeitos Visuais e Sonoros: Sistema de partículas personalizado (hélices de DNA giratórias, faíscas verdes de biomassa, textos flutuantes de recompensas, explosões), Screen Shake dinâmico nos impactos e sintetizador procedural Web Audio API para bleeps cósmicos e arpejos de evolução sem latência.
-
Modos de Jogo, Interface & Leaderboard:
- Modo Carreira (6 Eras Evolutivas): Lidere sua linhagem desde a "Sopa Primordial" até a "Singularidade Bio-Digital", superando glaciações e predadores para desbloquear novos traços genéticos.
Files built: index.html, src/index.css, src/types/game.ts, src/utils/sound.ts, src/utils/aiEngine.ts, src/utils/eras.ts, src/utils/storage.ts, src/components/StartScreen.tsx, src/components/TopHeader.tsx, src/components/BrainVisualizer.tsx, src/components/ControlDeck.tsx, src/components/VictoryModal.tsx, src/components/GameOverModal.tsx, src/components/GameCanvas.tsx, src/App.tsx