Problems with NSIntersectsRect
Problems with NSIntersectsRect
- Subject: Problems with NSIntersectsRect
- From: Mike Brinkman <email@hidden>
- Date: Mon, 26 Jan 2004 10:47:59 -0500
I was inspired by Mike Beam's article "Animating Graphics in Cocoa" to write
my own version of Pong. You can download it from this link:
http://www.msu.edu/~brinkma1/xPong.app.sitx
I'm using NSIntersectsRect(rectA, rectB). The problem I'm encountering is
that sometimes the ball will get "stuck" in the other rect it intersects
with. This can cause some minor problems when the ball hits a paddle, since
the y vector changes based on where it hits, but it is really a problem when
the ball hits the rect behind the paddle which tells the game a player has
scored.
It doesn't happen too often, but it still happens often enough that it can
ruin the experience. Has anybody else experienced this in their animations?
Is there a better way to check for collision rather than NSIntersectsRect?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.