Making games is fun
How do you best learn to program? By practising over and over again. And practising making games can be a very fun enterprise. I just started with making games a few months ago, so it’s still all a bit amateurish, but I am very proud of the result so far.
I will gradually improve the game by making adjustments, fixing bugs, refactoring and introducing new features.
HTML5 canvas with CSS styling and animations
There are multiple ways of making a Tetris game, but I wanted to combine HTML5 canvas with CSS styling and animations. Canvas is great for creating dynamic graphics and making games and is very efficient in terms of memory and rendering speed.
The downfall is that you have to manage every detail manually, such as a hover state. So why not let those things handled by good ol’ CSS, right?
Local storage
Using HTML5 Web Atorage API, we can easily and effectively store simple pieces of information right in the clients browser.
This means that things like the highscore never resets when reloading the browser. Just make sure you return to the same browser when trying to improve your highscore.