Skip to content

dilohn/block-blast

Repository files navigation

Block Blast Placer

Project Overview

These series of scripts analyze a game board image from Block Blast, detects which grid cells are filled or empty, classifies new shapes from the image, and determines the placement of those shapes on the grid using a basic algorithm.

Features

  • Grid Detection: Identifies the current 8x8 game grid state from an input image.
  • Shape Classification: Splits and classifies shapes from the game UI using template matching.
  • Optimal Placement: Computes the best placement for classified shapes and updates the grid.
  • Line Clearing: Clears fully populated rows and columns after shape placement.
  • Batch Processing: Processes and saves cropped shape images for training or visualization.

Usage

  1. Place your input image (e.g., Image.jpg) in the project root.
  2. Ensure the Block Blast Cropped Masked folder contains template images of shapes named by their array representation (e.g., [1,1]_[mask].png).

Run the main script:

python blockblast.py

This will:

  1. Detect the 8x8 grid (blockblast_detect.get_grid).
  2. Classify shapes from the UI (blockblast_classify.classify).
  3. Determine optimal placements and clear lines.
  4. Print the final grid state and placement grid.

About

where to put your pieces in block blast

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages