Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Forks of this sketch will become the forks of "Idle campfire".
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
Click the campfire to get embers, then spend them on upgrades!
A fork of Idle campfire by LukeFrayne
CC Attribution NonCommercial ShareAlike
Money Clicker
xxxxxxxxxx
// Options
// Show/hide cursor
// Toggle click sound
// Scroll direction up/down
// Fire height
// Shortened Numbers
// ??? achievs if you dont have them.
// 681683-42880-242860-9-8-6-103360-2-2-2-2-2-2-2-0-0
var moneyTypes = ["Torn Bills", "Dirt Bills", "Regular Bills", "Laminated Bills", "Glowing Bills", "Fluorescent Bills", "Irradiated Bills", "Neon Bills", "Space Bills", "Quantum Bills"];
// https://firewoodforstoves.com/wood-types/wood-types-best-worst/ was what I used
var laborTypes = ["Ignorant Workers", "Union Workers", "Underpaid Workers", "Chimpanzee Workers", "Outsourced Workers", "Competant Workers", "Educated Workers", "Child Workers", "Cyborg Workers", "Machine Workers"];
var cursorTypes = ["Barely Functional Cursor", "Normal Cursor", "Copper Cursor", "Bronze Cursor", "Silver Cursor", "White Gold Cursor", "Golden Cursor", "Platinum Cursor", "Diamond Cursor"];
var currentFire = 0; var currentLog = 0; var currentCursor = 0;
var fireCost = 1; var logCost = 1000; var cursorCost = 50;
var money = 0;
var mouseHold = false;
var saveScreen = false;
var check1 = true;
var loadScreen = false;
var achScreen = false;
var settingsScreen = false;
var scrollInvert = false;
var playAltClickSound = false;
var achScroll = 0;
var rotation;
var achievements = [
{"name":"First Paycheck", "description":"Get $1.", "completed":false, "claimed":false, "reward":10},
{"name":"Yay, Money!", "description":"Get the Bronze Cursor", "completed":false, "claimed":false, "reward":250},
{"name":"I Love Money!", "description":"Get $500.", "completed":false, "claimed":false, "reward":300},
{"name":"No More Debt", "description":"Get $2,500.", "completed":false, "claimed":false, "reward":1000},
{"name":"Ooh Shiny!", "description":"Get the Platinum Cursor.", "completed":false, "claimed":false, "reward":10000},
{"name":"Student Loans", "description":"Get $15,000.", "completed":false, "claimed":false, "reward":5000},
{"name":"Proper Career", "description":"Get $50,000.", "completed":false, "claimed":false, "reward":10000},
{"name":"Tax Evader", "description":"Get $500,000.", "completed":false, "claimed":false, "reward":150000},
{"name":"Maximum Speed", "description":"Get Fast Workers.", "completed":false, "claimed":false, "reward":750000},
{"name":"Millionare", "description":"Get $2.5 million.", "completed":false, "claimed":false, "reward":1000000},
]
var plasmaEllipses = [];
function preload() {
soundFormats('mp3');
clickSound = loadSound('click.mp3');
altClickSound = loadSound('altClick.mp3');
switchSound = loadSound('switch.mp3');
achDingSound = loadSound('achievementDing.mp3');
}
function setup() {
createCanvas(windowWidth, windowHeight);
rotation = -QUARTER_PI;
textFont("Trebuchet MS");
for (i=0;i<50;i++) {
plasmaEllipses.push([random(500, 900), random(150, 550), random(75, 150), random(50, 75), round(random(1, 3))]);
}
}
function button(x1, y1, x2, y2) {
if (x1 <= mouseX && mouseX <= x2 && y1 <= mouseY && mouseY <= y2) {
return true;
} else {return false;}
}
function shortNum(num) {
let numStr = num;
numMod1000 = String(num%1000);
while (numMod1000.length < 3) {
numMod1000 = "0".concat(numMod1000);
}
if (num >= 1000000000) {
numStr = round(num / 1000000000, 2) + " billion";
} else if (num >= 1000000) {
numStr = round(num / 1000000, 2) + " million";
} else if (num >= 1000) {
numStr = floor(num/1000) + "," + numMod1000;
}
return numStr;
}
function draw() {
background(255,215,0);
stroke(0);
strokeWeight(1);
if (currentFire === 0) {
fill(0, 128+abs(cos(frameCount/35)*35), 10);
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 1) {
fill(84, 51+abs(cos(frameCount/35)*35), 6);
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 2) {
fill(0, 128,+abs(cos(frameCount/35)*35), 0);
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 3) {
fill(0+abs(cos(frameCount/35)*35), 255+abs(cos(frameCount/35)*35), 127);
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 4) {
fill(100, 170, 200+abs(cos(frameCount/35)*35));
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 5) {
fill(220, 150, 200+abs(cos(frameCount/35)*35));
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 6) {
fill(250, 100, 150+abs(cos(frameCount/35)*35));
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 7) {
fill(75, 200+abs(cos(frameCount/35)*35), 110);
beginShape();
vertex(500, 400);
vertex(500, 200);
vertex(900, 200);
vertex(900, 400);
endShape();
textSize(80);
fill(0);
text("$", 680, 325);
} else if (currentFire === 8) {
fill(25, 200+abs(cos(frameCount/35)*35), 200);
for (i=0;i<plasmaEllipses.length;i++) {
ellipse(plasmaEllipses[i][0], plasmaEllipses[i][1], plasmaEllipses[i][2], plasmaEllipses[i][3]);
}
} else if (currentFire === 9) {
for (i=0;i<plasmaEllipses.length;i++) {
if (plasmaEllipses[i][4] === 1) {
fill(200+abs(cos(frameCount/35)*35), 25, 25);
} else if (plasmaEllipses[i][4] === 2) {
fill(25, 200+abs(cos(frameCount/35)*35), 25);
} else {
fill(25, 25, 200+abs(cos(frameCount/35)*35));
}
ellipse(plasmaEllipses[i][0], plasmaEllipses[i][1], plasmaEllipses[i][2]/2, plasmaEllipses[i][3]);
}
}
if (currentLog === 0) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 1) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 2) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 3) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 4) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 5) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 6) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 7) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 8) {
textSize(50);
text("👷", 500, 625);
} else if (currentLog === 9) {
textSize(50);
text("👷", 500, 625);
}
if (button(500, 200, 900, 725) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
if (!mouseHold) {
money+=(round(Math.pow(1.62, currentCursor)) * round(Math.pow(1.5, currentLog)));
if (playAltClickSound) {
altClickSound.play();
} else {
clickSound.play();
}
}
mouseHold = true;
}
fill(0);
textSize(50);
strokeWeight(0);
text("Money: $" + shortNum(round(money)), 50, 50);
textSize(40);
text("Per Click: $" + shortNum(round(Math.pow(1.62, currentCursor)) * round(Math.pow(1.5, currentLog))), 50, 150);
text("Per Second: $" + shortNum(round(Math.pow(1.5, sqrt(currentFire))) * currentFire * round(Math.pow(1.5, currentLog))), 50, 240);
strokeWeight(1);
if (money >= fireCost) {
fill(200, 150, 50);
} else {
fill(150, 100, 0);
}
rect(windowWidth - 500, 100, 400, 150);
if (money >= cursorCost) {
fill(200, 150, 50);
} else {
fill(150, 100, 0);
}
rect(windowWidth - 500, 300, 400, 150);
if (money >= logCost) {
fill(200, 150, 50);
} else {
fill(150, 100, 0);
}
rect(windowWidth - 500, 500, 400, 150);
fill(0);
textSize(24);
strokeWeight(0);
text("Upgrade Bills from "+moneyTypes[currentFire]+" to "+moneyTypes[currentFire+1]+": $"+shortNum(fireCost), windowWidth - 475, 125, 350, 150);
text("Upgrade cursor from "+cursorTypes[currentCursor]+" to "+cursorTypes[currentCursor+1]+": $"+shortNum(cursorCost), windowWidth - 475, 325, 350, 150);
text("Upgrade Workers from "+laborTypes[currentLog]+" to "+laborTypes[currentLog+1]+": $"+shortNum(logCost), windowWidth - 475, 525, 350, 150);
money += (round(Math.pow(1.5, sqrt(currentFire))) * currentFire * round(Math.pow(1.5, currentLog)))/40;
if (money === 1) {
achievements[0].completed = true;
}
if (money >= 500) {
achievements[2].completed = true;
}
if (money >= 2500) {
achievements[3].completed = true;
}
if (money >= 15000) {
achievements[4].completed = true;
}
if (money >= 50000) {
achievements[6].completed = true;
}
if (money >= 500000) {
achievements[7].completed = true;
}
if (money >= 2500000) {
achievements[9].completed = true;
}
if (currentCursor >= 3) {
achievements[1].completed = true;
} else if (currentCursor >= 7) {
achievements[5].completed = true;
}
if (currentLog >= 9) {
achievements[8].completed = true;
}
if (button(windowWidth - 500, 100, windowWidth-100, 250) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
if (!mouseHold) {
if (money >= fireCost) {
currentFire += 1;
money -= fireCost;
switchSound.play();
fireCost = round(1.9 * Math.pow(fireCost, 1.03));
}
}
mouseHold = true;
}
if (button(windowWidth - 500, 300, windowWidth-100, 450) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
if (!mouseHold) {
if (money >= cursorCost) {
currentCursor += 1;
money -= cursorCost;
switchSound.play();
cursorCost = round(1.9 * Math.pow(cursorCost, 1.03));
}
}
mouseHold = true;
}
if (button(windowWidth - 500, 500, windowWidth-100, 650) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
if (!mouseHold) {
if (money >= logCost) {
currentLog += 1;
money -= logCost;
switchSound.play();
logCost = round(1.9 * Math.pow(logCost, 1.03));
}
}
mouseHold = true;
}
fill(200, 100, 50);
strokeWeight(1);
rect(50, windowHeight-150, 100, 100);
rect(200, windowHeight-150, 100, 100);
rect(50, windowHeight-300, 100, 100);
rect(200, windowHeight-300, 100, 100);
fill(0);
textSize(30);
strokeWeight(0);
text("SAVE", 65, windowHeight-115, 100, 100);
text("LOAD", 215, windowHeight-115, 100, 100);
textSize(13.5);
text("ACHIEVEMENTS", 55, windowHeight-260, 100, 100);
textSize(20);
text("SETTINGS", 207, windowHeight-260, 100, 100);
if (button(50, windowHeight-150, 150, windowHeight-50) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
saveScreen = true;
switchSound.play();
}
if (button(200, windowHeight-150, 300, windowHeight-50) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
loadScreen = true;
switchSound.play();
}
if (button(50, windowHeight-300, 150, windowHeight-200) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
achScreen = true;
switchSound.play();
}
if (button(200, windowHeight-300, 300, windowHeight-200) && mouseIsPressed && !saveScreen && !loadScreen && !achScreen && !settingsScreen) {
settingsScreen = true;
switchSound.play();
}
if (saveScreen) {
background(150, 50, 50);
fill(250, 50, 25);
strokeWeight(1);
rect(25, 25, 75, 50);
fill(255);
textSize(20);
strokeWeight(0);
text("CLOSE", 35, 55);
if (button(25, 25, 100, 75) && mouseIsPressed) {
saveScreen = false;
switchSound.play();
}
fill(0);
textSize(50);
text("Check the terminal for your code!", 100, windowHeight*0.4);
if (check1) {
saveCode = fireCost+"-"+cursorCost+"-"+logCost+"-"+currentFire+"-"+currentCursor+"-"+currentLog+"-"+round(money)
for (i=0;i<achievements.length;i++) {
if (achievements[i].completed) {
if (achievements[i].claimed) {
saveCode += "-2"
} else {
saveCode += "-1"
}
} else {saveCode += "-0"}
}
print(saveCode);
check1 = false;
}
} else {check1=true}
if (loadScreen) {
background(150, 50, 50);
fill(250, 50, 25);
strokeWeight(1);
rect(25, 25, 75, 50);
fill(255);
textSize(20);
strokeWeight(0);
text("CLOSE", 35, 55);
if (button(25, 25, 100, 75) && mouseIsPressed) {
loadScreen = false;
switchSound.play();
}
fill(0);
textSize(50);
text("Save Succesfully Loaded!", 100, windowHeight*0.4);
if (check2) {
saveCodes = prompt("Please enter your save code").split("-");
fireCost = int(saveCodes[0]);
cursorCost = int(saveCodes[1]);
logCost = int(saveCodes[2]);
currentFire = int(saveCodes[3]);
currentCursor = int(saveCodes[4]);
currentLog = int(saveCodes[5]);
money = int(saveCodes[6]);
for (i = 7; i < saveCodes.length+1; i++) {
if (saveCodes[i] == 0) {
achievements[i-7].completed = false;
achievements[i-7].claimed = false;
} else if (saveCodes[i] == 1) {
achievements[i-7].completed = true;
achievements[i-7].claimed = false;
} else if (saveCodes[i] == 2) {
achievements[i-7].completed = true;
achievements[i-7].claimed = true;
}
}
check2 = false;
}
} else {check2=true}
if (achScreen) {
background(150, 50, 50);
fill(250, 50, 25);
strokeWeight(1);
rect(25, 25, 75, 50);
fill(255);
textSize(20);
strokeWeight(0);
text("CLOSE", 35, 55);
if (button(25, 25, 100, 75) && mouseIsPressed && achScreen) {
achScroll = 0;
achScreen = false;
switchSound.play();
}
for (i = 0; i < achievements.length; i++) {
if (achievements[i].completed) {
if (achievements[i].claimed) {
fill(150, 250, 150);
} else {
fill(50, 250, 50);
}
} else {fill(100, 200, 100);}
strokeWeight(1);
rect(200, i*300+200+achScroll, 600, 250);
textSize(30);
fill(0);
strokeWeight(0);
if (achievements[i].completed) {
if (achievements[i].claimed) {
text("CLAIMED", 250, i*300+420+achScroll);
} else {
text("CLICK TO CLAIM", 250, i*300+420+achScroll);
}
} else {text("PENDING", 250, i*300+420+achScroll);}
textSize(35);
text(achievements[i].name, 250, i*300+270+achScroll);
textSize(20);
text("Reward: " + " $" + shortNum(achievements[i].reward), 550, i*300+420+achScroll);
textSize(20);
text("Requirement: " + achievements[i].description, 250, i*300+330+achScroll, 700);
if (button(200, i*300+200+achScroll, 800, i*300+550+achScroll) && mouseIsPressed && achievements[i].completed && !achievements[i].claimed) {
money += achievements[i].reward;
achievements[i].claimed = true;
achDingSound.play();
}
}
} else {
for (i=0;i<achievements.length;i++) {
if (achievements[i].completed === true && achievements[i].claimed === false) {
strokeWeight(1);
fill(250, 25, 25);
ellipse(150, windowHeight-300, 20, 20);
break;
}
}
}
if (settingsScreen) {
background(150, 50, 50);
fill(250, 50, 25);
strokeWeight(1);
rect(25, 25, 75, 50);
fill(255);
textSize(20);
strokeWeight(0);
text("CLOSE", 35, 55);
if (button(25, 25, 100, 75) && mouseIsPressed && settingsScreen) {
settingsScreen = false;
switchSound.play();
}
}
if (!mouseIsPressed) {
mouseHold = false;
}
if (mouseIsPressed) {
rotation = min(rotation + 0.2, PI/-8);
} else {
rotation = max(rotation - 0.1, PI/-4);
}
translate(mouseX, mouseY);
rotate(rotation);
strokeWeight(1);
if (currentCursor === 0) {
fill(0);
textSize(60);
text("☚", 0, 0);
} else if (currentCursor === 1) {
fill(255,255,255);
textSize(60);
text("☚", 0, 0);
} else if (currentCursor === 2) {
fill(0);
textSize(60);
text("☚", 0, 0);
} else if (currentCursor === 3) {
fill(0);
textSize(60);
text("☚", 0, 0);
if (mouseIsPressed) {
fill(250, 150+abs(cos(frameCount/35)*35), 25, 150)
ellipse(15, -20, 20, 30);
}
} else if (currentCursor === 4) {
fill(0);
textSize(60);
text("☚", 0, 0);
if (mouseIsPressed) {
fill(50, 100, 250, 150)
ellipse(15, -20, 20, 30);
}
} else if (currentCursor === 5) {
// Design based on: https://sotooutdoors.com/product/pocket_torch_with_refillable_lighter/
fill(0);
textSize(60);
text("☚", 0, 0);
if (mouseIsPressed) {
fill(50, 100, 250, 150)
ellipse(-25, 12, 40, 20);
}
} else if (currentCursor === 6) {
// Design based on: https://www.amazon.com/Professional-Culinary-Continuous-Soldering-Included/dp/B07QPS75MR
fill(0);
textSize(60);
text("☚", 0, 0);
if (mouseIsPressed) {
fill(50, 100, 250, 150)
ellipse(-60, 20, 100, 30);
}
} else if (currentCursor === 7) {
fill(0);
textSize(60);
text("☚", 0, 0);
if (mouseIsPressed) {
fill(240, 60, 60);
rect(80, 110, 20, 20);
stroke(50, 100, 250, 150);
strokeWeight(5);
line(0, 0, 20, 50);
line(20, 50, -20, 50);
line(-20, 50, 0, 100);
}
} else if (currentCursor === 8) {
fill(0);
textSize(60);
text("☚", 0, 0);
if (mouseIsPressed) {
fill(250, 100, 20, 150);
ellipse(-90, 15, 160, 60);
}
}
}
function mouseWheel(event) {
if (scrollInvert) {
achScroll += event.delta/2;
} else {
achScroll -= event.delta/2;
}
}
Examples: Play - Synthesis - Microphone
See More Shortcuts
Please verify your email to comment
Verify Email