Ok, ignore the crappy title.
anyways, Ive run into a small problem and I have no idea as to what I did wrong (probably a lot though) Im trying to learn the fundamentals of SDL and C++ so im learning by trial and error. eitherway,
here is my issue:
I have a constructors for my objects
[SOURCE]
/////////// INITIALIZE THE OBJECT STRUCTURES ///////////
class Object
{
protected:
int x, y;
int graphicwidth;
int graphicheight;
int height, width;
int solid;
SDL_Surface *graphic;
public:
Object(int tempx, int tempy, SDL_Surface *tempgraphic) : x(tempx), y(tempy), graphic(tempgraphic)
{}
~Object();
void step();
void draw();
void setGraphicHeight(int tempHeigt);
void setGraphicWidth(int tempWidth);
int getGraphicHeight();
int getGraphicWidth();
void setSolid(int tempSolid);
void setX(int tempX);
void setY(int tempY);
int getX();
int getY();
int direction;
void setGraphic(SDL_Surface *graphic);
};
[/SOURCE]
and it works great for the object class. I have two subclasses MasterControl and PlayerBlocks. Now here is where my problems come in, doing research i found that I had to set up the contructors for the subclasses too, not a problem. But here is where my problem comes in, I use an array for my PlayerBlocks objects
[SOURCE]
/////////// CREATE THE OBJECTS ///////////
PlayerBlocks VerticalBlue[NumberOfBlocks];
MasterControl Master(0,0,NULL);
Object Background(0,0,gfx_background);
Object Titleimage(0,0,gfx_titleimage);
Object Bottomimage(0,233,gfx_bottomimage);
Object TopWall(16,120,gfx_topwall);
Object BottomWall((SCR_H)-16, 120, gfx_bottomwall);
Object LeftWall(120,10, gfx_leftwall);
Object RightWallTop(363, 16, gfx_rightwalltop);
Object RightWallBottom(363,(SCR_H)-(13+RightWallBottom.getGraphicHeight()), gfx_rightwallbottom);
[/SOURCE]
but whenever I try to compile I get an error message stating:
"no matching call to PlayerBlocks::PlayerBlocks()"
So I tried to change the PlayerBlocks to:
[SOURCE]
/////////// CREATE THE OBJECTS ///////////
PlayerBlocks VerticalBlue[NumberOfBlocks](0,0,NULL);
[/SOURCE]
and it still has problems error message:
"bad array initializer"
any ideas on what i did wrong?!
thanks
psiko