Hot answers tagged

3 votes
Accepted

Breakout - bounce off brick- why do I need to check for object == NULL?

If you're following the distribution code, you're likely to have a variable named paddle that stores an instance of your paddle. If the ball collides with the paddle, detectCollision returns an ...
user avatar
  • 17.4k
1 vote

pset3 Ball not detecting bricks

You should use the second approach like other people suggested. In your code: GObject object = detectCollision(window, ball) if (strcmp(getType(object), "GRect") == 0) { velocityY=-velocityY; }...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible