Loading...

Write a Tetris game in JavaScript

306,503 views

Loading...

Loading...

Transcript

The interactive transcript could not be loaded.

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Sep 8, 2016

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: https://youtu.be/g-FpDQ8Eqw8

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

Loading...

Advertisement
When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...