I don’t know how I would code a two cps. I need help.
Code for project:
function refreshclicks() {
setText(“clickdisplay”, "Clicks: " + howmany);
setText(“shopclickdisplay”, "Clicks: " + howmany);
}
var howmany = 0;
function minuscountdown(takeaway) {
for(takeaway; takeaway>0; takeaway–){
refreshclicks();
}
howmany = howmany - 10;
}
minuscountdown(10);
refreshclicks();
onEvent(“clickcoin”, “click”, function(event) {
howmany = howmany + 1;
console.log(“added 1 click”);
refreshclicks();
});
onEvent(“debug”, “click”, function(event) {
setScreen(“debugmenu”);
});
onEvent(“setclicks”, “click”, function(event) {
howmany = prompt(“Enter a value”);
refreshclicks();
});
onEvent(“back”, “click”, function(event) {
setScreen(“default”);
});
onEvent(“2x”, “click”, function(event) {
//purchase system
if (howmany >= 10) {
console.log(“2x bought”);
setText(“2x”, “BOUGHT!”);
refreshclicks();
} else {
setText(“2x”, “Not enough clicks!”);
setTimeout(function() {
setText(“2x”, “buy 2x clicks: 10 clicks”);
}, 1000);
}
});
onEvent(“backtohome”, “click”, function(event) {
setScreen(“default”);
});
onEvent(“gotoshop”, “click”, function(event) {
setScreen(“shop”);
});