Original Post
Hi,
Here''s my problem I''ve got a class called CMovSurface, and it inhearates from a class called CSurface.
I have a function in CMovSurface like this one below:
Of course it''s not complete - but that''s not my problem. The problem here occurs when I try to access the protected members x, y, width, and height of the CSurface class. I want to acess them, but I don''t want to have to make those members public either. Isn''t there a way to access those members since CMovSurface is inhearating from CSurface...
Any help,
Thanks,
Eric
//----------------------------
In a world without boundaries -
who needs gates or windows ?
----------------------------\\
int CMovSurface::Check_For_Collision(CSurface *checksurface)
{
RECT intersectrect;
RECT checkrect;
RECT movrect;
SetRect(&checkrect, checksurface->x, checksurface->y, (checksurface->x + checksurface->width), (checksurface->y + checksurface->height));
SetRect(&movrect, x, y, (x + width), (y + height));
IntersectRect(&intersectrect, &checkrect, &movrect);
return(0)
}
|