Tetris Turns 35
On June 6, 2019 Tetris turned 35 years old. To celebrate, I wrote my own version and posted it in my GitHub repo. No libraries. No frameworks. Just JavaScript. Those learning JavaScript might find a few lessons here!
--
Here’s a list of my best web development tutorials.
Complete CSS flex tutorial on Hashnode.
Ultimate CSS grid tutorial on Hashnode.
Higher-order functions .map, .filter & .reduce on Hashnode.
Follow me @ Twitter, Instagram & fb to never miss premium articles.
Tetris was created by Alexey Pajitnov and released on June 6, 1984.
So how do you make Tetris in 🍦 vanilla JavaScript from scratch?
No libraries. No frameworks. Just JavaScript and your coding fingers.
But why not put some visual sugar on it?
I got a bit creative and added Tetris In The Dark effect. Hopefully it will make this tutorial a bit less boring. Aside from this we’ll cover everything you need to know about putting Tetris together in JavaScript.
Tetris is more simple to play than it is to make. When I started making Tetris I learned that there are several tasks I needed to complete in isolation. Namely they are animation, collision detection and the row-clearing algorithm.
This is what my version of the game looked like on my first try: