Ever been stuck without internet and played that awesome T-Rex game in Chrome? Well, guess what? Now you can relive that glory right in your terminal, thanks to this cool project written in C! It's super simple, super retro, and totally addictive.
- Old-school Terminal Fun: Get ready for some sweet ASCII-ish graphics.
- Resizes with Your Terminal: No weird stretching! It just adapts.
- Dino Jumps, Obstacles Appear: Your trusty dino, pesky enemies, and even some fluffy clouds.
- High Score Chasing: See how long you can survive!
- Day & Night Cycle: Watch the sun and moon do their thing while you play.
- Operating System: If you're on Linux or macOS (basically, anything Unix-y), you're golden.
- Stuff Under the Hood: It uses standard C libraries and some terminal magic (
ioctl,unistd.h). - Compiler: Make sure you have
gccorclanginstalled.
yay -S trex-c-
Grab the code:
git clone https://github.com/StiveMan1/T-RexC.git cd T-RexC -
Compile it up:
gcc trex-c.c -O3 -lm -o trex-c
-
Run the show!
./trex-c
It's super straightforward. Just open your terminal, run the game, and use these keys:
- Space bar / Up Arrow: Jump! Also, kicks off the game.
- Arrow Up: Jump and Start game
- R: Game over? Hit 'R' to restart in spectator mode and watch the world go by.
Your mission: Dodge stuff! Seriously, just jump over those obstacles and keep your dino alive. Your score goes up the longer you last, so aim for that high score! Keep an eye on the changing day and night – it adds a nice touch to your endless run.
While it's a simple game, a few things adjust automatically:
- Screen Size: It'll fit your terminal window like a glove.
- Score: Always chilling in the top corner.
- World: Dynamic day/night, clouds, sun, moon – the whole shebang!
All contributions are welcome! Please follow the coding style found in the existing code and add comments where necessary.
This project is open source and licensed under the GNU License. Check out the LICENSE file for all the nitty-gritty details.