After seeing yesterday's Show HN about building a Tetris game on a game, I decided to take a crack at it and build it within a short time frame before I went back to studying for my midterm. I rarely code in JavaScript so it added to the challenge. Several features are missing but I am satisfied with what I accomplished during my coding session.
I initially had specified that in the controls list but it was too cluttered so I decided to give a general description of "arrow" = move. Preferably, I'd want to add a little guide box on the side of the canvas but I am still learning about formatting a page in hmtl/css.
I experienced a bug where the game suddenly stops after a few minutes of playing. I'm using Firefox ESR 45.4.0 on RHEL if it helps. Otherwise, great job!
That is quite interesting, I didn't really think about mobile capabilities while making this but it would be a fun thing to add. I'll look into it after my exam tomorrow!
I love Tetris! Played it for a few minutes.
Time to attach to blocks shouldn't be instant and I had the top and right game borders start flashing after a while but otherwise pretty cool!
Consider wrapping your code in a closure so that all the variables and functions aren't globals. It's good performance-wise and for not polluting the global namespace.
23 comments
[ 3.0 ms ] story [ 59.8 ms ] thread> TypeError: tetrisBoard[(y - 1)] is undefined
From within tick()
Seems to be triggered by rotation followed by a drop.
C https://gist.github.com/spaceexperiment/4d6b116ef577a2971259...
Tcl https://gist.github.com/nickbarth/cba8cc9996cc3ebe8427726fae...
Ah, procrastination ;)
Other than that good job.
Otherwise looks good. :)