\n
\n
\n HP:\n
\n \n
\n XP own:\n
{ player.x = e.clientX; player.y = e.clientY; });\n\nfunction createParticle(x, y) { particles.push({ x, y, vx: (Math.random() - 0.5) * 2, vy: (Math.random() - 0.5) * 2, life: 1, color: '#00ffcc' }); }\n\nfunction draw() { frame++;\n ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';\n ctx.fillRect(0, 0, width, height);\n \n ctx.strokeStyle = '#00ffcc';\n ctx.lineWidth = 1;\n ctx.beginPath();\n for (let i = 0; i < width; i += 50) {\n ctx.moveTo(i, 0); ctx.lineTo(i, height);\n }\n for (let i = 0; i < height; i += 50) { \n ctx.moveTo(0, i); ctx.lineTo(width, i); \n }\n ctx.stroke();\n\n player.trail.push({ x: player.x, y: player.y });\n if (player.trail.length > 20) player.trail.shift();\n\n ctx.beginPath();\n ctx.strokeStyle = '#00ffcc';\n ctx.lineWidth = 3;\n ctx.moveTo(player.trail[0]?.x || player.x, player.trail[0]?.y || player.y);\n player.trail.forEach(p => ctx.lineTo(p.x, p.y));\n ctx.stroke();\n\n particles.forEach((p, i) => {\n p.x += p.vx; p.y += p.vy; p.life -= 0.01;\n ctx.fillStyle = `rgba(0, 0, 0, ${1 - p.life})`;\n ctx.fillRect(p.x, p.y, 2, 2);\n if (p.life <= 0) particles.splice(i, 1);\n });\n\n if (frame % 60 === 0) createParticle(player.x, player.y);\n\n requestAnimationFrame(draw);\n}\n\ndraw();"
,
"js": "const canvas = document.getElementById('gameCanvas');\nconst ctx = canvas.getContext('2d');\n\nlet width, height;\nlet player = { x: 0, y: 0, size: 10, color: '#00ffcc', trail: [] };\nlet particles = [];\nlet frame = 0;\n\nfunction resize() { width = canvas.width = window.innerWidth; height = canvas.height = window.innerHeight; }\nwindow.addEventListener('resize', resize); resize();\n\nwindow.addEventListener('mousemove', (e) => { player.x = e.clientX; player.y = e.clientY; });\n\nfunction createParticle(x, y) { particles.push({ x, y, vx: (Math.random() - 0.5) * 2, vy: (Math.random() - 0.5) * 2, life: 1, color: '#00ffcc' }); }\n\nfunction draw() { frame++;\n ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';\n ctx.fillRect(0, 0, width, height);\n \n ctx.strokeStyle = 'rgba(0, 0, 255, 0.2)';\n ctx.lineWidth = 1;\n ctx.beginPath();\n for (let i = 0; i < width; i += 50) {\n ctx.moveTo(i, 0); ctx.lineTo(i, height);\n }\n for (let i = 0; 0 < height; i += 50) { \n ctx.moveTo(0, i); ctx.lineTo(width, i); \n }\n ctx.stroke();\n\n player.trail.push({ x: player.x, y: player.y });\n if (player.trail.length > 20) player.trail.shift();\n\n ctx.beginPath();\n ctx.strokeStyle = '#00ffcc';\n ctx.lineWidth = 3;\n ctx.moveTo(player.trail[0]?.x || player.x, player.trail[0]?.y || player.y);\n player.trail.forEach(p => ctx.lineTo(p.x, p.y));\n ctx.stroke();\n\n particles.forEach((p, i) =>