上QQ阅读APP看书,第一时间看更新
Game objects
Our approach so far has been entirely procedural and has been coded so that it could have been written in C and not C++. Developers have been writing games in C and even assembly language for a long time, so having an object-oriented approach to game design is not strictly necessary, but from a code management perspective OOP is a great way to design and write your games. Game objects can help us manage our allocated memory through object pooling. At this point, it will also make sense to begin breaking our program up into multiple files. My approach will be to have a single .hpp file that defines all of our game objects, and one .cpp file for each of our objects.