- Project Creation Date: 2023-12
- Author: Ulaş Can Demirbağ
- Student ID: -------
- Email: ulascan.demirbag@std.yeditepe.edu.tr
- GitHub: ulascan54
This README file provides information on how to compile and run the Tetris game, along with attributions and resources used in the project.
This project is created for the CSE 211 Data Structure Term project.
Tetris is a tile-matching puzzle video game originally designed and programmed by Soviet Russian game designer Alexey Pajitnov. The first playable version was completed on June 6, 1984, while he was working for the Dorodnitsyn Computing Centre of the Academy of Science of the Soviet Union in Moscow. He derived its name from the Greek numerical prefix tetra- (all of the game's pieces contain four segments) and tennis, Pajitnov's favorite sport.
binfolder contains the executable file.libfolder contains the object files and the SFML library files.includefolder contains the header files.srcfolder contains the source code files.imagesfolder contains the images used in the game.soundsfolder contains the music used in the game.fontfolder contains the fonts used in the game.Makefileis used to compile the project.readme.mdis the readme file.high_scores.txtis the file that stores the highscores.
- SFML library must be installed. Refer to the SFML documentation for installation instructions: SFML Download and Installation
- macOS Apple Silicon Chip System (ARM 64) M1, M2 Recommended
- Linux x86_64
- Windows x86_64
- SFML 2.5.1
- GCC 9.3.0
- minGW w64
- Make 4.3
- Clang 12.0.0
- Xcode 12.5.1
- CMake 3.22.5
- freetype
- x11
- xrandr
- udev
- opengl
- flac
- ogg
- vorbis
- vorbisenc
- vorbisfile
- openal
- pthread
I also added CMakeLists.txt file for cmake users.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cd build
make
./build/bin/cmake-tetris cmake -S . -B build
cmake --build build --config Release
cd build
make
./build/bin/cmake-tetris.exe- You can find more details in this readme.md.
- CMakeLists.txt Run Details
- Succestion: Run this game Development Mode
- if you want to run this game correctly you must run this game in development mode.
-
Development Mode (Compile Everything to lib): In development mode, it will compile everything in this project:
To compile, use the following command:
make m
This command will compile only necessary files in the
libfolder. -
Run:
If you want to run the game, use the following command:
make run-m
or
./bin/app-m
-
Fast Play:
-
Development Mode (Compile Everything to lib): In development mode, it will compile everything in this project:
To compile, use the following command:
make l
This command will compile only necessary files in the
libfolder. -
Run:
If you want to run the game, use the following command:
make run-l
or
./bin/app-l
-
Fast Play:
-
Development Mode (Compile Everything to lib): In development mode, it will compile everything in this project:
To compile, use the following command:
make w
This command will compile only necessary files in the
libfolder. -
Run:
If you want to run the game, use the following command:
make run-w
or
./bin/app-w.exe
Note: Clear Files Command
make clear
Game.hcontains the main game loop and the game logic.Board.hcontains the board class and the board logic.Piece.hcontains the piece class and the piece logic.MainMenu.hcontains the menu class and the menu logic.highscores.hcontains the highscores class and the highscores logic.TextBox.hcontains the text box class and the text box logic.Player.hcontains the player class and the player logic.CustomPieceGenerator.hcontains the custom piece generator class and the custom piece generator logic.Pieces.hcontains the piece definitions and rotation logic.colortheme.hcontains the color theme definitions for background.constatns.hcontains the constants used in the game.Position.hcontains the position class and the position logic.pieceColors.hcontains the color theme definitions for pieces.Portal.hcontains the portal class and the portal logic.Node.h,LinkedList.h,Vector.h,Stack.handQueue.hcontains the data structures used in the game.Logic.hcontains the connection between the game logic and the game objects.app-main.cppcontains the main function.
- Left Arrow, A Key: Move the piece left.
- Right Arrow, D Key: Move the piece right.
- Down Arrow, S Key: Move the piece down.
- Up Arrow, W Key: Rotate the piece clockwise.
- Z,L Key: Drop the piece.
- H Key: Hold the piece.
- P Key: Pause the game.
- Escape Key: Exit the game.
-
Medium: In this mode, you can enjoy the classic Tetris gameplay. However, there is an added twist with the portal feature, allowing you to teleport pieces to the opposite side of the board. Experience environmental effects, including a flash bank. Additionally, you have the advantage of previewing the next piece and using the hold piece.
-
Hard: A faster-paced version compared to the medium mode, offering increased point potential. The game board is also smaller after each level up, providing an additional challenge.
-
Deadly: The most challenging mode in the game. Here, you are limited to rotating pieces only twice. Unique color themes and music enhance the experience. The game board shrinks faster than in hard mode as you level up. Portals and environmental effects are much faster compared to the hard mode.
In the custom piece window: By clicking the left mouse button, you can draw a custom piece. When you are finished, click the right mouse button to draw a new piece. After completing your custom pieces, press Enter to initiate the saving process for your pieces. And you can show your custom pieces in the game.
- Game Design Tutorial
- Makefile Tutorial
- SFML Sprite Tutorial
- SFML Forum Discussions
- SFML Music Tutorial
