KreakOut #4 – Bricks shall be shat

A Breakout game without bricks is like a really one-sided Pong match, so now it was time for those!

The main part of the block-script is just a copy of the BallObject, the problem was in getting multiple objects of the same type to work.
As someone that got more experience creating programs, I figured that arrays would do the job. After a lot of tinkering around, we ended up with what seemed like it would work with no errors at all. But instead the program crashed when opening it (arrays tend to hate you like that), and due to a lack of competent teachers around at the time, we started working on a vector-version instead.

Vectors can also be useful, even when not modeling in 3D!

After awhile we ended up with the same problem again, but at least now we could work out the problem at least. An array starts in a fixed size (normally at least), while a vector does not. This did ’cause some problems, but we eventually got it sorted out and ended up with a looped-version of the other objects (including a vector on the brick-positions being sent to Engine.cpp).

Objects and stuff

Next on my to-do list (Jokke will work on the state-manager):

  • Make the blocks disappear on collision
  • Fix the problems with the ball hitting the edge of a sprite (on the sides)

And what it looks like right now