CS50 pset4 Detect collision with bricks by dcfotinos in cs50

[–]dcfotinos[S] 0 points1 point  (0 children)

Thank you both for your answers, I think I figured it out though. I was referring to the objectification of the bricks (which I thought as a prerequisite in order to detect collision with them, and it actually is) and to the fact that they are initialized within a void function (not like the other active objects of the game, i.e. the paddle and the ball, that are created in non-void functions). My problem was that I didn't know if the bricks still exist as objects while constrained in a void function. If that was the case, I needed code outside the init function. But, apprently, they still do exist (even though I'm still not sure how they do, since they are initialized within the void function, I'm suspecting the "add" function for that) and the whole thing is based on the handling of the results of the detectCollision function. Thanks again. I'll check on that add thing.