A modern brick breaker game built with Go and Ebitengine, featuring a flexible JSON-based level system.
- Circular Ball: Smooth, realistic ball physics with proper circular collision
- Configurable Levels: Easy-to-create JSON level files
- Multiple Brick Types: Different colors and hit requirements
- Score System: Points for hitting paddles and destroying bricks
- Modern Graphics: Vector-based rendering with Ebitengine
- Arrow Keys or A/D Keys: Move paddle left/right
- The game automatically starts when you run it
Levels are stored as JSON files in the levels/
directory. Each level file should be named levelX.json
where X is the level number.
{
"name": "Level Name",
"bricks": [
{"x": 0, "y": 1, "color": "red", "hits": 1},
{"x": 1, "y": 1, "color": "blue", "hits": 2}
]
}
- Screen Width: 720 pixels
- Brick Width: 60 pixels (12 bricks fit horizontally)
- Brick Height: 20 pixels
- Grid Coordinates:
- X: 0-11 (12 columns)
- Y: 0-9 (10 rows maximum)
- x, y: Grid position (0-based)
- color: Brick color (affects appearance)
- hits: Number of hits required to destroy the brick
red
: Red bricks (1 hit typically)orange
: Orange bricksyellow
: Yellow bricksgreen
: Green bricksblue
: Blue bricks (often 2+ hits)purple
: Purple bricks (often 3+ hits)pink
: Pink bricks
- Paddle Hit: 10 points
- Brick Hit: 25 points
- Brick Destroyed: 50 points
# Build the game
go build -o brick-breaker main.go
# Run the game
./brick-breaker
Simple horizontal rows with single-hit bricks.
Mixed brick types with some requiring multiple hits.
- Create a new JSON file in the
levels/
directory - Name it
levelX.json
where X is the next level number - Use the grid system to place bricks logically
- Test different color combinations and hit requirements
- The game will automatically load the new level
- Built with Go 1.24+
- Uses Ebitengine v2.8+ for graphics
- Vector-based rendering for smooth graphics
- JSON-based configuration for maximum flexibility
- Modular design for easy expansion
- Start Simple: Begin with single-hit bricks in basic patterns
- Add Complexity: Introduce multi-hit bricks gradually
- Use Colors Meaningfully: Different colors can indicate difficulty
- Leave Gaps: Strategic gaps make levels more interesting
- Test Thoroughly: Play-test your levels to ensure they're fun and fair