im making a pong game, and heres the function that wont work, 3 is the ball, 1 and 2 are the paddles.
void collision ( )
{
if (dbSpriteCollision(3,1)==1)
{
dbRotateSprite(3,dbSpriteAngle(3)+90);
dbText(1,1,"player 1");
}
if (dbSpriteCollision(3,2)==1)
{
dbRotateSprite(3,dbSpriteAngle(3)+90);
dbText(1,11,"player 2");
}
if (dbSpriteX(3)<=1)
{
dbRotateSprite(3,dbSpriteAngle(3)+90);
dbText(1,21,"x<=1");
}
if(dbSpriteX(3)>=dbScreenWidth()-1)
{
dbRotateSprite(3,dbSpriteAngle(3)+90);
dbText(1,31,"x=>screen");
}
if (dbSpriteY(3)<=1)
{
dbRotateSprite(3,dbSpriteAngle(3)+90);
dbText(1,41,"y<=1");
}
if (dbSpriteY(3)>=dbScreenHeight()-1)
{
dbRotateSprite(3,dbSpriteAngle(3)+90);
dbText(1,41,"y>=screen");
}
}
is it something real simple im missing?
edit:
fixed the doubling issue still wont bounce back
okay fixed another mixup, still wont bounce
fixed the bouncing, now it bounces only a certain way ><