|
| 1 | +# Tetrish |
| 2 | + |
| 3 | +- Similar to Tetris®; Tetris-ish; Tetrish |
| 4 | +- Written in ClojureScript with core.async |
| 5 | + |
| 6 | +## Where to play |
| 7 | + |
| 8 | +- [https://hacks.fearnoeval.com/tetrish/](https://hacks.fearnoeval.com/tetrish/) |
| 9 | + |
| 10 | +## How to play |
| 11 | + |
| 12 | +- `↑`: Rotate |
| 13 | +- `↓`: Soft drop |
| 14 | +- `←`: Left |
| 15 | +- `→`: Right |
| 16 | +- `S`: Save |
| 17 | + - A prompt will pop up that has the full game state as JSON in the input field |
| 18 | + - Game state can be copied out, saved for later, investigated, modified, etc. |
| 19 | +- `L`: Load |
| 20 | + - Prompts for a saved game state |
| 21 | + - Saved game state must be in the same format as that created via `S` |
| 22 | + - Invalid game states are ignored, continuing the game already in progress |
| 23 | +- `F5`: New Game |
| 24 | + |
| 25 | +## How to build and run locally |
| 26 | + |
| 27 | +1. Install [Leiningen](https://leiningen.org/) |
| 28 | +2. Run `lein cljsbuild once` |
| 29 | +3. Open `resources/index.html` in your web browser of choice |
| 30 | + |
| 31 | +## Notes |
| 32 | + |
| 33 | +- The game is fully data-driven, in that all of the game state is stored in a |
| 34 | + single map |
| 35 | +- Rotation behaves the same as NES Tetris, not how later versions behave |
| 36 | +- As an experiment, DOM string generation and insertion for the entire game UI |
| 37 | + happens on every state change |
| 38 | + - I was curious if this would be performant enough, and for something this |
| 39 | + basic, it is (tested using Chrome 47+) |
| 40 | +- Includes a basic, protocol-based, ClojureScript version of Hiccup |
| 41 | +- Written in January 2016 |
| 42 | + |
| 43 | +## Bugs as features |
| 44 | + |
| 45 | +- "Where's the next piece?" |
| 46 | + - Marketing: Tetrish is only available in hard mode |
| 47 | + - Truth: I forgot |
| 48 | +- "How do I hard drop?" |
| 49 | + - Marketing: Tetrish is only available in hard mode |
| 50 | + - Truth: I forgot |
| 51 | +- "Why can't I play on mobile?" |
| 52 | + - Marketing: Playing Tetrish on mobile enables infinitely-hard mode |
| 53 | + - Truth: I did a quick attempt at this, but getting swipe up, down, left, and |
| 54 | + right to control the game instead of scrolling was not working so well |
| 55 | + |
| 56 | +## License |
| 57 | + |
| 58 | +- © 2016-2017 [Tim Walter](https://www.fearnoeval.com/) |
| 59 | +- Licensed under the [Eclipse Public License 1.0](LICENSE.html) |
| 60 | +- Tetris is a registered trademark of Tetris Holding |
0 commit comments