In this episode I write a Tetris game in JavaScript from scratch.
If you like this tutorial you will probably also like my Super Mario Bros tutorial: • Code Super Mario in JS (Ep 1) - Backg...
Feel free to support me on Patreon: / meth
We will look at
Drawing on a canvas
Rotating a matrix
Rudimentary requestAnimationFrame listening
Handling keyboard input
Since we are writing ES6 this code might not run on all browsers yet. I was running Chrome 53 when I wrote this and if you wish to follow I recommend you do too.
The initial HTML can be found here:
https://raw.githubusercontent.com/met...
Source code with step-by-step commits:
https://github.com/meth-meth-method/t...
Music:
Demoscene Time Machine
http://demoscenetimemachine.com
On this page of the site you can watch the video online Write a Tetris game in JavaScript with a duration of hours minute second in good quality, which was uploaded by the user Meth Meth Method 08 September 2016, share the link with friends and acquaintances, this video has already been watched 395,713 times on youtube and it was liked by 7 thousand viewers. Enjoy your viewing!