My Sprite class contains an array of Rects dependant on the number of frames in the Sprite. I can get the array defined by declaring it in the header as:-
Rect *FrameArray and then initialising it in the function which also loads the image:-
FrameArray = new Rect[_f] ;
While this works what I wanted to do was set up the frame total in the constructor but my attempts to define a Sprite as a private variable at the bottom of MyGame kept failing with a 'constant' error so I just create a Sprite using an empty constructor and this works.
The question is how do I create an object with parameters available to the rest of the game code ( or is this not possible ). I don't see any examples anywhere of this happening.