Hacker Newsnew | past | comments | ask | show | jobs | submit | more nullobject's commentslogin

There's a link to the code from the game, but here it is for anyone who missed it:

https://github.com/nullobject/risk


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.


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


Sure. I'll have to read up on how that stuff works, but I'm keen to make my version as playable as possible.


Thanks, I'll create an issue for it.


OMG, that video is nuts. I'm assuming that is being controlled by a human in real-time?


That's correct. With DAS tuning it's much less frustrating to play at the speed at which you can think. Here's one of the top online players of puyo puyo tetris, for reference.

https://youtu.be/7AjbWroX4vA?t=18m57s


Yep it's a human - there's a good number of people who can reach that speed but it takes years of practice. I believe a lot of the community started young on various platforms so some people have been playing 10+ years


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


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?


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


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


Thanks for posting the code! :)


Thanks moberemk. I'm trying to take what lodash/underscore started to the next logical step with FKit.


You're mostly right.

The console var is assigned the result of an immediately-invoked anonymous function (http://benalman.com/news/2010/11/immediately-invoked-functio...).

The result of this function is an object which contains the console functions (log, warn, error, etc). Moreover, these functions only exist inside the scope of the anonymous function, so the only way to access them is through the returned object. This prevents the global namespace from being polluted.

So when you call console.log('hello'), you're applying one of those functions in the object returned by the anonymous function.


Wow! Once more many thanks for your time and effort. It is much appreciated. You are a Javascript GOD :-)

Cheers PK


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: