Version - 1 - 1-38

This commit is contained in:
2023-11-29 22:29:18 +01:00
commit 2b81a65227
396 changed files with 19689 additions and 0 deletions

17
Version - 18/Add.txt Normal file
View File

@@ -0,0 +1,17 @@
click.offline.make
max 5 hour
BuyDog dog.log clicks/s
1 dog = 1 clicks/s
1 cat = 100 clicks/s
1 hamster = 10 000 c/s
1 girrafe = 1 000 000 c/s
1 citronovník = 30 lemons/h
reset all.clicks
36,7% k 10 citronum že vyroste citronovník
compile to .exe and add it to the play store

16
Version - 18/devlog.txt Normal file
View File

@@ -0,0 +1,16 @@
v. 15
- added comments making code more readeble
- id of paragraph showing items must be same as item name in items object if not error can occur
- orgenised code in logic order (as example look at css & html)
- ui.updateitems function made working on every item in items object
- added lemons as new item now four total (including clicks)
- separated buy item functions from game object now are in buy object
- added setup function to game object to clean up window.onload function

75
Version - 18/index.html Normal file
View File

@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>BRB clicker</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- By MrEidamus & Stanislav Chlup -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- reset progress -->
<div id="delete">
<button id="reset" onclick="game.reset()">Reset</button>
</div>
<!-- percent button -->
<button id="percent" onclick="game.percents()">
1x
</button>
<!-- B.R.B. (big red button) -->
<div id="button">
<img src = 'https://i.postimg.cc/9Rs0vWFF/Nezm-kl.png' id="unpressed">
<img src = "https://i.postimg.cc/NLr5Rrpy/Zm-kl.png" id="pressed">
</div>
<!-- clicks logging -->
<div id="clicks">
<p id="logclicks"></p>
</div>
<!-- item sections -->
<!-- dogs -->
<div id="dog">
<p id="logdogs"></p>
<button id="buydog" onclick="buy.dog()">
Buy a dog for 100 clicks!
</button>
</div>
<!-- cats -->
<div id="cat">
<p id="logcats"></p>
<button id="buycat" onclick="buy.cat()">
Buy a cat for 10 dogs!
</button>
</div>
<!-- lemons -->
<div id="lemon">
<p id="loglemons"></p>
<button id="buylemon" onclick="buy.lemon()">
Buy a lemon for ? cats!
</button>
</div>
<!-- foxes -->
<div id="fox">
<p id="logfoxes"></p>
<button id="buyfox" onclick="buy.fox()">
Buy a fox for 15 dogs!
</button>
</div>
<!-- script -->
<script src="main.js"></script>
</body>
</html>

62
Version - 18/main.js Normal file
View File

@@ -0,0 +1,62 @@
window.onload = function(){
game.setup();
};
// items
var items = {
clicks: 0,
dogs: 0,
cats: 0,
lemons: 0,
foxes: 0,
};
// device
var user = {
device: function(){return (/Android|iPhone/i.test(navigator.userAgent));},/* true for mobiles */
setkeys: function(){
if(user.device()){
document.getElementById('button').ontouchstart=function(){button.press()};document.getElementById('button').ontouchend=function(){button.unpress()}
}else{document.getElementById('button').onmousedown=function(){button.press()};document.getElementById('button').onmouseup=function(){button.unpress()};};},
};
//user interface
var ui = {
updateitems: function(){
for (let name in items) {
document.getElementById('log'+name).innerHTML ='You have ' + name + ': ' + items[name];
}
localStorage.setItem('items', JSON.stringify(items))
},
}
// BRB
var button = {
press: function(){game.click();document.getElementById('unpressed').style.visibility = 'hidden';document.getElementById('pressed').style.visibility = 'visible';},
unpress: function(){document.getElementById('unpressed').style.visibility = 'visible';document.getElementById('pressed').style.visibility = 'hidden';},
};
// game functions
var game = {
loaditems: function(){items = JSON.parse(localStorage.getItem('items'));},
reset: function(){if(confirm('Are you sure you want to reset all your progress?')){items={clicks: 0,dogs: 0,cats: 0,lemons: 0,foxes: 0,};ui.updateitems();}},
setup: function(){user.setkeys();if (localStorage.getItem('items')!=null){game.loaditems();};ui.updateitems();},
click: function(){items.clicks+=1;ui.updateitems();},
};
// buy item functions
var buy = {
dog: function(){if(items.clicks>=100){items.dogs+=1;items.clicks-=100;ui.updateitems();}},
cat: function(){if(items.dogs>=10){items.cats+=1;items.dogs-=10;ui.updateitems();}},
lemon: function(){if(items.cats>=5){items.lemons+=1;items.cats-=5;ui.updateitems();}},
fox: function(){if(items.dogs>=15){items.foxes+=1;items.dogs-=15;ui.updateitems();}},
}

136
Version - 18/style.css Normal file
View File

@@ -0,0 +1,136 @@
body {
font-size: 15pt;
user-select: none;
}
/* reset */
#reset{
user-select: none;
width: 75px;
height: 50px;
background-color: darkred;
color: #ffffff;
}
#delete{
user-select: none;
position: absolute;
top: 900px;
right: 10px;
}
/* percent */
#percent{
user-select: none;
width: 30px;
height: 30px;
position: absolute;
top: 10px;
}
/*BRB*/
#unpressed{
position: absolute;
width: 300px;
height: 300px;
border-radius: 150px;
}
#pressed{
position: absolute;
width: 300px;
height: 300px;
visibility: hidden;
border-radius: 150px;
}
#button{
user-select: none;
position: absolute;
top: 69px;
left: 50%;
margin: 0 0 0 -150px;
border-radius: 150px;
}
/* I T E M S */
/* click */
#clicks{
position: absolute;
text-align: center;
height: 20px;
width: 400px;
top: 10px;
left: 50%;
margin: 0 0 0 -200px;
}
/* dog */
#dog{
position: absolute;
top: 400px;
}
#buydog{
width: 180px;
height: 50px;
background-color: wheat;
border-radius: 20px;
}
#logdogs{
position: absolute;
width: 200px;
top: -5px;
left: 190px;
}
/* cat */
#cat{
position: absolute;
top: 475px;
}
#buycat{
width: 180px;
height: 50px;
background-color: darkgray;
border-radius: 20px;
}
#logcats{
position: absolute;
width: 200px;
top: -5px;
left: 190px;
}
/* lemon */
#lemon{
position: absolute;
top: 550px;
}
#buylemon{
width: 180px;
height: 50px;
background-color: yellow;
border-radius: 20px;
}
#loglemons{
position: absolute;
width: 200px;
top: -5px;
left: 190px;
}
/* fox */
#fox{
position: absolute;
top: 625px;
}
#buyfox{
width: 180px;
height: 50px;
background-color: orange;
border-radius: 20px;
}
#logfoxes{
position: absolute;
width: 200px;
top: -5px;
left: 190px;
}