Fixed an issue with the ball occasionally clipping through the paddle/bricks or bouncing from a position inside the paddle/bricks This should never happen, as the ball should be updated to move in a different direction if the ball is clipping in the next frame This was being caused by a rounding error in the vertexWithinQuad function, where adding the compared volumes introduced a small imprecision and meant the test volume and original volume were not always exactly equal Cast the two areas as integers when comparing, such that only a discrepancy > 1px would be considered a collision (perfect since we are ultimately rendering bitmaps). Could also be solved by adding a percentage margin of error or increasing precision (both more costly)
Breakout
CATA 2017 Programming Principles project: Breakout game
Getting Started
To download and run, follow the instructions below.
Prerequisites
OpenGL compatible graphics driver
Clang
Default compiler used for this project
See the Clang getting started page for info on compiling.
Pre-build packages available on Debian/Ubuntu:
# apt-get install clang
and CentOS/Fedora:
# yum install clang
SDL
Simple DirectMedia Layer library
See the SDL wiki page for installation instructions
Installing
Clone the repository (into a new directory breakout_dir)
$ git clone https://bitbucket.org/sumptum/cata17-1-ef-breakout.git breakout_dir
Breakout
Change to the breakout directory inside the repository (contains the main program) and run make to compile
$ cd breakout_dir/breakout
$ make
To run, execute the output binary - breakout (takes no args)
$ ./breakout
Troubleshooting
Permission denied: Usually this is a result of the binary not having the correct permission bits set.
The user must have permission to execute the binary, e.g.
$ chmod +x ./breakout
Exit codes:
| Code | Meaning |
|---|---|
| 0 | Completed successfully |
| 1 | SDL initialisation failed |
| 2 | Error creating window |
| 3 | Error creating renderer |
Stderr may contain more information. See source for more
(Others)
Other folders contain test and reference code, detailed below.
For build instructions, view the readme files provided within
Running make with no arguments will prompt, e.g.:
$ cd breakout_dir/sdlboilerplate
$ make
.... OUTPUT TRUNCATED ....
compile usingmake pointy
.... OUTPUT TRUNCATED ....
Contents
breakout
This is the main folder for the project, containing the code for the breakout game
(Others)
Additional subfolders contain reference, experimental or tangential code used in creating neccesary components of the program.
For credits and usage details, see the readme files provided within
Authors
- Joe Adams - Owner - s5067322@bournemouth.ac.uk / dev@joea.co.uk