Im creating a basic game using SDL/C++. I need a way to implement 2 hit detection. When just trying one hit it works fine. Here is what i have for the two hit detection:
Yes, this identifies the object on which the method was called. In C++ if you use the this keyword explicitly when accessing a member, you need the -> access operator instead of . because it is a pointer, not a reference.
But, of course, you would usually just write ++ hits with no this.