Elements used in the Balls and Things games for the RETRO.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
Revision 6:860b82c19ecf, committed 2015-02-28
- Comitter:
- maxint
- Date:
- Sat Feb 28 19:40:48 2015 +0000
- Parent:
- 5:065f19e08dcb
- Child:
- 7:4fa3edaa1201
- Commit message:
- better collision detection on holes
Changed in this revision
Hole.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Hole.cpp Sat Feb 28 16:32:03 2015 +0000 +++ b/Hole.cpp Sat Feb 28 19:40:48 2015 +0000 @@ -64,7 +64,9 @@ bool Hole::hasGoneIn(Circle cObject) { // check if circular object has entered the hole - if(abs(cHole.getX()-cObject.getX())<=2 && abs(cHole.getY()-cObject.getY())<=2) + Line l(cHole.getX(), cHole.getY(), cObject.getX(), cObject.getY()); + + if(l.getSize()<=cHole.getRadius()) return(true); return(false); }