Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"features": {
"ghcr.io/r3dpoint/devcontainer-features/tailwindcss-standalone-cli:1": {}
},

"postCreateCommand": "npm i"

}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/node_modules
/lib
/mclick-theme/node_modules
/mclick-theme/node_modules
10 changes: 7 additions & 3 deletions mclick-counter/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export default class MclickCounter {

class MclickCounter {
constructor(initialValue = 0n) {
this.value = BigInt(initialValue);
}
version() {
return '0.7.0';
}

increment(amount = 1n) {
this.value += BigInt(amount);
Expand All @@ -15,7 +19,7 @@ export default class MclickCounter {
return this.value;
}

// Format as words (e.g., "1.2 million", "3.4 billion", etc.)
// Format as words (e.g., "1.2 million", "3.4 billion", etc.)
format() {
const units = [
{ suffix: "decillion", value: 10n ** 33n },
Expand All @@ -41,4 +45,4 @@ export default class MclickCounter {

return this.value.toString(); // just show number for small values
}
}
}
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
87 changes: 71 additions & 16 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//variables
//sets variable called score to zero

var score = 0;
var cursorCost = 2;
var cursors = 0;
Expand All @@ -13,7 +12,53 @@ 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

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()
Expand Down Expand Up @@ -47,11 +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;
}


Expand Down Expand Up @@ -135,6 +182,7 @@ const game = {
clicks: 0,
totalMoney: 0,
clickers: 0,
prestigePoints: 0,
// Other game properties
};

Expand Down Expand Up @@ -175,16 +223,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) {
Expand Down Expand Up @@ -222,14 +272,6 @@ function displayAchievement(achievement) {
}










function checkAchievements() {
achievements.forEach(achievement => {
if (!achievement.unlocked && achievement.condition(game)) {
Expand All @@ -250,7 +292,6 @@ function disableclickerbuy() {
}

// building upgrades

function buyclicker() {
if (score == clickerCost) {
clicker++
Expand All @@ -277,3 +318,17 @@ function Ultraclickerbuys() {
disableUltraclicker()
}
}

// prestige system
function givePrestigePoints() {
if (game.totalMoney >= requiredMoney) {
prestigePoints++;
game.totalMoney = 0; // Reset total money after prestiging
game.clicks = 0;
game.clickers = 0;
game.prestigePoints += 1;
game.clickPower = Math.round(game.clickPower * prestigeMultiplier);
clickPower = game.clickPower;
}
}