Skip to content

Alexander-Hou/tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris

This is a Tetris terminal game based on the C language and the ncurses library, which I implemented in my spare time.

How to build

This project uses the ncurses terminal graphics library for console drawing. So, the first thing you need to do is ensuring whether this library has been installed on your system before compiling. If you use Arch Linux, you can run the following command.

sudo pacman -S ncurses

If you use other Linux distributions like Ubuntu, Fedora and so on, you can obtain it through the corresponding package manager.

After preparing the dependencies, you can open a terminal in the project root directory, and run the following command.

make

Then you will find the compiled binary executable file in the bin directory, switch to the bin directory to run the tetris game.

cd ./bin
./tetris

How to play

Function Corresponding keyboard keys
Move left Left arrow key / A / a
Move right Right arrow key / D / d
Rotate clockwise Up arrow key / W / w
Hard landing Down arrow key / S / s
Temporary storage/Swap Space bar
Pause game P / p
Exit game Q / q
Restart game after it ends R / r

Your goal is to clear rows to score points. As you level up, the blocks fall faster, so challenge yourself!

Future

I will continue to optimize this game, and in the future I hope to add more features, such as save functionality, online multiplayer, etc.

About

A tetris terminal game based on the C language and the ncurses library.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors