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
+14
View File
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Open index.html",
"file": "c:\\Users\\Dream\\games\\Project\\index.html"
}
]
}
+2 -2
View File
@@ -8,10 +8,10 @@
<script type="text/javascript" src="main.js"></script> <script type="text/javascript" src="main.js"></script>
<h1>Вас приветствует игра "Камень, Ножницы, Бумага"</h1> <h1>Вас приветствует игра "Камень, Ножницы, Бумага"</h1>
<div class="game-board"> <div class="main">
<div class="box"> <div class="box">
<img id="player-img"> <img id="hum-img">
</div> </div>
<div class="box" id="result-box"> <div class="box" id="result-box">
+2 -6
View File
@@ -27,12 +27,9 @@ const Paper = { num: 1, Name: 'бумага' };
function game(hum) { function game(hum) {
document.getElementById("result-img").src = "";
let npc = Math.floor(Math.random() * 3) + 1; 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"; document.getElementById("npc-img").src = "img/" + images[npc] + ".png";
if (npc === 1 && hum === 3) { 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; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
width: 600px; width: 600px;
margin: 20px auto; margin: auto;
} }
.box { .box {
@@ -46,7 +45,6 @@ h1 {
.card-imgs { .card-imgs {
display: flex; display: flex;
flex-direction: row;
justify-content: center; justify-content: center;
gap: 20px; gap: 20px;
} }