- Team Leader: Huijun Seo
- Team Members: Huijun Seo, Jaehyuk Lee, Seokho Jung
This project aims to develop a robust and scalable Tetris game using data structures. The development will focus on enhancing readability, modularization, and efficient file handling. The main goals include implementing a console-based Tetris game, integrating advanced features, optimizing the ranking system using linked lists or arrays, and using a procedural programming approach.
- Readability: Ensuring the code is easy to read and understand.
- Modularization: Dividing the code into manageable modules.
- File Handling: Efficiently managing game data through file operations.
- Console Functions: Utilizing console functions for better game interaction.
- Feature Enhancements: Adding new features to improve the gameplay experience.
-
startpage()
Introduce the game. -
preset()
Initialize variables and set up the board. -
Game Loop (while(1))
-
Block Drop
Continuously drop blocks until the game is over. -
User Input (5 times)
Allow five user inputs per block drop. -
check_key()
Move blocks based on user input. -
draw_board()
Redraw the board after each move. -
sleep(speed)
Adjust game speed.
-
-
drop_block()
Drop the block one space down. -
check_level_up()
Award points and level up. -
check_game_over()
Determine if the game should end. -
create_new_block()
Generate a new block.
-
Read ranking file.
-
Initialize variables
(level, score, lines, speed, flags). -
Clear console
and reset board. -
Display game status
and rankings. -
Generate and draw new blocks.
-
Move blocks
based on user input. -
Collision check
before moving blocks. -
Automatic block drop
if no input. -
Fix blocks
in place upon collision.
-
Pause functionality.
-
Timer notifications
(e.g., remove a line within 50 seconds). -
Speed increase
after timeout. -
Combo bonuses
for removing multiple lines. -
Level up
and speed up features. -
Bomb items
and large block items. -
Ranking system
using linked lists or arrays.
-
Initialization:
- At the end of each game, compare the score and insert it into the appropriate position.
- If there are less than 10 rankings, add the new score to the list.
- If the list has 10 rankings, compare and insert if the new score is in the top 10, and remove the lowest score.
-
Linked List Handling:
- Create a linked list if it's the first game.
- Insert the user's score in the correct position based on the current scores.
- Save the updated rankings to the file before starting a new game.