Skip to content

New Share your ideas with the AWTRIX community. Keep your creations together in your account.

Sign in

Which AWTRIX do you have? Choose it once and the Hub shows what runs on it.

ScriptAWTRIX NG

Tetris

On an AWTRIX display
Tetris shown on an AWTRIX display
Tetris · by mckdoubleu

On your display

Self-playing Tetris for AWTRIX NG with automatic piece placement, rotation and line clearing.

Which AWTRIX do you have? See below where it runs, or choose your device.
Topic
Gaming
Includes
Script

Runs on

  • Runs on 32×8 (TC001 & DIY)
  • Runs on 52×16 (TC002)
  • Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.

Choose your display in the next step.

Send to AWTRIX

Choose your AWTRIX

TetrisAWTRIX NG script

Install this script on your AWTRIX NG. Its icons and sounds are installed with it.

Your AWTRIX’s local address, for example 192.168.178.39 or awtrix.local.

The name shown in your AWTRIX script list. Use letters, digits, hyphens or underscores.

Connection & device login

Connect your phone or computer to the same network as your AWTRIX. Allow local network access if your browser asks.

Use the device’s IP address, without a page path such as /#/apps.

If your AWTRIX requires a login, the username and password fields will appear when you connect.

Sign in to the Hub to install scripts. Attached files are installed separately.

Script description

A self-playing Tetris animation for AWTRIX NG. (Resource Hungry)

The game automatically spawns, rotates and moves Tetromino pieces, tries to place them efficiently and clears completed lines. When the stack reaches the top of the display, the game automatically starts a new round.

The script uses the full 32×8 LED matrix (ULANZI) and runs entirely on the AWTRIX device without requiring Home Assistant, Node-RED or MQTT.

Setup:

Open the AWTRIX NG web interface.
Go to Scripts.
Create a new script.
Paste the script content and save it.
Enable the app in the normal app rotation.

The script is "memory-optimized" (:D), but Tetris still requires more processing and RAM than very simple AWTRIX apps because it continuously calculates piece movement, collisions and placements. On devices with many scripts installed, available script memory may become limited. Removing unused scripts can help reduce memory pressure.

Feel free to optimize it.

More scripts in Gaming

Something wrong with this script? Report it.