"The repository is empty."
Anyways, from what I know, you're probably trying to access Player-only stuff when working with Instance types.
This is not really possible, you should request Players in the first place and leave Instances aside.
EDIT:
You can also post (hopefully short) code within code tags (
[ code][ /code] ).
Errors should be (hopefully
short but descriptive: we don't need your file paths and C#### error code,
but the description and the line of where it happens) within output (
[ output][ /output] ) tags.
RE-EDIT:
Just found out it's actually here:
https://github.com/ReDevilGames/test
In the hope that this is the actual project, i'm giving it an eye.
RE-EDIT:
The collide_rect on its own doesn't seem to be the issue.
The problem is probably around Player.h.
Are you using simple C++ or C++11?
On the regular C++ you cannot do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
class Player : public Instance
{
public:
SDL_Texture *curTexture = nullptr;
SDL_Rect playerRect, playerPos;
int player;
int dirh = 1; // <- no
float x = 0; // <- no
float hspeed = 0; // <- no
float animx = 0; // <- no
Player(SDL_Renderer *renderTarget, int player);
~Player();
void stepEvent(const Uint8 *keyState);
void endStepEvent();
void drawEvent(SDL_Renderer *renderTarget);
};
| |
Instead, you must put them in the constructor.