mirror of
https://github.com/MrEidam/PetPet.git
synced 2026-04-17 15:43:31 +00:00
Emm 2048 RESET
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
<title>2048</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>2048</h1>
|
||||
<h2>Score: <span id="score">0</span></h2>
|
||||
<h1>Score: <span id="score">0</span></h1>
|
||||
<div id="board"></div>
|
||||
<button id="reset" onclick="reset()"></button>
|
||||
<a href="../" id="home"></a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,13 @@
|
||||
var board;
|
||||
const newBoard = [
|
||||
[0,0,0,0],
|
||||
[0,0,0,0],
|
||||
[0,0,0,0],
|
||||
[0,0,0,0],
|
||||
];
|
||||
var score = 0;
|
||||
var rows = 4;
|
||||
var columns = 4;
|
||||
const rows = 4;
|
||||
const columns = 4;
|
||||
let startX, startY, endX, endY;
|
||||
|
||||
window.onload = function(){
|
||||
@@ -216,4 +222,13 @@ function handleSwipe(){
|
||||
document.getElementById("score").innerText = score;
|
||||
}
|
||||
}
|
||||
}
|
||||
async function reset(){
|
||||
document.getElementById("board").innerHTML = '';
|
||||
setGame();
|
||||
score = 0;
|
||||
document.querySelector('#score').innerText = '0';
|
||||
/*board = newBoard;
|
||||
setTwo();
|
||||
setTwo();*/
|
||||
}
|
||||
@@ -29,6 +29,17 @@ body{
|
||||
background: #555;
|
||||
}
|
||||
|
||||
#reset{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
border-radius: 0 25px 0 0;
|
||||
background: #d55;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#board{
|
||||
width: 372px;
|
||||
height: 372px;
|
||||
@@ -36,7 +47,6 @@ body{
|
||||
background: #cdc1d5;
|
||||
border: 6px solid #bbada0;
|
||||
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user