I encode a breakout clown. I had one version in which I had only one depth of structures. This version runs at 70 frames per second.
For clarity in the code, I decided that the code should have more abstractions and create more structures. In most cases, I have two two three levels of depth of structures. This version runs at 30 frames per second.
Since there are other differences besides structures, I ask you: can using a large number of C structures significantly slow down the code?
For example, in the second version, I use:
struct Breakout
{
Ball ball;
Paddle paddle;
Level* levels;
}
struct Level
{
Bricks* bricks;
}
So, I use breakout.levels [level_in_play] .bricks [i] .visible many times, for example. Will this be a possible cause?
Thank.