Day 5 of Charge Development
So instead I created a simple particle engine. For the most part, I just took LazyFoo's particle engine and slightly modified it to fit how I wanted it to react. I may expand it a bit but at the moment I'm only worried about one thing: The colored surfaces.
So the problem is that there is 4 surfaces that are used in the particles. LazyFoo has them as global variables but I doubt he'd do that in a real project. It's bad practice because the entire game doesn't need it. The only thing that actually needs it is the levels.
So my problem is that I have to display the surfaces in the particle class, because if I declare them in another class, then they can't be accessed. I don't want every particle I create to create 4 surfaces because that becomes real inefficient, real fast. The solution is supposed to be static variables.
I admit I forgot what the keyword was. I knew what it did though. As of now the variables aren't static, it's getting late so I'll fix it up tomorrow.
The big problem is that static variables can't be initialized in the class they are created in, nor in header files. Not initializing it isn't an option because that causes static variables to not be in scope. So what I'll have to do, is initialize them in the play state, and see if that works.
Well for now that's all I got... so I'll be back tomorrow for another update.
0 Response to "Day 5 of Charge Development"
Post a Comment