Hacker News new | ask | show | jobs
Building a Tetris Game using TypeScript and Angular (2017) (ivaylopavlov.com)
51 points by ivailop 2859 days ago
4 comments

A lot of the same pieces falling after one another, sometimes 4 in a row. For deciding which pieces should appear, you should create an array with the 7 unique possibilites for pieces and then shuffle the array and go through all the 7 randomly-ordered pieces before doing the same process again. This guarantees all pieces appear consistently.
The game area is rendering off screen[0] for me in Firefox Nightly (63.0a1 (2018-08-27)) on macOS. Looks fine in Chrome and Safari.

Fun project. Watch out for TTC lawyers if it gets popular (:

[0] https://i.imgur.com/IdNUZVW.png

Hey! Thanks. I'll look into fixing it. When I was building the game, focus on the logic. Didn't give much thought on browser compatibility and mobile.
Same bug for Firefox 61.0.1 on Ubuntu 18.04
Very inspiring. I am currently building a card game with Angular and socket.io.
I'm very happy to read your comment. It's the reason I decided to share the post. Good luck with the game, looking forward to playing it.
as an aside two player puzzle fighter was so addictive!