Bouncing Ball mid Term Project

Inspiration:

There are many games but I was inspired by the popping of the balls which is very fun to play. The visualization of bouncing of ball improves eye movement. It comes under stress reliever games category and the game logic is so simple so anyone can play and used to of the game. The game gives a perfect movement break and enhance sensory regulations in a smooth way. The health boosting game logic inspired me to implement bouncing ball game.

Rules for the game:

The rules for the game is very simple and one can play the game even by mouse movement. The main objective of the game is to pop all of marbles by bouncing balls. The top of the screen is filled with random marbles. At the bottom of screen we have a pile or stick on which ball is bouncing. We can bounce the ball in any direction to break the marbles which are at top of the screen. The user wins when screen cleared out from all marbles.  The user will lose the game if the ball drops from the bottom of the screen.

Implementation Strategy:

For the implementation I will make class for marble which represents the marble object. The color of the marble will be randomly selected. Same in pattern I will implement functions based on the behaviors and game logic and then simply calling those functions in order to perform actions at run time.

Objects using in Game:

Ball Object: This is the ball object which is bouncing on the stick placed at the bottom of the screen.

Marble Object: This is the marble object and in game the marbles will be placed at random positions on top of the screen with random colors.

Storyboard of the Game:

The game comprises of 3 screens.

  1. The initial screen for starting the game and prompting for how to play the game.
  2. The main screen where marbles are placed at top of screen and ball object is placed for bouncing.
  3. The third and final screen is for showing the score of the game. The third screen will pop up either when all marbles cleared up or when ball drops from the bottom of the screen.

 

Progress Code:

void setup() 
{
  
  size(800, 800);
  for(int i=0;i<height;i++)
  {
    for(int j=0;j<200;j++)
    {
        noStroke();
       fill(random(255));
        rect(i,j,50,50);
      j=j+50;
    }
    i=i+50;
  }
  
}

Progress Visualization:

One thought on “Bouncing Ball mid Term Project”

  1. Hi Theyab, you’ve got a long way to go here. I expected more progress by this point.

    One thing you may want to look into the using the Box2D physics library. this will make stacking abunch of marbles and then breaking them apart easy. It will take a little figuring out, but I’m sure you can do it. Here is a helpful link for reference: https://natureofcode.com/book/chapter-5-physics-libraries/

    It will look really nice if you use some marble images for the actual marbles.

Leave a Reply