I am trying to detect collisions between the ball and paddle or bricks. The difficulty for me is trying to determine if detectCollision is returning NULL. An excerpt from my code is shown below.
This code seems to be causing the error "Segmentation fault (core dumped)." Is it my first IF statement that is causing the problem?
// Detects a collision between the ball and another object
if (detectCollision() != NULL)
{
GObject collision = detectCollision(window, ball);
if (strcmp(getType(collision), "GRect") == 0)
{
velocity_y = -velocity_y;
}
}