Added baby Shiba + added heal boy function and choice window (needs to be implemented)

This commit is contained in:
2024-09-12 23:01:15 +02:00
parent eece543199
commit 9b3e7ecaa1
8 changed files with 60 additions and 11 deletions

BIN
img/gone/shiba.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 KiB

BIN
img/shiba/adult.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

BIN
img/shiba/baby.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

BIN
img/shiba/senior.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

BIN
img/shiba/teen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 KiB

View File

@@ -9,6 +9,11 @@
<title>PetPet</title> <title>PetPet</title>
</head> </head>
<body> <body>
<dialog id="chui" open>
<p>:OOOO</p>
<a href="./Games/" style="color: #fff;text-decoration: none;font-size: 20px;">:0000</a>
</dialog>
<div id="blurs"></div>
<article class="cash"> <article class="cash">
<img src="./img/mone.png" style="height: 1rem;"> <img src="./img/mone.png" style="height: 1rem;">
<p>Money: <span>0</span></p> <p>Money: <span>0</span></p>
@@ -34,7 +39,7 @@
</article> </article>
<article class="item"> <article class="item">
<p>Health: <span id="heaN"></span></p> <p>Health: <span id="heaN"></span></p>
<button class="actBTN" onclick="">Heal</button> <button class="actBTN" onclick="healBoy()">Heal</button>
</article> </article>
</div> </div>
<div class="games"> <div class="games">

11
main.js
View File

@@ -24,11 +24,6 @@ const animalImage = {
Dead: `./img/dead/${chosenAnimal}.png`, Dead: `./img/dead/${chosenAnimal}.png`,
Gone: `./img/gone/${chosenAnimal}.png` Gone: `./img/gone/${chosenAnimal}.png`
} }
////Spring: {},
////Summer: {},
////Fall: {},
////Winter: {},
} }
let attributes = { let attributes = {
@@ -137,7 +132,7 @@ function display(){
}else if(attributes.Age.value<60){ }else if(attributes.Age.value<60){
NameC.innerHTML = `Adult`; NameC.innerHTML = `Adult`;
Aimg.src = animalImage.animal.Normal.age[2]; Aimg.src = animalImage.animal.Normal.age[2];
}else if(attributes.Age.value<100){ }else if(attributes.Age.value<attributes.Age.max){
NameC.innerHTML = `Senior`; NameC.innerHTML = `Senior`;
Aimg.src = animalImage.animal.Normal.age[3]; Aimg.src = animalImage.animal.Normal.age[3];
}else{ }else{
@@ -196,6 +191,10 @@ function clearBoy(){
display(); display();
} }
function healBoy(){
alert('Not enough money!');
}
function hapiHeal(){ function hapiHeal(){
if( attributes.Hunger.value > (attributes.Hunger.max/100)* 70 && //? Hunger heal if( attributes.Hunger.value > (attributes.Hunger.max/100)* 70 && //? Hunger heal
attributes.Joy.value > (attributes.Joy.max/100)* 80 && //? Joy heal attributes.Joy.value > (attributes.Joy.max/100)* 80 && //? Joy heal

View File

@@ -137,3 +137,48 @@ span p{
border-radius: 0; border-radius: 0;
} }
} }
#blurs{
z-index: 68;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
backdrop-filter: blur(10px);
}
#chui{
z-index: 69;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 400px;
height: 400px;
padding: 1.5rem;
border: none;
border-radius: 1.5rem;
background-color: #333333dd;
color: #fff;
transition: .5s;
overflow: hidden;
}
#chui::backdrop{
content: '';
position: absolute;
background: #3c3;
width: 200px;
height: 300px;
border: red 2px solid;
}