https://github.com/godsarmy/pterm-tetris
TUI TETRIS Game implemented in Golang with pterm
https://github.com/godsarmy/pterm-tetris
golang pterm tetris tui
Last synced: 9 months ago
JSON representation
TUI TETRIS Game implemented in Golang with pterm
- Host: GitHub
- URL: https://github.com/godsarmy/pterm-tetris
- Owner: godsarmy
- License: mit
- Created: 2025-09-21T19:01:22.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-09-21T19:36:14.000Z (10 months ago)
- Last Synced: 2025-09-21T21:19:49.742Z (10 months ago)
- Topics: golang, pterm, tetris, tui
- Language: Go
- Homepage:
- Size: 2.25 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TETRIS Game in Golang with pterm
A TUI TETRIS game implemented in Golang with [pterm](https://github.com/pterm/pterm)
library for terminal rendering.
## Features
- Classic TETRIS gameplay with all 7 tetromino shapes
- Colorful terminal-based graphics
- Score tracking and level progression
- Next piece preview
- Centered display that adapts to terminal size
- Proper terminal cleanup when exiting

## Installation
1. Make sure you have Go installed (version 1.16 or later)
2. Clone or download this repository
3. Navigate to the project directory
## Building
```bash
go build -o tetris cmd/tetris/main.go
```
## Running
```bash
go run cmd/tetris/main.go
```
Or if you built the binary:
```bash
./tetris
```
## Controls
- **← →** : Move left/right
- **↑** : Rotate piece
- **↓** : Soft drop (move down faster)
- **Space** : Hard drop (instantly drop piece)
- **+ / -** : Increase / decrease level
- **g** : Toggle ghost piece (show/hide drop projection)
- **q** : Quit game
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.