Python · Pygame

Block Blast: Ghost Block Edition

A block-placing puzzle game on an 8×8 grid, with a twist: every piece contains at least one ghost block that can overlap cells that are already filled.

Screenshot of Block Blast Ghost Block Edition showing a partly filled grid with green hatched ghost blocks
Green hatched cells are ghost blocks. The next piece waits in the tray on the right.

What is this?

This repo is a single-file clone of the Block Blast puzzle genre, written in Python with Pygame. You drag pieces from a tray onto an 8×8 board and fill complete rows or columns to clear them and score points. You get three pieces at a time, and the game ends when none of them fit.

The twist is the ghost block. Every piece has at least one, shown in green with a hatch pattern. Normal cells need empty space, but ghost cells may land on top of filled cells, so you can squeeze pieces into spots that would otherwise be impossible.

How ghost blocks work

An example piece: two normal cells and one ghost cell in the middle.

  • Normal cells must land on empty grid cells.
  • Ghost cells can land on empty or filled cells.
  • Every cell of a piece must still be inside the board.
  • If a ghost lands on an empty cell, it fills it with a green ghost block. If it lands on a filled cell, the existing block stays as it is.
  • Ghost blocks count toward clearing rows and columns like any other block.

Features

25 piece shapes

Singles, dominoes, triominoes, tetrominoes and pentominoes, each with a ghost cell.

Mouse-only controls

Click a piece to pick it up, move over the grid, click again to place it.

Placement preview

A translucent preview shows where the piece will land, and only appears when the spot is valid.

Combo scoring

Clearing several lines at once earns a bonus on top of the base points.

Saved high score

Your best score is stored locally in a small JSON file.

Flash effects

Cleared lines flash white before disappearing.

Controls

InputAction
Left click on a tray piecePick it up
Left click on the gridPlace the held piece (if the preview is shown)
Right clickCancel and put the piece back
Any key (start screen)Start the game
R / Q or Esc (game over)Restart / quit

Scoring

Run it yourself

You need Python 3 and Pygame.

pip install pygame
python block_blast_ghost.py

Replace the filename with the name of the Python file in this repo. A block_blast_highscore.json file is created next to the game the first time you score.

Project layout

Everything lives in the repo root.

FilePurpose
block_blast_ghost.pyThe whole game: shapes, rules, drawing and main loop
block_blast_highscore.jsonLocal high score, generated at runtime
index.htmlThis page

Inside the code: the SHAPES list defines pieces, Piece holds a shape and color, can_place and place_piece implement the ghost rules, and main() runs the game loop.