From b0a85445ff2b801a7c76ed47ffbb629a8276a16a Mon Sep 17 00:00:00 2001 From: Kaspar Bergert Date: Sat, 29 Mar 2025 21:35:40 +0200 Subject: [PATCH 1/6] made the cookie move when clicked --- src/pages/CookieClicker.vue | 55 ++++++++++++++++++++++++------------- webpack.config.js | 6 +++- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/pages/CookieClicker.vue b/src/pages/CookieClicker.vue index 0727f08..ab08a01 100644 --- a/src/pages/CookieClicker.vue +++ b/src/pages/CookieClicker.vue @@ -3,13 +3,13 @@ import { computed, ref } from 'vue'; const cookies = ref(0); const buildings = ref([ - { name: 'Cursor', price: 15, cps: 0.1, count: 0}, - { name: 'Grandma', price: 100, cps: 1, count: 0}, - { name: 'Farm', price: 1000, cps: 10, count: 0}, - { name: 'Factory', price: 10_000, cps: 100, count: 0}, + { name: 'Cursor', price: 15, cps: 0.1, count: 0 }, + { name: 'Grandma', price: 100, cps: 1, count: 0 }, + { name: 'Farm', price: 1000, cps: 10, count: 0 }, + { name: 'Factory', price: 10, cps: 100, count: 0 }, ]); -function buyBuilding(building){ +function buyBuilding(building) { cookies.value -= building.price; building.price += Math.ceil(building.price / 100 * 15); building.count++; @@ -17,33 +17,50 @@ function buyBuilding(building){ let cps = computed(() => { let cps = 0; buildings.value.forEach(building => { - cps+=building.cps*building.count; + cps += building.cps * building.count; }); return cps; }); -setInterval(()=>{ - cookies.value+=cps.value; +setInterval(() => { + cookies.value += cps.value; - document.title ='πŸͺ' + +cookies.value.toFixed(1) + ' Cookies!'; -},1000); + document.title = 'πŸͺ' + +cookies.value.toFixed(1) + ' Cookies!'; +}, 1000); \ No newline at end of file + + + \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index dc5e268..73cf849 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,9 +45,13 @@ export default { { test: /\.vue$/, loader: 'vue-loader' + }, + { + test: /\.(png|jpe?g|gif|svg)$/i, + type: 'asset/resource', } ], - }, + }, plugins: [ new HtmlWebpackPlugin({ template: "./src/index.html", From 306fe1f2168a6ca87d93ab9f11d2a3a2fe42e806 Mon Sep 17 00:00:00 2001 From: Kaspar Bergert Date: Sat, 29 Mar 2025 21:54:50 +0200 Subject: [PATCH 2/6] middle area can now be filled with faces! --- src/pages/CookieClicker.vue | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/pages/CookieClicker.vue b/src/pages/CookieClicker.vue index ab08a01..ccb612b 100644 --- a/src/pages/CookieClicker.vue +++ b/src/pages/CookieClicker.vue @@ -6,7 +6,7 @@ const buildings = ref([ { name: 'Cursor', price: 15, cps: 0.1, count: 0 }, { name: 'Grandma', price: 100, cps: 1, count: 0 }, { name: 'Farm', price: 1000, cps: 10, count: 0 }, - { name: 'Factory', price: 10, cps: 100, count: 0 }, + { name: 'Factory', price: 0, cps: 1000000, count: 0 }, ]); function buyBuilding(building) { @@ -40,11 +40,22 @@ setInterval(() => {
- asdas +
+
+ you have {{ building.count }} {{ building.name }}'s +
+
+ πŸ‘΅ +
+
+
+
+ +
From 036f86aa20b0dd8b8c2815423071f8c4b97b5a0d Mon Sep 17 00:00:00 2001 From: Kaspar Bergert Date: Mon, 31 Mar 2025 23:24:47 +0300 Subject: [PATCH 6/6] fixed achievements --- src/pages/CookieClicker.vue | 65 +++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/src/pages/CookieClicker.vue b/src/pages/CookieClicker.vue index 8b17b6e..a7f9573 100644 --- a/src/pages/CookieClicker.vue +++ b/src/pages/CookieClicker.vue @@ -27,28 +27,81 @@ const buildings = ref([ let userclicked = ref(0); const clickAchievementsData = [ - [10, "Click more!", "You clicked the cookie 10 times!"], + [10, "Welcome to Cookie Clicker!", "10 clicks"], [50, "Click addict!", "50 clicks already?"], [100, "Click master!", "100 clicks. You serious?"], [500, "Click god!", "500 clicks. Seek help."], - [1000, "Endless clicker", "1,000 clicks. No turning back."], [10000, "Finger of steel", "10,000 clicks. What's wrong with you?"], [100, "Clicking Apprentice πŸ–±οΈ", "You've clicked 100 times."], ]; const buildingAchievementsData = [ - ["Factory", 100, "Factorio! βš™οΈ", "You have 100 factories"], + ["Cursor", 10, "Starter Clicker πŸ–±οΈ", "You own 10 Cursors."], + ["Cursor", 20, "Cursor Collector πŸ‘†", "You own 20 Cursors."], + ["Cursor", 50, "Click Swarm πŸ’₯", "You own 50 Cursors."], + ["Grandma", 10, "Grandma's Bakery πŸ‘΅", "You have 10 Grandmas."], + ["Grandma", 25, "Cookie Coven πŸ§™β€β™€οΈ", "You have 25 Grandmas."], + ["Grandma", 50, "Elder Council πŸ•―οΈ", "You have 50 Grandmas."], + ["Farm", 5, "Farming Tycoon 🌾", "You own 5 Farms."], - ["Cursor", 20, "Cursor Collector πŸ‘†", "You own 20 Cursors."], + ["Farm", 20, "Agricultural Empire 🚜", "You own 20 Farms."], + ["Farm", 50, "Mega Farm 🏑", "You own 50 Farms."], + + ["Factory", 10, "Mass Production 🏭", "You have 10 Factories."], + ["Factory", 50, "Factorio! βš™οΈ", "You have 50 Factories."], + ["Factory", 100, "Industrial Overlord πŸ› οΈ", "You have 100 Factories."], + + ["Mine", 10, "Rock Digger ⛏️", "You have 10 Mines."], + ["Mine", 25, "Tunnel Vision πŸ•³οΈ", "You have 25 Mines."], + ["Mine", 50, "Motherlode Miner πŸ’Ž", "You have 50 Mines."], + + ["Shipment", 5, "Export Hustler 🚚", "You own 5 Shipments."], + ["Shipment", 20, "Space Dealer πŸš€", "You own 20 Shipments."], + ["Shipment", 50, "Interstellar Trade πŸͺ", "You own 50 Shipments."], + + ["Alchemy Lab", 5, "Apprentice Alchemist βš—οΈ", "You own 5 Alchemy Labs."], + ["Alchemy Lab", 15, "Golden Touch ✨", "You own 15 Alchemy Labs."], + ["Alchemy Lab", 30, "Philosopher’s Stone πŸ§ͺ", "You own 30 Alchemy Labs."], + + ["Portal", 1, "First Rift πŸŒ€", "You opened a Portal."], + ["Portal", 10, "Beyond the Veil 🌌", "You own 10 Portals."], + ["Portal", 25, "Dimensional Master πŸͺž", "You own 25 Portals."], + + ["Time Machine", 1, "Time Beginner ⏰", "You built your first Time Machine."], + ["Time Machine", 10, "Looper πŸ”", "You own 10 Time Machines."], + ["Time Machine", 30, "Temporal Lord πŸ•°οΈ", "You own 30 Time Machines."], + + ["Antimatter Condenser", 5, "Quantum Tinkerer πŸ’ ", "You own 5 Antimatter Condensers."], + ["Antimatter Condenser", 15, "Core Melter βš›οΈ", "You own 15 Antimatter Condensers."], + + ["Prism", 5, "Light Bender 🌈", "You own 5 Prisms."], + ["Prism", 15, "Spectrum Shifter πŸŽ‡", "You own 15 Prisms."], + + ["Chancemaker", 5, "Probability Twister 🎲", "You own 5 Chancemakers."], + ["Chancemaker", 15, "Luck Architect πŸ€", "You own 15 Chancemakers."], + + ["Fractal Engine", 5, "Pattern Weaver 🧩", "You own 5 Fractal Engines."], + ["Fractal Engine", 15, "Recursive Genius πŸ”", "You own 15 Fractal Engines."], + + ["Javascript Console", 5, "Console Logger πŸ’»", "You own 5 JavaScript Consoles."], + ["Javascript Console", 15, "Infinite Loop πŸ–₯️", "You own 15 JavaScript Consoles."], + + ["Idleverse", 1, "Meta Awakening 🌌", "You created the Idleverse."], + ["Idleverse", 10, "Simulation Overlord 🧬", "You own 10 Idleverses."], + + ["Cortex Baker", 1, "Mind Over Batter 🧠", "You built your first Cortex Baker."], + ["Cortex Baker", 5, "Neural Doughmaster 🧠πŸͺ", "You own 5 Cortex Bakers."], + ["Cortex Baker", 10, "Brainstorm Bakesplosion 🧠⚑", "You own 10 Cortex Bakers."] ]; + const achievements = computed(() => [ ...clickAchievementsData.map(([count, name, desc]) => ({ name, desc, get condition() { - return userclicked.value === count; + return userclicked.value == count; }, })), ...buildingAchievementsData.map(([buildingName, targetCount, name, desc]) => ({ @@ -56,7 +109,7 @@ const achievements = computed(() => [ desc, get condition() { return buildings.value.some( - (item) => item.name === buildingName && item.count >= targetCount + (item) => item.name == buildingName && item.count == targetCount ); }, })),