Hacker News new | ask | show | jobs
by gunn 2620 days ago
Here's my tetris copy: http://wolandbros.com/tetris/

Both the game and the source are much more minimal, it's very easy to customise the rules. You can see the source here: https://github.com/gunn/tetris/blob/master/src/store.js

2 comments

Sweet! Thanks for sharing. I see you're using pure-store to manage your game state. My implementation also uses a redux pattern for state management :)
Thank you too! It's fun seeing the different ways we implemented the same things, even pieces and rotation.

pure-store is a library I made for very simple but efficient state management. The entire source is this file: https://github.com/gunn/pure-store/blob/master/src/index.ts

Here's a shorter cljs version [1], as a bonus it cross-compiles to the JVM and Js reusing the core logic.

[1] https://github.com/yogthos/clj-tetris/blob/master/src/tetris...