usermods/TetrisAI_v2/readme.md
This usermod adds a self-playing Tetris game as an 'effect'. The mod requires version 0.14 or higher as it relies on matrix support. The effect was tested on an ESP32 4MB with a WS2812B 16x16 matrix.
PHOTOSENSITIVE EPILEPSY WARNING: By default the effect features a flashing animation on line clear. This can be disabled from the usermod settings page in WLED.
To activate the usermod, add the following line to your platformio_override.ini
custom_usermods = tetrisai_v2
The effect will then become available under the name 'Tetris AI'. If you are running out of flash memory, use a different memory layout (e.g. WLED_ESP32_4MB_256KB_FS.csv).
If needed simply add to platformio_override.ini:
board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv
It is best to set the background color to black 🖤, the border color to light grey 🤍, the game over color (foreground) to dark grey 🩶, and color palette to 'Rainbow' 🌈.
If the speed is set to be a little bit faster than a good human could play with maximal intelligence and very few mistakes it makes people furious/happy at a party 😉.
The game grid is limited to a maximum width of 32 and a maximum height of 255 due to the internal structure of the code. The canvas of the effect will be centred in the segment if the segment exceeds the maximum width or height.