BendBall 0.12

by on Aug.25, 2014, under BendBall

This replaces version 0.11b. The main visible changes here are tweaks to gameplay, and making the grabber function automatic.

Besides that, I’ve been working towards tidying up the code. I’ve done a bit to split code up and do some tidy-up so far; I’ve been writing comments noting these as I go, and as I find the time I’ll be making further improvements. Sources are always available to see in the BitBucket repository (see below).

Code Analysis and Future Plans

Functionality-wise, my immediate plans are to fix the main known issues. Particular priority to the “ball sinking” state, where deflector positions should be reset and the ball marker should not be displayed; and the collision resolution system, which should be made to better handle fast moving objects and three-way collisions between ball, wall and deflector.

It’s been interesting taking a look at code I wrote 4-5 years ago, when I I had much less experience with C++ (and no professional experience). A lot of the basic structure I think is fine, but I have found various aspects that I think could be better. I see three main problems:

  1. Duplication – there’s a lot of unnecessary duplication. In my experience, a “Don’t Repeat Yourself” philosophy really helps make code more maintainable and readable in the long run.
  2. God objects” – classes like FPGame and FPSettings are too big and cumbersome, and should be split up.
  3. High coupling with external libraries – OpenGL rendering specific code is placed within the game classes. Ideally I’d like to reduce this coupling as much as possible, by having one or a set of classes specific to external libraries like OpenGL and GLUT.

With my newer projects I’ve tried to have a wrapper class that governs an entity and a factory for making entities from configs or specifications, rather than having them created and kept loose on a main class. I’ve also had a separate class that governs setting up and performing the actual rendering of the game world, and would like to do the same for the main game init and loop. This would allow for keeping OpenGL/GLUT code separate.

Free time allowing, I would like to write up a common game framework using the above ideas. This could then be used for both BendBall, BattleForPolaris, and any future C++ game projects. I’ve been Die Evil Rocks project in Python, and once that structure is finalised I would like to draw up the design and port it back to my common C++ code.


  • Project code restructure, and bundled libraries.
  • Grabber use is now automatic, preventing players from just grabbing the ball during normal play.
  • Settings tweaks to improve gameplay; particularly physics and game field size.


BendBall 0.12 for Windows (.ZIP, 2.48 Megabytes)

BendBall Source (BitBucket Repository)

Comments are closed.