The beginnings of Breakout

After my moderate success with Pong, but not much else, I thought I’d try another simple retro game, this time a Breakout clone (also known as Brick Breaker).

So far I’ve just been getting used to C++ again (I usually use Java) and this was just an experiment really so I’ll be the first to admit that my code on this is horrendous. This is possibly the most convoluted if statement I’ve ever written:

if (BallSprite.GetPosition().x + 30 >= PaddleSprite.GetPosition().x && BallSprite.GetPosition().x <= PaddleSprite.GetPosition().x + 100 && BallSprite.GetPosition().y - 30 <= PaddleSprite.GetPosition().y && BallSprite.GetPosition().y >= PaddleSprite.GetPosition().y - 30)

I’m going to refresh my memory on how inheritance works in C++ and aim to have the program be as object oriented as possible (which it is very much not at this point).

The code is available from My Github.

Either way, this is a starting point to develop on (even though I’m pretty much going to rewrite the whole thing).

Advertisements