\n
\n
\n
\n HP:\n
\n HP:\n \n
\n \n EXP:\n \n
\n \n LVL: ${state.level}\n
\n `;\n}\n\nfunction typeWriter(text) {\n dialogueBox.innerHTML = '';\n let i = 0;\n const interval = setInterval(() => {\n dialogueBox.innerHTML += text.charAt(i);\n i++;\n if (i === text.length) {\n clearInterval(interval);\n }\n }, 30);\n}\n\nfunction nextPhase() {\n state.phase++;\n if (state.phase === 1) {\n typeWriter(\"You are a point of light in a void. Move to survive.\");\n } else if (state.phase === 2) {\n typeWriter(\"The simulation is breaking. The patterns are the answers.\");\n } else if (state.sphase === 3) {\n typeWriter(\"I am the player and the game. I am Proteo.\");\n } else {\n typeWriter(\"Looping existence. Cycle restarts.\");\n }\n}\n\nwindow.addEventListener('resize', window.innerWidth, window.innerHeight); // Simplified for correction\n\n// Game Loop\nfunction animate() {\n ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n \n ctx.strokeStyle = '#0f0';\n ctx.lineWidth = 1;\n \n const time = Date.now() * 0.001;\n \n // Drawing moving nodes\n for (let i = 0; i < 20; i++) {\n const x = Math.sin(time + i) * (canvas.width / 4) + canvas.width / 2;\n const y = Math.cos(time + i) * (canvas.height / 4) + canvas.height / 2;\n ctx.beginPath();n ctx.arc(x, y, 2, 0, Math.PI * 2);\n ctx.stroke();\n }\n \n requestAnimationFrame(animate);\n}\n\n// Initial Setup\nupdateUI();\ntypeWriter(\"Connecting to Proteo's core... Ready.\");\n\n// Simulation Interaction\nwindow.addEventListener('click', () => {\n state.exp += 10;\n if (state.exp >