How to Code a Tetris Game using HTML and javascript
ฝัง
- เผยแพร่เมื่อ 2 ธ.ค. 2020
- Source code: jackhetech.io?p=tetris-js
PLEASE NOTE: I made an update to the Rotate() function in the final source code that is not shown in the video to check if there will be a collision if the user tries to rotate a piece. Other than that, the code you'll be getting is the same as what's shown in the video.
► Follow me on Instagram: / jack_he_hd
► How I got an internship at Microsoft in 1st year university: www.youtube.com/watch?v=-7rJv...
► The book I am currently reading: amzn.to/2KsHeTq
► My low-budget camera: amzn.to/37PhFo9
###################################################################
Major: Computer Science
College: University of British Columbia - แนวปฏิบัติและการใช้ชีวิต
Awesome project!
thanks bro!
hey ! if we want to slide the pieces left or right when it touches the ground, how to do that ?
do the shapes have to be done in any specific order? or can I do the slither shapes before the 2x2 square?
no joke better than the real tetris
break a leg! you are the best
🙏🙏Very nice .. 👍 thanks for the video 😍😍
thanks for the support!
Is it possible to add levels in the game?
I started to learn Javascript recently and have a question in your code.
let newGameState = () => {
}
To me, it seems like a mixture of variable(because of ‘let’) declaration and function. Any explanation will be helpful to my self-study. ^^;
Its an arrow function look it up.
its an arrow function and he used "let" because he wanted the newGameState to change , you only use const to store results that will not change and let when they will change such an score etc. have fun learning javascript !!
I learned that () => { is basically the same as function() {, so it's just a built-in function stored in a variable
i already follow your code. But, when i want to open html with live server it only show "Score: 0". and i try to use terminal and i follow your step and error. i still confuse how to run the program...
If you run the debugger, you might missed something around your constants.js file which is BLOCK_SIDE_WIDTH
Speedrun time
haha one day I will keep it under 5 minutes
fIRST!
huh