well, i´m trying to make a function that returns if the player collide and the direction of the collide. it is a int function, that returns 1, 2, 3, 4 or 0, it depends about the direction (x, -x, y, -y)
i have tryed this:
int Collide()
{
Collidei = dbSpriteCollision( 600, 0);
if (Collidei <= 3000 && Collidei > 600)
{
Cheight = dbSpriteHeight (Collidei);
Cwidth = dbSpriteWidth (Collidei);
Cx = dbSpriteX (Collidei);
Cy = dbSpriteY (Collidei);
if (y <= Cy + Cheight && y >= Cy + Cheight / 2)
{
return 1;
}
if (y+Sheight >= Cy && y+Sheight <= Cy + Cheight / 2)
{
return 2;
}
if (x+Swidth<= Cx && x+Swidth >= Cx+Cwidth/2)
{
return 3;
}
if (x >= Cx+Cwidth && x <= Cx+Cwidth/2)
{
return 4;
}
}
return 0;
well, the objects whith an i of 500-3000, son collide objects, like wals, etc.
sorry my english