bed7e9a8c1Added game end logic check, made sure bricks are workingJoe2018-01-12 08:48:38 +00:00
6be9da289cAdded a sticky paddle flag on death and new level, spacebar to (re)start game, ESC to exit, combined brick layouts (levels) into one functionJoe2018-01-12 04:24:35 +00:00
bf52ead7ccStarted to split sections of the program into their own header / source filesJoe2018-01-12 01:32:31 +00:00
f29f78e634Added second brick initialisation function, added 'stickToPaddle' flag to allow the ball to be aimed after it is resetJoe2018-01-12 00:34:16 +00:00
daa48a0e6dAdded text rendering using SDL_TTF, level counter, game over message, and if statement to stop the game updating once the game is overJoe Adams2018-01-11 14:14:58 +00:00
8082423e0cForgot to add font to repoJoe2018-01-11 12:18:54 +00:00
0d5153ea57Added playerLives variable that is updated when the ball is reset, and used SDL_Image to load bitmaps of heart icons and function to visually represent the lives SDL Surface to GL Texture code in loadTextures function used from http://www.sdltutorials.com/sdl-tip-sdl-surface-to-opengl-textureJoe2018-01-11 11:49:34 +00:00
a8898fe13aMerged Scoring_and_Text into masterJoe Adams2018-01-11 09:38:04 +00:00
a155ce320fImplemented a scoring system, added SDL_ttf addon in order to render text. Attempted rendering some test text (surface->GL texture->drawing quad), but was unsuccessful. May or may not remove in favour of spritemaps in the futureJoe2018-01-11 09:29:28 +00:00
d274b674e5Added 'clean' to makefile to make removing binaries before commits easier and fixed logic error in breakout.cJoe Adams2018-01-10 12:30:45 +00:00
841efab5ebUpdated makefile to compile on Linux (math wasn't linked)Joe Adams2018-01-10 12:12:09 +00:00
589b989b36Fixed collision detection (game-breaking bug) 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)Joe2018-01-09 18:36:05 +00:00
a40944d189Added collision detection for bricks as well as a parameter to track whether a brick has been destroyed. Fixed an issue where the ball's position on the next frame did not incorporate tickrate compensation (mismatch between predicted next value and actual). Added 'substeps' (iterations of main function that do not draw to screen, to allow for more precise calculation of movement by performing the calculations more frequently) and SDL_Delay to reduce FPS if it exceeds a given value (to prevent very high CPU usage with 1000+fps where not at all necessary)Joe2018-01-07 15:41:35 +00:00
d233f15f34Added in a coordinate struct (containing x and y), created function for testing whether given vertex is within a quad (coordinate array) by calculation of volume. Added in bricks and a chunk of code to populate some bricks in a gridJoe2018-01-05 13:35:40 +00:00
2e61b6b9e4Testing some code for storing brick information in mutli-dimensional arrays as leaf nodes in a tree. This approach is chosen with a view to introducting space partitioning for collision detection at a later dateJoe2017-12-15 17:00:07 +00:00
a3017b0774Added radius compensation to collision detection with paddle, within updateBall functionJoe Adams2017-12-14 10:05:58 +00:00
96b2380036Changed colours to neutral, added check to updateBall() to prevent ball 'colliding' with the area beneath the paddle when not in contact with the paddleJoe Adams2017-12-13 15:27:55 +00:00
862973e4c2File added: Alternative colour schemesJoe2017-12-13 10:17:39 +00:00
7c66002c7aRewritten to use structs for ball and paddle variables, thereby grouping everything together and keeping the functions simple/easy to readJoe2017-12-13 10:12:21 +00:00
00a089f6f9Applied tickrate to updateBall function and introduced updatePaddle function (also using tickrate) to keep timing consistent across platforms/launch scenarios - not yet tested on LinuxJoe2017-12-13 09:03:35 +00:00
c2bb045d5eFixed issue with function definition mismatch. Created a basic timer; starting work on issue #1Joe Adams2017-12-11 11:37:17 +00:00
f08b0d5b75Added some comments and changed X velocity post paddle-collision to be proportional to the relative position of the ball and paddleJoe2017-12-10 20:39:34 +00:00
54b9eb14f0Modified paddle to move in non-integer steps, created a ball with a function for updating based off of position relative to walls and paddle plus function to draw the ballJoe2017-12-10 20:24:28 +00:00
2f7a81dd9fRe-wrote to use OpenGL (based off glboilerplate/glboilerplate.c), modified window size and colour scheme to match the design doc. Implemented colour struct and background drawing functionJoe2017-12-10 19:44:04 +00:00
ca55281463Added a compiler condition so we can play on Windows tooJoe2017-12-10 17:55:35 +00:00
5af07e88f0Started to create GL boilerplateJoe Adams2017-12-08 14:05:37 +00:00