menu

Image System, Scene Manager & Memory Management

I’m continuing to expand my code base for a project due in two weeks. The idea is to create a simple game of Breakout using SFML. The idea is easy and likewise the coding shouldn’t take very long. Surprisingly I actually spent the last 5 hours working on a base for it without even a single thing on screen.

Essentially what I’m writing is somewhat of a subsidiary of SFML, or at least close to one. Closer to the end of my current trimester I’ll most likely be using the some functions that I’m writing now for a Pac-man project which will be somewhat more challenging, despite having some 3D interactive work done in the past.

Memory management is currently done efficiently and everything is handled quite well, regardless of the fact there is no actual game content. I have been using some resources from a previous test environment that’s responding well to it anyway. Sprite images are remembered within a vector class that can clear memory on scene changes as well as the previously mentioned entity system which has been modified to a fairly great extend. Entities and scenes are both handled with polymorphic abstract base classes and have been introduced with singletons and monotone design patterns.

The majority of time spent was the process of eliminating strange memory issues that have now been solved, making the future process of getting elements of Breakout working significantly faster. It’s possible I’ll have a prototype of the project by the end of the next time I work on it unless I get sidetracked on specific features. I’ve laid out skeletons of the ball, brick and paddle components as well as the three game scenes that I’ve planned which I’ll most likely start some time tomorrow.