I know it works, but every time I kept finding bugs I made the code more and more complicated to fix the bugs I found, so I decided to rewrite it again for the 4th or 5th time. This time with help of this awesome community
Edit: Oh I thought you meant the code I posted before I edited the whole post, and I didn't notice the attached file.
Edit 2: Hmm, I gotta convert it to Allegro 5 and I haven't used allegro 4 before, but it helps me a little. Thanks
Perhaps I've overlooked something, but I can't find the code for
2int Get_Y_Correction(C_Rect *, C_Rect *);
3int Get_X_Correction(C_Rect *, C_Rect *);
in the Collision_Handler.cpp file, these two interest me the most cause I'll only be using rectangles in my program.
Also, I have no idea what this is
1 if(u < 0)
3 u &= 0x007F; //save amount needed
4 u = u << 16; //shift 16 bits into first 2 bytes
5 u += 0x8000; //sign preservation
8 u &= 0x007F; //save amount needed
9 u = u << 16; //shift 16 bits into first 2 bytes
12 if(l < 0)
14 l &= 0x007F; //save amount needed
15 l += 0x80; //sign preservation
18 l &= 0x007F; //save amount needed
20 return u + l;
What is that called?
I haven't yet learnt what that is, but I have seen it before.