Blockade is a 2D game inspired by the classic Tetris, developed using Python and the Pygame library.
Tetris, originally created in 1984, is a tile-matching puzzle game where players manipulate falling blocks (tetrominoes) to form complete rows, which are then cleared. In this project, I recreated the core mechanics of Tetris, adding my own logic and implementation for rotation, block placement, and gameplay.
The goal of this project was to develop a fully functional Tetris-like game using Python. I utilized the Pygame library for rendering, handling inputs, and managing the game loop.
Key Mechanics and Features:
- Block Rotation: Implemented block rotations using custom mathematical formulas derived from logical patterns (detailed below).
- Gameplay Flow: Blocks fall in real-time, and players can rotate or move them horizontally to fit them into rows.
- Row Clearing: Complete rows are detected and cleared, earning points for the player.
- Game Over Condition: The game ends when blocks stack to the top of the screen.
- Python 3.7 or higher
- Pygame library
- Clone the Repository:
git clone https://github.com/Marirs27/blockade_game.git cd blockade
- Install Dependencies: Install Pygame using pip if it's not already installed:
pip install pygame
- Run the Game: Execute the game script:
python blockade.py
The rotation of blocks (tetrominoes) was a key challenge in implementing the game. I derived mathematical formulas to determine how blocks should rotate while staying within the grid.
Here is an image illustrating the logic and formulas behind the block rotation:
Here is a short snippet of the game in action:
Blockade_Demo.mp4
There is potential to expand the game further with additional features, such as:
- New Game Modes: Adding time challenges, survival mode, or multiplayer options.
- Enhanced Graphics: Improving visuals with animations, particle effects, and better UI design.
- Customizable Controls: Allowing players to remap controls to their preferences.
- Sound Effects and Music: Integrating background music and sound effects for a richer gaming experience.
- High Score System: Implementing a leaderboard to track top scores.
- Developed by: Sriram Kannan
- Tools Used: Python, Pygame