Skip to content

zluuba/games-of-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Games Of Terminal

linter-check

Games Of Terminal (or GOT) is a console-based gaming platform where classic games like Minesweeper, Tetris, Snake, and TicTacToe come to life. With customization, achievements, and flexibility, GOT offers a diverse and enjoyable gaming experience in your favourite environment - console.
You can run GOT on macOS and Linux (even on Ubuntu Server, huh).
Here's the promo video, click to watch.

got-intro GIF with Games Of Terminal interaction demo (sped-up)

Requirements

This package has no dependencies, it was intentionally designed this way.
So, you only need to have Python installed (version 3.11 or higher). You can download it here.

Installation

Open a terminal window.
Clone this repository (with Git) or download it with Pip:

git clone https://github.com/zluuba/games-of-terminal.git
pip install --user git+https://github.com/zluuba/games-of-terminal.git

Navigate to the downloaded directory and install package:

cd games-of-terminal
make install

Additional

If you try it on Ubuntu Server or another non-GUI platform, you need to ensure that your terminal supports all the colors that GOT uses. If it doesn't, you may face this error: "ValueError: color number is greater than COLORS-1" while running GOT. To solve this problem, you need to add the $TERM variable to your environment using this command:

TERM=xterm-256color

P.S. even so, if you use a non-GUI system, the app may process colors incorrectly and hide some items (actually just showing them with base colors - white text & black background). In the next version, I plan to solve this problem and create special universal color schemes for every game.

If you experience any other errors, please create an issue with a detailed error description and your OS name and version.

Usage

To start the games, use the following command:

got-games

Upon launching, you'll encounter the menu. Here are some useful keys:

  • Navigate through the options using the ↓ and ↑ arrows (or WS keys).
  • Press Enter to initiate the selected item.
  • To exit any window (menu, game, or settings), press Esc.
  • To enter Detail mode in the Achievements or All Settings sections, press the Spacebar.

Important note: to ensure the app functions correctly, you need to keep your keyboard set to the English layout.

See demos here.

Project Features

GOT has many advantages, this is the full list of them:

  1. Achievements: GOT has 35+ achievements, so you can get them all. Or you can't? ;)
  2. Customizing: in every game, you have the option to choose a color scheme that suits your preferences, create your own custom color scheme (in development), or explore different game modes.
  3. Settings: you can view your stats, customize your GOT experience by setting your username (yes, it matters), adjust game preferences, and warm the author's heart by discovering a secret option.
  4. Autosave: no matter if you overlook your game and simply exit, the game automatically saves your current progress and asks the next time you want to continue an unfinished game (in development). And, of course, GOT has pause and restart functions.
  5. God Mode: You can add your own game to GOT. Yes. Read this documentation and have fun!
  6. Adaptability: GOT adjusts to the user and automatically resizes the window when the user changes the size of the terminal window. Regardless of whether you are in the menu, settings, or playing the game, the interface can detect terminal resizing and redraw the window to create a better experience.
  7. Flexibility: the side block with the logo, menu, and game status area has a fixed width but flexible height. The game window has fully flexible parameters. In some games, it helps to add more game items (as in Minesweeper: the bigger the terminal window, the more game cells you will get), while in other games, it adjusts the size of the elements (as in TicTacToe).
  8. Versatility: whether you have a new MacBook or an old Asus (or a new Asus and an old MacBook), GOT doesn't strain the processor (maybe just a little), ensuring you the ability to play various games. I tested it on macOS, Ubuntu-22, and Ubuntu Server, and it works perfectly. P.S. I tried testing it on Windows, but Windows is a special platform and I just concluded that PC gaming already offers enough games, so if GOT doesn't work on Windows, I don't mind.
  9. Testing: I utilized the Curses library to interact with the terminal, and as Curses operates at a low level, simulating or mocking it in a controlled testing environment proves challenging. Consequently, GOT has tests for non-terminal logic, and manual testing has played a significant role. If you encounter any issues or shortcomings, please report me about it.
  10. Supporting: With a deep affection for this project, I am committed to its continuous support and development. If you share the same passion, you can help me with that. Thank you!

For Developers

In this section, you'll find information about documentation, instructions for integrating your own games into GOT, details on how to contribute to the project, and bug reporting.

Project Documentation

For technical details and project documentation, visit Documentation.

Implementing Your Own Game

If you enjoy GOT, Python, and would like to create your own game with the GOT interface, be sure to read this detailed instruction on game implementation.

Contributing

If you've implemented your own game and would like to share it with others or have ideas to improve this project, I would be thrilled to welcome your contribution. For all the details, please visit this page.

Bug Reporting

If you encounter any issues, discover a bug while using GOT, or have any ideas to improve, please help me enhance the project by reporting it. Follow the steps outlined in the issue reporting guide to create an issue.

F.A.Q.

Here are some answers about this project.

Upcoming Features

I have a lot of ideas (and bugs), so here is a list of them.

Feel free to suggest additional features or share your ideas!

Demo

Games Of Terminal interaction demo (sped-up)

got-intro.mp4

Games Of Terminal | by zluuba