started working on javascript

This commit is contained in:
Andreas Jönsson 2025-04-22 15:31:55 +02:00
parent 0905df5249
commit 5882939405
2 changed files with 13 additions and 3 deletions

14
app.js
View File

@ -1,3 +1,15 @@
document.addEventListener('DOMContentLoaded', () => {
// Code goes here
const grid = document.querySelector('.grid')
let squares = Array.from(document.querySelectorAll('.grid div'))
const ScoreDisplay = document.querySelector('#score')
const StartBtn = document.querySelector('#start-button')
const width = 10
//The Tetrominoes
const lTetromino = [
[1, width+1, width*2+1, 2],
[width, width+1, width+2, width*2+2],
[1, width+1, width*2+1, width*2],
[width, width*2, width*2+1, width*2+2]
]
})

View File

@ -8,10 +8,8 @@
<title>Javascript Tetris</title>
</head>
<body>
<h3>Score:<span id="score">0</span></h3>
<button id="start-button">Start/Pause</button>
<div class="grid">
<div></div>
<div></div>