Need help making boundaries in pong. I'm really new to coding.
if (isAtEdge())
{
if (getX() == 0) player2scores(); // left edge
else if (getX() == getWorld().getWidth()-1) player1scores(); // right edge
else negateVerticalSpeed(); // top and bottom edges
}