Coder Social home page Coder Social logo

brick-breaker-opengl's Introduction

Brick Breaker

It's a simple graphical game. The objective of the game is to break the brick. I used C++ as a programming language and GLUT (OpenGL Utility Toolkit) to construct the structure of the game.

Rules of the Game:

  • If the player break the brick the game will goes on...
  • Until all the brick breaks or player faild to break the brick the game is over.

How the Game Works

Now, there will be a cube, a block at the bottom of the screen, and a total number of 45 bricks. The cube will go up and down, and try to hit one of the bricks, if it becomes successful in doing so the brick that was hit will be removed. The game will continue until the cube misses the block at the bottom after hitting a brick or after going downward, or it hits all of the bricks one by one.

Instructions:

  • To move the block use the LEFT key or RIGHT key of the keyboard.

Demo GIF:

img

Functions

I have taken following functons in order to complete the project.

  • void initialize(); //To set the initial co-ordinates of the objects on the screen
  • bool check_collision(float, float, float, float, float, float, float, float); //Function for checking collision
  • void draw(); //Render the objects on the screen using the latest updated co-ordinates
  • void reshape(); //Modify the co-ordinates according to the key-presses and collisions etc...
  • void specialUp(int,int, int); //Checks for Key Press
  • void specialDown(int, int, int); //Checks for Key Release
  • void revert();

Procuders to Run this Game on your machine

In order to run this game, you need to follow these steps -

  • Make sure your machine have Code::Blocks IDE and GLUT installed
  • Then just press Build & Run to run this project.
  • Enjoy the game.

๐Ÿ“ Note: This project code is written on Windows OS.

โฌ‡๏ธ: Download: You can download whole project folder (zip) from here.

brick-breaker-opengl's People

Contributors

saruarchy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.