Skip to main content

Terminal game with sweet block of tofu character!

Project description

Terminal game with sweet block of tofu character!

output

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.

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
  • ctrl+mouse_click - selects multiple

Some tutorial will be provided soon.

Screenshot_20260210_232854

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tofubyte-0.3.2.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tofubyte-0.3.2-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file tofubyte-0.3.2.tar.gz.

File metadata

  • Download URL: tofubyte-0.3.2.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for tofubyte-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9bfaf10f6d7c2e6df71d578a9b598ef6af110a56718afb6208cff1e386bf0348
MD5 372ec46529c057ebf25946271d799f44
BLAKE2b-256 4934a9648185d8a12b5794914a96ea922ce01e91b2a72a61c310c40b25272949

See more details on using hashes here.

File details

Details for the file tofubyte-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: tofubyte-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for tofubyte-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb59f2d8b164332bc6519993dfa2b9dd1bc32cb4cdc6bc4c900219cdff385751
MD5 a9c2e3cb39c2047df0b23d172bb3a0d4
BLAKE2b-256 b58e2f6f0fec3c2f3994eada7ca3da5bbfe42044360e275c02c933cfcb20489d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page