const platforms = []; for(let i=0;i<120;i++){ platforms.push({ x: Math.random()*canvas.width, y: 500 - i*40, w: 120 + Math.random()*60 }); }const platforms = []; // GUARANTEED START PLATFORM const startPlatform = { x: canvas.width / 2 - 100, y: 500, w: 200 }; platforms.push(startPlatform); // rest of world platforms for(let i=1;i<120;i++){ platforms.push({ x: Math.random()*canvas.width, y: 500 - i*40, w: 120 + Math.random()*60 }); }const player = { x: 100, y: 500,const player = { x: startPlatform.x + startPlatform.w / 2, y: startPlatform.y - 20, vx: 0, vy: 0, w: 20, h: 20, stamina: 100, onGround: true };const player = { x: startPlatform.x + startPlatform.w / 2 - 10, y: startPlatform.y - 20, vx: 0, vy: 0, w: 20, h: 20, stamina: 100, onGround: true };platforms.push(startPlatform);const startPlatform = { x: canvas.width / 2 - 100, y: 500, w: 200 };let startLock = true;// platform collision player.onGround = false; for(let p of platforms){// platform collision player.onGround = false; for (let p of platforms) { const isTouching = player.x < p.x + p.w && player.x + player.w > p.x && player.y < p.y + 10 && player.y + player.h > p.y; if (isTouching) { if (player.vy >= 0) { player.y = p.y - player.h; player.vy = 0; player.onGround = true; } // 🔒 HARD START PROTECTION if (startLock && p === startPlatform) { player.y = p.y - player.h; player.vy = 0; player.onGround = true; } } }setTimeout(() => { startLock = false; }, 1000);