Site Title

🖥️ The Coders

Name GitHub Profile
Precia Verma github.com/precia-verma
Krystal github.com/krystal-727
Tasha (Struti) github.com/StutiPandey19

🍪 Hack 1: Quiz

Quiz Screenshot

Notebook

2025-08-29-collaboration.ipynb


🥛 Hack 2: Your Own Feature – Milk Upgrade

Purpose

The Milk Upgrade is a purchasable item in the Cookie Clicker game shop (Cost: 1000 cookies).
Buying Milk gives a sweet boost: it doubles cookies per click and makes the grind way more strategic.

Screenshot Screenshot Screenshot Screenshot

🥛 How the Milk Upgrade Works (Code Explained)

// --- Milk Upgrade Feature ---
const milkUpgrade = {
  name: "Milk",
  emoji: "🥛",
  price: 1000,
  itemEffected: "click",
  multiplier: 2,
};

// Add Milk to upgrades list
shop.upgrades.push(milkUpgrade);

// Restore Milk upgrade from localStorage
let hasMilk = localStorage.getItem("hasMilk") === "true";

// Listen for Milk button click
document.addEventListener("DOMContentLoaded", () => {
  const milkBtn = document.getElementById("milkBtn");
  if (milkBtn) {
    if (hasMilk) milkBtn.disabled = true;
    milkBtn.addEventListener("click", () => {
      if (hasMilk) {
        alert("You already own Milk!");
        return;
      }
      if (cookie.cookies >= milkUpgrade.price) {
        cookie.addCookies(-milkUpgrade.price);
        cookie.cookieMulti *= milkUpgrade.multiplier;
        hasMilk = true;
        localStorage.setItem("hasMilk", "true");
        milkBtn.disabled = true;
        alert("Milk purchased! Your cookies per click are doubled.");
      } else {
        alert("Not enough cookies!");
      }
    });
  }
});

What does this code mean and what does it do?

This feature makes the game more strategic and rewarding, giving players a big boost when they buy Milk!


🎮 Play the Game

👉 Cookie Clicker Game Live Site