let wood, cookieimg, emraldcookieimg, cursorimg, cookie, emraldcookie, ecstart, frenzydisplay, clickfrenzydisplay, wipescreen;
let mycursor, mycursorbutton, grandma, grandmabutton, farm, farmbutton, mine, minebutton, factory, factorybutton, bank, bankbutton,
temple, templebutton, wizardtower, wizardtowerbutton, shipment, shipmentbutton, alchemylab, alchemylabbutton, portal,
portalbutton, timemachine, timemachinebutton, clickingup, cursorup;
let clickfrenzyison = false
function convertSeconds(s) {
return nf(min, 2) + ':' + nf(sec, 2);
wood = loadImage("download.jpg");
cookieimg = loadImage("pngimg.com - cookie_PNG13659.png");
emraldcookieimg = loadImage("EmraldCookie.png");
createCanvas(windowWidth - 23, windowHeight * 2);
emraldcookie = new EmraldCookie();
frenzydisplay = new frenzyDisplay()
clickfrenzydisplay = new clickFrenzyDisplay()
wipescreen = new wipeScreen()
wizardtower = new WizardTower();
shipment = new Shipment();
alchemylab = new AlchemyLab();
timemachine = new TimeMachine();
clickingup = new Clickingup();
cursorup = new Cursorup();
let this_cookies = getItem('some-cookies');
let this_cps = getItem('some-cps');
let this_clickcps = getItem('some-clickcps');
let this_clickpowerplus = getItem('clickpowerplus');
let this_cursors = getItem('some-cursors');
let this_grandmas = getItem('some-grandmas');
let this_farms = getItem('some-farms');
let this_mines = getItem('some-mines');
let this_factorys = getItem('some-factorys');
let this_banks = getItem('some-banks');
let this_temples = getItem('some-temples');
let this_wizardtowers = getItem('some-wizardtowers');
let this_shipments = getItem('some-shipments');
let this_alchemylabs = getItem('some-alchemylabs');
let this_portals = getItem('some-portals');
let this_timemachines = getItem('some-timemachines');
let cursor_price = getItem('cursor-price')
let grandma_price = getItem('grandma-price')
let farm_price = getItem('farm-price')
let mine_price = getItem('mine-price')
let factory_price = getItem('factory-price')
let bank_price = getItem('bank-price')
let temple_price = getItem('temple-price')
let wizardtower_price = getItem('wizardtower-price')
let shipment_price = getItem('shipment-price')
let alchemylab_price = getItem('alchemylab-price')
let portal_price = getItem('portal-price')
let timemachine_price = getItem('timemachine-price')
clickpower = this_clickcps;
clickingup.price = this_clickpowerplus
if (this - cps !== null) {
mycursor.howmanyhaveigot = this_cursors;
grandma.howmanyhaveigot = this_grandmas;
farm.howmanyhaveigot = this_farms;
mine.howmanyhaveigot = this_mines;
factory.howmanyhaveigot = this_factorys;
bank.howmanyhaveigot = this_banks;
temple.howmanyhaveigot = this_temples;
wizardtower.howmanyhaveigot = this_wizardtowers;
shipment.howmanyhaveigot = this_shipments;
alchemylab.howmanyhaveigot = this_alchemylabs;
portal.howmanyhaveigot = this_portals;
timemachine.howmanyhaveigot = this_timemachines;
if (cursor_price !== null) {
mycursor.price = cursor_price;
} else if (grandma_price !== null) {
grandma.price = grandma_price;
} else if (farm_price !== null) {
} else if (mine_price !== null) {
} else if (factory_price !== null) {
factory.price = factory_price;
} else if (bank_price !== null) {
} else if (temple_price !== null) {
temple.price = temple_price;
} else if (wizardtower_price !== null) {
wizardtower.price = wizardtower_price;
} else if (shipment_price !== null) {
shipment.price = shipment_price;
} else if (alchemylab_price !== null) {
alchemylab.price = alchemylab_price;
} else if (portal_price !== null) {
portal.price = portal_price;
} else if (timemachine_price !== null) {
timemachine.price = timemachine_price;
setTimeout(ecspawn, 3000);
clickpower = cps / 100 * clickingup.howmanyhaveigot + 1
let seconds = floor(millis() / 100);
let sec = floor(seconds % 60);
let min = floor(seconds / 60);
let hour = floor(seconds / 360);
let timeis = sec + min * 60 + hour * 24;
if (timeis > previousTime) {
if (moreclickpower > 0) {
clickFrenzyDisplayActivate()
clickFrenzyDisplayActivate()
if (wipescreenon == true) {
function mouseReleased() {
if (cookie.clicked(mouseX, mouseY)) {
if (emraldcookie.clicked(mouseX, mouseY)) {
let decide = random(0, 100);
} else if (decide > 47 && decide < 96) {
emraldcookie.x = 1000000;
if (cps * 900 + 13 > cookies / 100 * 15) {
cookies += cookies / 100 * 15 + 13
cookies += (cps + morecps) * 900 + 13
let interval = setInterval(timeIt, 1000);
currentTime = floor((millis() - startTime) / 1000);
if (timeleft - currentTime <= 0) {
function frenzyDisplayActivate() {
function frenzyDisplay() {
text('Frenzy x7 cps ' + convertSeconds(timeleft - currentTime), width / 6, height / 2 - 30)
function ecclickfrenzy() {
let interval = setInterval(timeIt, 1000);
moreclickpower = clickpower * 776
currentTime = floor((millis() - startTime) / 1000);
if (timeleft - currentTime <= 0) {
function clickFrenzyDisplayActivate() {
clickfrenzydisplay.show()
function clickFrenzyDisplay() {
text('Click Frenzy x777 clicking power ' + convertSeconds(timeleft - currentTime), width / 6, height / 2 - 30)
rect(0, 20, width / 3 - 10, 120);
text(numShort(cookies) + " Cookies", width / 6, 70);
text(numShort(cps + morecps) + " CpS", width / 6, 115);
image(cookieimg, this.x, this.y, this.w, this.h);
let d = dist(x, y, this.x, this.y);
return d < this.w / 2 - 4;
text("Store", (width / 6) * 4, 33);
text("Upgrades", width / 3 + 120, 90);
text("Buildings", (width / 6) * 5, 90);
image(wood, width / 3 - 10, 0, 20, height / 2);
image(wood, width / 4 * 3 - 16, 120, 20, height);
image(wood, 0, 0, 20, height / 2);
image(wood, 0, height / 2 - 20, width / 4 * 3 - 15, 20);
image(wood, 0, 0, width / 3 - 10, 20);
image(wood, 0, 140, width / 3 - 10, 20);
image(wood, width / 3 + 10, 40, (width / 3) * 2, 20);
image(wood, width / 3 + 10, 100, (width / 3) * 2, 20);
mycursor.howmanyhaveigot = 0
grandma.howmanyhaveigot = 0
factory.howmanyhaveigot = 0
temple.howmanyhaveigot = 0
wizardtower.howmanyhaveigot = 0
wizardtower.price = 330000000
shipment.howmanyhaveigot = 0
shipment.price = 5100000000
alchemylab.howmanyhaveigot = 0
alchemylab.price = 75000000000
portal.howmanyhaveigot = 0
portal.price = 1000000000000
timemachine.howmanyhaveigot = 0
timemachine.price = 14000000000000
function EmraldCookie() {
this.x = random(50, width - 50);
this.y = random(50, height / 2 - 50);
image(emraldcookieimg, this.x, this.y, this.d, this.d);
this.clicked = function(x, y) {
let d = dist(x, y, this.x, this.y);
emraldcookie.x = random(50, width / 2 - 50);
emraldcookie.y = random(50, height / 2 / 2 - 50);
setTimeout(ecspawn, random(300000, 900000));
} else if (n > 999999 && n < 1000000000) {
return nfc(n / 1000000, 3) + ' M';
} else if (n > 999999999 && n < 1000000000000) {
return nfc(n / 1000000000, 3) + ' B';
} else if (n > 999999999999 && n < 1000000000000000) {
return nfc(n / 1000000000000, 3) + ' T';
} else if (n > 999999999999999 && n < 1000000000000000000) {
return nfc(n / 1000000000000000, 3) + ' Qa';
} else if (n > 999999999999999999 && n < 1000000000000000000000) {
return nfc(n / 1000000000000000000, 3) + ' Qi';
} else if (n > 999999999999999999999 && n < 1000000000000000000000000) {
return nfc(n / 1000000000000000000000, 3) + ' Sx';
} else if (n > 999999999999999999999999 && n < 1000000000000000000000000000) {
return nfc(n / 1000000000000000000000000, 3) + ' Sp';
} else if (n > 999999999999999999999999999 && n < 1000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000, 3) + ' Oc';
} else if (n > 999999999999999999999999999999 && n < 1000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000, 3) + ' No';
} else if (n > 999999999999999999999999999999999 && n < 1000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000, 3) + ' Dc';
} else if (n > 999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000, 3) + ' Ud';
} else if (n > 999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000, 3) + ' Dd';
} else if (n > 999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000, 3) + ' Td';
} else if (n > 999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000, 3) + ' Qad';
} else if (n > 999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000, 3) + ' Qid';
} else if (n > 999999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000000, 3) + ' Sxd';
} else if (n > 999999999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000000000, 3) + ' Spd';
} else if (n > 999999999999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000000000000, 3) + ' Ocd';
} else if (n > 999999999999999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000000000000000, 3) + ' Nod';
} else if (n > 999999999999999999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000000000000000000, 3) + ' Vg';
} else if (n > 999999999999999999999999999999999999999999999999999999999999999999 && n < 1000000000000000000000000000000000000000000000000000000000000000000000) {
return nfc(n / 1000000000000000000000000000000000000000000000000000000000000000000, 3) + ' Uvg';
storeItem('some-cookies', cookies);
storeItem('some-cps', cps);
storeItem('some-clickcps', clickpower);
storeItem('clickpowerplus', clickingup.price)
storeItem('some-cursors', mycursor.howmanyhaveigot);
storeItem('some-grandmas', grandma.howmanyhaveigot);
storeItem('some-farms', farm.howmanyhaveigot);
storeItem('some-mines', mine.howmanyhaveigot);
storeItem('some-factorys', factory.howmanyhaveigot);
storeItem('some-banks', bank.howmanyhaveigot);
storeItem('some-temples', temple.howmanyhaveigot);
storeItem('some-wizardtowers', wizardtower.howmanyhaveigot);
storeItem('some-shipments', shipment.howmanyhaveigot);
storeItem('some-alchemylabs', alchemylab.howmanyhaveigot);
storeItem('some-portals', portal.howmanyhaveigot);
storeItem('some-timemachines', timemachine.howmanyhaveigot);
storeItem('cursor-price', mycursor.price);
storeItem('grandma-price', grandma.price);
storeItem('farm-price', farm.price);
storeItem('mine-price', mine.price);
storeItem('factory-price', factory.price);
storeItem('bank-price', bank.price);
storeItem('temple-price', temple.price);
storeItem('wizardtower-price', wizardtower.price);
storeItem('shipment-price', shipment.price);
storeItem('alchemylab-price', alchemylab.price);
storeItem('portal-price', portal.price);
storeItem('timemachine-price', timemachine.price);
rect(this.x, this.y, this.w, this.h, 15);
text('WIPE', this.x, this.y - 70);
text('Are you sure you want to\nwipe the game and reset?\nYou will lose all your progress.', this.x, this.y - 50);
rect(this.x - 60, this.y + 40, 70, 50, 10);
text('Yes', this.x - 60, this.y + 45);
rect(this.x + 60, this.y + 40, 70, 50, 10);
text('No', this.x + 60, this.y + 45);
if (mouseIsPressed && mouseX > this.x - 60 - 35 && mouseX < this.x - 60 + 35 && mouseY > this.y + 40 + 25 && mouseY < this.y + 40 - 25) {
const createButton = (intervalId, textStart, textStop, func) => {
const topBar = document.getElementById('topBar');
const block = document.createElement('div');
const link = document.createElement('a');
link.innerText = textStart;
link.setAttribute('href', '#cookies');
link.addEventListener('click', (event) => {
link.innerText = textStart;
clearInterval(intervalId);
link.innerText = textStop;
intervalId = setInterval(func, 1);
topBar.insertBefore(block, topBar.firstChild);
let goldenCookieInterval = null;
let bigCookieInterval = null;
Array.from(document.getElementById('shimmers').children).forEach((el) => {
document.getElementById('bigCookie').click();
const news = document.getElementById('commentsText1');
Array.from(news.children).forEach((el) => {
el.className === 'fortune' && news.click();