if (dist < player.size + f.size) // Eat food player.maxTail += 2; score += 10; scoreEl.innerText = score; foods.splice(i, 1); // Remove eaten food foods.push(new Food()); // Spawn new one
: A helpful repository will usually have a URL ending in .github.io in the "About" section, which takes you straight to the playable game. snakeio unblocked github