Coder Social home page Coder Social logo

tetris-by-riyuan-liu's Introduction

Tetris-by-Riyuan-Liu

Game Mechanics:

             * The project implements the classic Tetris game mechanics, where different-shaped blocks called "tetrominos" fall from
                the top of the screen.
             * The player can move and rotate the tetrominos to fit them together in a horizontal line at the bottom of the screen.
             * Once a line is complete, it disappears, and the player earns points.


User Interface:

             * The project includes a graphical user interface (GUI) using a library like SDL or SFML to render the game elements
                 and handle user input.
             * The GUI displays the game board, the falling tetrominos, the score, and other relevant information.
                                                                 image

Game Loop:

             * The project implements a game loop that continuously updates the game state, handles user input, and renders
                the updated visuals.
             * The game loop ensures a smooth gameplay experience by controlling the timing and framerate.


Collision Detection:

                                                                 image

             The project incorporates collision detection to prevent tetrominos from overlapping with existing blocks or the game boundaries.
             It checks for collisions when moving or rotating tetrominos and adjusts their positions accordingly.

Scorekeeping:

image
             The project keeps track of the player's score based on the number of lines cleared.
             It increments the score when lines are completed and updates the display accordingly.

Level and Speed:

             As the game progresses, the project can implement increasing difficulty levels.
             Each level raises the falling speed of the tetrominos, making the game more challenging.
             The player's level may increase based on the number of lines cleared.

Game Over:

             The project detects the end of the game when the stack of tetrominos reaches the top of the screen, resulting in a "Game Over" condition.
             It displays the final score and offers the option to restart the game.

Random Tetromino Generation:

             The project generates random tetrominos for the player to control and drop onto the game board.
             It uses a random number generator to select the next tetromino from a predefined set of shapes.
             image

Additional Features:

             Depending on the project's complexity, you can consider adding features like a preview of the next tetromino,
             a "hold" mechanic to store a tetromino temporarily, special power-ups or bonus blocks, multiplayer support, or a high score leaderboard.

tetris-by-riyuan-liu's People

Contributors

riyuanliu avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.