Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //biscuit tapper v1.2 dev version
- let scoreText = document.getElementById("scoreText");
- let biscuitButton = document.querySelector("#biscuitButton");
- let resetButton = document.getElementById("resetButton");
- let buyAutoClicker = document.getElementById("buyAutoClicker");
- let amountOfAutoClickersText = document.getElementById("amountOfAutoClickersText");
- let score = 0;
- let amountOfAutoClickers = 0;
- let canClick = true;
- console.log("Made by [email protected]; idea from cookie clicker by orteil \nCheated biscuits taste bad.")
- biscuitButton.onclick = function() {
- if (canClick) {
- score++;
- scoreText.innerText = score;
- canClick = false;
- setTimeout( function() {
- canClick = true;
- }, 250);
- }
- }
- resetButton.onclick = function() {
- score = 0;
- amountOfAutoClickers = 0;
- scoreText.innerText = score;
- amountOfAutoClickersText.innerText = amountOfAutoClickers;
- }
- buyAutoClicker.onclick = function() {
- if (score < 100) {
- console.log("no mony");
- } else {
- score -= 100;
- amountOfAutoClickers++;
- amountOfAutoClickersText.innerText = amountOfAutoClickers;
- setInterval(autoClick, 4000);
- }
- function autoClick() {
- scoreText.innerText = score;
- score += amountOfAutoClickers;
- scoreText.innerText = score;
- }
- }
- /**function incrementScore() {
- score++;
- scoreText.innerText = score;
- }**/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement