mirror of
https://github.com/rjNemo/breakout
synced 2026-06-06 00:26:39 +00:00
2.5 KiB
2.5 KiB
Breakout Game in Go
A classic Breakout game implementation in Go using the Ebitengine game library. Break all the bricks to win, but don't let the ball fall below your paddle!
Game Features
- Rainbow-colored bricks with depth-based scoring
- Smooth paddle and ball movement
- Score tracking
- Game over state with restart option
Installation Requirements
- Go 1.21 or later
- Ebitengine dependencies (automatically handled by Go modules)
System Dependencies
For macOS:
brew install go
For Linux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install golang-go
sudo apt-get install libgl1-mesa-dev xorg-dev
For Windows:
- Download and install Go from golang.org
- Install GCC (required for Ebitengine) via MinGW or MSYS2
How to Run
- Clone the repository:
git clone <repository-url>
cd breakout
- Install dependencies:
go mod tidy
- Run the game:
go run main.go
Game Rules
- Control the paddle to prevent the ball from falling below
- Break bricks by hitting them with the ball
- Different colored bricks award different points:
- Red (top row): 50 points
- Orange: 40 points
- Yellow: 30 points
- Green: 20 points
- Blue (bottom row): 10 points
- Game ends when the ball falls below the paddle
- Maximum possible score: 1,500 points
Controls
- Left Arrow: Move paddle left
- Right Arrow: Move paddle right
- Space: Restart game after game over
Game Mechanics
- The ball bounces off walls, the paddle, and bricks
- Ball direction gets slightly randomized when hitting the paddle
- Breaking all bricks is a win condition
- Higher bricks are worth more points but are harder to reach
Development
The game is built using:
- Go programming language
- Ebitengine for game development
- Standard library for core functionality
Project Structure
breakout/
├── main.go # Main game code
├── go.mod # Go module file
├── go.sum # Go module checksum
└── README.md # This file
Contributing
Feel free to fork the repository and submit pull requests. Some ideas for improvements:
- Add sound effects
- Implement different levels
- Add power-ups
- Add high score tracking
- Add different ball speeds or paddle sizes
License
This project is open source and available under the MIT License.