A simple terminal-based implementation of the classic Breakout game written in Go, using the tcell library for handling terminal graphics and input.
-
Paddle movement using arrow keys
- Added animation when the paddle is moved, to give it a little bit of smoothness while moving.
-
Ball animation and basic collision with walls and paddle
- Ensure all objects on screen are smooth even when frame rate fluctuates.
- Added additional brick collision, when the ball hits the sides of the brick, the ball changes direction.
-
Smooth rendering in the terminal
- FPS is visible, the game fixed at 30 frames per second.
-
Add bricks for the player to break by the ball.
- Level / Height of bricks can be modified through the configuration file.
-
FPS can be configured through the configuration file.
-
Add debug information
- To enable debug mode - can be enabled by adding
debug=trueundercorein the configuration file.
- To enable debug mode - can be enabled by adding
-
Added mouse support, to enable
mouse=true -
Added multi ball game, hitting the space bar will shoot them, limited to 10 balls a game.
-
Status Bar to show player details.
-
Added 'You Win!' message at the end, when destroying all the bricks.
-
Showing a message before starting the game 'Click the left mouse button to get started!' as a tutorial.
Clone repository
git clone https://github.com/omar0ali/breakout-game-cli.gitRun the game
go run .The game uses toml file for the user to configure the game, paddle, and ball speed can be changed as well as
the paddle width to fit the player need.
Example
[core]
duration_ticker = 33 # Target frame/update interval in milliseconds (actual FPS may vary)
debug = false
mouse = true
[player]
speed = 60
jump_by = 8
paddle_wdith = 10
balls = 10 # number of balls a player can have start of the game
[ball]
speed = 17
[bricks]
level = 3File is saved as config.toml
- The paddle can be moved left and right using the
Arrow Keys. - Mouse control is now supported.
ESC,qTo quit / stop the game.Space,Mouse Left Clickshooting the ball out of the paddle.
