#include <iostream>
#include <stdlib.h>
using namespace std;
class sprite_ptr
{
public:
int x;
int y;
int width;
int height;
int object1;
int object2;
};
short int Sprite_Collide(sprite_ptr* object1, sprite_ptr* object2);
int main()
{
cout << Sprite_Collide(sprite_ptr object1, sprite_ptr object2);
system("pause");
return 0;
}
short int Sprite_Collide(sprite_ptr* object1, sprite_ptr* object2)
{
int left1, left2;
int right1, right2;
int top1, top2;
int bottom1, bottom2;
left1 = object1->x;
left2 = object2->x;
right1 = object1->x + object1->width;
right2 = object2->x + object2->width;
top1 = object1->y;
top2 = object2->y;
bottom1 = object1->y + object1->height;
bottom2 = object2->y + object2->height;
if (bottom1 < top2) return(0);
if (top1 > bottom2) return(0);
if (right1 < left2) return(0);
if (left1 > right2) return(0);
return(1);
};
I am stuck on this line of codecout << Sprite_Collide(sprite_ptr object1, sprite_ptr object2);






