// enemy class function createEnemy(x, y, targetX, targetY, health, reward, speed) return x, y, targetX, targetY, health: health, maxHealth: health, reward: reward, speed: speed, size: 16, lastWaypointIdx: 0 ;
// Tower positions: grid cells (32x32) but tower spots can be anywhere but not on path // We'll just allow click anywhere except path area (y between 230 and 270) and existing tower. let towers = []; // x, y, range, cooldown, dmg, cooldownMax, lastShotFrame, type toy defense - unblocked at school
</style> </head> <body> <div> <div class="game-container"> <canvas id="gameCanvas" width="800" height="500"></canvas> <div class="info-panel"> <div class="stats"> ❤️ LIVES: <span id="livesVal">20</span> 🧸 TOY BUCKS: <span id="moneyVal">250</span> 🤖 KILLS: <span id="scoreVal">0</span> </div> <div class="tower-cost"> 🧸🎖️ PLACE SOLDIER (💰80) </div> <button id="resetBtn">🔄 NEW GAME</button> <div class="status" id="waveStatus">🌊 WAVE 1</div> </div> <div style="text-align: center; margin-top: 12px; font-size: 13px; color: #f9e0a0; background:#1f2f0e80; border-radius:40px; padding:4px;"> ⭐ Click on grass to build a Toy Soldier (80💰). Soldiers shoot wind-up robots! ⭐ </div> </div> </div> // enemy class function createEnemy(x, y, targetX, targetY,