version 5, updated

This commit is contained in:
2026-05-15 20:58:17 +03:00
parent f9069e24ba
commit d25f15bd04
4 changed files with 20 additions and 12 deletions
+2 -2
View File
@@ -8,10 +8,10 @@
<script type="text/javascript" src="main.js"></script>
<h1>Вас приветствует игра "Камень, Ножницы, Бумага"</h1>
<div class="game-board">
<div class="main">
<div class="box">
<img id="player-img">
<img id="hum-img">
</div>
<div class="box" id="result-box">
+2 -6
View File
@@ -27,12 +27,9 @@ const Paper = { num: 1, Name: 'бумага' };
function game(hum) {
document.getElementById("result-img").src = "";
let npc = Math.floor(Math.random() * 3) + 1;
document.getElementById("player-img").src = "img/" + images[hum] + ".png";
document.getElementById("hum-img").src = "img/" + images[hum] + ".png";
document.getElementById("npc-img").src = "img/" + images[npc] + ".png";
if (npc === 1 && hum === 3) {
@@ -66,5 +63,4 @@ function game(hum) {
}
updateScore();
console.log("wins-" + stats.wins + ",looses-" + stats.looses + ",draws-" + stats.draws);
console.log("wins-" + stats.wins + ",looses-" + stats.looses + ",draws-" + stats.draws);
+2 -4
View File
@@ -8,13 +8,12 @@ h1 {
}
.game-board {
.main {
display: flex;
justify-content: space-between;
align-items: center;
width: 600px;
margin: 20px auto;
margin: auto;
}
.box {
@@ -46,7 +45,6 @@ h1 {
.card-imgs {
display: flex;
flex-direction: row;
justify-content: center;
gap: 20px;
}