I wrote the following code (within the while loop) but my bricks aren't disappearing. My ball just hits the bricks and bounces off. What am I missing here?
GObject object = detectCollision(window, ball);
if (object != NULL)
{
if (object == paddle)
{
y_velocity = -y_velocity;
}
else if (strcmp(getType(object), "GRect") == 0)
{
y_velocity = -y_velocity;
removeGWindow(window, "GRect");
}
}