Skip to content

omar0ali/breakout-game-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breakout CLI Game

A simple terminal-based implementation of the classic Breakout game written in Go, using the tcell library for handling terminal graphics and input.

game-screenshot

Features

  • 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=true under core in the configuration file.
  • 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.

Getting Started

Clone repository

git clone https://github.com/omar0ali/breakout-game-cli.git

Run the game

go run .

Configuration

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 = 3

File is saved as config.toml

Controls

  • The paddle can be moved left and right using the Arrow Keys.
  • Mouse control is now supported.
  • ESC, q To quit / stop the game.
  • Space, Mouse Left Click shooting the ball out of the paddle.

About

Simple terminal-based Breakout game built in Go using the tcell library.

Topics

Resources

Stars

Watchers

Forks

Languages