Skip to content

HeeJohn/tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Developing a Procedural Tetris Game

370fa23c6e13d0dc3fa6b6e011fa0b57-0


Team Information

  • Team Leader: Huijun Seo
  • Team Members: Huijun Seo, Jaehyuk Lee, Seokho Jung

Project Overview

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.


Objectives

  1. Readability: Ensuring the code is easy to read and understand.
  2. Modularization: Dividing the code into manageable modules.
  3. File Handling: Efficiently managing game data through file operations.
  4. Console Functions: Utilizing console functions for better game interaction.
  5. Feature Enhancements: Adding new features to improve the gameplay experience.

Development Plan

Game Flow

  1. startpage()
    Introduce the game.

  2. preset()
    Initialize variables and set up the board.

  3. 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.

  4. drop_block()
    Drop the block one space down.

  5. check_level_up()
    Award points and level up.

  6. check_game_over()
    Determine if the game should end.

  7. create_new_block()
    Generate a new block.


Features

Ranking System

  • 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.

Block Movement

  • Move blocks
    based on user input.

  • Collision check
    before moving blocks.

  • Automatic block drop
    if no input.

  • Fix blocks
    in place upon collision.

Additional Features

  • 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.


Ranking System Algorithm

  • 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.

screenshots

procedural flow

370fa23c6e13d0dc3fa6b6e011fa0b57-2

file structure

370fa23c6e13d0dc3fa6b6e011fa0b57-1

start

370fa23c6e13d0dc3fa6b6e011fa0b57-0

370fa23c6e13d0dc3fa6b6e011fa0b57-3

370fa23c6e13d0dc3fa6b6e011fa0b57-10

370fa23c6e13d0dc3fa6b6e011fa0b57-8

370fa23c6e13d0dc3fa6b6e011fa0b57-10

370fa23c6e13d0dc3fa6b6e011fa0b57-11

370fa23c6e13d0dc3fa6b6e011fa0b57-13

370fa23c6e13d0dc3fa6b6e011fa0b57-14

370fa23c6e13d0dc3fa6b6e011fa0b57-26

370fa23c6e13d0dc3fa6b6e011fa0b57-18

370fa23c6e13d0dc3fa6b6e011fa0b57-23

370fa23c6e13d0dc3fa6b6e011fa0b57-22

370fa23c6e13d0dc3fa6b6e011fa0b57-23

370fa23c6e13d0dc3fa6b6e011fa0b57-26

370fa23c6e13d0dc3fa6b6e011fa0b57-27

ranking algorithm

370fa23c6e13d0dc3fa6b6e011fa0b57-31

370fa23c6e13d0dc3fa6b6e011fa0b57-32

370fa23c6e13d0dc3fa6b6e011fa0b57-33

370fa23c6e13d0dc3fa6b6e011fa0b57-35

end

370fa23c6e13d0dc3fa6b6e011fa0b57-40

370fa23c6e13d0dc3fa6b6e011fa0b57-41

370fa23c6e13d0dc3fa6b6e011fa0b57-42


References


Releases

No releases published

Packages

No packages published

Languages