Games App: Pong, Snake and Tetris
CI / build (pull_request) Successful in 2m20s
Site / build (pull_request) Successful in 10s

A new App (issue #101) that shows its three Games as icons, as the
Launcher shows Apps, and plays the one chosen. A Game left in the middle
is found again paused; one being played keeps the screen lit. Tetris
plays Korobeiniki on a speaker channel of its own, faster with each
level: 0 switches it, 8 and 9 set its volume, both remembered. The drop
is on 1, away from the arrows. The best of each Game is kept.

Played on the device. The speeds are as tuned there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
2026-10-13 22:59:05 +02:00
co-authored by Claude Opus 5.5
parent 68d50b320f
commit ec15c2f52a
15 changed files with 835 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
+++
title = "Games"
description = "Pong, Snake and Tetris, for when the radio is quiet."
weight = 17
[extra]
tag = "Games"
+++
The Games App opens on its three games, an icon each, as the Launcher shows Apps: <kbd>,</kbd> and <kbd>/</kbd> go from one to the next, with its name and your best so far under the row. <kbd>Enter</kbd> picks one, <kbd>Enter</kbd> again starts it.
In every game:
| Key | Does |
|---|---|
| <kbd>Enter</kbd> | Starts, or starts again when a game is over |
| <kbd>p</kbd> | Pauses. Any key carries on |
| <kbd>`</kbd> | Back to the three games. This one waits, paused |
A game you leave in the middle, for another game or another App, is **found again paused**, and its icon has an orange dot. While a game is being played the screen does not dim. The games beep, and Tetris has its tune, unless **Settings → This device → Sound & LED** is off. There is no choice of difficulty: each game starts gently and gets faster.
## Pong
You have the left paddle, the device the right one. Hold <kbd>;</kbd> to go up and <kbd>.</kbd> to go down. **First to 7 wins.**
Where the ball meets your paddle decides how it leaves: off the middle it goes straight, off an end it goes steeply. Each return makes the ball a little faster. The device's paddle only moves so fast: a steep, fast ball gets past it.
What is kept is your **longest rally**: the most returns you made between two serves.
## Snake
The arrows (<kbd>;</kbd> <kbd>.</kbd> <kbd>,</kbd> <kbd>/</kbd>) turn the snake. It grows by one with each thing it eats, and goes a little faster every third. **The walls kill it**, and so does its own body.
Two turns pressed quickly one after the other are both taken, one a step: that is how to turn round in two rows.
## Tetris
| Key | Does |
|---|---|
| <kbd>,</kbd> <kbd>/</kbd> | Left and right. Held, it repeats |
| <kbd>;</kbd> | Turns the piece. <kbd>z</kbd> turns it the other way |
| <kbd>.</kbd> | Falls faster, while held |
| <kbd>1</kbd> | Drops it at once. It is far from the arrows on purpose: a drop cannot be taken back |
| <kbd>0</kbd> | The music, on or off. The device remembers it |
| <kbd>8</kbd> <kbd>9</kbd> | The music, quieter and louder, in eight steps. Remembered too |
The well is 10 wide and 20 high. The pieces come from a bag: each of the seven once, in a shuffled order, then seven again, so the long one is never more than twelve pieces away. The **next piece** is shown on the right. A piece turned against a wall shifts a step away from it.
It plays to **Korobeiniki**, the tune Tetris has always had, round and round, and **faster with each level**, as the fall is; it stops when the game is paused or over. With Sound & LED off in the Settings there is no music either.
A full row goes: 100 points for one, 300 for two, 500 for three, **800 for four at once**, times the level. Falling faster gives a point a row, dropping two. The key that brought a piece down does not send the next one down too: let it go and press again. Every ten rows is a level, and the fall quickens.
## The keys, as the device lists them
What <kbd>Fn</kbd> + <kbd>h</kbd> shows on these screens. These tables are generated from the firmware's own lists, so they are always the current ones.
{{ keys(scopes=["games", "games-pong", "games-snake", "games-tetris"]) }}
+44
View File
@@ -385,6 +385,50 @@ rows = [
["; .", "up, down"],
]
[[scope]]
id = "games"
title = "Games, the three games"
rows = [
["Enter", "this game"],
[", /", "the game before, the next"],
]
[[scope]]
id = "games-pong"
title = "Games, Pong"
rows = [
["; .", "the paddle, while held"],
["Enter", "start, or start again"],
["p", "pause; any key carries on"],
["`", "the other games; this one waits"],
]
[[scope]]
id = "games-snake"
title = "Games, Snake"
rows = [
["; . , /", "turn"],
["Enter", "start, or start again"],
["p", "pause; any key carries on"],
["`", "the other games; this one waits"],
]
[[scope]]
id = "games-tetris"
title = "Games, Tetris"
rows = [
[", /", "left, right; held, it repeats"],
[";", "turn"],
["z", "turn the other way"],
[".", "fall faster, while held"],
["1", "drop"],
["0", "the music, on or off"],
["8 9", "the music, quieter, louder"],
["Enter", "start, or start again"],
["p", "pause; any key carries on"],
["`", "the other games; this one waits"],
]
[[scope]]
id = "ssh"
title = "SSH, the hosts"