Well, I
have done the collision detection, and I don't really know what it doesn't work that well.
I'll explain to you what my code is doing, and why it might possibly not be working:
CODE
if((this->X > 48 && this->X < 70) && Abs(this->Y - link2->Y + 8) < 16 && !boatjump){
Link->HP -= 16;
Waitframes(20);
}
This function, within the loop that runs while the barrel goes across the screen, is what checks for whether it hits Link's ffc.
How it works is:
It checks whether the barrel is within the x-coordinates 48 and 70 (so this might well be the bit that's causing the problem)
CODE
(this->X > 48 && this->X < 70)
So, if this X coordinate is greater than 48, AND less than 70 (so it creates an invisible region from top to bottom of the screen between 48 and 70, and checks whether the boat is in it)
Then it checks whether the barrel is within 16 pixels of the middle of Link's ffc:
CODE
Abs(this->Y - link2->Y + 8) < 16
Abs takes a negative value and makes it positive, so what this says is:
'Subtract Link's ffc's Y coordinate from this Y coordinate (so, find the distance between the two), add 8 (which puts it in the middle of the ffc), make sure it's positive (incase Link was below the barrel), then check if that value is less than 16.
So this creates a 16 pixel field below and above Link's boat.
If the barrel is within that space, and the boat is not jumping, it then proceeds to the next two parts:
CODE
Link->HP -= 16;
That just takes 16 off Link's current HP, which is one heart's worth, and I don't see how it could go wrong really.
Then, it waits for 20 frames.
This is to make sure (well, that's what it's supposed to do) that the barrel doesn't trigger damaging Link more than once.
If that's what happening, you might want to either increase the number of frames waited, or reduce the size of the x-coordinate gap that the script checks in.
I don't know the specific conditions, so I can't really do it.