From 2077f812930af04a68a81d33edad4e097516ca32 Mon Sep 17 00:00:00 2001 From: randomusert <127417963+randomusert@users.noreply.github.com> Date: Thu, 2 Oct 2025 05:18:25 +0000 Subject: [PATCH 1/3] devcontainer config --- .devcontainer/devcontainer.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..db39be5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "features": { + "ghcr.io/r3dpoint/devcontainer-features/tailwindcss-standalone-cli:1": {} + }, + + "postCreateCommand": "npm i" + +} \ No newline at end of file From b31f32f0e2b4e092a47dc25a3918baca65596929 Mon Sep 17 00:00:00 2001 From: randomusert <127417963+randomusert@users.noreply.github.com> Date: Thu, 2 Oct 2025 06:43:25 +0000 Subject: [PATCH 2/3] Implement MclickCounter integration(tried) and prestige system; update dependencies and HTML structure --- .gitignore | 2 +- mclick-counter/src/index.js | 79 ++++++++++++++++++++----------------- package-lock.json | 6 +++ package.json | 3 +- src/index.html | 2 + src/index.js | 45 ++++++++++++++------- src/require.js | 5 +++ src/scripts/main.js | 16 ++++++++ 8 files changed, 105 insertions(+), 53 deletions(-) create mode 100644 src/require.js create mode 100644 src/scripts/main.js diff --git a/.gitignore b/.gitignore index f7bf2ef..014291d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /node_modules /lib -/mclick-theme/node_modules \ No newline at end of file +/mclick-theme/node_modules diff --git a/mclick-counter/src/index.js b/mclick-counter/src/index.js index 69f75ab..cc4a3b2 100644 --- a/mclick-counter/src/index.js +++ b/mclick-counter/src/index.js @@ -1,44 +1,51 @@ -export default class MclickCounter { - constructor(initialValue = 0n) { - this.value = BigInt(initialValue); - } +define(function () { + class MclickCounter { + constructor(initialValue = 0n) { + this.value = BigInt(initialValue); + } + version() { + return '0.7.0'; + } - increment(amount = 1n) { - this.value += BigInt(amount); - } + increment(amount = 1n) { + this.value += BigInt(amount); + } - set(value) { - this.value = BigInt(value); - } + set(value) { + this.value = BigInt(value); + } - get() { - return this.value; - } + get() { + return this.value; + } - // Format as words (e.g., "1.2 million", "3.4 billion", etc.) - format() { - const units = [ - { suffix: "decillion", value: 10n ** 33n }, - { suffix: "nonillion", value: 10n ** 30n }, - { suffix: "octillion", value: 10n ** 27n }, - { suffix: "septillion", value: 10n ** 24n }, - { suffix: "sextillion", value: 10n ** 21n }, - { suffix: "quintillion", value: 10n ** 18n }, - { suffix: "quadrillion", value: 10n ** 15n }, - { suffix: "trillion", value: 10n ** 12n }, - { suffix: "billion", value: 10n ** 9n }, - { suffix: "million", value: 10n ** 6n }, - { suffix: "thousand", value: 10n ** 3n } - ]; + // Format as words (e.g., "1.2 million", "3.4 billion", etc.) + format() { + const units = [ + { suffix: "decillion", value: 10n ** 33n }, + { suffix: "nonillion", value: 10n ** 30n }, + { suffix: "octillion", value: 10n ** 27n }, + { suffix: "septillion", value: 10n ** 24n }, + { suffix: "sextillion", value: 10n ** 21n }, + { suffix: "quintillion", value: 10n ** 18n }, + { suffix: "quadrillion", value: 10n ** 15n }, + { suffix: "trillion", value: 10n ** 12n }, + { suffix: "billion", value: 10n ** 9n }, + { suffix: "million", value: 10n ** 6n }, + { suffix: "thousand", value: 10n ** 3n } + ]; - for (const unit of units) { - if (this.value >= unit.value) { - const whole = this.value / unit.value; - const decimal = (this.value % unit.value) / (unit.value / 10n); - return `${whole}.${decimal} ${unit.suffix}`; + for (const unit of units) { + if (this.value >= unit.value) { + const whole = this.value / unit.value; + const decimal = (this.value % unit.value) / (unit.value / 10n); + return `${whole}.${decimal} ${unit.suffix}`; + } } - } - return this.value.toString(); // just show number for small values + return this.value.toString(); // just show number for small values + } } -} + + return MclickCounter; +}); diff --git a/package-lock.json b/package-lock.json index 84bc46f..ce71fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "dependencies": { "@tailwindcss/cli": "^4.1.4", "express": "^5.1.0", + "mclick-counter": "0.7.0", "mclick-theme": "^0.7.0" }, "devDependencies": { @@ -1324,6 +1325,11 @@ "node": ">= 0.4" } }, + "node_modules/mclick-counter": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/mclick-counter/-/mclick-counter-0.7.0.tgz", + "integrity": "sha512-yqiLH/IWhiZh9q2GAnq375+yiEciG5Ma53Dz+r6DI4jbbK00lXVnAQXbYJdNZs+Yn9itqH5PUn9e+n3LSoIflA==" + }, "node_modules/mclick-theme": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/mclick-theme/-/mclick-theme-0.7.0.tgz", diff --git a/package.json b/package.json index e77ed73..118360e 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": { "@tailwindcss/cli": "^4.1.4", "express": "^5.1.0", - "mclick-theme": "^0.7.0" + "mclick-theme": "^0.7.0", + "mclick-counter": "0.7.0" } } diff --git a/src/index.html b/src/index.html index 73c58a4..4baaafd 100644 --- a/src/index.html +++ b/src/index.html @@ -4,6 +4,8 @@ Money Clicker + + diff --git a/src/index.js b/src/index.js index 10f59b0..7a5e946 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ //variables //sets variable called score to zero + var score = 0; var cursorCost = 2; var cursors = 0; @@ -13,6 +14,12 @@ var superclicker = 0 var superclickerCost = 1000 var Ultraclicker = 2000 var UltraclickerCost = 0 +var prestigePoints = 0 //prestige points +var requiredMoney = 1000000 //money required to prestige +var prestigeMultiplier = 1.2 //multiplier for prestige points + + +console.log('MclickCounter loaded:', MclickCounter.version()); //load the save on the website loading window.onload = function() { @@ -50,7 +57,6 @@ function getmoney() { score = score + clickPower; game.clicks++; game.totalMoney += clickPower; - document.getElementById("score").innerHTML = score; } @@ -135,6 +141,7 @@ const game = { clicks: 0, totalMoney: 0, clickers: 0, + prestigePoints: 0, // Other game properties }; @@ -175,16 +182,18 @@ const achievements = [ description: "click one million times. grazy to get without an auto clicker", condition: (game) => game.clicks >= 1000, unlocked: false + }, + { + id: "first_prestige", + name: "Prestige!", + description: "Prestige for the first time.", + condition: (game) => game.prestigePoints >= 1, + unlocked: false } ]; - // advancements - - - - function displayAchievement(achievement) { let container = document.getElementById("achievement-container"); if (!container) { @@ -222,14 +231,6 @@ function displayAchievement(achievement) { } - - - - - - - - function checkAchievements() { achievements.forEach(achievement => { if (!achievement.unlocked && achievement.condition(game)) { @@ -250,7 +251,6 @@ function disableclickerbuy() { } // building upgrades - function buyclicker() { if (score == clickerCost) { clicker++ @@ -277,3 +277,18 @@ function Ultraclickerbuys() { disableUltraclicker() } } + +// prestige system +function givePrestigePoints() { + if (game.totalMoney >= requiredMoney) { + prestigePoints++; + game.totalMoney = 0; // Reset total money after prestiging + alert("You have prestiged and earned a prestige point!"); + game.clicks = 0; + game.clickers = 0; + game.prestigePoints += 1; + game.clickPower = Math.round(game.clickPower * prestigeMultiplier); + clickPower = game.clickPower; + } +} + diff --git a/src/require.js b/src/require.js new file mode 100644 index 0000000..8ffd104 --- /dev/null +++ b/src/require.js @@ -0,0 +1,5 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.3.7 Copyright jQuery Foundation and other contributors. + * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE + */ +var requirejs,require,define;!function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.7",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1,disallowedProps=["__proto__","constructor"];function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e)for(var i=0;i Date: Thu, 2 Oct 2025 07:06:19 +0000 Subject: [PATCH 3/3] Refactor MclickCounter class and remove RequireJS integration; streamline HTML and JavaScript structure --- mclick-counter/src/index.js | 81 ++++++++++++++++++------------------- src/index.html | 2 - src/index.js | 56 +++++++++++++++++++++---- src/require.js | 5 --- src/scripts/main.js | 16 -------- 5 files changed, 87 insertions(+), 73 deletions(-) delete mode 100644 src/require.js delete mode 100644 src/scripts/main.js diff --git a/mclick-counter/src/index.js b/mclick-counter/src/index.js index cc4a3b2..6e8f867 100644 --- a/mclick-counter/src/index.js +++ b/mclick-counter/src/index.js @@ -1,51 +1,48 @@ -define(function () { - class MclickCounter { - constructor(initialValue = 0n) { - this.value = BigInt(initialValue); - } - version() { - return '0.7.0'; - } - increment(amount = 1n) { - this.value += BigInt(amount); - } +class MclickCounter { + constructor(initialValue = 0n) { + this.value = BigInt(initialValue); + } + version() { + return '0.7.0'; + } - set(value) { - this.value = BigInt(value); - } + increment(amount = 1n) { + this.value += BigInt(amount); + } - get() { - return this.value; - } + set(value) { + this.value = BigInt(value); + } + + get() { + return this.value; + } // Format as words (e.g., "1.2 million", "3.4 billion", etc.) - format() { - const units = [ - { suffix: "decillion", value: 10n ** 33n }, - { suffix: "nonillion", value: 10n ** 30n }, - { suffix: "octillion", value: 10n ** 27n }, - { suffix: "septillion", value: 10n ** 24n }, - { suffix: "sextillion", value: 10n ** 21n }, - { suffix: "quintillion", value: 10n ** 18n }, - { suffix: "quadrillion", value: 10n ** 15n }, - { suffix: "trillion", value: 10n ** 12n }, - { suffix: "billion", value: 10n ** 9n }, - { suffix: "million", value: 10n ** 6n }, - { suffix: "thousand", value: 10n ** 3n } - ]; + format() { + const units = [ + { suffix: "decillion", value: 10n ** 33n }, + { suffix: "nonillion", value: 10n ** 30n }, + { suffix: "octillion", value: 10n ** 27n }, + { suffix: "septillion", value: 10n ** 24n }, + { suffix: "sextillion", value: 10n ** 21n }, + { suffix: "quintillion", value: 10n ** 18n }, + { suffix: "quadrillion", value: 10n ** 15n }, + { suffix: "trillion", value: 10n ** 12n }, + { suffix: "billion", value: 10n ** 9n }, + { suffix: "million", value: 10n ** 6n }, + { suffix: "thousand", value: 10n ** 3n } + ]; - for (const unit of units) { - if (this.value >= unit.value) { - const whole = this.value / unit.value; - const decimal = (this.value % unit.value) / (unit.value / 10n); - return `${whole}.${decimal} ${unit.suffix}`; - } + for (const unit of units) { + if (this.value >= unit.value) { + const whole = this.value / unit.value; + const decimal = (this.value % unit.value) / (unit.value / 10n); + return `${whole}.${decimal} ${unit.suffix}`; } - - return this.value.toString(); // just show number for small values } - } - return MclickCounter; -}); + return this.value.toString(); // just show number for small values + } +} \ No newline at end of file diff --git a/src/index.html b/src/index.html index 4baaafd..73c58a4 100644 --- a/src/index.html +++ b/src/index.html @@ -4,8 +4,6 @@ Money Clicker - - diff --git a/src/index.js b/src/index.js index 7a5e946..8506b87 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,5 @@ //variables //sets variable called score to zero - - var score = 0; var cursorCost = 2; var cursors = 0; @@ -18,9 +16,49 @@ var prestigePoints = 0 //prestige points var requiredMoney = 1000000 //money required to prestige var prestigeMultiplier = 1.2 //multiplier for prestige points - -console.log('MclickCounter loaded:', MclickCounter.version()); - +function constructor(initialValue = 0n) +{ + this.value = BigInt(initialValue); +} +function increment(amount = 1n) +{ + this.value += BigInt(amount); +} +function set(value) +{ + this.value = BigInt(value); +} +function get() +{ + console.log(this.value) +} +// Format as words (e.g., "1.2 million", "3.4 billion", etc.) +function format(value) +{ + this.value = BigInt(value); + const units = [ + { suffix: "decillion", value: 10n ** 33n }, + { suffix: "nonillion", value: 10n ** 30n }, + { suffix: "octillion", value: 10n ** 27n }, + { suffix: "septillion", value: 10n ** 24n }, + { suffix: "sextillion", value: 10n ** 21n }, + { suffix: "quintillion", value: 10n ** 18n }, + { suffix: "quadrillion", value: 10n ** 15n }, + { suffix: "trillion", value: 10n ** 12n }, + { suffix: "billion", value: 10n ** 9n }, + { suffix: "million", value: 10n ** 6n }, + { suffix: "thousand", value: 10n ** 3n } + ]; + + for (const unit of units) { + if (this.value >= unit.value) { + const whole = this.value / unit.value; + const decimal = (this.value % unit.value) / (unit.value / 10n); + return `${whole}.${decimal} ${unit.suffix}`; + } + } + return this.value.toString(); // just show number for small values +} //load the save on the website loading window.onload = function() { Load() @@ -54,10 +92,13 @@ function BuySuperCursors() { function getmoney() { + var formatedScorse = format(score) + document.getElementById("score").innerHTML = formatedScorse; score = score + clickPower; game.clicks++; game.totalMoney += clickPower; - document.getElementById("score").innerHTML = score; + + //document.getElementById("score").innerHTML = formatedScorse; } @@ -283,7 +324,6 @@ function givePrestigePoints() { if (game.totalMoney >= requiredMoney) { prestigePoints++; game.totalMoney = 0; // Reset total money after prestiging - alert("You have prestiged and earned a prestige point!"); game.clicks = 0; game.clickers = 0; game.prestigePoints += 1; @@ -291,4 +331,4 @@ function givePrestigePoints() { clickPower = game.clickPower; } } - + diff --git a/src/require.js b/src/require.js deleted file mode 100644 index 8ffd104..0000000 --- a/src/require.js +++ /dev/null @@ -1,5 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.3.7 Copyright jQuery Foundation and other contributors. - * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE - */ -var requirejs,require,define;!function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.7",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1,disallowedProps=["__proto__","constructor"];function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e)for(var i=0;i