Block Breaker

A brick-breaker arcade game written in a single Python file with Pygame. Catch powerups, survive tougher bricks each level, and let auto-aim help you finish the board.

What this is

This repo holds the full source for Block Breaker, made by Yosef Setiawan. Everything lives in one script with no image or sound files, so you can read it top to bottom. The game draws every shape itself, and the settings you are most likely to change sit in a block of named constants at the top.

Move the paddle, launch the ball, and clear every brick to move on. Each new level adds rows, makes bricks take more hits, and speeds up the ball.

Block Breaker gameplay: rainbow rows of bricks, a white ball and a cyan paddle

Controls

InputAction
MouseMove the paddle
← →Move the paddle with the keyboard
Space or clickLaunch the ball
EscPause and resume
Space or EnterPlay again after Game Over

Powerups

About one in four destroyed bricks drops a powerup, and the first brick you break each round always does. Catch it with the paddle to activate it.

Explode

The ball blasts every brick within 90 pixels of the brick it hits. It wears off the first time the ball touches a wall.

Pierce

The ball passes through bricks instead of bouncing. Each brick can be hit once per second, and the effect ends after two wall bounces.

Split

On your next paddle hit, two small clone balls launch beside the main ball. Clones vanish if the main ball is lost.

Auto-aim

Not a drop. When 10 or fewer bricks remain, the ball curves toward the nearest one and it gets a yellow outline.

Levels, lives and score

Run it

You need Python 3 and Pygame.

pip install pygame
python block_breaker.py

Replace block_breaker.py with the name of the script in this repo. The game opens an 800 × 650 window.

Make it your own

Edit these constants near the top of the script, then run it again.