Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Block Blast - SDL2 Puzzle Game

A fully functional puzzle game built in C using SDL2, inspired by the popular Block Blast mobile game. Players place randomly generated Tetris-like pieces on a 10×10 grid to complete rows and columns.

Features

  • 10×10 interactive game board
  • 10 unique piece shapes with random rotations
  • Score tracking and line-clearing mechanics
  • Game over detection with restart functionality
  • Smooth SDL2 rendering

Installation & Setup

IMPORTANT: All files must be in the same folder for the game to work properly.

1. Clone or Download Repository

git clone https://github.com/yourusername/blockblast.git
cd blockblast

Or download as ZIP and extract all files to a single folder.

2. Install SDL2 Dependencies

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install libsdl2-dev libsdl2-ttf-dev

Fedora/RHEL:

sudo dnf install SDL2-devel SDL2_ttf-devel

Arch Linux:

sudo pacman -S sdl2 sdl2_ttf

macOS (Homebrew):

brew install sdl2 sdl2_ttf

3. Compile

Navigate to the folder containing all files and compile:

gcc blockblastSDL.c -o blockblast -lSDL2 -lSDL2_ttf -lm

4. Run

./blockblast

How to Play

  1. Click on one of the three pieces displayed in the left sidebar
  2. Click on the grid where you want to place the selected piece
  3. Complete full rows or columns to clear them and earn points
  4. Game ends when no pieces can be placed - click to restart

Scoring

  • Placing a piece: +30 points
  • Clearing a line or column: +50 points

Technical Stack

  • Language: C
  • Graphics: SDL2
  • Font Rendering: SDL2_ttf
  • Platform: Linux (cross-platform compatible)

Project Structure

blockblast/
├── blockblastSDL.c    # Main game source code
├── arial.ttf          # Font file (included)
└── README.md          # Documentation

Author

Stefan Andrei Sirbu - Computer Science Student at Politehnica University Timișoara

Developed as part of learning C programming and Linux development.


About

Block Blast puzzle game in C with SDL2 — 10x10 board, 10 piece shapes with random rotations, line-clearing, score tracking and game-over detection.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages