my function looks like this.
bool check_collision( int Sprite, int Target )
{
int leftA, leftB;
int rightA, rightB;
int topA, topB;
int bottomA, bottomB;
leftA = dbSpriteX ( Sprite );
rightA = leftA + 40;
topA = dbSpriteY ( Sprite );
bottomA = topA + 40;
leftB = dbSpriteX ( Target );
rightB = leftB + 40;
topB = dbSpriteY ( Target );
bottomB = topB + 40;
if( bottomA <= topB )
{
return false;
}
if( topA >= bottomB )
{
return false;
}
if( rightA <= leftB )
{
return false;
}
if( leftA >= rightB )
{
return false;
}
return true;
}
Bit it doesent work so well, it makes my sprite shake upon contact, the GDK Collision function works good but it need's modification for my game...
How should i make a collision function that works good?
fency federejshn