r/javascript • • Jul 24 '16

1.92kb Tetris in HTML5 (JavaScript). Any suggestions are welcome.

https://github.com/michowski/tetris-light
99 Upvotes

38 comments sorted by

View all comments

Show parent comment

3

u/michowski Jul 24 '16

I think everything is some kind of excercise, but it was rather a fun project inspired by this Snake. With Tetris it isn't that simple to bind everything to one event though and there are some predefined objects. I wanted to make it as raw as possible, yet with a clean code. That's why I didn't use canvas. Regarding "shaking side borders" - hm, I haven't really encountered this problem, but I am aware that default <pre> tag is different on every browser.

3

u/Plorntus Jul 24 '16

Im on mac and Chrome and the borders shake here too. I think it maybe the unicode font (it is using unicode right for the blocks?). I dont think they are fixed width even if you're using pre-tags.

0

u/xxxabc123 Jul 24 '16

I also think this is the problem.

1

u/xxxabc123 Jul 24 '16

It's because of widths of characters not being equal, it makes the game a bit unplayable as cells don't align with each other.