Code Monkey home page Code Monkey logo

breakoutgame's Introduction

Breakout by Hamza Usmani

About the Game

Breakout is a game where you have a paddle, a ball, and levels with breaks that you have to break by hitting with the ball! In this implementation of Breakout in C++, there are 2 game types:

  1. Basic Mode The first level starts with 5 rows and 10 columns of randomly generated blocks. Each block is worth 1 point. After every 5 points, the speed of the ball increaes by 1. Each level after is randomly generated with a similar difficulty to the first.

  2. Advanced Mode The first level is an advanced pattern which is much more difficult to complete. This mode includes stronger bricks which may take more than 1 hit to break. The speed of the ball also increases by 1 after every 5 points in this mode. For more experienced players.

Command Line Options

There are 2 optional command line parameters when running the game. The first is FPS (frames per second). The second is the initial speed of the ball. The game can be run with no arguments, 1 argument (FPS), or both arguments (FPS followed by Speed). The default FPS is 60, and default speed is 2.

./Breakout
./Breakout 60
./Breakout 60 4

Starting the Game

After running the program, press the 's' key to start, choose your game type using left and right arrows, then press 's' to select again. Upon losing, you can press 'r' to return to the main menue. You can press the 'q' key at any time to quit.

Technical Information

The game uses C++ and Xlib for graphics, as well as techniques such as an event loop, double buffering, and is single threaded. Run make to compile, or make run to compile and run using default FPS/speed.

breakoutgame's People

Contributors

hamza-usmani avatar

Watchers

 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.