Advertisement
Game_Logic

Clicker Game

May 11th, 2019
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. document.body.innerHTML = "<big id='count'>0</big><div><button onclick='add()'>Click!</button></div>"; function add() { var val = Number(document.getElementById('count').innerHTML) + Number(1); document.getElementById('count').innerHTML = val; var count = document.getElementById('count').innerHTML; if (count == 666) { document.getElementById('count').outerHTML = "<big style='color:red;font-size:30;' id='count'>666</big>"; }; if (count == 667) { document.getElementById('count').outerHTML = "<big id='count'>667</big>"; }; if (count == 777) { document.getElementById('count').outerHTML = "<big style='color:cyan;font-size:30;' id='count'>777</big>"; }; if (count == 778) { document.getElementById('count').outerHTML = "<big id='count'>778</big>"; }; }; function addClicks(clicks) { var val = Number(document.getElementById('count').innerHTML) + Number(clicks); document.getElementById('count').innerHTML = val; }; function setClicks(clicks) { var val = Number(document.getElementById('count').innerHTML) - Number(document.getElementById('count').innerHTML); addClicks(clicks); document.getElementById('count').innerHTML = val; document.getElementById('count').innerHTML = clicks; }; function resetClicks() { document.getElementById('count').innerHTML = 0; }; confirm('Available Commands : setClicks() | addClicks() | resetClicks() ');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement