Currently I've been reading up on DOD and its benefits over OOP in games with cache speed in mind. I think I've read everything easy to find on the web, and I do understand the principles of keeping data structs small and worked on as much as possible whilst still in memory to reduce cache loading/misses. But I just can't seem to get that eureka moment when it comes to piecing it all together in a program.
say for example I have a bat and ball game, i need to draw 1 sprite for bat and 1 for ball, and 1 for brick many times over, then check for collisions between all bricks and 1 ball, then all bricks and bat (consider the bat and bricks can move freely), what kind of interaction would the classes have?
At the moment I would have a collsion object within an entities manager object, enman would have a checkcollision() which would take 2 arrays of objects arguments and set relevant flags in the objects as to whether they collided. As for drawing Im not entirely sure about what i would do.
please consider that I have already googled and I havent found any examples of classes working together with DOD in mind.
if youre reading this and youve never heard of DOD this sums it up pretty well.
http://www.gamedev.net/topic/575076-what-is-data-oriented-programming/page__st__20