Skip to main content

Terminal game with sweet block of tofu character!

quick-demo

How to install

Prerequisites

To properly display all characters:

  • Use a modern terminal emulator.
  • Install a Unicode-ready font (e.g., NerdFonts).
  • Ensure your shell environment is configured to use UTF-8 encoding.

Installation and running TofuByte

With uv

uvx tofubyte

or using pipx

pipx install tofubyte
tofubyte

If you prefer mauall Installation:

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the package
pip install tofubyte

# Run the game
tofubyte

Input system

The game uses pynput for handling keyboard input. As it is not a terminal-native input system, it might not work as expected in all terminal environments or operating systems.

I plan to implement scroll mode in the game that will not require any additional input system.

Troubleshooting

Input issues (Pynput)

If keyboard input is not working, the game should inform you with an in-game message. This is likely due to pynput compatibility issues with your terminal or operating system. It might also be affected by whether you are running X11 or Wayland.

Currently, you can try the following:

  • Run the game with sudo tofubyte
  • Run the terminal emulator with sudo
  • Run the game with PYNPUT_BACKEND_KEYBOARD=uinput tofubyte (This forces pynput to use the uinput backend, which might be more compatible on some Linux systems.)
  • Try running the game in a different terminal emulator:
    • Guake (should work without sudo)
    • Wezterm (should work without sudo)
    • Kitty (requires sudo)
    • Ghostty (requires sudo)
    • Terminator (requires sudo)
  • On macOS, you can try running with sudo or refer to this StackOverflow comment for alternative solutions.
  • Windows WSL - As the

Further reading and potential solutions can be found in the Pynput Documentation.

If you are concerned about how Pynput is used, feel free to review the available source code.

Also if you found solution for your problem, share this in the issue so it can help others.

Map Editing

Screenshot_20260210_232553

You can edit and create maps with built in editor!

There are some keybindings worth to know:

  • ctrl+mouse_move - resize selected
  • ctrl+mouse_click - selects multiple
  • ctrl+v - to copy-paste selected objects

Some tutorial will be provided soon.

Screenshot_20260210_232854

Community Maps

TofuByte supports community-created maps! You can browse them on GitHub by searching for the tofubyte-map topic.

Explore community maps on GitHub: https://github.com/topics/tofubyte-map

To play a community map:

  1. Download the .json map file from GitHub.
  2. Place the downloaded .json file into your custom maps directory. This directory is typically located at ~/.local/share/TofuByte/maps/custom_maps on Linux, but the exact path might vary depending on your operating system.

Contributing Your Own Maps to GitHub

If you've created a map you'd like to share with the TofuByte community and make it discoverable through the in-game browser, follow these steps:

  1. Create a New GitHub Repository: Create a new public repository on GitHub for your map.
  2. Upload Your Map File: Add your .json map file (created using the in-game editor) to this new repository. It's recommended to include a README.md in your repository with a description of your map, screenshots, and any special instructions.
  3. Add the tofubyte-map Topic: To make your repository discoverable by the TofuByte community maps browser, you must add the tofubyte-map topic to your repository.
    • On your GitHub repository page, look for the "About" section on the right sidebar.
    • Click on the gear icon (⚙️) or "Manage topics" to edit topics.
    • Add tofubyte-map to the list of topics and save your changes.

Your map will now be browsable in the TofuByte client!

Development

There are some additional tools I have used during developed. They show some stats and other things that helped debug:

uv run textual run --dev tofu_byte.command_line:run --debug contact_dir,step,fps,footer,player_stats

Speciall thanks

As always, huge shot out to Textualize team!
TofuByte was created as result of exploration of what can be done to display game with such a nice framework as Textual.

License and Community

This is my little independent game, developed in my personal time.

As I have many plans for further changes and wish to maintain a clear mental model of the project, I am not currently planning to accept code contributions.

However, feedback is very welcome. If you encounter bugs, issues, or have feature ideas, please open an issue on GitHub.

I also plan to implement features for uploading, browsing, and downloading maps directly from within the game.

Metadata

Release files for TofuByte 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TofuByte 0.4.0
File Size Uploaded Provenance Actions
tofubyte-0.4.0.tar.gz 57.5 kB Without provenance Details for tofubyte-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TofuByte 0.4.0
File Interpreter ABI Platform Actions
tofubyte-0.4.0-py3-none-any.whl Python 3 none any Details for tofubyte-0.4.0-py3-none-any.whl

Total release size: 138.1 kB

Release files / tofubyte-0.4.0.tar.gz

Download URL tofubyte-0.4.0.tar.gz
Size 57.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dc87c36e6004f3c7b9bdf4a1fd402b9c29f9ca032d130f2fc4b0fe4cd599661f
BLAKE2b-256 checksum
How to use checksums
dac1573fb6bda25f58c63551ac2e9be8a5b67c59d2324fa18e2cb522b7c66871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / tofubyte-0.4.0-py3-none-any.whl

Download URL tofubyte-0.4.0-py3-none-any.whl
Size 80.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50c0d32c0c0493164ea5ff657c4cf7bbcf1ce9c7d3c5cc39996fbd5e59a9ef71
BLAKE2b-256 checksum
How to use checksums
4f0a49e5bd36358d2377b25a329cfe986d99403da51f3204db5f4116118d53bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for TofuByte 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page