Skip to content

A Breakout-style game written in C where the player controls a paddle to bounce a ball and destroy bricks, featuring menus, scoring, lives, and sound effects.

Notifications You must be signed in to change notification settings

iiYessine/BrickBuster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฑ Breakout Game (C)

๐Ÿ“Œ Description

This project is a Breakout (Brick Breaker) game implemented in C, using a graphical library (libTableauNoir).
The player controls a paddle to bounce a ball and destroy bricks while keeping the ball from falling off the screen.


๐ŸŽฎ Game Features

  • Paddle controlled by mouse or keyboard
  • Ball physics with realistic rebounds
  • Brick collision detection
  • Score system with graphical digits
  • Life system (hearts)
  • Sound effects and background music
  • Menus (start menu, mode selection, color selection)
  • Win and loss screens

๐Ÿง  Game Logic

  • The ball bounces off walls, paddle, and bricks
  • Each destroyed brick increases the score
  • The player loses a life if the ball falls below the paddle
  • The game ends when:
    • All bricks are destroyed (win)
    • All lives are lost (game over)

๐Ÿ—๏ธ Code Structure

  • modele_t : Game model (ball, paddle, bricks, states)
  • donnees_t : Game state and rendering tools
  • init_modele() : Initializes positions and velocities
  • mettre_a_jour() : Updates game physics and collisions
  • afficher() / effacer() : Rendering logic
  • lignebrique() : Brick layout generation
  • menu1(), menu2() : Game menus
  • gagner() : Win condition
  • afficher_score() : Displays the score using images

๐ŸŽฎ Controls

Paddle Control

  • Mouse mode: Paddle follows mouse movement
  • Keyboard mode:
    • Left Arrow โ†’ Move left
    • Right Arrow โ†’ Move right

Other Controls

  • SPACE โ†’ Start / Continue
  • Close window โ†’ Exit game

โ–ถ๏ธ Compilation & Execution

Make sure the required graphics and audio library is installed.

gcc casse_briques.c -o casse_briques -lTableauNoir -lm
./casse_briques

About

A Breakout-style game written in C where the player controls a paddle to bounce a ball and destroy bricks, featuring menus, scoring, lives, and sound effects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages