- As a rule of thumb, let classes do one thing, means have one for rendering animations, one for loading.
The sheets are loaded as needed within the class, when an object is added it's checking to see if the sheet exists, if not, it loads them.
- The first animation is implicitly loaded, all others must be specified externally. Why ? Do not store resource paths and names inside, rather pass them in.
That's just to fill the array with at least one sheet off the bat, for testing purposes. Not going to be in the final code. The rest are loaded on-the-fly as they are requested, that way I don't need to load thousands of animations and only use a few dozen.
- Upper case names are usually seen only for constant fields.
My mistake, I was thinking all statics were uppercase, not just constants. I just rechecked the naming conventions and realized I'm wrong. Hmm..
- Let the number of animation frames be flexible.
Already planned, just not part of the test code. Eventually the number of frames and delay will be determined based on the sheet loaded.
- Put all members in private scope. MAP_ANIMATION_ARRAY is an implemention detail that should not be exposed.
Final product will have it private.
- As a beginner, do not use static. Ever.
There's nothing wrong with statics, they have their place. I think this is a good place. Why wouldn't
I want it static? I only want one array to exist, ever. I could make it non-static if I pull it out of the object and make a resource loader, I just don't understand why I'd want to other than to make all the "statics are evil always" programmers happy.
But, to clarify your answer to my actual question; Basically I should stick the ArrayList in a separate resource loader class all by itself?