This is a fun project I developed while testing QMK library with ZSA moonlander.
I was trying to implement custom layout and stumbled upon the article describing custom RGB-lighting and couldn't get past it.
Thumb clusters are used next figure indication and falling figures control. Field size is 10x7 excepting 6 missing keys (pixels). While clearing the rows these missing keys are taken into account. So, you need to fill only 5 cells of the last row in order to clear the line.
- Spawn all 7 pieces: I, O, Z, S, J, L, T.
- Rotate and move all pieces.
- Clear the row if it's covered.
- Indicate next piece with color.
- Music theme (I bet it will be deleted).
- Fair random algorithm.
- Gameover animation and sound.
- Fancy SRS rotation.
- Score counter.
- Fast move down.
- All the game is controlled using the thumb cluster of the right half of the keyboard.
- There are also: toggle music button, pause button, restart button, start button.
- Install QMK using the tutorial from here.
- Clone this repo.
- Copy all the content to
<YOU_QMK_FOLDER>/keyboards/moonlander/keymaps/<YOUR_NAME>
or make a symlink. - Put your keyboard into bootloader mode. (Click a small button in a hole on a left half of moonlander)
- Flash the keyboard using this tutorial.
- Implementing custom colorscheme.
- Implementing custom sounds.
Here you can see my tables.
Top left table is initial colors to keys mapping. Next tables are my remaps (don't ask why such an order). Red keys are non-existing ones. These rows has less cells and we need to take it into account while calculating the collisions.
I used the simpliest possible rotation system. All the pieces are rotated around 3 cell. Kicks are not implemented. The only thing I check here is collisions with walls and other pieces.
Sorry :(
I found this repo somewhere on reddit: and it was superuseful and helped me a lot to understand QMK library. Shutout to @rgoulter.
And additional thanks to @optozorax for the motivation to this project.