started working on javascript
This commit is contained in:
parent
0905df5249
commit
5882939405
14
app.js
14
app.js
@ -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]
|
||||
]
|
||||
})
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user