https://github.com/jserv/trex
A terminal-based recreation of Google Chrome's famous T-Rex game
https://github.com/jserv/trex
Last synced: 11 months ago
JSON representation
A terminal-based recreation of Google Chrome's famous T-Rex game
- Host: GitHub
- URL: https://github.com/jserv/trex
- Owner: jserv
- License: mit
- Created: 2025-08-02T16:00:09.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-16T17:46:13.000Z (12 months ago)
- Last Synced: 2025-08-24T02:11:53.842Z (11 months ago)
- Language: C
- Size: 441 KB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# trex
`trex` is a terminal-based recreation of Google Chrome's famous T-Rex game, enhanced with modern optimizations and additional features.
## Features
- Classic T-Rex Gameplay - Jump and duck to avoid obstacles
- Enhanced Mechanics - Power-ups, fire abilities, and invincibility
- Scoring System - Track your high scores and level progression
- Rich Graphics - ASCII art sprites with full color support
- Zero Dependencies - No external libraries required
## Quick Start
### Building
```shell
make # Build the game
make clean # Clean build artifacts
```
### Running
```shell
./trex # Play the game (optimized rendering)
TUI_DISABLE_WRITEV=1 ./trex # Compatibility mode for older systems
```
### Controls
- Space or Up Arrow: Jump over obstacles
- Down Arrow: Duck under pterodactyls
- ESC or Q: Return to menu / Quit game
## Performance Optimizations
This implementation includes several advanced optimizations for terminal rendering:
### Vectored I/O (Default)
- 70-90% fewer system calls compared to traditional terminal applications
- Batches cursor movements, colors, and text into single writev() operations
- Especially beneficial for SSH connections and remote terminals
- Automatic fallback to compatibility mode if unsupported
### Additional Optimizations
- Hierarchical dirty region tracking - Only updates changed screen areas
- Escape sequence caching - Pre-computed terminal control sequences
- RLE compression - Optimized rendering of repeated characters
- Attribute state caching - Eliminates redundant color/style changes
## License
`trex` is available under a permissive MIT-style license.
Use of this source code is governed by a MIT license that can be found in the [LICENSE](LICENSE) file.