No description
Find a file
2025-03-02 22:20:36 +01:00
.gitignore readme 2025-03-02 17:13:32 +01:00
ball.go add ball 2025-03-02 21:38:52 +01:00
brick.go extracat brick 2025-03-02 18:37:05 +01:00
go.mod init: game 2025-03-02 17:00:17 +01:00
go.sum init: game 2025-03-02 17:00:17 +01:00
LICENSE readme 2025-03-02 17:13:32 +01:00
main.go add victory message 2025-03-02 22:20:36 +01:00
paddle.go extract paddle code 2025-03-02 21:38:52 +01:00
README.md readme 2025-03-02 17:13:32 +01:00

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

  1. Go 1.21 or later
  2. 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:

  1. Download and install Go from golang.org
  2. Install GCC (required for Ebitengine) via MinGW or MSYS2

How to Run

  1. Clone the repository:
git clone <repository-url>
cd breakout
  1. Install dependencies:
go mod tidy
  1. Run the game:
go run main.go

Game Rules

  1. Control the paddle to prevent the ball from falling below
  2. Break bricks by hitting them with the ball
  3. 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
  4. Game ends when the ball falls below the paddle
  5. 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.