I am trying to create collision detection for rectangleshapes, and I decided to try and attach it directly to the shape by calling the rectangleshape constructor as a member of the bounding box class, and it is giving me all kinds of errors. I can't figure out how to fix it, or if I am even able to do this.
Here's my code:
#include <SFML/Graphics.hpp>
const int OBoxA = 20;
const int IBoxA = 20;
class box{
public:
RectangleShape drawBox;
int xOffset;
int xLength;
int xOrigin;
int yOffset;
int yLength;
int yOrigin;
box(){
xLength = -1;
}
//I set the values through a different method besides calling it
};
My error message is:
Error 18 error C2146: syntax error : missing ';' before identifier 'drawBox'
Error 19 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
If you need more, please let me know. Thanks.