
Show HN: A Tetris clone written in ES6 using React - nullobject
https://tetris.joshbassett.info/
======
bherrmann7
also...
[https://shaunlebron.github.io/t3tr0s-slides/#0](https://shaunlebron.github.io/t3tr0s-slides/#0)
using clojurescript in place of ES6

~~~
ronilan
The slides are amazing just by themselves.

~~~
edwinyzh
Wow, the slides are amazingly beautiful and neat!

~~~
mcv
Maybe the slides should have been a Show HN.

------
nullobject
There's a link to the code from the help and game over screens, but here it is
for anyone who missed it:
[https://github.com/nullobject/tetris](https://github.com/nullobject/tetris)

~~~
ryan-allen
Thanks for posting the code! :)

------
slow_donkey
May i suggest adding settings for DAS and ARR. It's quite hard to play fast
without.

simon.lc/tetr.js is currently my favorite web based version and i think a good
standsrd

~~~
slow_donkey
Ah one small bug(?) I noticed was t-spins arent recognized if they're hard
dropped after you spin them in. But I think this is a great showcase for
reactive and it's impressive all the spins work correctly!

~~~
nullobject
Thanks, I'll create an issue for it.

------
bjpirt
Good work, however a little feedback...

This works fine at lower rates but once you hit anything greater than 120 or
so there's a noticeable lag between hitting the key to rotate and the shape
actually rotating - enough that the shape will often have moved a couple of
spaces by the time it rotates which makes it very difficult to play.

Not sure if that's inherent to the framework or just how this particular
version is programmed.

------
ajeet_dhaliwal
I have wanted to try creating a game with ES6 and React for a while but been
too busy recently. Thanks for this, it's great to see your attempt, I think it
plays and looks great. Any unexpected challenges or issues experienced when
using React for this? (I am experienced with React, just haven't used it for
games, I also have experience creating games, just not with React).

~~~
nullobject
Thanks!

It's nice that react is just a view library, so you are free to choose the
rest of your stack to best suit your app (i.e. a game).

The only thing I would point out is that you should use immutable data
structures, so that you don't re-render parts of your view unnecessarily.
There are ways to handle this without immutable data structures (i.e.
componentShouldUpdate), but it's more of a pain IMHO.

------
laurent123456
Back button doesn't work on the "How to play" page and there's no obvious way
to close it (there should at least be a close button in the top right corner).
I thought the "Resume" button would open your resumé so I didn't think of
clicking on it at first.

~~~
nullobject
I removed that button, you can now click anywhere on the modal to dismiss it.

------
bherrmann7
fyi: [http://timothypratley.blogspot.com/2015/07/you-should-be-
usi...](http://timothypratley.blogspot.com/2015/07/you-should-be-using-
figwheelreagent.html) using clojurescript in place of ES6

------
bcherny
No mobile support? :(

~~~
nullobject
Not yet, sorry. Maybe someone will send me a PR ;)

~~~
nurettin
I think it is a bit complicated to add code so someone's resume showcase. How
would you avoid taking credit for what others did?

~~~
nullobject
I have a credits section on the help screen. I'd be happy to add anybody in
there who contributes a patch.

