Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var curAmntLogs = 1000.00;
- var curAmntClay = 1000.00;
- var curAmntMetal = 1000.00;
- var maxResources = 1000;
- var curLogsPerSec = 1.67;
- var curClayPerSec = 1.67;
- var curMetalPerSec = 1.67;
- function logs() {
- curAmntLogs = curAmntLogs + curLogsPerSec;
- if (curAmntLogs > maxResources) {
- curAmntLogs = maxResources;
- document.getElementById('logs').innerHTML = '<strong>' + (curAmntLogs).toFixed(2) + '</strong>';
- } else {
- document.getElementById('logs').innerHTML = (curAmntLogs).toFixed(2);
- }
- }
- function clay() {
- curAmntClay = curAmntClay + curClayPerSec;
- if (curAmntClay > maxResources) {
- curAmntClay = maxResources;
- document.getElementById('clay').innerHTML = '<strong>' + (curAmntClay).toFixed(2) + '</strong>';
- } else {
- document.getElementById('clay').innerHTML = (curAmntClay).toFixed(2);
- }
- }
- function metal() {
- curAmntMetal = curAmntMetal + curMetalPerSec;
- if (curAmntMetal > maxResources) {
- curAmntMetal = maxResources;
- document.getElementById('metal').innerHTML = '<strong>' + (curAmntMetal).toFixed(2) + '</strong>';
- } else {
- document.getElementById('metal').innerHTML = (curAmntMetal).toFixed(2);
- }
- }
- setInterval(function(){ logs(); clay(); metal(); }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement