Skip to content

andrianllmm/byteblast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ByteBlast

A BlockBlast clone and solver in PyGame

Demo

About

ByteBlast is a BlockBlast clone using PyGame that includes an auto solver that uses a backtracking algorithm to find solutions. BlockBlast is a puzzle game where players place blocks on a grid to clear rows and columns much like Tetris.

Features

  • Block movement and placement: use the keyboard keys to move and place blocks on the grid.
  • Line clear: clear entire rows and columns when they are filled.
  • Random solvable block generation: generates new blocks that can always be solved.
  • Score tracking: track the users score as they place blocks and clear lines.
  • Auto-solve: an algorithm that automatically solves the puzzle indefinitely using backtracking.

Installation

  1. Clone the repo
    git clone https://github.com/andrianllmm/byteblast.git
    cd byteblast
  2. Create and activate a virtual environment
    python -m venv venv
    source venv/bin/activate  # or venv\Scripts\activate for Windows
  3. Install the dependencies
    pip install -r requirements.txt
  4. Start the game
    python src/main.py

Usage

Gameplay Rules

  • Blocks can only be placed if they fully fit within the grid and do not overlap existing tiles.

  • Completing a full row or columnclears it and awards bonus points.

  • Your score increases based on:

    • The number of tiles placed.
    • The number of rows and columns cleared.
  • New blocks are generated only when all current blocks are placed.

  • Generated blocks are guaranteed to be solvable.

Game Over

The game ends when none of the available blocks can be placed anywhere on the grid.

Controls

Block Selection

  • A: Select first block
  • S: Select second block
  • D: Select third block
  • TAB: Cycle through available blocks

Block Movement

  • Arrow Keys: Move the selected block around the grid

Placement

  • SPACE: Place the currently selected block

Auto Solver

  • ENTER: Toggle auto-solve mode

    • When enabled, the solver will automatically place blocks using a backtracking algorithm.
    • The game will continue indefinitely until no valid solution exists.

Contributing

Contributions are welcome! To get started:

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

Issues

Found a bug or issue? Report it on the issues page.

Releases

No releases published

Packages

No packages published

Languages