feat(games): add Snake and Tetris X11 games with menu integration
Add two standalone X11 games (not DWM plugins) for the Nokia 8110 keypad: - src/games/snake.cpp: Nokia Snake II-style game, 240x296, built-in 5x7 font - src/games/tetris.cpp: Tetris with next-piece preview, levels, line clears Both float as dialog windows in dwm, use a self-contained bitmap font (no font-file dependency), and are controlled via the numeric keypad (2/4/6/8 directions, 5 action) with arrow-key fallbacks. - scripts/build-games.sh: Docker armv7 cross-compile (mirrors build-sxmo-x11.sh) - overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_games.sh: Games menu hook - overlay/rootfs/usr/bin/sxmo_appmenu.sh: add 'Games' entry after 'Apps' and a games submenu case Binaries committed to prebuilt/games and overlay/rootfs/usr/bin per repo convention. Deployed and verified on the live device (window maps, dwm focuses it, keypad input reaches the game).
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# configversion: 00000000000000000000000000000000
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2025 Bananarchy Contributors
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||
export PATH="${HOME:-/home/user}/.local/bin:${HOME:-/home/user}/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:$PATH"
|
||||
. sxmo_hook_icons.sh
|
||||
|
||||
write_line() {
|
||||
printf "%s ^ 0 ^ %s\n" "$1" "$2"
|
||||
}
|
||||
|
||||
write_line_app() {
|
||||
executable="$1"
|
||||
label="$2"
|
||||
command="$3"
|
||||
if command -v "$executable" >/dev/null; then
|
||||
write_line "$label" "$command"
|
||||
fi
|
||||
}
|
||||
|
||||
write_line_app snake "$icon_gam Snake" "snake"
|
||||
write_line_app tetris "$icon_gam Tetris" "tetris"
|
||||
Reference in New Issue
Block a user