Ball Game C Project application is a simple ball game for c programmers which will have the ball moving from top to bottom with paddle moving from left to right. the user needs to control directions using left and right keys to managing bricks to hit ball and send to opposition paddle.

Objective:

The main objective of this project is to develop a simple c gaming project which will have features of controlling ball by not hitting walls busing two paddle moving
on top of the screen.

Project Development:

 

  • There are many faces in developing this project which is given below.
  • Calculate center of the screen
  • Display opening screen and selects
  • Set speed of the ball as the player choose
  • Draw the bricks and the paddle of the ball
  • Memory for storage of the ball
  • Memory for storing image of the paddle
  • Store image of the ball and paddle into allocated memory
  • Store current position of paddle and ball
  • Display balls in hand initially 3
  • Display initial score
  • Save current x and y cordinate of the ball
  • Update ballx and bally to move in appropriate dirn
  • As per the dirn of the ball determine the layer of the brciks to check
  • If ball hitds the left boundry reflect to right dirn
  • If ball hits right boundry ,deflect it to left
  • If ball hits top reflect it down
  • If ball is in the area occupied by the bricks
  • If there is no brick exactly at the top of ball
  • Determine if the ball touches a brick
  • Check whether there is brick at the right of the ball
  • Check whether there is brick at the left of the ball
  • If the ball deos not touch a brick at the top,left or right
  • Check if the ball has moved above the current layer
  • If so change current layer
  • Erase the image at the old cordinates
  • Place image of the ball at new coordinates
  • Introduce delay
  • Continue with moving of the ball
  • Control comes to this point of the balltouches brick
  • Clear the part of screen used for displaying welldone message

 

Download Ball Game C project source code.