merge branch
This commit is contained in:
commit
26ee13e313
21
GameLogic.js
21
GameLogic.js
@ -78,6 +78,27 @@ var Tembok = [];
|
|||||||
UpdateScore(0);
|
UpdateScore(0);
|
||||||
RandomizeApel();
|
RandomizeApel();
|
||||||
|
|
||||||
|
//buat ngatur batu spwan apa ga nanti
|
||||||
|
const halaman = document.querySelector(".HalamanFull");
|
||||||
|
const gameCanvas = document.getElementById("game");
|
||||||
|
|
||||||
|
document.getElementById("mode-normal").addEventListener("click", function () {
|
||||||
|
halaman.style.backgroundImage ='url("halamanFull/cherryBlossom.png")';
|
||||||
|
halaman.style.setProperty("--overlay-opacity", "0.4");
|
||||||
|
gameCanvas.style.filter = "brightness(1)";
|
||||||
|
|
||||||
|
StartingGame(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("mode-tambahan").addEventListener("click", function () {
|
||||||
|
halaman.style.backgroundImage ='url("halamanFull/cherryBlossomNight.png")';
|
||||||
|
halaman.style.setProperty("--overlay-opacity", "0.7");
|
||||||
|
gameCanvas.style.filter = "brightness(0.5)";
|
||||||
|
|
||||||
|
StartingGame(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getDirection(cell1, cell2) {
|
function getDirection(cell1, cell2) {
|
||||||
if (cell2.x > cell1.x) return "kanan";
|
if (cell2.x > cell1.x) return "kanan";
|
||||||
|
|||||||
@ -31,8 +31,20 @@
|
|||||||
justify-content: left;
|
justify-content: left;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
|
background-image: url("halamanFull/cherryBlossom.png");
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
.HalamanFull::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0,0,0, var(-- overlay-opacity, 0.4)); /* 0.4 = opacity overlay */
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.starting {
|
.starting {
|
||||||
|
border: 2px solid pink;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 21px;
|
top: 21px;
|
||||||
left: 51px;
|
left: 51px;
|
||||||
@ -64,6 +76,24 @@
|
|||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||||
width: 80%;
|
width: 80%;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
|
background-image: url("gameOver/gameOver.png");
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
.popAwal1 {
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: rgb(50, 50, 50);
|
||||||
|
padding: 30px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||||
|
width: 80%;
|
||||||
|
height: 60%;
|
||||||
|
max-width: 400px;
|
||||||
|
background-image: url("gameOver/gameOver.png");
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
.popAwal h1 {
|
.popAwal h1 {
|
||||||
margin-left: 30px;
|
margin-left: 30px;
|
||||||
@ -150,6 +180,10 @@
|
|||||||
#game {
|
#game {
|
||||||
background: rgb(192, 232, 255);
|
background: rgb(192, 232, 255);
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
|
background-image: url("mapGame/mapgame\ .png");
|
||||||
|
background-size: 50% 50%;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: repeat
|
||||||
}
|
}
|
||||||
.modegame {
|
.modegame {
|
||||||
padding: 15px 30px;
|
padding: 15px 30px;
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
<div class="HalamanFull">
|
<div class="HalamanFull">
|
||||||
<canvas width="1056" height="480" id="game"></canvas>
|
<canvas width="1056" height="480" id="game"></canvas>
|
||||||
<div id="gameover-overlay" class="starting" style="display: none">
|
<div id="gameover-overlay" class="starting" style="display: none">
|
||||||
<div class="popAwal">
|
<div class="popAwal1">
|
||||||
<h1 style="color: red" id="gameover-title">YOU DIED</h1>
|
<h1 style="color: red" id="gameover-title">YOU DIED</h1>
|
||||||
<p id="gameover-score">Score: 0</p>
|
<p id="gameover-score">Score: 0</p>
|
||||||
<button id="ulangi" class="modegame">Main lagi?</button>
|
<button id="ulangi" class="modegame">Main lagi?</button>
|
||||||
|
|||||||
BIN
halamanFull/cherryBlossom.png
Normal file
BIN
halamanFull/cherryBlossom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 MiB |
BIN
halamanFull/cherryBlossomNight.png
Normal file
BIN
halamanFull/cherryBlossomNight.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 MiB |
BIN
halamanFull/dayRiver.jpg
Normal file
BIN
halamanFull/dayRiver.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
BIN
halamanFull/nightRiver.jpg
Normal file
BIN
halamanFull/nightRiver.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
Loading…
x
Reference in New Issue
Block a user